On Wednesday, January 6, 2010, cgp <[email protected]> wrote: > > > I think that would work, but it might make my code too long and > unmanageable. I'd also like to avoid hard-coding as much as possible. In my > post, I only used a small example of 3 layers, but my actual application has > around 50 layers in it, so it's going to be huge if I make a set of controls > for each of them
I'm not suggesting that. I'm suggesting creating a function that receives a layer, destroys the existing controls (if any), and creates new ones (configured with the passed layer). It's only 4 or 5 controls to destroy and create on each call to this function. Alternatively, you can add a setLayer method to the modify feature control. I'm not sure but the select feature control may have a setLayer method already, that would probably help you. 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 : [email protected] http://www.camptocamp.com _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
