[mapserver-users] Re: handling multiple styles for WMS layers
aznan
g8a at email.com
Tue Apr 12 06:33:24 PDT 2011
Sorry to resurrect an old thread. I'm trying to accomplish the same thing,
but I can't get the styles URL parameter to "stick". I modified the OGC
workshop slightly:
LAYER
NAME rivers
GROUP "Vectors"
CLASSGROUP "blue"
PROJECTION
"init=epsg:4326"
END
TYPE LINE
STATUS ON
DATA ../data/rivers
# how will this data look?
CLASS
NAME "Rivers-blue"
GROUP "blue"
COLOR 0 0 255
END
CLASS
NAME "Rivers-red"
GROUP "red"
COLOR 255 0 0
END
END
When I do a GetLegendGraphic using the following URL I still get a blue
river:
http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/ms_ogc_workshop/service/config.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=rivers&format=image/png&styles=red
Likewise, if I set CLASSGROUP to "red" I only get the red river even though
I specify "&styles=blue" in the URL.
What gives? Thanks!
Stephan Holl wrote:
>
> Hello Verena,
>
> Verena Diewald <verena.diewald at wheregroup.com>, [20100119 -
> 14:27:49]
>
>> Hi list,
>>
>> I have one question concerning style handling in MapServer. Is it
>> possible to define multiple layer styles for my WMS and request the
>> single styles in the styles parameter in the GetMap request? And how
>> are the single styles defined in the layer section of the mapfile?
>
> Have a look at GROUP[1] and CLASSGROUP[2].
>
> This should should give what you want.
>
> Best
>
> Stephan
>
> [1] http://mapserver.org/mapfile/class.html
> [2] http://mapserver.org/mapfile/layer.html
>
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/handling-multiple-styles-for-WMS-layers-tp4419989p6265124.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list