Abstract Class: MapComponent<P>
Defined in: src/sdk/components/map/MapComponent.ts:38
A component which displays a map. A map projects geographic coordinates onto a planar pixel grid. Each map component maintains a MapProjection instance which handles the details of the projection. MapLayer objects added to the map as children determine what is drawn on the map.
Extends
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
P extends MapComponentProps <any > | MapComponentProps <any > |
Constructors
Constructor
new MapComponent<
P
>(props
):MapComponent
<P
>
Defined in: src/sdk/components/map/MapComponent.ts:57
Parameters
Parameter | Type |
---|---|
props | P |
Returns
MapComponent
<P
>
Inherit Doc
Overrides
Properties
context?
optional
context: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonly
optional
contextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
mapProjection
readonly
mapProjection:MapProjection
Defined in: src/sdk/components/map/MapComponent.ts:42
This map component's projection model.
props
props:
P
&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
Accessors
isAwake
Get Signature
get isAwake():
boolean
Defined in: src/sdk/components/map/MapComponent.ts:82
Whether this map is awake.
Returns
boolean
Methods
attachLayer()
protected
attachLayer(layer
):void
Defined in: src/sdk/components/map/MapComponent.ts:209
Attaches a layer to this map component. If the layer is already attached, then this method has no effect.
Parameters
Parameter | Type | Description |
---|---|---|
layer | MapLayer | The layer to attach. |
Returns
void
attachLayers()
protected
attachLayers(thisNode
):void
Defined in: src/sdk/components/map/MapComponent.ts:140
Scans this component's VNode sub-tree for MapLayer components and attaches them when found. Only the top-most level of MapLayer components are attached; layers that are themselves children of other layers are not attached.
Parameters
Parameter | Type | Description |
---|---|---|
thisNode | VNode | This component's VNode. |
Returns
void
destroy()
destroy():
void
Defined in: src/sdk/components/map/MapComponent.ts:272
Destroys this component.
Returns
void
Overrides
detachLayer()
protected
detachLayer(layer
):boolean
Defined in: src/sdk/components/map/MapComponent.ts:224
Detaches a layer from this map component.
Parameters
Parameter | Type | Description |
---|---|---|
layer | MapLayer | The layer to detach. |
Returns
boolean
Whether the layer was succesfully detached.
getContext()
protected
getContext(context
):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
Parameter | Type | Description |
---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
getProjectedSize()
getProjectedSize():
ReadonlyFloat64Array
Defined in: src/sdk/components/map/MapComponent.ts:74
Gets the size of this map's projected window, in pixels.
Returns
The size of this map's projected window.
onAfterRender()
onAfterRender(
thisNode
):void
Defined in: src/sdk/components/map/MapComponent.ts:115
A callback that is called after the component is rendered.
Parameters
Parameter | Type | Description |
---|---|---|
thisNode | VNode | The component's VNode. |
Returns
void
Overrides
DisplayComponent
.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent
.onBeforeRender
onMapProjectionChanged()
protected
onMapProjectionChanged(mapProjection
,changeFlags
):void
Defined in: src/sdk/components/map/MapComponent.ts:189
This method is called when the map projection changes.
Parameters
Parameter | Type | Description |
---|---|---|
mapProjection | MapProjection | This layer's map projection. |
changeFlags | number | The types of changes made to the projection. |
Returns
void
onProjectedSizeChanged()
abstract
protected
onProjectedSizeChanged():void
Defined in: src/sdk/components/map/MapComponent.ts:203
This method is called when the size of this map's projected window changes.
Returns
void
onSleep()
protected
onSleep():void
Defined in: src/sdk/components/map/MapComponent.ts:170
This method is called when the map is put to sleep.
Returns
void
onUpdated()
protected
onUpdated(time
,elapsed
):void
Defined in: src/sdk/components/map/MapComponent.ts:254
This method is called once every update cycle.
Parameters
Parameter | Type | Description |
---|---|---|
time | number | The current real time as a UNIX timestamp in milliseconds. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
void
onWake()
protected
onWake():void
Defined in: src/sdk/components/map/MapComponent.ts:153
This method is called when the map is awakened.
Returns
void
render()
abstract
render():null
|VNode
Defined in: src/sdk/components/FSComponent.ts:93
Renders the component.
Returns
null
| VNode
A JSX element to be rendered.
Inherited from
sleep()
sleep():
void
Defined in: src/sdk/components/map/MapComponent.ts:89
Puts this map to sleep. While asleep, this map will not be updated.
Returns
void
sleepLayers()
protected
sleepLayers():void
Defined in: src/sdk/components/map/MapComponent.ts:177
Calls the onSleep() method of this map's layers.
Returns
void
update()
update(
time
):void
Defined in: src/sdk/components/map/MapComponent.ts:240
Updates this map.
Parameters
Parameter | Type | Description |
---|---|---|
time | number | The current real time as a UNIX timestamp in milliseconds. |
Returns
void
updateLayers()
protected
updateLayers(time
,elapsed
):void
Defined in: src/sdk/components/map/MapComponent.ts:264
Updates this map's attached layers.
Parameters
Parameter | Type | Description |
---|---|---|
time | number | The current real time as a UNIX timestamp in milliseconds. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
void
wake()
wake():
void
Defined in: src/sdk/components/map/MapComponent.ts:96
Wakes this map, allowing it to be updated.
Returns
void
wakeLayers()
protected
wakeLayers():void
Defined in: src/sdk/components/map/MapComponent.ts:160
Calls the onWake() method of this map's layers.
Returns
void