Change google maps marker icon when external link is clicked?

前端 未结 2 1083
攒了一身酷
攒了一身酷 2021-01-16 21:29

I have a google map with lots of markers on it (gathered from MySQL database). I\'m currently using the following code to change a marker\'s icon when that marker is clicked

2条回答
  •  孤独总比滥情好
    2021-01-16 22:02

    Trigger the 'click' event on the marker when the link is clicked.

    google.maps.event.trigger(gmarkers[i], "click");
    

    example with a clickable dynamic sidebar (the click listener opens an infowindow)

提交回复
热议问题