Possible Duplicate:
limiting google maps autocomplete to UK address only
If anyone with Google Maps API V3 experience can help me out it would be much appreciated - I've been stuck on this for hours.
I'm trying to get my autocomplete to return UK addresses only (because the site is based in the UK), but my code isn't working even though it appears as though I've done it right. I still get all other countries as suggestions.
Here's 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 bounds from - I have found the ones above on a forum but am not sure if they're 100% correct.
Below is my API include:
<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 have set a region and gl in the querystring. If you see my image below, you'll see the result I have. Yes, it's slightly more biased to the UK - but there's still Los Angeles appearing.
Any help would be much appreciated!