[OpenLayers-Dev] Re: multiple select controls on multiple layers in same map not working

Andreas Hocevar ahocevar at opengeo.org
Sun Oct 3 03:00:09 EDT 2010


Hi,

if you just need to differentiate your onSelect and onUnselect actions, why don't you look at the event object's layer property in your handlers? Based on the layer, you can then choose the appropriate action.

Regards,
Andreas.

On Oct 1, 2010, at 21:54 , crb wrote:

> 
> Thanks for the reply Andy.  While it's great that the SelectFeature control
> will support multiple layers, what I need to do is have multiple
> SelectFeature controls (that call different onSelect and onUnselect
> functions).  From the docs, I don't think that is supported:  
> "As of OpenLayers 2.7, there is no support for selecting features from more
> than a single vector layer at a time..."  (technically not accurate as you
> showed.  But then:
> "... The layer which is currently being used for selection is the last one
> on which the .activate() method of the attached select feature control was
> called."  Which is what I think is preventing me from doing what I hoped to
> do.
> -- 
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/multiple-select-controls-on-multiple-layers-in-same-map-not-working-tp5591394p5592688.html
> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Dev mailing list