开发者

Google map Info box doesn't listen the click event

开发者 https://www.devze.com 2023-02-15 08:53 出处:网络
How to attach a click event to a gool开发者_运维百科e mapYou need to create marker & add a listener to it.

How to attach a click event to a gool开发者_运维百科e map


You need to create marker & add a listener to it.

amarker = new google.maps.Marker(
           { position: alocations,
             map: map,
             title: "title " 
           } );
        google.maps.event.addListener(amarker, 'click', 
            function() {
              markerClick(this);
            }
        );
    }
    function markerClick( mark )
    {
       //do something
    }

You can follow the link for more details http://code.google.com/apis/maps/documentation/javascript/events.html

0

精彩评论

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

关注公众号