Skip to main content

SidebarTool

geovisto-mapReadme | API


geovisto-map / SidebarTool

Class: SidebarTool

This class provides the sidebar tool.

Author

Jiri Hynek

Extends

Implements

Constructors

new SidebarTool()

new SidebarTool(props?): SidebarTool

It creates a new tool with respect to the props.

Parameters

props?: ISidebarToolProps

Returns

SidebarTool

Overrides

MapTool.constructor

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:48

Properties

themeChangeAdapter

private themeChangeAdapter: SidebarToolThemeChangeAdapter

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:41

Methods

copy()

copy(): ISidebarTool\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>, ISidebarToolConfig, IMapToolInitProps\<ISidebarToolConfig>>

It creates a copy of the uninitialized tool.

Returns

ISidebarTool\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>, ISidebarToolConfig, IMapToolInitProps\<ISidebarToolConfig>>

Implementation of

ISidebarTool.copy

Overrides

MapTool.copy

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:55


create()

create(): this

It creates sidebar.

Returns

this

Implementation of

ISidebarTool.create

Overrides

MapTool.create

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:116


createDefaults()

protected createDefaults(): ISidebarToolDefaults

It creates new defaults of the tool.

Returns

ISidebarToolDefaults

Overrides

MapTool.createDefaults

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:76


createSidebar()

protected createSidebar(): void

It creates a sidebar tool and its parts (leaflet sidebar and sidebar tabs).

Returns

void

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:126


createSidebarTab()

protected createSidebarTab(tool, config, propsSidebarTab): void

Help function which initializes and creates sidebar tab for a tool with respect to a given config.

Parameters

tool: undefined | IMapTool\<IMapToolProps, IMapToolDefaults, IMapToolState\<IMapToolProps, IMapToolDefaults, IMapToolConfig, IMapToolInitProps\<IMapToolConfig>>, IMapToolConfig, IMapToolInitProps\<IMapToolConfig>, IMapToolAPI>

config: undefined | ISidebarTabConfig

propsSidebarTab: undefined | ISidebarTab\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabState\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabConfig>, ISidebarTabConfig, ISidebarTabInitProps\<ISidebarTabConfig>>

Returns

void

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:219


createState()

protected createState(): ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>

It returns default tool state.

Returns

ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>

Overrides

MapTool.createState

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:90


createTabs()

protected createTabs(): void

It returns sidebar tabs.

Returns

void

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:163


getAPIGetter()

getAPIGetter(): undefined | IMapToolAPIGetter

It returns the tool API

Returns

undefined | IMapToolAPIGetter

Implementation of

ISidebarTool.getAPIGetter

Inherited from

MapTool.getAPIGetter

Source

model/internal/tool/MapTool.ts:74


getDefaults()

getDefaults(): ISidebarToolDefaults

It returns default values of the sidebar tool.

Returns

ISidebarToolDefaults

Implementation of

ISidebarTool.getDefaults

Overrides

MapTool.getDefaults

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:69


getId()

getId(): string

Help function which returns the id of the object.

Returns

string

Implementation of

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

ISidebarTool.getMap

Inherited from

MapTool.getMap

Source

model/internal/tool/MapTool.ts:112


getProps()

getProps(): ISidebarToolProps

It returns the props given by the programmer.

Returns

ISidebarToolProps

Implementation of

ISidebarTool.getProps

Overrides

MapTool.getProps

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:62


getPropsSidebarTab()

protected getPropsSidebarTab(toolId): undefined | ISidebarTab\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabState\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabConfig>, ISidebarTabConfig, ISidebarTabInitProps\<ISidebarTabConfig>>

Help function which loops up a sidebar tab in props

Parameters

toolId: string

Returns

undefined | ISidebarTab\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabState\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabConfig>, ISidebarTabConfig, ISidebarTabInitProps\<ISidebarTabConfig>>

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:202


getSidebarStructure()

protected getSidebarStructure(): SidebarOptions

It returns structure of sidebar defined with respect to the leaflet-sidebar-v2 plugin specification.

See: https://github.com/noerw/leaflet-sidebar-v2

Returns

SidebarOptions

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:144


getState()

getState(): ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>

It returns the sidebar tool state.

Returns

ISidebarToolState\<ISidebarToolProps, ISidebarToolDefaults, ISidebarToolConfig>

Implementation of

ISidebarTool.getState

Overrides

MapTool.getState

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:83


getTabs()

getTabs(): ISidebarTab\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabState\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabConfig>, ISidebarTabConfig, ISidebarTabInitProps\<ISidebarTabConfig>>[]

Help function which returns sidebar tabs.

Returns

ISidebarTab\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabState\<ISidebarTabProps, ISidebarTabDefaults, ISidebarTabConfig>, ISidebarTabConfig, ISidebarTabInitProps\<ISidebarTabConfig>>[]

Implementation of

ISidebarTool.getTabs

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:156


getThemeChangeAdapter()

protected getThemeChangeAdapter(): SidebarToolThemeChangeAdapter

It returns theme change adapter.

Returns

SidebarToolThemeChangeAdapter

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:97


getType()

getType(): string

Help function which returns the type of the object.

Returns

string

Implementation of

ISidebarTool.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/sidebar/model/internal/tool/SidebarTool.ts:243


initialize()

initialize(initProps): this

Overrides the super method.

Parameters

initProps: IMapToolInitProps\<ISidebarToolConfig>

Returns

this

Implementation of

ISidebarTool.initialize

Overrides

MapTool.initialize

Source

tools/sidebar/model/internal/tool/SidebarTool.ts:109


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

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

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

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

ISidebarTool.switchEnabled

Inherited from

MapTool.switchEnabled

Source

model/internal/tool/MapTool.ts:158