Gmaps4rails : How to change appearance of marker when user clicks link in sidebar?
问题 I'm trying to get this behavior with gmaps4rails : User clicks link in the sidebar, corresponding marker on the map changes image/color in order to make the selected one stand out from the others. I've tried with this code Gmaps.map.callback = function(){ var len = Gmaps.map.markers.length; for(var i = 0; i < len; i++){ marker = Gmaps.map.markers[i]; google.maps.event.addListener(marker.serviceObject, 'click', (function(i){ return function(){ console.log($(Gmaps.map.markers[i].serviceObject