Skip to content

Releases: openlayers/ol-mapbox-style

v12.1.0

02 Nov 18:47
e668b65
Compare
Choose a tag to compare

Overview

  • New 'updateMapboxSource()' utility function.
  • Accept Promise as return type for transformRequest()
  • Do not overwrite existing search param with access token

What's Changed

Full Changelog: v12.0.0...v12.1.0

v12.0.0

15 Sep 20:01
230bdb4
Compare
Choose a tag to compare

Backwards incompatible changes

  • The transformRequest hook is now called for every single Tiles request with the final url, instead of just once with the url template.
  • Generated OpenLayers Tile and VectorTile sources previously used the template urls obtained by source.getUrl() or source.getUrls(). Now they use a tileLoadFunction configured by ol-mapbox-style instead.
  • Generated OpenLayers Vector sources are now always configured with a 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.

Other changes

  • The 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.

What's Changed

Full Changelog: v11.0.3...v12.0.0

v11.0.3

27 Aug 20:56
793264b
Compare
Choose a tag to compare

What's Changed

  • More generous version ranges, and update versions in readme by @ahocevar in #977

Full Changelog: v11.0.2...v11.0.3

v11.0.2

27 Aug 19:43
c06b72d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v11.0.1...v11.0.2

v11.0.1

21 Aug 18:20
3bc4460
Compare
Choose a tag to compare

Summary

  • Use ol >= 7.x || v8.0.0-dev to allow deduping

What's Changed

Full Changelog: v11.0.0...v11.0.1

v11.0.0

14 Aug 16:32
3d49cea
Compare
Choose a tag to compare

Summary

Backwards incompatible changes

  • The ol-mapbox-style package now contains untranspiled modern JavaScript code. When targeting older browsers, make sure to configure your build tools to transpile the code accordingly.

Other changes

  • New MapboxVectorLayer export, which replaces ol/layer/MapboxVector from OpenLayers.

What's Changed

Full Changelog: v10.7.0...v11.0.0

v10.7.0

07 Aug 20:55
cc71c1a
Compare
Choose a tag to compare

Summary

  • Small fixes for add/update/removeMapboxLayer
  • Support for SDF sprites
  • Improved documentation for applyStyle

What's Changed

Full Changelog: v10.6.0...v10.7.0

v10.6.0

01 Jun 11:25
1657da0
Compare
Choose a tag to compare

Summary

  • 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.

What's Changed

Full Changelog: v10.5.0...v10.6.0

v10.5.0

14 Apr 16:03
9bdd4a6
Compare
Choose a tag to compare

Summary

  • Add terrarium hillshade example
  • Add getStyleForLayer() function for more efficient legend creation without recordStyleLayer(true)

What's Changed

Full Changelog: v10.4.0...v10.5.0

v10.4.0

05 Apr 09:34
410323e
Compare
Choose a tag to compare

Changes that require attention

Font handling and loading

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

  • {font-family}: CSS font family converted to lowercase, blanks replaced with -, e.g. noto-sans
  • {Font+Family}: CSS font family in original case, blanks replaced with +, e.g. Noto+Sans
  • {fontweight}: CSS font weight (numeric), e.g. 400, 700
  • {fontstyle}: CSS font style, e.g. normal, italic
  • {-fontstyle}: CSS font style other than normal, e.g. -italic or empty string for normal

In 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}

Summary of other changes

  • Fix a potential tile cache issue
  • Fix problem caused by getUid function missing in the full build
  • Make updateMapboxStyle() work with objects that are not a reference to the original one
  • Add support for the tms tile scheme for raster and vector layers
  • Add support for the terrarium encoding for raster-dem sources
  • Fix an issue where the icon-offset layout property modifies the underlying Mapbox Style object
  • Set the correct input projection for geojson sources when the projection option is used

What's Changed

New Contributors

Full Changelog: v10.3.4...v10.4.0