Possible duplicate:
restrict Google Maps autocomplete to the UK address only
If anyone who has experience with the Google Maps V3 Maps API can help me, that would be very appreciated - I was stuck with this for hours.
I am trying to get autocomplete to only return UK addresses (because the site is based in the UK), but my code does not work, although it seems like I did it right. I still offer all other countries.
Here is my autocomplete code:
<script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-0.12800500000003012, 51.508129), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; var bounds = new google.maps.LatLngBounds( new google.maps.LatLng(49.00, -13.00), new google.maps.LatLng(60.00, 3.00)); var input = document.getElementById('sei'); var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.setBounds(bounds); } google.maps.event.addDomListener(window, 'load', initialize); </script>
I'm not sure where to get the borders - I found the ones that were higher on the forum, but I'm not sure that they are 100% correct.
Below is my API:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?libraries=places,geometry&sensor=false®ion=GB&gl=gb"></script>
As you can see, I set the scope and gl to a querystring. If you see my image below, you will see the result that I have. Yes, it's a little more biased for the UK, but Los Angeles still appears there.

Any help would be greatly appreciated!