Thanks, worked like a charm :-) -Håvard
2011/12/6 Raymond Nijssen <[email protected]>: > Havard, > > I'm using this to destroy any existing popups: > > while (map.popups.length > 0) { > map.removePopup(map.popups[0]); > > Regards, > Raymond > > >> Hi, with the OpenLayers.Control.WMSGetFeatureInfo function how do I >> destroy old popups before creating a new one? >> >> I have tried using map.removePopup(popupwindow) without success. >> >> >> popup_size = new OpenLayers.Size(420,400); >> >> info = new OpenLayers.Control.WMSGetFeatureInfo({ url: >> 'http://www.example.com:8080/geoserver/wms', title: >> 'Identify features by clicking', layers: [tiled], >> //hover:true, queryVisible: true, >> eventListeners: { getfeatureinfo: function(event) { >> popupwindow = new >> OpenLayers.Popup.FramedCloud( "chicken", >> map.getLonLatFromPixel(event.xy), >> popup_size, event.text, >> null, true ); >> >> map.addPopup(popupwindow); >> //alert(event.text); } } >> }); >> >> -- >> Håvard Wahl Kongsgård >> NTNU-DMF/HUNT >> http://havard.security-review.net/ >> _______________________________________________ >> Users mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/openlayers-users >> > > -- Håvard Wahl Kongsgård NTNU-DMF/HUNT http://havard.security-review.net/ -- Håvard Wahl Kongsgård NTNU-DMF/HUNT http://havard.security-review.net/ _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
