title: How to search for cities in an area using Google Maps v3?
body: <p>I tried to search for all cities within a visible map's bounds. How can I do that?</p>
  
  <p>Below is what I tried to do:</p>
  
  <pre><code>$.fn.gmap3.geocoder.geocode({ 'address': 'Georgia' }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
          globalMap.setCenter(results[0].geometry.location);
          var resultBounds = new google.maps.LatLngBounds(
              results[0].geometry.viewport.getSouthWest(),
              results[0].geometry.viewport.getNorthEast()
          );
          globalMap.fitBounds(resultBounds);
          // get cities in the map
          var service = new google.maps.places.PlacesService(globalMap);
          var request = {
              bounds: resultBounds,
              types: ['locality']
          };
          service.search(request, function (results, status) {
              debugger;
          });
      }
  });
  </code></pre>
  
  <p>But the result is <code>ZERO_RESULTS</code>. Maybe the reason is that the results are restricted to a radius of 50.000 meters?</p>
  
  <p>Anyone knows how to solve my problem? Thanks a lot.</p>
  
  <p><strong>--UPDATE--</strong></p>
  
  <p>Thank, Sean, for reading my post carefully and give detail feedback.</p>
  
  <p>This is how I refer to the lib:
  <code><pre>src="https://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places"</pre></code>
  I also added more detail to the geocode function to get more precise result. But I still don't get the results I want. </p>
  
  <p>Check the list in this page: <a href="https://developers.google.com/places/documentation/supported_types" rel="nofollow">https://developers.google.com/places/documentation/supported_types</a>, I realize that almost all items in the first list returns values but not for the second list. The only item return value is 'political' and it returns only 1 instead of 20.</p>
  
  <p>This is my code after modifing:
  <code><pre>
  this.setCenterByAddress = function (address, region) {
      $.fn.gmap3.geocoder.geocode({ 'address': address, 'region': region }, function (results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
              globalMap.setCenter(results[0].geometry.location);
              var resultBounds = new google.maps.LatLngBounds(
                  results[0].geometry.viewport.getSouthWest(),
                  results[0].geometry.viewport.getNorthEast()
              );
              globalMap.fitBounds(resultBounds);
              // get cities in the map
              var service = new google.maps.places.PlacesService(globalMap);
              var request = {
                  bounds: resultBounds,
                  types: ['country',
                  'administrative_area_level_1',
                  'administrative_area_level_2',
                  'administrative_area_level_3',
                  'colloquial_area',
                  'country',
                  'floor',
                  'geocode',
                  'intersection',
                  'locality',
                  'natural_feature',
                  'neighborhood',
                  'political',
                  'point_of_interest',
                  'post_box',
                  'postal_code',
                  'postal_code_prefix',
                  'postal_town',
                  'premise',
                  'room',
                  'route',
                  'street_address',
                  'street_number',
                  'sublocality',
                  'sublocality_level_4',
                  'sublocality_level_5',
                  'sublocality_level_3',
                  'sublocality_level_2',
                  'sublocality_level_1',
                  'subpremise',
                  'transit_station']
              };
              service.search(request, function (results, status) {
                  debugger;
              });
          }
      });
  }
  </pre></code></p>
  
  <p>MORE INFO: The same value return even when location and radius is used. And I use free map and receive "OVER_QUERY_LIMIT" all the time.</p>