0

I am using Google maps and I want to restrict user search results to only Australia. For example, if user enters 'Melbourne', currently it is redirecting to Melbourne location in US. Also, the zip code 3000 is redirecting to some country in Europe.

How can we restrict these kind of issues? What are the options that should be enabled in the Google maps.

Note: I am not using any API key for this. Can we restrict people to Australia if we have an API key?

Vickel
  • 7,879
  • 6
  • 35
  • 56
Kiran
  • 305
  • 1
  • 3
  • 7
  • Possible duplicate: http://stackoverflow.com/questions/717019/how-to-display-only-one-country-or-a-specific-area-in-google-maps-using-the-api – Android Enthusiast Feb 12 '16 at 12:09
  • No, that is not similar to my question. I am using [Bjorn blog's store locator](http://bjornblog.com/web/jquery-store-locator-plugin). Please refer to the above link. – Kiran Feb 15 '16 at 10:29

1 Answers1

0

This issue is resolved. I altered the geocode search with componentRestrictions. See the below code:

g.geocode({'address': addressInput, componentRestrictions: {country: region}}, function (data) {
 // add your code here 
});
Kiran
  • 305
  • 1
  • 3
  • 7