the way to do it is by doing:
google.maps.event.addListener
That was easy!
Вопрос
It is possible to get the place reference id from google places api?
So far this is what I'm doing:
var geocoder;
var autocomplete;
var zipCode = $('.j-zipcode').val();
function initialize(newZipcode) {
geocoder = new google.maps.Geocoder();
if( newZipcode != undefined ) {
zipCode = newZipcode;
}
geocoder.geocode({address:zipCode},
function(results_array, status) {
lat = results_array[0].geometry.location.lat();
lng = results_array[0].geometry.location.lng();
var myLatlng = new google.maps.LatLng(lat, lng);
autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'));
}
)
}
Any help? :/
Решение
the way to do it is by doing:
google.maps.event.addListener
That was easy!