更新时间:2022-11-18 08:36:51
infowindows调用 closeclick
可以帮助您的事件
there's an event for infowindows call closeclick
that can help you
var currentMark;
var infoWindow = new google.maps.InfoWindow({
content: 'im an info windows'
});
google.maps.event.addListener(marker, 'click', function () {
infoWindow.open(map, this);
currentMark = this;
});
google.maps.event.addListener(infoWindow,'closeclick',function(){
currentMark.setMap(null); //removes the marker
// then, remove the infowindows name from the array
});