title: Google Maps Places API issue with getPlaces() function
body: <p>Can someone tell me why the getPlaces() function returns a space character string below?</p>
  
  <p>In head element I have the link to the Google maps script</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&amp;v=3.exp&amp;key=MyKey&amp;libraries=places"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Javascript code:</p>
  
  <pre><code>jQuery(window).load(function() {
    var map = new google.maps.Map(document.getElementById('mapCanvas'), {
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      streetViewControl: false
    });
    var defaultBounds = new google.maps.LatLngBounds(
      new google.maps.LatLng(41.7033177, -93.0573533),
      new google.maps.LatLng(41, -93)
    );
  
    map.fitBounds(defaultBounds);
  
    var input = document.getElementById('addressSearch');
    var searchBox = new google.maps.places.SearchBox(input);
    var markers = [];
  
    google.maps.event.addListener(searchBox, 'places_changed', function() {
      var places = searchBox.getPlaces();
  
      for (var i = 0, marker; marker = markers[i]; i++) {
        marker.setMap(null);
      }
  
      markers = [];
      var bounds = new google.maps.LatLngBounds();
  
      for (var i = 0, place; place = places[i]; i++) {
        var place = places[i];
        var marker = new google.maps.Marker({
          map: map,
          title: place.name,
          position: place.geometry.location,
          draggable: true
        });
        markers.push(marker);
  
        bounds.extend(place.geometry.location);
      }
      map.fitBounds(bounds);
      if (markers.length == 1) map.setZoom(17);
    });
  
    google.maps.event.addListener(map, 'bounds_changed', function() {
      var bounds = map.getBounds();
      searchBox.setBounds(bounds);
    });
  });
  </code></pre>
  
  <p>This code is taken from Google's developer site, from the example with the text search field, so it should work fine. 2 days ago, it worked fine. Now it doesn't. The problem is that the <code>getPlaces()</code> method returns a string with a space character and not an array as it should. What am I missing here?</p>
  
  <p><strong>Update:</strong> Ok, my question was not clear enough. What does work is the autocomplete functionality in the search box. What does not work is the <code>places_changed</code> event and specifically the line</p>
  
  <pre><code>var places = searchBox.getPlaces();
  </code></pre>
  
  <p>The <code>places</code> variable should contain an array, so that in the next <code>for</code> loop, it will create an array of markers and put them on the map. Instead, what it returns is an empty string.</p>