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 411

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) experimental

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

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.

drawFeature(feature, style) experimental

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

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 an ol.layer.Vector instead of calling this method directly.

Name Type Description
feature ol.Feature

Feature.

style ol.style.Style

Style.

drawLineStringGeometry(lineStringGeometry) experimental

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

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

Name Type Description
lineStringGeometry ol.geom.LineString | ol.render.Feature

Line string geometry.

drawMultiLineStringGeometry(multiLineStringGeometry) experimental

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

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

Name Type Description
multiLineStringGeometry ol.geom.MultiLineString | ol.render.Feature

MultiLineString geometry.

drawMultiPointGeometry(multiPointGeometry) experimental

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

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

Name Type Description
multiPointGeometry ol.geom.MultiPoint | ol.render.Feature

MultiPoint geometry.

drawMultiPolygonGeometry(multiPolygonGeometry) experimental

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

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

Name Type Description
multiPolygonGeometry ol.geom.MultiPolygon

MultiPolygon geometry.

drawPointGeometry(pointGeometry) experimental

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

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

Name Type Description
pointGeometry ol.geom.Point | ol.render.Feature

Point geometry.

drawPolygonGeometry(polygonGeometry) experimental

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

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

Name Type Description
polygonGeometry ol.geom.Polygon | ol.render.Feature

Polygon geometry.

setFillStrokeStyle(fillStyle, strokeStyle) experimental

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

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 877

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 913

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

Name Type Description
textStyle ol.style.Text

Text style.