MapTool
geovisto-map / MapTool
Class: MapTool
This class provides basic tools API.
Author
Jiri Hynek
Extends
Implements
Constructors
new MapTool()
new MapTool(
props
?):MapTool
It initializes the tool.
Parameters
• props?: IMapToolProps
Returns
Overrides
Source
model/internal/tool/MapTool.ts:25
Methods
copy()
copy():
IMapTool
\<IMapToolProps
,IMapToolDefaults
,IMapToolState
\<IMapToolProps
,IMapToolDefaults
,IMapToolConfig
,IMapToolInitProps
\<IMapToolConfig
>>,IMapToolConfig
,IMapToolInitProps
\<IMapToolConfig
>,IMapToolAPI
>
It creates copy of the uninitialized tool.
Returns
IMapTool
\<IMapToolProps
, IMapToolDefaults
, IMapToolState
\<IMapToolProps
, IMapToolDefaults
, IMapToolConfig
, IMapToolInitProps
\<IMapToolConfig
>>, IMapToolConfig
, IMapToolInitProps
\<IMapToolConfig
>, IMapToolAPI
>
Implementation of
Source
model/internal/tool/MapTool.ts:32
create()
create():
this
It creates a tool.
Override this function.
Returns
this
Implementation of
Source
model/internal/tool/MapTool.ts:121
createDefaults()
protected
createDefaults():IMapToolDefaults
It creates new defaults of the tool.
Returns
Overrides
Source
model/internal/tool/MapTool.ts:53
createState()
protected
createState():IMapToolState
\<IMapToolProps
,IMapToolDefaults
,IMapToolConfig
,IMapToolInitProps
\<IMapToolConfig
>>
It creates new defaults of the tool.
Returns
IMapToolState
\<IMapToolProps
, IMapToolDefaults
, IMapToolConfig
, IMapToolInitProps
\<IMapToolConfig
>>
Overrides
Source
model/internal/tool/MapTool.ts:67
getAPIGetter()
getAPIGetter():
undefined
|IMapToolAPIGetter
It returns the tool API
Returns
undefined
| IMapToolAPIGetter
Implementation of
Source
model/internal/tool/MapTool.ts:74
getDefaults()
getDefaults():
IMapToolDefaults
It returns default values of the state properties.
Returns
Implementation of
Overrides
Source
model/internal/tool/MapTool.ts:46
getId()
getId():
string
Help function which returns the id of the object.
Returns
string
Implementation of
Inherited from
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
Source
model/internal/tool/MapTool.ts:112
getProps()
getProps():
IMapToolProps
Help function which returns the props given by the programmer.
Returns
Implementation of
Overrides
Source
model/internal/tool/MapTool.ts:39
getState()
getState():
IMapToolState
\<IMapToolProps
,IMapToolDefaults
,IMapToolConfig
,IMapToolInitProps
\<IMapToolConfig
>>
It returns the map tool state.
Returns
IMapToolState
\<IMapToolProps
, IMapToolDefaults
, IMapToolConfig
, IMapToolInitProps
\<IMapToolConfig
>>
Implementation of
Overrides
Source
model/internal/tool/MapTool.ts:60
getType()
getType():
string
Help function which returns the type of the object.
Returns
string
Implementation of
Inherited from
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
Implementation of
Source
model/internal/tool/MapTool.ts:171
initialize()
initialize(
initProps
):this
It initializes the tool before it is created. It processes the serialized config and sets the Geovisto map which manages the tools.
This cannot be done in the tool constructor since the tool can be created before the Geovisto map is created.
This cannot be done in the tool create function since there can be possible dependencies between the tools (the tool might depend on other tools which needs to be initialized).
Parameters
• initProps: IMapToolInitProps
\<IMapToolConfig
>
Returns
this
Implementation of
Overrides
Source
model/internal/tool/MapTool.ts:98
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
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
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
Source
model/internal/tool/MapTool.ts:142
setProps()
protected
setProps(props
):void
It updates the props.
Parameters
• props: IMapObjectProps
Returns
void
Inherited from
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