Web API Reference MapGuide Open Source
virtual MgByteReader* MgMappingService::GenerateLegendImage ( MgResourceIdentifier resource,
double  scale,
INT32  width,
INT32  height,
CREFSTRING  format,
INT32  geomType,
INT32  themeCategory 
) [pure virtual]

GenerateLegendImage() returns the legend image for the specified layer.

.NET Syntax
virtual MgByteReader GenerateLegendImage(MgResourceIdentifier resource, double scale, int width, int height, string format, int geomType, int themeCategory);
Java Syntax
virtual MgByteReader GenerateLegendImage(MgResourceIdentifier resource, double scale, int width, int height, String format, int geomType, int themeCategory);
PHP Syntax
virtual MgByteReader GenerateLegendImage(MgResourceIdentifier resource, double scale, int width, int height, string format, int geomType, int themeCategory);

Parameters:
resource (MgResourceIdentifier) Input MgResourceIdentifier object identifying the layer definition resource.
scale (double) Input The scale at which the symbolization is requested.
width (int) Input The requested image width in pixels.
height (int) Input The requested image height in pixels.
format (String/string) Input Image format, from MgImageFormats. Example: PNG, JPG, PNG8, etc …
geomType (int) Input The type of symbolization required: 1=Point, 2=Line, 3=Area, 4=Composite
themeCategory (int) Input The value indicating which theme category swatch to return. Used when there is a theme defined at this scale. An exception will be thrown if a requested them category doesn't exist.
Returns:
Returns a stream representing the legend image. The default returned image format will be PNG8 unless a different supported format is requested. An exception will be thrown if an unsupported image format is requested.
Exceptions:
MgArgumentOutOfRangeException 
MgInvalidResourceTypeException 
MgNullArgumentException 
MgInvalidImageFormatException 


Comments or suggestions? Send us feedback.