<div dir="ltr">Hi List,<br><br>I'm working with OpenLayers 2.6 and I need to create a Layer, where the name of the layer is on a JavaScript variable...<br><br>Like this:<br><br> This is my normal layer :<br><br> var ruta22 = new OpenLayers.Layer.MapServer.Untiled( "Ruta 22", "../../cgi-bin/mapserv",<br>
{map:"C:/data/publicacion.map", transparent: "true", <br> layers: <b>"ruta22_ida"</b>,map_imagetype: "png"},{"isBaseLayer": false}, {"displayInLayerSwitcher":false});<br>
<br> And here I wanto to create my layer where the name "ruta22_ida" is on a variable.<br><br><br> var layer1 = document.pos_recorridos.layertxt.value;<br> alert(layer1);<br><br> var ruta8 = new OpenLayers.Layer.MapServer.Untiled( "Ruta 8", "../../cgi-bin/mapserv",<br>
{map:"C:/data/publicacion.map", <br> layers: <b>layer1</b> ,transparent: "true", map_imagetype: "png"});<br><br><br>I hope your help...<br><br>Thanks..! David<br></div>