[OpenLayers-Users] Correct way to replace the layers in a map with a completely new set?

Phil Scadden p.scadden at gns.cri.nz
Fri Apr 23 01:05:10 EDT 2010


In response to a button push, I want a map to dump its current set of 
layers and load a completely new set (which could include completely 
different baselayers). Cycling through the layer list destroying each in 
turn is causing headaches as a "setnewbaselayer" tries to reference a 
non-existing div. Is there a way to nuke the
layer list in one hit? Am I better to destroy map and start again? (Was 
trying to avoid that as have legends and a great list of controls tied 
to it.).

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.




More information about the Users mailing list