Sources

A source provides the data that is displayed on a map. Sources are defined by the GL Style Specification.

Vector Tile

A vector tile source. Tiles must be in Vector Tile format. All layers that use a vector source must specify a "source-layer" value. (See the Style Specification for detailed documentation of options.)

Extends Evented.

Example

Methods

Raster Tile

A raster tile source. Tiles must be in ZXY or TMS tile format. (See the Style Specification for detailed documentation of options.)

Extends Evented.

Example

Methods

GeoJSON

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

Extends Evented.

Example

Methods

Raster DEM Tile

A raster DEM source. Only supports Terrain RGB format. (See the Style Specification for detailed documentation of options.)

Extends Evented.

Example

Methods

Image

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

Extends Evented.

Example

Methods

Video

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

Extends ImageSource.

Example

Methods

Canvas

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

Extends ImageSource.

Example

Properties

options.type Source type. Must be "canvas".
options.canvas Canvas source from which to read pixels. Can be a string representing the ID of the canvas element, or the HTMLCanvasElement itself.
options.coordinates Four geographical coordinates denoting where to place the corners of the canvas, specified in [longitude, latitude] pairs.
options.animate 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.

Methods

Reference documentation of MapTiler SDK JS, an extension of MapLibre GL JS