Skip to main content

LegendTool

geovisto-mapReadme | API


geovisto-map / LegendTool

Class: LegendTool

This class provides the legend tool.

Author

Tomas Koscielniak

Extends

Implements

Constructors

new LegendTool()

new LegendTool(props?): LegendTool

It creates a new tool with respect to the props.

Parameters

props?: IMapToolProps

Returns

LegendTool

Overrides

MapTool.constructor

Source

tools/legend/model/internal/tool/LegendTool.ts:38

Methods

clearLegend()

clearLegend(owner): void

This function clears legend.

Parameters

owner: undefined | string

Returns

void

Source

tools/legend/model/internal/tool/LegendTool.ts:156


copy()

copy(): ILegendTool\<IMapToolProps, ILegendToolDefaults, ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>, ILegendToolConfig, IMapToolInitProps\<ILegendToolConfig>>

It creates a copy of the uninitialized tool.

Returns

ILegendTool\<IMapToolProps, ILegendToolDefaults, ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>, ILegendToolConfig, IMapToolInitProps\<ILegendToolConfig>>

Implementation of

ILegendTool.copy

Overrides

MapTool.copy

Source

tools/legend/model/internal/tool/LegendTool.ts:45


create()

create(): this

It creates legend.

Returns

this

Implementation of

ILegendTool.create

Overrides

MapTool.create

Source

tools/legend/model/internal/tool/LegendTool.ts:96


createDefaults()

protected createDefaults(): ILegendToolDefaults

It creates new defaults of the tool.

Returns

ILegendToolDefaults

Overrides

MapTool.createDefaults

Source

tools/legend/model/internal/tool/LegendTool.ts:66


createLegend()

protected createLegend(): void

It creates a legend tool and its parts (new legend for each layer that implements it).

Returns

void

Source

tools/legend/model/internal/tool/LegendTool.ts:106


createState()

protected createState(): ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>

It returns default tool state.

Returns

ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>

Overrides

MapTool.createState

Source

tools/legend/model/internal/tool/LegendTool.ts:80


getAPIGetter()

getAPIGetter(): undefined | IMapToolAPIGetter

It returns the tool API

Returns

undefined | IMapToolAPIGetter

Implementation of

ILegendTool.getAPIGetter

Inherited from

MapTool.getAPIGetter

Source

model/internal/tool/MapTool.ts:74


getDefaults()

getDefaults(): ILegendToolDefaults

It returns default values of the legend tool.

Returns

ILegendToolDefaults

Implementation of

ILegendTool.getDefaults

Overrides

MapTool.getDefaults

Source

tools/legend/model/internal/tool/LegendTool.ts:59


getId()

getId(): string

Help function which returns the id of the object.

Returns

string

Implementation of

ILegendTool.getId

Inherited from

MapTool.getId

Source

model/internal/object/MapObject.ts:93


getMap()

getMap(): undefined | IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Help function returns map which uses this tool.

Do not override this function. Use the state class instead.

Returns

undefined | IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Implementation of

ILegendTool.getMap

Inherited from

MapTool.getMap

Source

model/internal/tool/MapTool.ts:112


getProps()

getProps(): IMapToolProps

It returns the props given by the programmer.

Returns

IMapToolProps

Implementation of

ILegendTool.getProps

Overrides

MapTool.getProps

Source

tools/legend/model/internal/tool/LegendTool.ts:52


getState()

getState(): ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>

It returns the legend tool state.

Returns

ILegendToolState\<IMapToolProps, ILegendToolDefaults, ILegendToolConfig>

Implementation of

ILegendTool.getState

Overrides

MapTool.getState

Source

tools/legend/model/internal/tool/LegendTool.ts:73


getType()

getType(): string

Help function which returns the type of the object.

Returns

string

Implementation of

ILegendTool.getType

Inherited from

MapTool.getType

Source

model/internal/object/MapObject.ts:86


handleEvent()

handleEvent(event): void

This function is called when a custom event is invoked.

Parameters

event: IMapEvent\<IMapObject\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectState\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>>

Returns

void

Overrides

MapTool.handleEvent

Source

tools/legend/model/internal/tool/LegendTool.ts:168


initialize()

initialize(initProps): this

Overrides the super method.

Parameters

initProps: IMapToolInitProps\<ILegendToolConfig>

Returns

this

Implementation of

ILegendTool.initialize

Overrides

MapTool.initialize

Source

tools/legend/model/internal/tool/LegendTool.ts:89


isEnabled()

isEnabled(): boolean

Help getter which returns enabled property of state.

Do not override this function. Use the state class instead.

Returns

boolean

Implementation of

ILegendTool.isEnabled

Inherited from

MapTool.isEnabled

Source

model/internal/tool/MapTool.ts:130


isSingleton()

isSingleton(): boolean

Help getter which returns a logtical value whether the tool type is singleton.

Returns

boolean

Implementation of

ILegendTool.isSingleton

Inherited from

MapTool.isSingleton

Source

model/internal/tool/MapTool.ts:81


setEnabled()

setEnabled(enabled): void

Some tools might be dynamicaly enabled/disabled. This function is called externally when the tool is enabled/disabled.

Override this function, if needed.

Parameters

enabled: boolean

Returns

void

Implementation of

ILegendTool.setEnabled

Inherited from

MapTool.setEnabled

Source

model/internal/tool/MapTool.ts:142


setProps()

protected setProps(props): void

It updates the props.

Parameters

props: IMapObjectProps

Returns

void

Inherited from

MapTool.setProps

Source

model/internal/object/MapObject.ts:38


switchEnabled()

switchEnabled(): void

Help function which switches enabled state (enabled/disabled).

Do not override this function. Use setEnabled instead.

Returns

void

Implementation of

ILegendTool.switchEnabled

Inherited from

MapTool.switchEnabled

Source

model/internal/tool/MapTool.ts:158