/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:
PropertiesName | Type | Description |
---|---|---|
layer | layer | JSON layer |
Name | Type | Description |
---|---|---|
layer.style | Object | |
style.URL | string | The location of a mvt stylesheet. |
layer.accessToken | string | An accessToken is required to access tiles and stylesheets from the Mapbox API. |
Returns:
layer decorated with format methods.
- Type:
- layer