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

Frank Broniewski brfr at metrico.lu
Fri Apr 23 02:21:02 EDT 2010


Hi,

how do you "destroy" the layers? Do you use map.removeLayer()? You could 
add the new baselayer first and then remove the old ones. But without 
some example code which shows the problem it is difficult to help you ...

Frank

Notice: this email is not confidential ;-)

Am 23.04.2010 07:05, schrieb Phil Scadden:
> 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.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>


-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu



More information about the Users mailing list