Class: ImageCanvasSource

ol/source/ImageCanvas~ImageCanvasSource


import ImageCanvasSource from 'ol/source/ImageCanvas';

Base class for image sources where a canvas element is the image.

new ImageCanvasSource(opt_options)

source/ImageCanvas.js, line 50
Name Type Description
options

ImageCanvas options.

Name Type Default Description
attributions module:ol/source/Source~AttributionLike

Attributions.

canvasFunction module:ol/source/ImageCanvas~FunctionType

Canvas function. The function returning the canvas element used by the source as an image. The arguments passed to the function are: {module:ol/extent~Extent} the image extent, {number} the image resolution, {number} the device pixel ratio, {module:ol/size~Size} the image size, and {module:ol/proj/Projection~Projection} the image projection. The canvas returned by this function is cached by the source. If the value returned by the function is later changed then changed should be called on the source for the source to invalidate the current cached image. See: module:ol/Observable~Observable#changed

projection module:ol/proj~ProjectionLike

Projection.

ratio number 1.5

Ratio. 1 means canvases are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher.

resolutions Array.<number>

Resolutions. If specified, new canvases will be created for these resolutions

state module:ol/source/State

Source state.

Fires:

Extends

Methods

getProjection(){module:ol/proj/Projection~Projection} inherited

source/Source.js, line 119

Get the projection of the source.

Returns:
Projection.

getState(){module:ol/source/State} inherited

source/Source.js, line 136

Get the state of the source, see module:ol/source/State~State for possible states.

Returns:
State.

refresh() inherited

source/Source.js, line 151

Refreshes the source and finally dispatches a 'change' event.

setAttributions(attributions) inherited

source/Source.js, line 162

Set the attributions of the source.

Name Type Description
attributions module:ol/source/Source~AttributionLike | undefined

Attributions. Can be passed as string, Array<string>, module:ol/source/Source&tilde;Attribution, or undefined.