I'm tring to use the google.maps.places.Autocomplete class but am
getting some weird results on the place_changed event. The drop-down
item I'm selecting does not seem to be the value that is returned in
the place_changed event.
Steps to trigger this include:
1. Type in united campervan and select the dropdown which should be
Kingsford Smith Place, Mangere, Auckland
2) the address returned in the place_changed event is Horotiu Waikato
District, Waikato.
3) Type this address into google maps and I get an address correctly.
I've tried this on a number of browsers including chrome v17, IE 9 and
FF 3.6
The funny thing is until about 2 weeks ago I didn't notice anything
strange happening. Now it seems to be happening fairly frequently.
Some of my code looks like:
function setup_autoComplete()
{
var defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-37.82877, 175.17975),
new google.maps.LatLng(-37.71370, 175.34386));
var input = document.getElementById('bk_address');
var options = {
bounds: defaultBounds
};
autocomplete = new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete, 'place_changed',
function() {
var place = autocomplete.getPlace();
var point = place.geometry.location;
if(point)
{
// do other stuff here but at this point
the place.geometry is wrong anyway
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.