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 forraster
andvector
layers - Add support for the
terrarium
encoding forraster-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 theprojection
option is used
What's Changed
- Changes for v10.3.4 by @ahocevar in #850
- Ensure sources have a unique key by @ahocevar in #852
- Fix full build by fixing getUid import by @ahocevar in #863
- Make updateMapboxStyle work with new object literals by @ahocevar in #864
- Add support for the tms tile scheme by @ahocevar in #865
- Bump webpack from 5.76.1 to 5.76.2 by @dependabot in #853
- Bump puppeteer from 19.7.4 to 19.7.5 by @dependabot in #854
- Bump mini-css-extract-plugin from 2.7.3 to 2.7.5 by @dependabot in #855
- Bump typedoc from 0.23.26 to 0.23.28 by @dependabot in #856
- Bump webpack-dev-server from 4.11.1 to 4.13.1 by @dependabot in #857
- ✨Add 'terrarium' encoding option to raster-dem hillshading by @V-Roger in #866
- Fix icon offset flip by @RobertOrthofer in #875
- Set projection from projection option as GeoJSON dataProjection by @ahocevar in #880
- Flexible font handling without Google Fonts default by @ahocevar in #851
- Bump style-loader from 3.3.1 to 3.3.2 by @dependabot in #872
- Bump sinon from 15.0.2 to 15.0.3 by @dependabot in #873
- Bump puppeteer from 19.7.5 to 19.8.3 by @dependabot in #877
- Bump typescript from 4.9.5 to 5.0.3 by @dependabot in #878
- Bump webpack from 5.76.2 to 5.77.0 by @dependabot in #879
New Contributors
- @RobertOrthofer made their first contribution in #875
Full Changelog: v10.3.4...v10.4.0