How can i capture the click event when a default marker/place is clicked on googlemaps?

后端 未结 4 1408
清酒与你
清酒与你 2020-12-20 17:08

I am working with Google Maps API V3. The googlemaps displays markers for some places/location by default, I need to capture the click event when one of them is clicked..

4条回答
  •  猫巷女王i
    2020-12-20 17:54

    Note that the OP is asking about doing this using the GMAP3 library, which is a jQuery plugin library that adds an API layer on top of the Google Maps layer. it is absolutely correct to say that the Google API is to use google.maps.addListener, but I think that the OP wants something that's closer to the GMAP3 example using addMarkers, but listening to the click event. With that in mind, I modified the example from GMAP3 and changed the mouseenter event to the click event and got rid of the mouseleave event.

    Refer

提交回复
热议问题