Sources

The source types MapLibre GL JS can handle in addition to the ones described in the MapLibre Style Specification.

GeoJSONSource

A source containing GeoJSON. (See the Style Specification for detailed documentation of options.)

Extends Evented.

Example

Instance Members

VideoSource

A data source containing video. (See the Style Specification for detailed documentation of options.)

Extends ImageSource.

Example

Instance Members

ImageSource

A data source containing an image. (See the Style Specification for detailed documentation of options.)

Extends Evented.

Example

Instance Members

CanvasSource

A data source containing the contents of an HTML canvas. See CanvasSourceOptions for detailed documentation of options.

Extends ImageSource.

Example

Instance Members

CanvasSourceOptions

Options to add a canvas source type to the map.

Properties

type(string): Source type. Must be "canvas" .
canvas((string | HTMLCanvasElement)): Canvas source from which to read pixels. Can be a string representing the ID of the canvas element, or the HTMLCanvasElement itself.
coordinates(Array<Array<number>>): Four geographical coordinates denoting where to place the corners of the canvas, specified in [longitude, latitude] pairs.
animate(boolean?): Whether the canvas source is animated. If the canvas is static (i.e. pixels do not need to be re-read on every frame), animate should be set to false to improve performance.
JavaScript Maps API

Examples

On This Page