Google Maps v3 places autocomplete shows address, but returns no place result? -
i have set-up page using google maps places autocomplete service. below screen snapshot of address being entered text field (controlled) places autocomplete (works fine)...
when click on option presented google drop down list, place changed handler invoked (as should be) , following code executed place result object:
var place = m_autocomplete.getplace();
examining place object in debugger reveals 1 property defined; name property, below place object json string:
{"name":"2701 riverside dr, ottawa, on k1a 0b1, canada"}
the place object missing other properties (ie: no geometry, no address_components, etc) outlined in google maps documentation placeresult object.
so, added more code (to fallback) , call geocoder service directly when place results object incomplete, ie:
var geocoder = new google.maps.geocoder(); geocoder.geocode({ 'address': addr }, geocoder_callback_handler);
where addr contained value text field (confirmed via debugger); geocoder callback function returns status of: zero_results
questions:
1 - why autocomplete service present address in drop down list results in incomplete place result object?
2 - why geocoder not recognize address presented autocomplete service?
any advice appreciated.
Comments
Post a Comment