MapObjectState
geovisto-map / MapObjectState
Class: MapObjectState
This class manages state of the tool. It wraps the state since the tool can work with state objects which needs to be explicitly serialized.
Author
Jiri Hynek
Extended by
Implements
Constructors
new MapObjectState()
new MapObjectState(
mapObject
):MapObjectState
It creates a map object state.
Parameters
• mapObject: IMapObject
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectState
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>
Returns
Source
model/internal/object/MapObjectState.ts:23
Properties
id
private
id:string
Source
model/internal/object/MapObjectState.ts:18
mapObject
private
mapObject:IMapObject
\<IMapObjectProps
,IMapObjectDefaults
\<IMapObjectProps
,IMapObjectConfig
>,IMapObjectState
\<IMapObjectProps
,IMapObjectDefaults
\<IMapObjectProps
,IMapObjectConfig
>,IMapObjectConfig
,IMapObjectInitProps
\<IMapObjectConfig
>>,IMapObjectConfig
,IMapObjectInitProps
\<IMapObjectConfig
>>
Source
model/internal/object/MapObjectState.ts:15
type
private
type:string
Source
model/internal/object/MapObjectState.ts:17
Methods
deserialize()
deserialize(
config
):void
The metod takes config and deserializes the values.
Parameters
• config: IMapObjectConfig
Returns
void
Implementation of
Source
model/internal/object/MapObjectState.ts:60
getId()
getId():
string
It returns the id property of the tool state.
Returns
string
Implementation of
Source
model/internal/object/MapObjectState.ts:87
getMapObject()
protected
getMapObject():IMapObject
\<IMapObjectProps
,IMapObjectDefaults
\<IMapObjectProps
,IMapObjectConfig
>,IMapObjectState
\<IMapObjectProps
,IMapObjectDefaults
\<IMapObjectProps
,IMapObjectConfig
>,IMapObjectConfig
,IMapObjectInitProps
\<IMapObjectConfig
>>,IMapObjectConfig
,IMapObjectInitProps
\<IMapObjectConfig
>>
It makes the map object visible to extended classes.
Returns
IMapObject
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectState
\<IMapObjectProps
, IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>, IMapObjectConfig
, IMapObjectInitProps
\<IMapObjectConfig
>>
Source
model/internal/object/MapObjectState.ts:39
getType()
getType():
string
It returns the type property of the tool state.
Returns
string
Implementation of
Source
model/internal/object/MapObjectState.ts:80
initialize()
initialize(
defaults
,props
,initProps
):void
It resets the state to the initial props.
Parameters
• defaults: IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>
• props: IMapObjectProps
• initProps: IMapObjectInitProps
Returns
void
Implementation of
Source
model/internal/object/MapObjectState.ts:50
serialize()
serialize(
defaults
):IMapObjectConfig
The method serializes the tool state. Optionally, a serialized value can be let undefined if it equals the default value.
Parameters
• defaults: undefined
| IMapObjectDefaults
\<IMapObjectProps
, IMapObjectConfig
>
Returns
Implementation of
Source
model/internal/object/MapObjectState.ts:70
setId()
setId(
id
):void
It sets the id property of the tool state.
Parameters
• id: string
Returns
void