2012/1/19 Juan Jesús Cremades Monserrat <[email protected]>: > 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?
See the exclusive parameter to addPopup: <http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.addPopup>. -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : [email protected] http://www.camptocamp.com _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
