Class: MapSharedCachedCanvasSubLayer<P>
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:209
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:73
Creates an instance of a DisplayComponent.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | P | The propertis of the component. |
Returns
MapSharedCachedCanvasSubLayer<P>
Inherited from
Properties
context?
optionalcontext: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonlyoptionalcontextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
props
props:
P&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
Accessors
buffer
Get Signature
get
protectedbuffer():MapSharedCachedCanvasInstance
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:248
This sublayer's shared offscreen buffer canvas instance.
Throws
Error if the buffer does not exist.
Returns
display
Get Signature
get
protecteddisplay():MapSharedCachedCanvasInstance
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:235
This sublayer's shared displayed canvas instance.
Throws
Error if this sublayer is not attached.
Returns
projection
Get Signature
get
protectedprojection():MapProjection
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:222
This sublayer's map projection.
Throws
Error if this sublayer is not attached.
Returns
Methods
attach()
attach(
projection,display,buffer):void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:286
Attaches this sublayer to a parent layer.
Parameters
| Parameter | Type | Description |
|---|---|---|
projection | MapProjection | The map projection used by this sublayer. |
display | MapSharedCachedCanvasInstance | The displayed canvas instance shared by this sublayer. |
buffer | undefined | MapSharedCachedCanvasInstance | The 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:98
Destroys this component.
Returns
void
Inherited from
getContext()
protectedgetContext(context):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | never | The 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
isAttached()
protectedisAttached():boolean
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:268
Checks whether this sublayer is attached to a parent layer.
Returns
boolean
Whether this sublayer is attached to a parent layer.
isVisible()
protectedisVisible():boolean
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:276
Checks whether this sublayer is visible.
Returns
boolean
Whether this sublayer is visible.
onAfterRender()
onAfterRender(
node):void
Defined in: src/sdk/components/FSComponent.ts:87
A callback that is called after the component is rendered.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | VNode | The component's VNode. |
Returns
void
Inherited from
DisplayComponent.onAfterRender
onAttached()
onAttached():
void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:325
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:80
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:349
This method is called when this sublayer's map projection changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
projection | MapProjection | This sublayer's map projection. |
changeFlags | number | The types of changes made to the projection. |
Returns
void
onSleep()
onSleep():
void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:339
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:385
This method is called once every update cycle after this sublayer's shared canvas instance has had a chance to be invalidated.
Parameters
| Parameter | Type | Description |
|---|---|---|
time | number | The current time as a Javascript timestamp. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
void
onVisibilityChanged()
protectedonVisibilityChanged(isVisible):void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:318
This method is called when this layer's visibility changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
isVisible | boolean | Whether the layer is now visible. |
Returns
void
onWake()
onWake():
void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:332
This method is called when this sublayer's parent layer is awakened.
Returns
void
render()
render():
null|VNode
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:390
Renders the component.
Returns
null | VNode
A JSX element to be rendered.
Overrides
setVisible()
setVisible(
val):void
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:302
Sets this sublayer's visibility.
Parameters
| Parameter | Type | Description |
|---|---|---|
val | boolean | Whether this sublayer should be visible. |
Returns
void
shouldInvalidateBuffer()
shouldInvalidateBuffer(
time,elapsed):boolean
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:374
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
| Parameter | Type | Description |
|---|---|---|
time | number | The current time as a Javascript timestamp. |
elapsed | number | The 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:361
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
| Parameter | Type | Description |
|---|---|---|
time | number | The current time as a Javascript timestamp. |
elapsed | number | The elapsed time, in milliseconds, since the last update. |
Returns
boolean
Whether this sublayer's shared displayed canvas instance should be invalidated.
tryGetBuffer()
protectedtryGetBuffer():undefined|MapSharedCachedCanvasInstance
Defined in: src/sdk/components/map/layers/MapSharedCachedCanvasLayer.tsx:260
Attempts to get this sublayer's shared offscreen buffer canvas instance.
Returns
undefined | MapSharedCachedCanvasInstance
This sublayer's shared offscreen buffer canvas instance, or undefined if the buffer does not exist.