[mapserver-users] WMS Legend with more than one layer class

Andrea Peri aperi2007 at gmail.com
Sun Sep 25 05:34:56 PDT 2016


This is the fragment from mapfile to reproduce the legend of our anpil.

    ...
    CLASSGROUP "default"
    CLASSITEM "AREA"
    LABELCACHE on
    CLASS
      NAME 'area superiore a 10ha'
      GROUP 'default'
      EXPRESSION ( ([AREA] < 2000000000) AND ([AREA] > 10000000) )
      MAXSCALEDENOM 5000100
      MINSCALEDENOM 1500100
      STYLE
         SYMBOL 'downwarddiagonalfill'
         WIDTH 0.5
         SIZE 4
         COLOR "#1BE37FFF"
         OUTLINECOLOR "#1BE37FFF"
         ANTIALIAS false
      END
      STYLE
         WIDTH 0.5
         OUTLINECOLOR "#1BE37FFF"
         ANTIALIAS false
      END
    END
    CLASS
      NAME 'area inferiore a 10ha'
      GROUP 'default'
      EXPRESSION ([AREA] < 10000000)
      MAXSCALEDENOM 5000100
      MINSCALEDENOM 1500100
      STYLE
         GEOMTRANSFORM 'centroid'
         SYMBOL 'circlefill'
         SIZE 4
         COLOR "#1BE37FFF"
         OUTLINECOLOR "#1BE37FFF"
         ANTIALIAS false
      END
    END
    CLASS
      NAME 'anpil'
      GROUP 'default'
      MAXSCALEDENOM 1500100
      MINSCALEDENOM 1
      STYLE
         SYMBOL 'downwarddiagonalfill'
         WIDTH 0.5
         SIZE 4
         COLOR "#1BE37FFF"
         OUTLINECOLOR "#1BE37FFF"
         ANTIALIAS false
      END
      STYLE
         WIDTH 0.5
         OUTLINECOLOR "#1BE37FFF"
         ANTIALIAS false
      END
      ....
  END

Regards,
A.


2016-09-25 14:30 GMT+02:00 Andrea Peri <aperi2007 at gmail.com>:
> I forget the scale parameter:
>
> http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsarprot&map_resolution=91&language=ita&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&format=image/png&STYLE=default&layer=rt_arprot.idanpil.rt.poly&scale=2000000
>
>
> 2016-09-25 14:29 GMT+02:00 Andrea Peri <aperi2007 at gmail.com>:
>> Hi Andrea,
>>
>> I try it on one of our wms services:
>>
>> It return correctly the class list with labels.
>>
>> This is the call.
>> http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsarprot&map_resolution=91&language=ita&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&format=image/png&STYLE=default&layer=rt_arprot.idanpil.rt.poly
>>
>>
>> Now I try to extract the mapfile fragment.
>>
>>
>> 2016-09-25 13:32 GMT+02:00 aborruso <aborruso at gmail.com>:
>>> Ciao Andrea,
>>>
>>>
>>> Andrea Peri wrote
>>>> I will try to add a group element to every class . With the same group
>>>> value.
>>>
>>> I have added it to every class (I have added also CLASSGROUP to the layer)
>>> but it's the same: no labels.
>>>
>>> Thank you
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-Legend-with-more-than-one-layer-class-tp5287624p5287627.html
>>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>>
>> --
>> -----------------
>> Andrea Peri
>> . . . . . . . . .
>> qwerty àèìòù
>> -----------------
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



More information about the MapServer-users mailing list