To change the parameter of a WMS layer you can use 
 
ruta22.mergeNewParams({ 'layers' : layer1 });
 
I'm not sure, if you can use it also for MapServer layers.
 
Arnd Wippermann

  _____  

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
Auftrag von davyd
Gesendet: Samstag, 13. September 2008 18:10
An: OpenLayers
Betreff: [OpenLayers-Users] Layer with Parameter ..


Hi List,

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...

Like this:

       This is my normal layer :

            var ruta22 = new OpenLayers.Layer.MapServer.Untiled( "Ruta 22",
"../../cgi-bin/mapserv",
            {map:"C:/data/publicacion.map", transparent: "true", 
            layers: "ruta22_ida",map_imagetype: "png"},{"isBaseLayer":
false}, {"displayInLayerSwitcher":false});

    And here I wanto to create my layer where the name "ruta22_ida" is on a
variable.


            var layer1 = document.pos_recorridos.layertxt.value;
            alert(layer1);

            var ruta8 = new OpenLayers.Layer.MapServer.Untiled( "Ruta 8",
"../../cgi-bin/mapserv",
            {map:"C:/data/publicacion.map", 
            layers: layer1 ,transparent: "true", map_imagetype: "png"});


I hope your help...

Thanks..!  David

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to