Add link to marker

This commit is contained in:
Markus Ankenbrand 2017-02-19 18:29:27 +01:00
parent 23537782d6
commit 7c1a8d8de7

View file

@ -90,9 +90,13 @@
var marker = new google.maps.Marker({
position: {lat: parseFloat(places[i]['lat']), lng: parseFloat(places[i]['lng']) },
title: places[i]['title'],
url: "/?p="+places[i]['post'],
map: map
});
marker.setVisible(true);
google.maps.event.addListener(marker, 'click', function() {
window.location.href = this.url;
});
bounds.extend(marker.getPosition());
}
map.fitBounds(bounds);
@ -100,7 +104,7 @@
if(map.getZoom() > 15){
map.setZoom(15);
}
}, 500)
}, 500);
}
</script>