Google Maps API v3: How do I dynamically change the marker icon?

前端 未结 5 1960
心在旅途
心在旅途 2020-11-30 20:33

Using Google Maps API v3, how do I programmatically change the marker icon?

What I would like to do is, when someone hovers over a link - to have the corresponding m

5条回答
  •  一生所求
    2020-11-30 21:03

    Call the marker.setIcon('newImage.png')... Look here for the docs.

    Are you asking about the actual way to do it? You could just create each div, and a add a mouseover and mouseout listener that would change the icon and back for the markers.

提交回复
热议问题