[mapserver-users] Layerswitcher all Layers in one Mapfile

Strunck, Alexander strunck at bicc.de
Thu Aug 5 08:51:01 EDT 2010


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/0f45246e/attachment.html


More information about the mapserver-users mailing list