[OpenLayers-Users] control.SelectFeature

Sarah Schuessler sarah_flip at yahoo.de
Tue Apr 20 11:30:23 EDT 2010


Hi Alexandre,

I think I mixed it all up.
I have included my event to my wfs2 layer and added feature to an empty vectorlayer (select):
wfs2.events.on({'featureselected': function(feature){ 
        select.addFeatures([feature.feature]);}, 
                        'featureunselected': function(feature){..}
    });

It worked.

If I use version 1.1.0 at GeFeature request (for server side reprojection) for my other kind of selection I get exception like: encode failed for value..(I think because of srs/epsg code, projection issue). I tried to change epsg code and some other things at geoserver but problem still remain. 
I asked about this issue at geoserver list some time ago but could not solved it yet.

Thanks.
best regards
Sarah


________________________________


Sarah,

Sarah Schuessler wrote:
> If I use map.addLayers(wfs2) after defining my layer my map is empty 
> (no layers were loaded).
>
> You said:
> "unless you add all the vector layers to the SelectFeature control.
>
> Also, you could use only one layer (wfs2) for feature selection instead
> of two."
> Can I use only one vector layer or more than one?
If you have multiple layers of different types, let's say a 'city' 
layer, a 'road' layer and a 'water' layer (all of them vector) and you 
want to be able to select features from any of these layers, you can 
define an array of layers to the SelectFeature control and you'll be 
able to select any feature from any layer.

What you're currently doing is having a 'water' layer (I don't know what 
is the type, but let's assume they are 'water' polygons) to display your 
features and an other 'water' layer (that is empty) for feature 
selection.  Having 2 layers for just the purpose of selection seems odd 
so that is why I proposed you should only have one.

Do you want your features to be always Vector of do you want to 
'highlight' them only from drawing a box on the map ?

Also, do you have control on the feature server ?  I mean, are you able 
to add the missing projection on server-side ?  That could resolve that 
issue.

Kind regards,

-- 
Alexandre Dubé
Mapgears
www.mapgears.com

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100420/f704550e/attachment.html


More information about the Users mailing list