GeovistoMapState
geovisto-map / GeovistoMapState
Class: GeovistoMapState
This class manages state of the map. It wraps the state since the map can work with state objects which needs to be explicitly serialized.
Author
Jiri Hynek
Extends
Implements
Constructors
new GeovistoMapState()
new GeovistoMapState(
map
):GeovistoMapState
It initializes a map state.
Parameters
• map: IMap
\<IMapProps
, IMapDefaults
, IMapState
\<IMapProps
, IMapDefaults
, IMapConfig
>, IMapConfig
, IMapInitProps
\<IMapConfig
>>
Returns
Overrides
Source
model/internal/map/GeovistoMapState.ts:45
Properties
data
private
data:IMapData
Source
model/internal/map/GeovistoMapState.ts:32
eventManager
private
eventManager:IMapEventManager
Source
model/internal/map/GeovistoMapState.ts:27
geoDataManager
private
geoDataManager:IGeoDataManager
Source
model/internal/map/GeovistoMapState.ts:34
leafletMap?
private
optional
leafletMap:any
Source
model/internal/map/GeovistoMapState.ts:28
mapCenter
private
mapCenter:object
lat
lat:
number
lng
lng:
number
Source
model/internal/map/GeovistoMapState.ts:36
mapConfig
private
mapConfig:IMapConfigManager
Source
model/internal/map/GeovistoMapState.ts:33
mapData
private
mapData:IMapDataManager
Source
model/internal/map/GeovistoMapState.ts:31
mapStructure
private
mapStructure:object
maxBounds
maxBounds: [[
number
,number
], [number
,number
]]
maxZoom
maxZoom:
number
Source
model/internal/map/GeovistoMapState.ts:37
toolTemplates
private
toolTemplates:IMapToolsManager
Source
model/internal/map/GeovistoMapState.ts:30
tools
private
tools:IMapToolsManager
Source
model/internal/map/GeovistoMapState.ts:29
toolsAPI
private
toolsAPI:Record
\<string
, () =>IMapToolAPI
>
Source
model/internal/map/GeovistoMapState.ts:38
zoom
private
zoom:number
Source
model/internal/map/GeovistoMapState.ts:35
Methods
deserialize()
deserialize(
config
):void
It takes config and deserializes the values.
Parameters
• config: IMapConfig
Returns
void
Implementation of
Overrides
Source
model/internal/map/GeovistoMapState.ts:92
getCurrentData()
getCurrentData():
IMapData
It returns current data (might be filtered).
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:224
getEventManager()
getEventManager():
IMapEventManager
It returns the map event manager.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:134
getGeoDataManager()
getGeoDataManager():
IGeoDataManager
It returns the geo data manager.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:256
getId()
getId():
string
It returns the id property of the tool state.
Returns
string
Implementation of
Inherited from
Source
model/internal/object/MapObjectState.ts:87
getInitialMapCenter()
getInitialMapCenter():
object
It returns the initial map center.
TODO: remove from state (use defaults only)
Returns
object
lat
lat:
number
lng
lng:
number
Implementation of
Source
model/internal/map/GeovistoMapState.ts:290
getInitialMapStructure()
getInitialMapStructure():
object
It returns the initial structure.
TODO: remove from state (use defaults only)
Returns
object
maxBounds
maxBounds: [[
number
,number
], [number
,number
]]
maxZoom
maxZoom:
number
Implementation of
IMapState
.getInitialMapStructure
Source
model/internal/map/GeovistoMapState.ts:310
getInitialZoom()
getInitialZoom():
number
It returns the initial zoom level.
Returns
number
Implementation of
Source
model/internal/map/GeovistoMapState.ts:272
getLeafletMap()
getLeafletMap():
any
It returns the Leaflet map.
Returns
any
Implementation of
Source
model/internal/map/GeovistoMapState.ts:157
getMapConfig()
getMapConfig():
IMapConfigManager
It returns the map config manager.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:240
getMapData()
getMapData():
IMapDataManager
It returns the map data manager.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:206
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
>>
Inherited from
Source
model/internal/object/MapObjectState.ts:39
getToolTemplates()
getToolTemplates():
IMapToolsManager
It returns the tool manager providing tool templates.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:173
getTools()
getTools():
IMapToolsManager
It returns tools manager providing tools.
Returns
Implementation of
Source
model/internal/map/GeovistoMapState.ts:189
getToolsAPI()
getToolsAPI():
Record
\<string
, () =>IMapToolAPI
>
It returns the map tools API.
Returns
Record
\<string
, () => IMapToolAPI
>
Implementation of
Source
model/internal/map/GeovistoMapState.ts:150
getType()
getType():
string
It returns the type property of the tool state.
Returns
string
Implementation of
Inherited from
Source
model/internal/object/MapObjectState.ts:80
initialize()
initialize(
defaults
,props
,initProps
):void
It resets the state to the initial props.
Parameters
• defaults: IMapDefaults
• props: IMapProps
• initProps: IMapInitProps
Returns
void
Implementation of
Overrides
Source
model/internal/map/GeovistoMapState.ts:59
serialize()
serialize(
defaults
):IMapConfig
It serializes the map state. Optionally, a serialized value can be let undefined if it equals the default value.
Parameters
• defaults: undefined
| IMapDefaults
Returns
Implementation of
Overrides
Source
model/internal/map/GeovistoMapState.ts:105
setCurrentData()
setCurrentData(
data
):void
It sets current data.
Parameters
• data: IMapData
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:233
setEventManager()
setEventManager(
eventManager
):void
It returns the map event manager.
Parameters
• eventManager: IMapEventManager
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:143
setGeoDataManager()
setGeoDataManager(
geoDataManager
):void
It sets a geo data manager.
Parameters
• geoDataManager: IGeoDataManager
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:265
setId()
setId(
id
):void
It sets the id property of the tool state.
Parameters
• id: string
Returns
void
Implementation of
Inherited from
Source
model/internal/object/MapObjectState.ts:96
setInitialMapCenter()
setInitialMapCenter(
mapCenter
):void
It sets initial map center.
TODO: remove from state (use defaults only)
Parameters
• mapCenter
• mapCenter.lat: number
• mapCenter.lng: number
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:301
setInitialMapStructure()
setInitialMapStructure(
mapStructure
):void
It sets initial map structure.
TODO: remove from state (use defaults only)
Parameters
• mapStructure
• mapStructure.maxBounds: [[number
, number
], [number
, number
]]
• mapStructure.maxZoom: number
Returns
void
Implementation of
IMapState
.setInitialMapStructure
Source
model/internal/map/GeovistoMapState.ts:321
setInitialZoom()
setInitialZoom(
zoom
):void
It sets initial zoom level.
Parameters
• zoom: number
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:281
setLeafletMap()
setLeafletMap(
map
):void
It returns the Leaflet map.
Parameters
• map: Map
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:166
setMapConfig()
setMapConfig(
mapConfig
):void
It sets the map config manager.
Parameters
• mapConfig: IMapConfigManager
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:249
setMapData()
setMapData(
mapData
):void
It sets the map data manager. note: It also updates the current data.
Parameters
• mapData: IMapDataManager
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:216
setToolTemplates()
setToolTemplates(
toolTemplates
):void
It sets tool templates providing tool templates.
Parameters
• toolTemplates: IMapToolsManager
Returns
void
Implementation of
Source
model/internal/map/GeovistoMapState.ts:182
setTools()
setTools(
tools
):void
It sets tools manager providing tools.
Parameters
• tools: IMapToolsManager
Returns
void