<head><title></title></head>
<body><div class="iw_mail" dir="ltr">Hi again,<br><br>I have modified my example and found out some things that works and some that don't work.<br>Actually I got a little furhter looking at:<br><a href="https://github.com/mapserver/mapserver/issues/4660">https://github.com/mapserver/mapserver/issues/4660</a><br><br>One layer with "layer name" as Layer=square gives correct result with both styles=color and styles=grey.<br>That is the layer name from the Layer name declaration.<br><br> <a href="http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1">http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1</a><br>&LAYERS=square&styles=grey<br>&srs=EPSG:4326&BBOX=0,0,20,15&FORMAT=image/png&WIDTH=200&HEIGHT=150<br><br>Two layers with "layer name" as Layer=square,circle gives correct result if I give two arguments to styles ie. styles=grey,grey or styles=color,color or styles=grey,color.<br><br><a href="http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1">http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1</a><br>&LAYERS=circle,square&styles=grey,grey<br>&srs=EPSG:4326&BBOX=0,0,20,15&FORMAT=image/png&WIDTH=200&HEIGHT=150<br><br>If I specify the layer with layers from "wms_layer_group" "/ST/circles" and /ST/squares that is layers=circles,squares it seem like the style given with styles parameter is ignored. It is only showing the default CLASSGROUP regardless of how styles is specified. as long as I have two arguments.<br><br><a href="http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1">http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1</a><br>&LAYERS=squares,circles&styles=grey,grey<br>&srs=EPSG:4326&BBOX=0,0,20,15&FORMAT=image/png&WIDTH=200&HEIGHT=150<br><br>It seems like the style is not assosiated with the the layer handling with wms_layer_groups.<br>I suspect that there is some undocumented way to do that.<br><br>If I specify the layers with the root layer name , ST<br><br><a href="http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&">http://localhost/cgi-bin/mapserv?map=/home/lars/Maps/Style_test/style_test_5.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&</a><br>LAYERS=ST&styles=grey<br>&srs=EPSG:4326&BBOX=0,0,20,15&FORMAT=image/png&WIDTH=200&HEIGHT=150<br><br>I get the following error.<br><br><ServiceException code="StyleNotDefined"><br>msWMSLoadGetMapParams(): WMS server error. Style (grey) not defined on root layer.<br></ServiceException><br><br>So to conclude, I am wordering if there is a way to specify the style for the root layer?<br>Because that is really what I would like to do.<br><br>Second question is how do I associate the style to layers in wms_layer_group instead of the layers specified in the layer name.<br><br>I hope this wasn't to long. All input would be welcome.<br><br>Lars Schylberg<br><br>New mapfile: style_test_5.map<br>------<br>MAP<br> NAME ST<br> EXTENT 0 0 20 15<br> SIZE 200 150<br> UNITS DD<br> IMAGECOLOR 200 200 200<br> CONFIG "MS_ERRORFILE" "/tmp/style_test.log"<br> DEBUG 5<br><br> OUTPUTFORMAT<br> NAME 'AGG'<br> DRIVER AGG/PNG<br> IMAGEMODE RGB<br> END<br><br> WEB<br> IMAGEPATH "/tmp/ms_tmp/"<br> IMAGEURL "/ms_tmp/"<br> METADATA<br> "wms_srs" "EPSG:3006 EPSG:4326"<br> "ows_enable_request" "*"<br> END<br> END<br><br> PROJECTION<br> "init=epsg:4326"<br> END<br><br> SYMBOL<br> NAME "circle"<br> TYPE ELLIPSE<br> FILLED TRUE<br> POINTS 1 1 END<br> END<br> SYMBOL<br> NAME "square"<br> TYPE VECTOR<br> FILLED TRUE<br> POINTS 0 0 0 1 1 1 1 0 0 0 END<br> END<br>#<br># Start of layer definitions<br>#<br> LAYER<br> NAME "circle"<br> TYPE POINT<br> FEATURE POINTS 10 5 END END<br> FEATURE POINTS 15 10 END END<br> METADATA<br> "wms_title" "Circles"<br> "wms_enable_request" "*"<br> "wms_layer_group" "/ST/circles"<br> END<br> STATUS on<br> CLASSGROUP "color"<br> CLASS<br> NAME "circle-color"<br> GROUP "color"<br> STYLE<br> COLOR 255 0 0<br> SIZE 15<br> WIDTH 1<br> SYMBOL "circle"<br> END<br> END<br> CLASS<br> NAME "circle-grey"<br> GROUP "grey"<br> STYLE<br> COLOR 50 50 50<br> SIZE 15<br> WIDTH 1<br> SYMBOL "circle"<br> END<br> END<br> END # Layer<br> LAYER<br> NAME "square"<br> TYPE POINT<br> FEATURE POINTS 10 10 END END<br> FEATURE POINTS 15 5 END END<br> METADATA<br> "wms_title" "Squares"<br> "wms_enable_request" "*"<br> "wms_layer_group" "/ST/squares"<br> END<br> STATUS on<br> CLASSGROUP "color"<br> CLASS<br> NAME "square-color"<br> GROUP "color"<br> STYLE<br> COLOR 0 0 255<br> SIZE 15<br> WIDTH 1<br> SYMBOL "square"<br> END<br> END<br> CLASS<br> NAME "square-grey"<br> GROUP "grey"<br> STYLE<br> COLOR 100 100 100<br> SIZE 15<br> WIDTH 1<br> SYMBOL "square"<br> END<br> END<br> END # Layer<br>END # Map File<br><br><br><br>
</div></body>