Reputation: 11
I cannot get a link to work in my marker.
My code is:
var marker = new google.maps.Marker({ draggable: false, raiseOnDrag: false, icon: image, shape: shape, map: map, url: 'http://www.google.com/', position: myLatlng36, title:"My marker" });
It shows the marker perfectly on the right location, but nothing happens when I click it. I also tried adding
google.maps.event.addListener(marker, 'click', function() {
window.location.href = marker.url;
});
No result. Any suggestions?
Upvotes: 1
Views: 90
Reputation: 2668
Did you test with?
google.maps.event.addListener(marker, 'click', function() {
window.location.href = this.url;
});
Changing 'marker' to 'this'?
Upvotes: 3