[OpenLayers-Users] Using only one set of modify feature controls for different layers?

Eric Lemoine eric.lemoine at camptocamp.com
Wed Jan 6 00:27:23 EST 2010


> I also made my own layer switcher that only allows modification of one layer
> at a time. When I toggle between the layers, I assign the layer to each of
> the modify feature controls:
>
>             for(var modify_key in modifyControls) {
>                 var control = modifyControls[modify_key];
>                 control.layer = layer;
>             }

I think you can't dynamically change a modify feature control's layer.
For example, the select feature control the modify feature control
uses internally would also need to be reconfigured. So I'd recommend
creating new controls when switching from one layer to another.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list