How to obtain the HTML DOM element of a Google Maps marker?

后端 未结 3 1051
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 02:07

Given a GMarker JS variable, how do I obtain the HTML DOM element that represents it? I need this so I can insert a

of my own into the map with the
3条回答
  •  孤街浪徒
    2021-01-06 02:37

    It looks like the Google Maps API doesn't provide a method to return a marker's DOM element.

    Do you just want to create your own custom marker? If so, you can create a marker class which extends GOverlay. MarkerLight is a great example of how to accomplish this (and here is the example page).

    If all you need is a custom icon, here is how to do that.

提交回复
热议问题