[OpenLayers-Users] Switching Layers Assigned to a SelectFeature Control

Alexandre Dube adube at mapgears.com
Wed Jan 14 08:53:48 EST 2009


Hi Bill,

Keep in mind that only your top layer is the only one you can interact 
with. Plus, I'm not sure if what you're trying to do is a good practice. 
I would recommend on control per layer, only one usable at a time on the 
top most layer. You could register some visibilitychanged events to 
determine which layer is on top and activate the related control on the 
same time.

Best of luck,

Alexandre

Bill Thoen wrote:
> I've got three vector feature layers and I'd like to use the same tool 
> to select any feature from any of these layers. But I understand that 
> you can only have one layer selectable at a time. So I'm thinking that 
> if I change the layer reference in the control as needed, that will do 
> it. But it doesn't seem to work. I've tried changing the layer reference 
> in both map.controls[n].layer and panel.controls[n].layer but the tool 
> continues to select from the original layer that was assigned when the 
> tool was created. What am I doing wrong?
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list