Skip to main content

HierarchyTool

geovisto-map β€’ Readme | API


geovisto-map / HierarchyTool

Class: HierarchyTool

Hierarchy tool provides configuration parsing for hierarchy, sets hierarchy trees for geoDataManager and later dispatches event in case of zoom/geo data change event.

Author​

MalΓ½ VojtΔ›ch

Extends​

Implements​

Constructors​

new HierarchyTool()​

new HierarchyTool(props?): HierarchyTool

Parameters​

β€’ props?: IMapToolProps

Returns​

HierarchyTool

Overrides​

MapTool.constructor

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:35

Properties​

changeLastZoom​

private changeLastZoom: string[] = []

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:32


changeStruct​

private changeStruct: Map\<string, [boolean, number]>

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:31


manager​

private manager: HierarchyToolManager

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:28


mapForm​

private mapForm: HieararchyToolMapForm

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:27

Methods​

copy()​

copy(): IHierarchyTool\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>, IHierarchyToolConfig, IMapToolInitProps\<IHierarchyToolConfig>>

It creates a copy of the uninitialized tool.

Returns​

IHierarchyTool\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>, IHierarchyToolConfig, IMapToolInitProps\<IHierarchyToolConfig>>

Implementation of​

IHierarchyTool.copy

Overrides​

MapTool.copy

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:76


create()​

create(): this

It creates a tool.

Returns​

this

Implementation of​

IHierarchyTool.create

Overrides​

MapTool.create

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:81


createDefaults()​

createDefaults(): IHierarchyToolDefaults

It creates new defaults of the tool.

Returns​

IHierarchyToolDefaults

Overrides​

MapTool.createDefaults

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:50


createMapForm()​

protected createMapForm(): IMapForm

Returns​

IMapForm

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:54


createState()​

createState(): IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>

It creates new defaults of the tool.

Returns​

IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>

Overrides​

MapTool.createState

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:72


getAPIGetter()​

getAPIGetter(): undefined | IMapToolAPIGetter

It returns the tool API

Returns​

undefined | IMapToolAPIGetter

Implementation of​

IHierarchyTool.getAPIGetter

Inherited from​

MapTool.getAPIGetter

Source​

model/internal/tool/MapTool.ts:74


getDefaults()​

getDefaults(): IHierarchyToolDefaults

It returns default values of the state properties.

Returns​

IHierarchyToolDefaults

Implementation of​

IHierarchyTool.getDefaults

Overrides​

MapTool.getDefaults

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:46


getId()​

getId(): string

Help function which returns the id of the object.

Returns​

string

Implementation of​

IHierarchyTool.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​

IHierarchyTool.getMap

Inherited from​

MapTool.getMap

Source​

model/internal/tool/MapTool.ts:112


getMapForm()​

getMapForm(): IMapForm

It returns a map control.

Returns​

IMapForm

Implementation of​

IMapFormControl.getMapForm

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:39


getProps()​

getProps(): IMapToolProps

Help function which returns the props given by the programmer.

Returns​

IMapToolProps

Implementation of​

IHierarchyTool.getProps

Inherited from​

MapTool.getProps

Source​

model/internal/tool/MapTool.ts:39


getState()​

getState(): IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>

It returns the map object state.

Returns​

IHierarchyToolState\<IMapToolProps, IHierarchyToolDefaults, IHierarchyToolConfig>

Implementation of​

IHierarchyTool.getState

Overrides​

MapTool.getState

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:68


getType()​

getType(): string

Help function which returns the type of the object.

Returns​

string

Implementation of​

IHierarchyTool.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.

Override this function, if needed.

Parameters​

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

Returns​

void

Inherited from​

MapTool.handleEvent

Source​

model/internal/tool/MapTool.ts:171


initialize()​

initialize(initProps): this

It initializes the state of the object. It processes the serialized config and sets further objects.

This cannot be done in the object constructor since the object can be created before the Geovisto map is created.

Parameters​

β€’ initProps: IMapToolInitProps\<IMapToolConfig>

Returns​

this

Implementation of​

IHierarchyTool.initialize

Overrides​

MapTool.initialize

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:58


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​

IHierarchyTool.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​

IHierarchyTool.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​

IHierarchyTool.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​

IHierarchyTool.switchEnabled

Inherited from​

MapTool.switchEnabled

Source​

model/internal/tool/MapTool.ts:158


updateChangeStruct()​

private updateChangeStruct(zoom): void

Private method to update data in change structer.

Parameters​

β€’ zoom: number

New level of zoom.

Returns​

void

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:156


zoomChanged()​

private zoomChanged(): void

Method called whenever zoom changes.

Returns​

void

Source​

tools/hierarchy/model/internal/tool/HierarchyTool.ts:125