[Mapserver-users] GetLegendGraphic questions

Emil Zegers EZS at DeStraat.NL
Fri May 7 11:38:10 EDT 2004


Hello Bart,

Don't know if this is the cause but when you look in maplegend.c msDrawLegendIcon is called in the else part if class is NULL (if class is NULL all classes should be drawn):

  // Call drawLegendIcon with destination (0, 0)
  // Return an empty image if lp==NULL || class=NULL 
  //(If class is NULL draw the legend for all classes. Modifications done
  // Fev 2004 by AY)
  if (lp) {
    msClearLayerPenValues(lp); // just in case the mapfile has already been processed
    if (class) {
      msDrawLegendIcon(map, lp, class, width, height, image->img.gd, 0, 0);
    }
    else {
      for (i=0; i<lp->numclasses; i++) {
        msDrawLegendIcon(map, lp, &lp->class[i], width, height, image->img.gd, 0, 0);
      }
    }
  }

But doesn't it clip every image on top on the former one like this with dstX en dstY set to 0?

Regards,

Emil Zegers


>>> <bartvde at xs4all.nl> 05/07/04 01:38pm >>>
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
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu 
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 

__________
VChecked


______________________________________________________

 This message has been checked for all known viruses
______________________________________________________




More information about the mapserver-users mailing list