在開啟的時候把其他的 infowindow 移除就好了。 view plaincopy to clipboardprint google.maps.event.addListener(marker, 'click', function() { if($('.gm-style-iw').length) { $('.gm-style-iw').parent().remove(); } infowindow.open(map,marker); });