ol-mapbox-style
Advanced tools
Changelog
2.3.0
path
argument to applyStyle()
Changelog
12.1.1
icon-size
layout property also for icons not provided by the stylesheetminzoom
and maxzoom
properly when fetching source dataChangelog
2.0.0
With version 2.x, ol-mapbox-style switched to the ol
npm package for the OpenLayers dependency. Users of dist/olms.js
will not notice this change. Applications that have been using the openlayers
npm package should be migrated to the ol
package too.
If switching to ol
is not yet desired, it is still possible to use ol-mapbox-style with the openlayers
package, with the help of standalonify
. You have to require OpenLayers as global.ol = require('openlayers');
. To build the bundle, use a command like the following:
$ node_modules/.bin/browserify -g [ babelify --plugins [ transform-es2015-modules-commonjs ] ] -p [ standalonify --name null --deps [ null --ol/style/style ol.style.Style --ol/style/fill ol.style.Fill --ol/style/stroke ol.style.Stroke --ol/style/circle ol.style.Circle --ol/style/icon ol.style.Icon --ol/style/text ol.style.Text ] ] example/index.js > example/bundle.js
getStyleFunction
moved to separate mapbox-to-ol-style packageFor applications that do not need sprites and web fonts for their styles, a separate mapbox-to-ol-style
package with focus on small build size and minimal dependencies has been created. ol-mapbox-style depends on that package.
If you have previously been using the getStyleFunction
function, you now have to import it from mapbox-to-ol-style
. If you have not used anything else from ol-mapbox-style, you can uninstall it.
ol-mapbox-style now automatically loads web fonts from Google. So in most cases, it is no longer necessary to scan the Mapbox Style for fonts and include them manually in the html of the application.