[OpenLayers-Users] select feature with multiple wfs

Arnd Wippermann arnd.wippermann at web.de
Wed Feb 27 15:16:20 EST 2008


Hi,

You should try to work only with one control. I get around with the problem,
that I destroy the control before I add the control to an other layer.

if(editingControl) //global variable
{  killControl(previousLayer)
   addControl(activeLayer)
}
else 
   addcontrol(activeLayer)
	

It works.

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/




-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Lars Lingner
Gesendet: Mittwoch, 27. Februar 2008 17:20
An: users at openlayers.org
Betreff: [OpenLayers-Users] select feature with multiple wfs

Hello,

currently I'm doing my first steps with OL. I want to setup a map with
multiple different overlay layers (WFS). The features of these layers should
expose their attributes on an certain event (like onClick, hover etc).
Currently I'm just filling an div element with an callback function.

Its working fine if I use just one OpenLayers.Control.SelectFeature



var sf_lines_wfs = new OpenLayers.Control.SelectFeature(lines_wfs,
   {
     onSelect: lineSelected,
     onUnselect: lineUnselected
   }
);
map.addControl(sf_lines_wfs);
sf_lines_wfs.activate();

If I add other OpenLayers.Control.SelectFeature to my other layers  my
featureinfo function seems to work randomly.

var sf_alt_lines_wfs = new OpenLayers.Control.SelectFeature(alt_lines_wfs,
   {
     onSelect: altLineSelected,
     onUnselect: altLineUnselected
   }
);
map.addControl(sf_alt_lines_wfs);
sf_alt_lines_wfs.activate();

Is this the right way to go?

How can I read and process attributes from different wfs-layers? Each
WFS-Layer should be accessible through the OL.Layerswitcher

I search the examples of OL but I couldn't find one pushing me the right
way.

Thanks in advance....

lars

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list