Skip to main content

Class: GenericMapSharedCanvasSubLayer<P>

A generic implementation of MapSharedCanvasSubLayer that delegates behavior to props.

Type parameters

NameType
Pextends GenericMapSharedCanvasSubLayerProps<any>

Hierarchy

Constructors

constructor

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

Creates an instance of a DisplayComponent.

Type parameters

NameType
Pextends GenericMapSharedCanvasSubLayerProps<any>

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

GenericMapSharedCanvasSubLayer<P>

Inherited from

MapSharedCanvasSubLayer.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

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

MapSharedCanvasSubLayer.contextType

Defined in

src/sdk/components/FSComponent.ts:67


props

props: P & ComponentProps

The properties of the component.

Inherited from

MapSharedCanvasSubLayer.props

Defined in

src/sdk/components/FSComponent.ts:61

Accessors

display

get display(): MapSharedCanvasInstance

This sublayer's shared canvas instance.

Returns

MapSharedCanvasInstance

Throws

Error if this sublayer is not attached.

Inherited from

MapSharedCanvasSubLayer.display

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:196


projection

get projection(): MapProjection

This sublayer's map projection.

Returns

MapProjection

Throws

Error if this sublayer is not attached.

Inherited from

MapSharedCanvasSubLayer.projection

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:183

Methods

attach

attach(projection, display): void

Attaches this sublayer to a parent layer.

Parameters

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

Returns

void

Inherited from

MapSharedCanvasSubLayer.attach

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:225


destroy

destroy(): void

Destroys this component.

Returns

void

Overrides

MapSharedCanvasSubLayer.destroy

Defined in

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


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

MapSharedCanvasSubLayer.getContext

Defined in

src/sdk/components/FSComponent.ts:106


isAttached

isAttached(): boolean

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

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:208


isVisible

isVisible(): boolean

Checks whether this sublayer is visible.

Returns

boolean

Whether this sublayer is visible.

Inherited from

MapSharedCanvasSubLayer.isVisible

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:216


onAfterRender

onAfterRender(node): void

A callback that is called after the component is rendered.

Parameters

NameTypeDescription
nodeVNodeThe component's VNode.

Returns

void

Inherited from

MapSharedCanvasSubLayer.onAfterRender

Defined in

src/sdk/components/FSComponent.ts:87


onAttached

onAttached(): void

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

Returns

void

Overrides

MapSharedCanvasSubLayer.onAttached

Defined in

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


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

MapSharedCanvasSubLayer.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onMapProjectionChanged

onMapProjectionChanged(projection, changeFlags): void

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

Parameters

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

Returns

void

Inherited from

MapSharedCanvasSubLayer.onMapProjectionChanged

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:287


onSleep

onSleep(): void

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

Returns

void

Overrides

MapSharedCanvasSubLayer.onSleep

Defined in

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


onUpdated

onUpdated(time, elapsed): void

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

Parameters

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

Returns

void

Overrides

MapSharedCanvasSubLayer.onUpdated

Defined in

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


onVisibilityChanged

onVisibilityChanged(isVisible): void

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

Parameters

NameTypeDescription
isVisiblebooleanWhether the layer is now visible.

Returns

void

Overrides

MapSharedCanvasSubLayer.onVisibilityChanged

Defined in

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


onWake

onWake(): void

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

Returns

void

Overrides

MapSharedCanvasSubLayer.onWake

Defined in

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


render

render(): null | VNode

Renders the component.

Returns

null | VNode

A JSX element to be rendered.

Inherited from

MapSharedCanvasSubLayer.render

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:315


setVisible

setVisible(val): void

Sets this sublayer's visibility.

Parameters

NameTypeDescription
valbooleanWhether this sublayer should be visible.

Returns

void

Inherited from

MapSharedCanvasSubLayer.setVisible

Defined in

src/sdk/components/map/layers/MapSharedCanvasLayer.tsx:240


shouldInvalidate

shouldInvalidate(time, elapsed): boolean

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

NameTypeDescription
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

Defined in

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