/layer/formats/maplibre

The maplibre format module imports the maplibre-gl library from esm and assigns the right-to-left [rtl] language module to display arabic labels correctly.

The rtl plugin will be loaded from the xyz host public directory.

Requires

Methods

(inner) maplibre(layer) → {layer}

The maplibre format method will create a new MaplibreGL.Map() class object in a layer.container element. The layer.container is prepended to the Openlayers mapview.Map target element. A custom Openlayers.layer object will position the Maplibre Map object and return the rendered map into the container.

Parameters:
NameTypeDescription
layerlayer

JSON layer

Properties
NameTypeDescription
layer.styleObject
style.URLstring

The location of a mvt stylesheet.

layer.accessTokenstring

An accessToken is required to access tiles and stylesheets from the Mapbox API.

layer.preserveDrawingBufferboolean

The preserveDrawingBuffer flag is required in order to render to canvas for screenshots.

Returns:

layer decorated with format methods.

Type: 
layer