Hi!
Is there a way to check first if a infoWindow is set and on the map before use
marker.infowindow.close();
if this isn't set and not on the map, the script don't work? I was thinking of an if statement to check before close?
Thanks!
Hi!
Is there a way to check first if a infoWindow is set and on the map before use
marker.infowindow.close();
if this isn't set and not on the map, the script don't work? I was thinking of an if statement to check before close?
Thanks!
You can use the typeof
function in Javascript.
if (typeof(marker.infowindow) === "undefined"){
//object doesn't exist
}
else{
//the object does exist
marker.infowindow.close();
}