[mapserver-users] Layerswitcher all Layers in one Mapfile

Langlois, Dominique Dominique.Langlois at RNCan-NRCan.gc.ca
Thu Aug 5 11:39:07 EDT 2010


Hello,

 

First thing that I see is the missing END keywords for each LAYER blocks. Personnaly, since I used MapServer in WMS mode, I also add WMS_NAME directive into the METADATA block. Hope this will help.

 

 

Dominique Langlois

Ressources naturelles Canada                       Natural Resources Canada

Centre d'information topographique             Centre for Topographic Information

Équipe Services Web                                     Web Services Team

Sherbrooke (Québec) J1J 2E8                       Sherbrooke, Quebec J1J 2E8

Courriel: langlois at RNCan.gc.ca <mailto:langlois at RNCan.gc.ca>                                       E-Mail: langlois at NRCan.gc.ca <mailto:langlois at NRCan.gc.ca> 

 

 

 

 

________________________________

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Strunck, Alexander
Sent: 5 août 2010 08:51
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Layerswitcher all Layers in one Mapfile

 

Hello

 

i am just testing a layerswitcher. First i programmed it so that every layer is in a separate mapfile. everything works fine.

now i want to try to put all layers in one mapfile. but now if i want to turn a layer on, i get the message

msWMSLoadGetMapParams():WMS server error. Invalid layer(s) given in the LAYERS parameter.

 

the html file looks like this

 

       var bicc_wms = new OpenLayers.Layer.WMS(

              "baselayer",

              "****/cgi-bin/mapserv",

              {      

                     map: '/var/www/map_data/umn/allinone.map',

                     layers: 'baselayer',

                     format: 'image/png',

                     transparent: 'false'

              },

              {isBaseLayer: true, visibility: false}

       );

              

       layer_test1 = new OpenLayers.Layer.WMS(

              "milex",

              "****/cgi-bin/mapserv",

              {

                     map: '/var/www/map_data/umn/allinone.map',

                     layers: "milex",

                     transparent: "true",

                     format: "image/png"

              },

              {isBaseLayer: false, visibility: false}

       );

the part of the mapfile looks like this

 

LAYER

 NAME 'baselayer'

 GROUP 'baselayer'

 TYPE Polygon

 INCLUDE 'postgis.config'

 DATA 'the_geom from (SELECT c.gid, c.the_geom AS the_geom FROM basemap AS c ) as foo using unique gid using SRID=4326'  

 STATUS on

   

 METADATA

  WMS_TITLE 'Grenzen aller Länder'

  WMS_FEATURE_INFO_MIME_TYPE 'text/html'

 END #METADATA

 

 CLASS

  NAME 'Grenzen aller Länder'  

   STYLE

    COLOR 211 211 211

    OUTLINECOLOR 1 1 1

   END #STYLE

 END # CLASS

 

#-------------------------------------------------------------------------------

# LayerGroup Klassen Militärausgaben #

#-------------------------------------------------------------------------------

 

LAYER

 NAME 'milex'

 TYPE Polygon

 INCLUDE 'postgis.config'

 DATA 'the_geom from (SELECT c.gid, gmi.c_milex AS rank, c.the_geom AS the_geom FROM basemap AS c LEFT JOIN m3_thema1_2008_2 AS gmi ON c.iso3_code = gmi.iso3_code) as foo using unique gid using SRID=4326' 

 STATUS off

 

 METADATA

 

  WMS_TITLE 'Country Boundaries'

  WMS_FEATURE_INFO_MIME_TYPE 'text/html'

 END #METADATA

 

 CLASS

  NAME 'no data available'

  EXPRESSION ([rank] eq 999)

   STYLE

    COLOR 211 211 211

    OUTLINECOLOR 1 1 1

   END #STYLE

 END # CLASS

 

has someone an idea??

 

thx

 

alex

 

________________________________

--
Internationales Konversionszentrum Bonn
Bonn International Center for Conversion (BICC) GmbH
Pfarrer- Byns-Straße 1, 53121 Bonn, GERMANY
Tel. / Phone: +49-228-911 96 0, Fax: +49-228-911 96 - 22
Internet: www.bicc.de, E-mail: bicc at bicc.de

Firmensitz/ Office: Bonn
Registergericht/ Registered at: Amtsgericht Bonn, HRB 6717
Geschäftsführer/ Director: Peter Johannes Croll
Prokurist/ Authorized Signatory: Michael Dedek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100805/8068be19/attachment-0001.html


More information about the mapserver-users mailing list