[OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer
Hello, I'm trying to have an Openlayers.WMS layer that should contain 2 WMS layers, served by MapServer, using the following code (in theory this is possible): var twms = new OpenLayers.Layer.WMS( Sigpac, http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wms.map;, { transparent: 'true', layers: 'ParcelasSigpac, RecintosSigpac'},{strategies: [new OpenLayers.Strategy.BBOX()],isBaseLayer: false, buffer:1, gutter:0,visibility: false, units: 'm', maxExtent: new OpenLayers.Bounds(463506.9978541628, 4702558.185239193, 603185.4988525142, 4811754.780732273)} ); map.addLayer(twms); but no layer is displayed. Instead I get a MapServer error: msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. Is there anything special that I have to configure or am I doing something wrong?? On a totally differente subject. I use Tilecache for raster files. It makes sense using Tilecache for non-raster layers, i.e. for wms vector layers?? Thanks in advance. Un saludo, ·· David Alda Fernández de Lezea Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad IKT Granja Modelo s/n · 01192 · Arkaute (Araba) ·· Tlfnos.: 945-00-32-95 Fax: 945-00.32.90 ·· email: da...@ikt.esweb: www.ikt.es http://www.ikt.es/ ·· logo.gif___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer
Hi David, For me it works when I do it like this: map.addLayer( new OpenLayers.Layer.WMS( Niedersachsen WMS, http://www.geobasisdaten.niedersachsen.de/bestand;, {layers: 'ueb5000_nf,ueb1000_nf,ukn500_nf,dtk100_v_nf'}, {singleTile:true} ) ); cheers, Marco Am 18.01.2010 09:25, schrieb David Alda Fernandez de Lezea: Hello, I'm trying to have an Openlayers.WMS layer that should contain 2 WMS layers, served by MapServer, using the following code (in theory this is possible): var twms = new OpenLayers.Layer.WMS( Sigpac, http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wms.map;, { transparent: 'true', layers: 'ParcelasSigpac, RecintosSigpac'},{strategies: [new OpenLayers.Strategy.BBOX()],isBaseLayer: false, buffer:1, gutter:0,visibility: false, units: 'm', maxExtent: new OpenLayers.Bounds(463506.9978541628, 4702558.185239193, 603185.4988525142, 4811754.780732273)} ); map.addLayer(twms); but no layer is displayed. Instead I get a MapServer error: msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. Is there anything special that I have to configure or am I doing something wrong?? On a totally differente subject. I use Tilecache for raster files. It makes sense using Tilecache for non-raster layers, i.e. for wms vector layers?? Thanks in advance. Un saludo, ·· *David Alda Fernández de Lezea* Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad *IKT* Granja Modelo s/n · 01192 · Arkaute (Araba) ·· Tlfnos.: 945-00-32-95 Fax: 945-00.32.90 ·· email: da...@ikt.es mailto:da...@ikt.esweb: www.ikt.es http://www.ikt.es/ ·· ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer
Thanks to both of you. The problem was the blank space as you mentioned Pierre. Thanks again. Un saludo, ·· David Alda Fernández de Lezea Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad IKT Granja Modelo s/n · 01192 · Arkaute (Araba) ·· Tlfnos.: 945-00-32-95 Fax: 945-00.32.90 ·· email: da...@ikt.esweb: www.ikt.es ·· -Mensaje original- De: Pierre Giraud [mailto:pierre.gir...@camptocamp.com] Enviado el: lunes, 18 de enero de 2010 11:10 Para: David Alda Fernandez de Lezea CC: openlayers users Asunto: Re: [OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer Hi, Maybe, your WMS server doesn't like the space in your layers param. Try with 'ParcelasSigpac,RecintosSigpac' instead of 'ParcelasSigpac, RecintosSigpac'. Even better, you can give the layers param an array : layers: ['ParcelasSigpac', 'RecintosSigpac'] I hope this will help you. Regards, Pierre On Mon, Jan 18, 2010 at 9:25 AM, David Alda Fernandez de Lezea da...@ikt.es wrote: Hello, I'm trying to have an Openlayers.WMS layer that should contain 2 WMS layers, served by MapServer, using the following code (in theory this is possible): var twms = new OpenLayers.Layer.WMS( Sigpac, http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wms .map, { transparent: 'true', layers: 'ParcelasSigpac, RecintosSigpac'},{strategies: [new OpenLayers.Strategy.BBOX()],isBaseLayer: false, buffer:1, gutter:0,visibility: false, units: 'm', maxExtent: new OpenLayers.Bounds(463506.9978541628, 4702558.185239193, 603185.4988525142, 4811754.780732273)} ); map.addLayer(twms); but no layer is displayed. Instead I get a MapServer error: msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. Is there anything special that I have to configure or am I doing something wrong?? On a totally differente subject. I use Tilecache for raster files. It makes sense using Tilecache for non-raster layers, i.e. for wms vector layers?? Thanks in advance. Un saludo, ·· David Alda Fernández de Lezea Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad IKT Granja Modelo s/n · 01192 · Arkaute (Araba) ·· Tlfnos.: 945-00-32-95 Fax: 945-00.32.90 ·· email: da...@ikt.es web: www.ikt.es ·· ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Pierre GIRAUD Géomaticien, Analyste Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 93 Mail : pierre.gir...@camptocamp.com http://www.camptocamp.com ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer
David Alda Fernandez de Lezea wrote: Hello, I'm trying to have an Openlayers.WMS layer that should contain 2 WMS layers, served by MapServer, using the following code (in theory this is possible): var twms = new OpenLayers.Layer.WMS( Sigpac, http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wms.map;, { transparent: 'true', layers: 'ParcelasSigpac, RecintosSigpac'},{strategies: [new OpenLayers.Strategy.BBOX()],isBaseLayer: false, buffer:1, gutter:0,visibility: false, units: 'm', maxExtent: new OpenLayers.Bounds(463506.9978541628, 4702558.185239193, 603185.4988525142, 4811754.780732273)} ); Try to remove the comma between the layers: layers: 'ParcelasSigpac,RecintosSigpac' Regards, Andreas. map.addLayer(twms); but no layer is displayed. Instead I get a MapServer error: msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. Is there anything special that I have to configure or am I doing something wrong?? On a totally differente subject. I use Tilecache for raster files. It makes sense using Tilecache for non-raster layers, i.e. for wms vector layers?? Thanks in advance. Un saludo, ·· *David Alda Fernández de Lezea* Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad *IKT* Granja Modelo s/n · 01192 · Arkaute (Araba) ·· Tlfnos.: 945-00-32-95 Fax: 945-00.32.90 ·· email: da...@ikt.es mailto:da...@ikt.esweb: www.ikt.es http://www.ikt.es/ ·· ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users
Re: [OpenLayers-Users] How to have multiple wms layers into one Openlayers.WMS layer
On Monday, January 18, 2010, David Alda Fernandez de Lezea da...@ikt.es wrote: Hello, I'm trying to have an Openlayers.WMS layer that should contain 2 WMS layers, served by MapServer, using the following code (in theory this is possible): var twms = new OpenLayers.Layer.WMS( Sigpac, http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wms.map;, { transparent: 'true', layers: 'ParcelasSigpac, RecintosSigpac'},{strategies: [new OpenLayers.Strategy.BBOX()],isBaseLayer: false, buffer:1, gutter:0,visibility: false, units: 'm', maxExtent: new OpenLayers.Bounds(463506.9978541628, 4702558.185239193, 603185.4988525142, 4811754.780732273)} ); As a side note, do not set strategies into WMS layers, strategies apply to Vector layers only. Cheers, -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : eric.lemo...@camptocamp.com http://www.camptocamp.com ___ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users