Skip to main content

Class: MapCachedCanvasLayerCanvasInstanceClass

An implementation of MapCachedCanvasLayerCanvasInstance.

Hierarchy

Implements

Constructors

constructor

new MapCachedCanvasLayerCanvasInstanceClass(canvas, context, isDisplayed, getReferenceMargin): MapCachedCanvasLayerCanvasInstanceClass

Creates a new canvas instance.

Parameters

NameTypeDescription
canvasHTMLCanvasElementThe canvas element.
contextCanvasRenderingContext2DThe canvas 2D rendering context.
isDisplayedbooleanWhether the canvas is displayed.
getReferenceMargin() => numberA function which gets this canvas instance's reference margin, in pixels. The reference margin is the maximum amount of translation allowed without invalidation at a scale factor of 1.

Returns

MapCachedCanvasLayerCanvasInstanceClass

Overrides

MapCanvasLayerCanvasInstanceClass.constructor

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:223

Properties

canvas

Readonly canvas: HTMLCanvasElement

The canvas element.

Implementation of

MapCachedCanvasLayerCanvasInstance.canvas

Inherited from

MapCanvasLayerCanvasInstanceClass.canvas

Defined in

src/sdk/components/map/layers/MapCanvasLayer.tsx:46


context

Readonly context: CanvasRenderingContext2D

The canvas 2D rendering context.

Implementation of

MapCachedCanvasLayerCanvasInstance.context

Inherited from

MapCanvasLayerCanvasInstanceClass.context

Defined in

src/sdk/components/map/layers/MapCanvasLayer.tsx:47


isDisplayed

Readonly isDisplayed: boolean

Whether the canvas is displayed.

Implementation of

MapCachedCanvasLayerCanvasInstance.isDisplayed

Inherited from

MapCanvasLayerCanvasInstanceClass.isDisplayed

Defined in

src/sdk/components/map/layers/MapCanvasLayer.tsx:48

Accessors

geoProjection

get geoProjection(): GeoProjection

The projection used to draw this instance's canvas image.

Returns

GeoProjection

Implementation of

MapCachedCanvasLayerCanvasInstance.geoProjection

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:250


isInvalid

get isInvalid(): boolean

Whether this instance's transform is invalid.

Returns

boolean

Implementation of

MapCachedCanvasLayerCanvasInstance.isInvalid

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:245


reference

get reference(): MapCachedCanvasLayerReference

This instance's map projection reference. The rendering of items to this instance's canvas is based on this reference.

Returns

MapCachedCanvasLayerReference

Implementation of

MapCachedCanvasLayerCanvasInstance.reference

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:235


transform

get transform(): MapCachedCanvasLayerTransform

This instance's transform.

Returns

MapCachedCanvasLayerTransform

Implementation of

MapCachedCanvasLayerCanvasInstance.transform

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:240

Methods

clear

clear(): void

Clears this canvas.

Returns

void

Implementation of

MapCachedCanvasLayerCanvasInstance.clear

Inherited from

MapCanvasLayerCanvasInstanceClass.clear

Defined in

src/sdk/components/map/layers/MapCanvasLayer.tsx:53


invalidate

invalidate(): void

Invalidates this canvas instance. This also clears the canvas.

Returns

void

Implementation of

MapCachedCanvasLayerCanvasInstance.invalidate

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:314


reset

reset(): void

Resets this instance's canvas. This will erase the canvas of all drawn pixels, reset its state (including all styles, transformations, and cached paths), and clear the Coherent GT command buffer associated with it.

Returns

void

Implementation of

MapCachedCanvasLayerCanvasInstance.reset

Inherited from

MapCanvasLayerCanvasInstanceClass.reset

Defined in

src/sdk/components/map/layers/MapCanvasLayer.tsx:58


syncWithCanvasInstance

syncWithCanvasInstance(other): void

Syncs this canvas instance with another canvas instance.

Parameters

NameTypeDescription
otherMapCachedCanvasLayerCanvasInstancethe canvas instance with which to sync.

Returns

void

Implementation of

MapCachedCanvasLayerCanvasInstance.syncWithCanvasInstance

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:268


syncWithMapProjection

syncWithMapProjection(mapProjection): void

Syncs this canvas instance with the current map projection.

Parameters

NameTypeDescription
mapProjectionMapProjectionThe current map projection.

Returns

void

Implementation of

MapCachedCanvasLayerCanvasInstance.syncWithMapProjection

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:255


transformCanvasElement

transformCanvasElement(): void

Transforms this instance's canvas element.

Returns

void

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:301


updateTransform

updateTransform(mapProjection): void

Updates this canvas instance's transform given the current map projection.

Parameters

NameTypeDescription
mapProjectionMapProjectionThe current map projection.

Returns

void

Defined in

src/sdk/components/map/layers/MapCachedCanvasLayer.ts:283