Google Maps Directions Add-on Support Product Page

This topic is locked
Answered

Restrict AutoComplete results to current country?[SOLVED]

Asked 16 Jul 2011 18:49:04
1
has this question
16 Jul 2011 18:49:04 John Carter posted:
Is there a way to restrict the Auto Complete drop down results to the maps current country?
Example: I am using a google map on a contact page for an American address marker, can I have only North American, actual drivable addresses appear in the drop down?

When the 1st thing that appears is Polish or Finnish addresses, I question the usefulness or the "wow" value of using this.
Regards

Replies

Replied 18 Jul 2011 09:13:19
18 Jul 2011 09:13:19 Miroslav Zografski replied:
Hello John,

for now this option is only available through code change by hand. We will consider including Region Localization for next update.

To do this now you need to change the following <script> element included on the page with the map :

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>


to :

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&region=US">


The region parameter accepts Unicode region subtag identifiers.


Replied 28 Jul 2011 06:43:21
28 Jul 2011 06:43:21 John Carter replied:
Thanks so much for adding region selection to the new update, you guys are great.
Replied 28 Jul 2011 10:04:48
28 Jul 2011 10:04:48 Miroslav Zografski replied:
Hello John,

You are welcome.

Reply to this topic