Здравствуйте, ломаю голову, как сделать чтобы по селекту перенаправляло на точку и выскакивал попап
new google.maps.Marker({
position: {lat: 53.877805, lng: 27.540712}, map: map
});
new google.maps.Marker({
position: {lat: 39.489874, lng: -8.448817}, map: map
});
new google.maps.Marker({
position: {lat: 52.519881, lng: 13.407338}, map: map
});
var geocoder = new google.maps.Geocoder();
$("#city_dropdown").change(function() {
address = $("#city_dropdown :selected")[0].text;
console.log(address)
geocodeAddress(address, geocoder, map);
});
var address = $("#city_dropdown :selected")[0].text;
geocodeAddress(address, geocoder, map);
function geocodeAddress(address, geocoder, resultsMap) {
geocoder.geocode({
'address': address
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
resultsMap.fitBounds(results[0].geometry.viewport);
console.log(results[0].geometry.location.lat())
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}