开发者

Google Maps API make icon a link

开发者 https://www.devze.com 2023-02-27 09:54 出处:网络
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.

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/";
 });
0

精彩评论

暂无评论...
验证码 换一张
取 消