[OpenLayers-Users] Layer with Parameter ..

Arnd Wippermann arnd.wippermann at web.de
Sat Sep 13 16:30:52 EDT 2008


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: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080913/6cf19da0/attachment.html


More information about the Users mailing list