Restricting Google Map API to show only Cities, States & Country
geocoding, geolocation, google-maps, google-maps-api-3
Solution
Add 'regions' to the options in the constructor:
var acOptions = {
types: ['(regions)']
};
var autocomplete = new google.maps.places.Autocomplete($("#address")[0], acOptions);
Problem
I am new to Google Map APIs.. I wish to use dropdown where user will type location and correspondingly google will give suggestions.. but problem is i dont want Google to give Street & District names..I want only City, State & country names to be autosuggested..My code is as follows ``` <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en-AU"></script> <script> var autocomplete = new google.maps.places.Autocomplete($("#address")[0], {}); google.maps.event.addListener(autocomplete, 'place_changed', function() { var place = autocomplete.getPlace(); console.log(place.address_components); }); </script> </body> ``` How to get only City & Country name from the API ? Thanks In advance