javascript - Google Maps API v3 infowindow close event/callback? -
i keep track of , infowindows open on google maps interface (i store names in array), can't figure out how remove them array when closed via "x" in upper right hand corner of each one.
is there sort of callback can listen for? or maybe can addlistener("close", infowindow1, etc
?
there's event infowindows call closeclick
can you
var currentmark; var infowindow = new google.maps.infowindow({ content: 'im 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 marker // then, remove infowindows name array });
Comments
Post a Comment