[OpenLayers-Users] Close a popup when another is open

Juan Jesús Cremades Monserrat relicary at gmail.com
Thu Jan 19 02:46:27 EST 2012


Hi,

I have the next code to show a popup when a user clicks over the map:


info = new OpenLayers.Control.WMSGetFeatureInfo({
url : 'http://localhost:9000/cgi-bin/mapserv.exe',
title : ' ',
layers : [ StatesWms ],
queryVisible : true,
vendorParams : {
map : '/ms4w/apps/demo-cv/demoCV.map'
},
eventListeners : {
'getfeatureinfo' : function(event) {
var popup = new
OpenLayers.Popup.FramedCloud("Datos",map.getLonLatFromPixel(event.xy),
null, event.text, null, true);
  popup.autoSize = true;
map.addPopup(popup);
}
}
});

map.addControl(info);
info.activate();

When I click over the map, the popup with the correct information appears
at the web client, but I want that if I click in another point, the first
popup will be closed and the new will be open. Some help?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120119/8b80f06d/attachment.html


More information about the Users mailing list