external link in infoWindow or onClick of a marker on a map

1,210 views
Skip to first unread message

camfam

unread,
Aug 23, 2010, 2:34:10 PM8/23/10
to Google Maps JavaScript API v3
I have created a map and added markers. I would like to open an
external link when a marker is clicked. IF that is not possible,
would like to have the URL clickable within an infoWindow. Are either
of these possible?

Keir

unread,
Aug 24, 2010, 10:31:44 AM8/24/10
to Google Maps JavaScript API v3
Both should be possible. Just change the click event on the marker.

For example this would redirect the browser to Google.com

google.maps.event.addListener(marker, 'click', function() {
window.location = "http://www.google.com/"
});
Reply all
Reply to author
Forward
0 new messages