Skip to main content

Class: MapSharedCachedCanvasSubLayer<P>

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:225

A sublayer of MapSharedCachedCanvasLayer.

Extends​

Type Parameters​

Type Parameter
P extends MapSharedCachedCanvasSubLayerProps<any>

Constructors​

Constructor​

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

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

Creates an instance of a DisplayComponent.

Parameters​

ParameterTypeDescription
propsPThe propertis of the component.

Returns​

MapSharedCachedCanvasSubLayer<P>

Inherited from​

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


props​

props: P & ComponentProps

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

The properties of the component.

Inherited from​

DisplayComponent.props

Accessors​

buffer​

Get Signature​

get protected buffer(): MapSharedCachedCanvasInstance

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:264

This sublayer's shared offscreen buffer canvas instance.

Throws​

Error if the buffer does not exist.

Returns​

MapSharedCachedCanvasInstance


display​

Get Signature​

get protected display(): MapSharedCachedCanvasInstance

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:251

This sublayer's shared displayed canvas instance.

Throws​

Error if this sublayer is not attached.

Returns​

MapSharedCachedCanvasInstance


projection​

Get Signature​

get protected projection(): MapProjection

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

This sublayer's map projection.

Throws​

Error if this sublayer is not attached.

Returns​

MapProjection

Methods​

attach()​

attach(projection, display, buffer): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:302

Attaches this sublayer to a parent layer.

Parameters​

ParameterTypeDescription
projectionMapProjectionThe map projection used by this sublayer.
displayMapSharedCachedCanvasInstanceThe displayed canvas instance shared by this sublayer.
bufferMapSharedCachedCanvasInstance | undefinedThe offscreen buffer canvas instance shared by this sublayer, or undefined if there is no buffer.

Returns​

void


destroy()​

destroy(): void

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

Destroys this component.

Returns​

void

Inherited from​

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

DisplayComponent.getContext


isAttached()​

protected isAttached(): boolean

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:284

Checks whether this sublayer is attached to a parent layer.

Returns​

boolean

Whether this sublayer is attached to a parent layer.


isVisible()​

protected isVisible(): boolean

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:292

Checks whether this sublayer is visible.

Returns​

boolean

Whether this sublayer is visible.


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​

DisplayComponent.onAfterRender


onAttached()​

onAttached(): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:341

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

Returns​

void


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()​

onMapProjectionChanged(projection, changeFlags): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:365

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


onSleep()​

onSleep(): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:355

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

Returns​

void


onUpdated()​

onUpdated(time, elapsed): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:401

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 Javascript timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns​

void


onVisibilityChanged()​

protected onVisibilityChanged(isVisible): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:334

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

Parameters​

ParameterTypeDescription
isVisiblebooleanWhether the layer is now visible.

Returns​

void


onWake()​

onWake(): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:348

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

Returns​

void


render()​

render(): VNode | null

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:406

Renders the component.

Returns​

VNode | null

A JSX element to be rendered.

Overrides​

DisplayComponent.render


setVisible()​

setVisible(val): void

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:318

Sets this sublayer's visibility.

Parameters​

ParameterTypeDescription
valbooleanWhether this sublayer should be visible.

Returns​

void


shouldInvalidateBuffer()​

shouldInvalidateBuffer(time, elapsed): boolean

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:390

This method is called at the beginning of every update cycle to check whether this sublayer's shared offscreen buffer 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 Javascript timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns​

boolean

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


shouldInvalidateDisplay()​

shouldInvalidateDisplay(time, elapsed): boolean

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:377

This method is called at the beginning of every update cycle to check whether this sublayer's shared displayed 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 Javascript timestamp.
elapsednumberThe elapsed time, in milliseconds, since the last update.

Returns​

boolean

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


tryGetBuffer()​

protected tryGetBuffer(): MapSharedCachedCanvasInstance | undefined

Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:276

Attempts to get this sublayer's shared offscreen buffer canvas instance.

Returns​

MapSharedCachedCanvasInstance | undefined

This sublayer's shared offscreen buffer canvas instance, or undefined if the buffer does not exist.