Google Maps API make icon a link
I am looking for something to put in javascript that will enable me to click on the icon plotted on a Google maps API and it will send me to that page.
The plots are being read via an xml document and I would want it to link to that placeid
e.g
开发者_JS百科place.php?id=1233
Any ideas would be great!
One way to do it is to do a redirect with window.location
within the marker's click event callback function where the redirect link is in your example place.php?id=1233
:
google.maps.event.addListener(marker, 'click', function() {
window.location = "http://www.google.com/";
});
精彩评论