[OpenLayers-Users] updating layer name in LayerSwitcher

Steven Chall stevec at renci.org
Thu Dec 6 13:09:29 PST 2012


Thank you,  Jürgen, that did the trick.

Steve
________________________________________
From: Jürgen Dankoweit [Juergen.Dankoweit at T-Online.de]
Sent: Thursday, December 06, 2012 2:29 PM
To: Steven Chall
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] updating layer name in LayerSwitcher

Hello Steven,


for my maps with dynamic layer-switch entries I use the following code
snipped:
var l_Satbild = map.getLayersBy("metadata","LAYER_METEOSAT9")[0];
var c_LayerSwitcher =
map.getControlsByClass("OpenLayers.Control.LayerSwitcher")[0];

if (l_Satbild) {
 l_Satbild.name = "new name";
 l_Satbild.redraw();
 c_LayerSwitcher.redraw();
}

Look here: http://www.dankoweit.de/cgi-bin/metar_karte.pl?geo=1&typ=metar

I hope this hels you.

Best regards

Juergen


More information about the Users mailing list