Skip to content

Canvas

Allows vector layers to be displayed with <canvas>. Inherits Renderer.

Usage example

Use Canvas by default for all paths in the map:

js
const map = new Map('map', {
renderer: new Canvas()
});

Use a Canvas renderer with extra padding for specific vector geometries:

js
const map = new Map('map');
const myRenderer = new Canvas({ padding: 0.5 });
const line = new Polyline( coordinates, { renderer: myRenderer } );
const circle =  new Circle( center, { renderer: myRenderer, radius: 100 } );

Options

OptionTypeDefaultDescription
toleranceNumber0How much to extend the click tolerance around a path/object on the map.