[Mapserver-users] GetLegendGraphic questions

bartvde at xs4all.nl bartvde at xs4all.nl
Fri May 7 07:38:26 EDT 2004


Hi list,

I have some questions about the GetLegendGraphic operation in Mapserver.

I have a layer in my MAP file which has 5 classes, but when performing a
GetLegendGraphic request I only get an image of the last class defined.
Should I not get an image of all classes?

Also, how do you get the "text labels" for the specific classes, e.g.
"0-20%" next to the symbols?

Maybe I am missing something in my LAYER definition?

This is the request I am using:
http://myserver/cgi-bin/mapserv.exe?map=/ms4w/apps/zulte/map/zulte_server.map&layer=kwelder_2000&version=1.1.1&request=GetLegendGraphic&format=image/png

This is my LAYER definition:

  LAYER

    METADATA
      WMS_TITLE "2000_kwelder"
      WFS_TITLE "2000_kwelder"
      WMS_ABSTRACT "2000_kwelder"
      WMS_SRS "epsg:28992"
    END
    NAME "kwelder_2000"
    CONNECTIONTYPE OGR
    TILEINDEX "2000.shp"

    SIZEUNITS PIXELS
    STATUS ON
    TOLERANCE 3
    TOLERANCEUNITS PIXELS
    TYPE POLYGON
    DUMP TRUE
    TEMPLATE "blank.html"
    UNITS METERS
    CLASSITEM "Kwelder_to"
    CLASS
    	EXPRESSION (([Kwelder_to] > 0) AND ([Kwelder_to] <= 20))
    	NAME "0-20%"
    	COLOR 254 255 212
    END
    CLASS
    	EXPRESSION (([Kwelder_to] > 20) AND ([Kwelder_to] <= 40))
    	NAME "21-40%"
    	COLOR 255 218 143
    END
    CLASS
    	EXPRESSION (([Kwelder_to] > 40) AND ([Kwelder_to] <= 60))
    	NAME "41-60%"
    	COLOR 255 151 41
    END
    CLASS
    	EXPRESSION (([Kwelder_to] > 60) AND ([Kwelder_to] <= 80))
    	NAME "61-80%"
    	COLOR 217 95 13
    END
    CLASS
    	EXPRESSION (([Kwelder_to] > 80) AND ([Kwelder_to] <= 100))
    	NAME "81-100%"
    	COLOR 153 54 5
    END
  END

Thanks in advance for any info on this subject.

Best regards,
Bart



More information about the mapserver-users mailing list