I have a Google Maps div and list of check boxes that I use to filter markers on the map.
But if I click on a marker, open an InfoWindow
, and then click on a check box to remove the markers of that type, the InfoWindow
is not removed from the map.
After I remove the markers, I call this code but the InfoWindow
stays:
try {
if( infowindow ) {
infowindow.close();
}
}
catch(err) { }
function closeInfoWindow() {
if (infoWindow !== null) {
google.maps.event.clearInstanceListeners(infoWindow); // just in case handlers continue to stick around
infoWindow.close();
infoWindow = null;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With