Disable click behavior of POI markers in Google Maps JS API

前端 未结 5 859
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 10:17

As of Google Maps API v3.6, maps now include \"points of interest\", which are gray markers embedded into a map. When the user clicks on this icon, an InfoWindow appears wi

5条回答
  •  攒了一身酷
    2020-12-06 11:16

    I'm not sure this is not a violation of the Google Maps TOS, 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, and the window is hidden

提交回复
热议问题