I am getting unexpected results against 'Yorkshire' using Google Maps auto-complete API. I have filtered the results to only display regions of UK. Please help me
Following are the results I am getting while search for Yorkshire:
Below is the code:
<script src="http://maps.google.com/maps?file=api&v=2&key=MYGooGleAPiKey" type="text/javascript"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en"></script><script>
$(function() {
var options = {
types: ['(regions)'],
componentRestrictions: {country: 'uk'},
region: ['(GB)']
};
var autocomplete = new google.maps.places.Autocomplete($("#txt_search")[0], options);
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
//console.log(place.address_components);
});
});</script>
It seems to be a bug in the API, see https://code.google.com/p/gmaps-api-issues/issues/detail?id=8619 and star if you want to see them fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With