选择标记后,我希望它反弹。当我点击另一个标记时,我希望第一个停止弹跳,然后另一个开始弹跳。我认为这是可以通过简单地做到这一点来实现的
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);
}
});
}
相反,第一个标记将继续弹跳,直到再次单击它,我不希望发生这种情况。有什么想法吗?