Hi Simon, We had to create a CLASSGROUP for every style and on every layer:
LAYER CLASSGROUP 'Style1' CLASSGROUP 'Style2' CLASS GROUP 'Style1' STYLE [...] END END CLASS GROUP 'Style2' STYLE [...] END END END With this, they are advertised as: <Layer queryable="1" opaque="0" cascaded="0"> [...] <Style> <Name>Style1</Name> [...] </Style> <Style> <Name>Style2</Name> [...] </Style> </Layer> And you can request the one to use on GetMap-Requests using the STYLES parameter. HTH > -----Ursprüngliche Nachricht----- > Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im > Auftrag von Wright, Simon M. > Gesendet: Dienstag, 31. Mai 2016 14:37 > An: mapserver-users@lists.osgeo.org > Betreff: [mapserver-users] Multiple styles in a MapServer WMS Service > > Dear All > > > > I'm fairly new to MapServer and am trying to create a WMS Service. > > > > I have defined two styles the following metadata section of a layer as > follows: > > > > METADATA > > "wms_title" "LC.LandCoverSurfaces" > > "wms_srs" "CRS:84 EPSG:4326 EPSG:27700 EPSG:4258 > EPSG:3857" > > "wms_metadataurl_type" "ISO19115:2003" > > "wms_metadataurl_format" "text/xml" > > "wms_metadataurl_href" > "https://catalogue.ceh.ac.uk//id/a1f88807-4826-44bc-994d-a902da5119c2?" > > "wms_style" "default" > > "wms_style_default_legendurl_title" "" > > "wms_style_default_legendurl_width" "226" > > "wms_style_default_legendurl_height" "431" > > "wms_style_default_legendurl_format" "image/png" > > "wms_style_default_legendurl_href" > "http://eidc.ceh.ac.uk/administration-folder/tools/wms/987544e0-22d8-11e4- > 8c21-0800200c9a66/legends/LCM2007_DomTar.png" > > "wms_style" "inspire_common:DEFAULT" > > "wms_style_inspire_common:DEFAULT_legendurl_title" > "LC.LandCoverSurfaces Default Style" > > "wms_style_inspire_common:DEFAULT_legendurl_width" > "226" > > "wms_style_inspire_common:DEFAULT_legendurl_height" > "431" > > "wms_style_inspire_common:DEFAULT_legendurl_format" > "image/png" > > "wms_style_inspire_common:DEFAULT_legendurl_href" > "http://eidc.ceh.ac.uk/administration-folder/tools/wms/987544e0-22d8-11e4- > 8c21-0800200c9a66/legends/LCM2007_DomTar.png" > > > > But only one style is actually broadcast in the WMS GetCapabilities > document: > > > > <Layer queryable="0" opaque="0" cascaded="0"> > > <Name>LC.LandCoverSurfaces</Name> > > <Title>LC.LandCoverSurfaces</Title> > > <CRS>CRS:84</CRS> > > <CRS>EPSG:4326</CRS> > > <CRS>EPSG:27700</CRS> > > <CRS>EPSG:4258</CRS> > > <CRS>EPSG:3857</CRS> > > <EX_GeographicBoundingBox> > > <westBoundLongitude>-9.49714</westBoundLongitude> > > <eastBoundLongitude>3.63202</eastBoundLongitude> > > <southBoundLatitude>49.7668</southBoundLatitude> > > <northBoundLatitude>61.581</northBoundLatitude> > > </EX_GeographicBoundingBox> > > <BoundingBox CRS="CRS:84" minx="-9.49714" miny="49.7668" maxx="3.63202" > maxy="61.581"/> > > <BoundingBox CRS="EPSG:4326" minx="49.7668" miny="-9.49714" maxx="61.581" > maxy="3.63202"/> > > <BoundingBox CRS="EPSG:27700" minx="0" miny="0" maxx="700000" > maxy="1.3e+06"/> > > <BoundingBox CRS="EPSG:4258" minx="49.7668" miny="-9.49714" maxx="61.581" > maxy="3.63202"/> > > <BoundingBox CRS="EPSG:3857" minx="-1.05722e+06" miny="6.40599e+06" > maxx="404315" maxy="8.76046e+06"/> > > <MetadataURL type="ISO19115:2003"> > > <Format>text/xml</Format> > > <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" > xlink:type="simple" xlink:href="https://catalogue.ceh.ac.uk//id/a1f88807- > 4826-44bc-994d-a902da5119c2?"/> > > </MetadataURL> > > <Style> > > <Name>inspire_common:DEFAULT</Name> > > <Title>inspire_common:DEFAULT</Title> > > <LegendURL width="226" height="431"> > > <Format>image/png</Format> > > <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" > xlink:type="simple" xlink:href="http://eidc.ceh.ac.uk/administration- > folder/tools/wms/987544e0-22d8-11e4-8c21- > 0800200c9a66/legends/LCM2007_DomTar.png"/> > > </LegendURL> > > </Style> > > </Layer> > > > > It appears that the last defined style is the one that makes it through to > the GetCapabilities file. > > > > > > > > Therefore, am I specifying my styles incorrectly in the .map file? > > > > Is it possible to define multiple styles for the GetCapabilities document? > > > > Or, is this a bug in MapServer 6.4.2? And if so, should I use a later > version of MapServer? > > > > > > > > Many thanks for any help that anyone can provide. > > > > > > > > Best wishes, Simon. > > ________________________________ > > This message (and any attachments) is for the recipient only. NERC is > subject to the Freedom of Information Act 2000 and the contents of this > email and any reply you make may be disclosed by NERC unless it is exempt > from release under the Act. Any material supplied to NERC may be stored in > an electronic records management system. > ________________________________ _______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users