Following google documentation up to changing the marker icon was easy. But I\'m stuck, I don\'t know how to change image when marker is clicked?
My code so far:
You need to set the marker icon in the click event.
google.maps.event.addListener(marker, 'click', function() { infowindow.open(map); //Change the marker icon marker.setIcon('https://www.google.com/mapfiles/marker_green.png'); });
Here is an example: jsfiddle