mapscript.legendObj

class mapscript.legendObj

The LEGEND object

Overview

The legendObj has the following relationships:

../../../_images/legendObj_labelObj.png ../../../_images/legendObj_mapObj.png

Attributes

height

int Legend height

imagecolor

colorObj Legend background color - see IMAGECOLOR

keysizex

int Width in pixels of legend keys - see KEYSIZE

keysizey

int Height in pixels of legend keys - see KEYSIZE

keyspacingx

int Horizontal padding around keys in pixels - see KEYSPACING

keyspacingy

int Vertical padding around keys in pixels - see KEYSPACING

label

labelObj immutable See LABEL

map

mapObj immutable Instances of legendObj are always are always embedded inside the mapObj

outlinecolor

colorObj Key outline color, -1 for no outline - see OUTLINECOLOR

position

int Used for embedded legends, see POSITION

postlabelcache

int MS_TRUE, MS_FALSE - see POSTLABELCACHE

status

int MS_ON, MS_OFF or MS_EMBED- see STATUS

template

char See TEMPLATE

thisown

The membership flag

width

int Legend width

Methods

__init__()[source]
convertToString() char[source]

Output the legendObj object as a Mapfile string. Provides the inverse option for legendObj.updateFromString().

updateFromString(snippet: char) int[source]

Update a legendObj from a string snippet. Returns MS_SUCCESS or MS_FAILURE