Skip to main content

Class: GenericMapSharedCanvasSubLayer<P>

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:40

A generic implementation of MapSharedCanvasSubLayer that delegates behavior to props.

Extends​

Type Parameters​

Type Parameter
P extends GenericMapSharedCanvasSubLayerProps<any>

Constructors​

Constructor​

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

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

Creates an instance of a DisplayComponent.

Parameters​

ParameterTypeDescription
propsPThe propertis of the component.

Returns​

GenericMapSharedCanvasSubLayer<P>

Inherited from​

MapSharedCanvasSubLayer.constructor

Properties​

context?​

optional context: [] = undefined

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

The context on this component, if any.

Inherited from​

MapSharedCanvasSubLayer.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​

MapSharedCanvasSubLayer.contextType


props​

props: P & ComponentProps

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

The properties of the component.

Inherited from​

MapSharedCanvasSubLayer.props

Accessors​

display​

Get Signature​

get protected display(): MapSharedCanvasInstance

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:218

This sublayer's shared canvas instance.

Throws​

Error if this sublayer is not attached.

Returns​

MapSharedCanvasInstance

Inherited from​

MapSharedCanvasSubLayer.display


projection​

Get Signature​

get protected projection(): MapProjection

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:205

This sublayer's map projection.

Throws​

Error if this sublayer is not attached.

Returns​

MapProjection

Inherited from​

MapSharedCanvasSubLayer.projection

Methods​

attach()​

attach(projection, display): void

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:247

Attaches this sublayer to a parent layer.

Parameters​

ParameterTypeDescription
projectionMapProjectionThe map projection used by this sublayer.
displayMapSharedCanvasInstanceThe canvas instance shared by this sublayer.

Returns​

void

Inherited from​

MapSharedCanvasSubLayer.attach


destroy()​

destroy(): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:72

Destroys this component.

Returns​

void

Overrides​

MapSharedCanvasSubLayer.destroy


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​

MapSharedCanvasSubLayer.getContext


isAttached()​

protected isAttached(): boolean

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:230

Checks whether this sublayer is attached to a parent layer.

Returns​

boolean

Whether this sublayer is attached to a parent layer.

Inherited from​

MapSharedCanvasSubLayer.isAttached


isVisible()​

protected isVisible(): boolean

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:238

Checks whether this sublayer is visible.

Returns​

boolean

Whether this sublayer is visible.

Inherited from​

MapSharedCanvasSubLayer.isVisible


onAfterRender()​

onAfterRender(node): void

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

A callback that is called after the component is rendered.

Parameters​

ParameterTypeDescription
nodeVNodeThe component's VNode.

Returns​

void

Inherited from​

MapSharedCanvasSubLayer.onAfterRender


onAttached()​

onAttached(): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:47

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

Returns​

void

Overrides​

MapSharedCanvasSubLayer.onAttached


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​

MapSharedCanvasSubLayer.onBeforeRender


onMapProjectionChanged()​

onMapProjectionChanged(projection, changeFlags): void

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:309

This method is called when this sublayer's map projection changes.

Parameters​

ParameterTypeDescription
projectionMapProjectionThis sublayer's map projection.
changeFlagsnumberThe types of changes made to the projection.

Returns​

void

Inherited from​

MapSharedCanvasSubLayer.onMapProjectionChanged


onSleep()​

onSleep(): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:57

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

Returns​

void

Overrides​

MapSharedCanvasSubLayer.onSleep


onUpdated()​

onUpdated(time, elapsed): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:67

This method is called once every update cycle after this sublayer's shared canvas instance has had a chance to be invalidated.

Parameters​

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

Returns​

void

Overrides​

MapSharedCanvasSubLayer.onUpdated


onVisibilityChanged()​

onVisibilityChanged(isVisible): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:42

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

Parameters​

ParameterTypeDescription
isVisiblebooleanWhether the layer is now visible.

Returns​

void

Overrides​

MapSharedCanvasSubLayer.onVisibilityChanged


onWake()​

onWake(): void

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:52

This method is called when this sublayer's parent layer is awakened.

Returns​

void

Overrides​

MapSharedCanvasSubLayer.onWake


render()​

render(): VNode | null

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:337

Renders the component.

Returns​

VNode | null

A JSX element to be rendered.

Inherited from​

MapSharedCanvasSubLayer.render


setVisible()​

setVisible(val): void

Defined in: src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:262

Sets this sublayer's visibility.

Parameters​

ParameterTypeDescription
valbooleanWhether this sublayer should be visible.

Returns​

void

Inherited from​

MapSharedCanvasSubLayer.setVisible


shouldInvalidate()​

shouldInvalidate(time, elapsed): boolean

Defined in: src/sdk/components/map/layers/GenericMapSharedCanvasSubLayer.ts:62

This method is called at the beginning of every update cycle to check whether this sublayer's shared canvas instance should be invalidated. If the canvas is already invalidated, then this method will not be called.

Parameters​

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

Returns​

boolean

Whether this sublayer's shared canvas instance should be invalidated.

Overrides​

MapSharedCanvasSubLayer.shouldInvalidate