Change Google Maps marker icon when clicking on other

What duncan said: What you want to do is add all your markers to an array. In your click event handler, loop over that array, updating each marker’s icon. Then finally set the icon for just the marker that’s been clicked. google.maps.event.addListener(marker, ‘click’, (function (marker, i) { return function () { infowindow.setContent(locations[i][0], locations[i][6]); infowindow.open(map, marker); … Read more