When a marker is selected, I want it to bounce. When I click on another marker, I want the first one to stop bouncing, and the other to then start bouncing. I assumed that this was achievable by simple doing this
function bindInfoWindow(marker, map, infoWindow, html) {
google.maps.event.addListener(marker, 'click', function() {
document.getElementById('loc-info').innerHTML = html;
if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
});
}
Instead, the first marker will continue to bounce until it is clicked again, which I don't want to happen. Any thoughts?