/layer/formats/mapboxStyle

The module imports ol-mapbox-style plugin for the native display of mapbox style tile layer in Openlayers.

CSP access to unpkg.com is required in order to import the ol-mapbox-style plugin.

Requires

  • module:ol-mapbox-style@12.6.1

Methods

(inner) mapboxStyle(layer) → {layer}

The mapboxStyle method creates an Openlayers VectorTile layer and assigns a mapbox style through the ol-mapbox-style plugin.

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.

Returns:

layer decorated with format methods.

Type: 
layer