Skip to main content

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 ParameterDefault 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​

ParameterType
propsP

Returns​

MapComponent<P>

Inherit Doc​

Overrides​

DisplayComponent.constructor

Properties​

context?​

optional context: [] = undefined

Defined in: src/sdk/components/FSComponent.ts:67

The context on this component, if any.

Inherited from​

DisplayComponent.context


contextType?​

readonly optional contextType: readonly [] = undefined

Defined in: src/sdk/components/FSComponent.ts:70

The type of context for this component, if any.

Inherited from​

DisplayComponent.contextType


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:64

The properties of the component.

Inherited from​

DisplayComponent.props

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​

ParameterTypeDescription
layerMapLayerThe 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​

ParameterTypeDescription
thisNodeVNodeThis component's VNode.

Returns​

void


destroy()​

destroy(): void

Defined in: src/sdk/components/map/MapComponent.ts:272

Destroys this component.

Returns​

void

Overrides​

DisplayComponent.destroy


detachLayer()​

protected detachLayer(layer): boolean

Defined in: src/sdk/components/map/MapComponent.ts:224

Detaches a layer from this map component.

Parameters​

ParameterTypeDescription
layerMapLayerThe layer to detach.

Returns​

boolean

Whether the layer was succesfully detached.


getContext()​

protected getContext(context): never

Defined in: src/sdk/components/FSComponent.ts:109

Gets a context data subscription from the context collection.

Parameters​

ParameterTypeDescription
contextneverThe 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​

DisplayComponent.getContext


getProjectedSize()​

getProjectedSize(): ReadonlyFloat64Array

Defined in: src/sdk/components/map/MapComponent.ts:74

Gets the size of this map's projected window, in pixels.

Returns​

ReadonlyFloat64Array

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​

ParameterTypeDescription
thisNodeVNodeThe component's VNode.

Returns​

void

Overrides​

DisplayComponent.onAfterRender


onBeforeRender()​

onBeforeRender(): void

Defined in: src/sdk/components/FSComponent.ts:83

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​

ParameterTypeDescription
mapProjectionMapProjectionThis layer's map projection.
changeFlagsnumberThe 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​

ParameterTypeDescription
timenumberThe current real time as a UNIX timestamp in milliseconds.
elapsednumberThe 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(): VNode | null

Defined in: src/sdk/components/FSComponent.ts:96

Renders the component.

Returns​

VNode | null

A JSX element to be rendered.

Inherited from​

DisplayComponent.render


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​

ParameterTypeDescription
timenumberThe 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​

ParameterTypeDescription
timenumberThe current real time as a UNIX timestamp in milliseconds.
elapsednumberThe 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