开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜