ol-mapbox-style
Advanced tools
Changelog
12.1.0
Promise
as return type for transformRequest()
Changelog
12.0.0
transformRequest
hook is now called for every single Tiles
request with the final url, instead of just once with the url template.source.getUrl()
or source.getUrls()
. Now they use a tileLoadFunction
configured by ol-mapbox-style instead.loader
by ol-mapbox-style. The getUrl()
method will return the url without the transformRequest
transform. When the url is templated ({bbox-...}
), getUrl()
will return undefined
.transformRequest
hook now also accepts a url string as return value. When a Request
is returned, it will be fully respected - not just the request's url
.Changelog
11.0.0
MapboxVectorLayer
export, which replaces ol/layer/MapboxVector
from OpenLayers.Changelog
10.7.0
applyStyle
Changelog
10.6.0
addMapboxLayer()
can now also add a layer as first layer in the layer stack.addMapboxLayer()
is no longer restricted go layers with the same source.Changelog
10.5.0
recordStyleLayer(true)
Changelog
10.4.0
ol-mapbox-style no longer defaults to loading Google fonts when a required font is not available. Instead, it respects the new metadata.ol:webfonts
field in the Mapbox Style document. Example:
{
"version": 8,
"metadata": {
"ol:webfonts": "https://mytileservergl.com/fonts/{font-family}/{fontweight}{-fontstyle}.css"
}
// ...
}
The supported template placeholders are
-
, e.g. noto-sans
+
, e.g. Noto+Sans
400
, 700
normal
, italic
-italic
or empty string for normalIn addition to providing fonts along with the style, this can be used to retrieve fonts from a CDN (e.g. @fontsource
) or Google fonts. If this metadata field is not set to the style, the following default template will be used:
https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css
To retain the current behavior (i.e. use Google Fonts), the template URL will have to be
https://fonts.googleapis.com/css?family={Font+Family}:{fontweight}{fontstyle}
getUid
function missing in the full buildupdateMapboxStyle()
work with objects that are not a reference to the original onetms
tile scheme for raster
and vector
layersterrarium
encoding for raster-dem
sourcesicon-offset
layout property modifies the underlying Mapbox Style objectgeojson
sources when the projection
option is used