Class: Immediate

ol.render.canvas.Immediate

A concrete subclass of ol.render.VectorContext that implements direct rendering of features and geometries to an HTML5 Canvas context. Instances of this class are created internally by the library and provided to application code as vectorContext member of the ol.render.Event object associated with postcompose, precompose and render events emitted by layers and maps.

Extends

Methods

drawAsync(zIndex, callback) experimental

src/ol/render/canvas/canvasimmediate.js, line 417

Register a function to be called for rendering at a given zIndex. The function will be called asynchronously. The callback will receive a reference to ol.render.canvas.Immediate context for drawing.

Name Type Description
zIndex number

Z index.

callback function

Callback.

drawCircleGeometry(circleGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 436

Render a circle geometry into the canvas. Rendering is immediate and uses the current fill and stroke styles.

Name Type Description
circleGeometry ol.geom.Circle

Circle geometry.

feature ol.Feature

Feature,

drawFeature(feature, style) experimental

src/ol/render/canvas/canvasimmediate.js, line 481

Render a feature into the canvas. In order to respect the zIndex of the style this method draws asynchronously and thus after calls to drawXxxxGeometry have been finished, effectively drawing the feature on top of everything else. You probably should be using ol.FeatureOverlay instead of calling this method directly.

Name Type Description
feature ol.Feature

Feature.

style ol.style.Style

Style.

drawLineStringGeometry(lineStringGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 577

Render a LineString into the canvas. Rendering is immediate and uses the current style.

Name Type Description
lineStringGeometry ol.geom.LineString

Line string geometry.

feature ol.Feature

Feature.

drawMultiLineStringGeometry(multiLineStringGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 607

Render a MultiLineString geometry into the canvas. Rendering is immediate and uses the current style.

Name Type Description
multiLineStringGeometry ol.geom.MultiLineString

MultiLineString geometry.

feature ol.Feature

Feature.

drawMultiPointGeometry(multiPointGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 556

Render a MultiPoint geometry into the canvas. Rendering is immediate and uses the current style.

Name Type Description
multiPointGeometry ol.geom.MultiPoint

MultiPoint geometry.

feature ol.Feature

Feature.

drawMultiPolygonGeometry(multiPolygonGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 680

Render MultiPolygon geometry into the canvas. Rendering is immediate and uses the current style.

Name Type Description
multiPolygonGeometry ol.geom.MultiPolygon

MultiPolygon geometry.

feature ol.Feature

Feature.

drawPointGeometry(pointGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 535

Render a Point geometry into the canvas. Rendering is immediate and uses the current style.

Name Type Description
pointGeometry ol.geom.Point

Point geometry.

feature ol.Feature

Feature.

drawPolygonGeometry(polygonGeometry, feature) experimental

src/ol/render/canvas/canvasimmediate.js, line 643

Render a Polygon geometry into the canvas. Rendering is immediate and uses the current style.

Name Type Description
polygonGeometry ol.geom.Polygon

Polygon geometry.

feature ol.Feature

Feature.

setFillStrokeStyle(fillStyle, strokeStyle) experimental

src/ol/render/canvas/canvasimmediate.js, line 854

Set the fill and stroke style for subsequent draw operations. To clear either fill or stroke styles, pass null for the appropriate parameter.

Name Type Description
fillStyle ol.style.Fill

Fill style.

strokeStyle ol.style.Stroke

Stroke style.

setImageStyle(imageStyle) experimental

src/ol/render/canvas/canvasimmediate.js, line 899

Set the image style for subsequent draw operations. Pass null to remove the image style.

Name Type Description
imageStyle ol.style.Image

Image style.

setTextStyle(textStyle) experimental

src/ol/render/canvas/canvasimmediate.js, line 939

Set the text style for subsequent draw operations. Pass null to remove the text style.

Name Type Description
textStyle ol.style.Text

Text style.