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

后端 未结 4 1407
清酒与你
清酒与你 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条回答
  •  星月不相逢
    2020-12-20 17:35

    It's a bit hacky, and doesn't work on IE < 9, but you can listen on dom event, to detect the creation of the window, using

    Mutation Observer
    

    Here is a plunkr to demonstrate : http://plnkr.co/edit/pGep9OZFligLhRtHlhgk You can check in the console, an event is fired (actually twice) when you click on a POI.

提交回复
热议问题