Skip to main content

Class: MapLayer<P>

A base component for map layers.

Type parameters

NameType
Pextends MapLayerProps<any> = MapLayerProps<any>

Hierarchy

Constructors

constructor

new MapLayer<P>(props): MapLayer<P>

Creates an instance of a DisplayComponent.

Type parameters

NameType
Pextends MapLayerProps<any> = MapLayerProps<any>

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

MapLayer<P>

Inherited from

DisplayComponent.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


props

props: P & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61

Methods

destroy

destroy(): void

Destroys this component.

Returns

void

Inherited from

DisplayComponent.destroy

Defined in

src/sdk/components/FSComponent.ts:98


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
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

Defined in

src/sdk/components/FSComponent.ts:106


isVisible

isVisible(): boolean

Checks whether this layer is visible.

Returns

boolean

whether this layer is visible.

Defined in

src/sdk/components/map/MapLayer.ts:38


onAfterRender

onAfterRender(node): void

A callback that is called after the component is rendered.

Parameters

NameTypeDescription
nodeVNodeThe component's VNode.

Returns

void

Inherited from

DisplayComponent.onAfterRender

Defined in

src/sdk/components/FSComponent.ts:87


onAttached

onAttached(): void

This method is called when this layer is attached to its parent map component.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:67


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onDetached

onDetached(): void

This method is called when this layer is detached from its parent map component.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:108


onMapProjectionChanged

onMapProjectionChanged(mapProjection, changeFlags): void

This method is called when the map projection changes.

Parameters

NameTypeDescription
mapProjectionMapProjectionthis layer's map projection.
changeFlagsnumberThe types of changes made to the projection.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:91


onSleep

onSleep(): void

This method is called when this layer's parent map is put to sleep.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:81


onUpdated

onUpdated(time, elapsed): void

This method is called once every map update cycle.

Parameters

NameTypeDescription
timenumberThe current time as a UNIX timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:101


onVisibilityChanged

onVisibilityChanged(isVisible): void

This method is called when this layer's visibility changes.

Parameters

NameTypeDescription
isVisiblebooleanWhether the layer is now visible.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:60


onWake

onWake(): void

This method is called when this layer's parent map is woken.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:74


render

render(): null | VNode

Renders the component.

Returns

null | VNode

A JSX element to be rendered.

Inherited from

DisplayComponent.render

Defined in

src/sdk/components/FSComponent.ts:93


setVisible

setVisible(val): void

Sets this layer's visibility.

Parameters

NameTypeDescription
valbooleanWhether this layer should be visible.

Returns

void

Defined in

src/sdk/components/map/MapLayer.ts:46