limit Google maps of countries in the autocomplete list to "INDIA, USA and UK"

Posted by Manoj Thakur on Stack Overflow See other posts from Stack Overflow or by Manoj Thakur
Published on 2012-07-02T09:10:09Z Indexed on 2012/07/02 9:15 UTC
Read the original article Hit count: 253

Filed under:
|

This code is not working. Please tell me the exact solution

<script src="maps.googleapis.com/maps/api/…; type="text/javascript"></script>
<script type="text/javascript">
   function initialize() {
      var input = document.getElementById('searchTextField');
      /* restrict to multiple cities? */
      var options = {
          types: ['(cities)'],
          componentRestrictions: {country: ["usa", "uk"]}
      };
      var autocomplete = new google.maps.places.Autocomplete(input, options); 
   }
   google.maps.event.addDomListener(window, 'load', initialize);
</script>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about google-maps