- Fix version issue with @mapbox/mapbox-gl-style-spec
- Improvements and bug fixes for multi-line text and wrapping
- Support for running
stylefunction
in web workers
ol-mapbox-style now ships with transpiled modules in the dist/
folder, and sources in the src/
folder. Previously, all modules were provided in the root directory.
When upgrading, the import paths need to be checked. For example,
import stylefunction from 'ol-mapbox-style/stylefunction';
needs to be changed to
import stylefunction from 'ol-mapbox-style/dist/stylefunction';
- Allow mapbox:// urls for all layer types, not just vector
- Update dependencies
- Use ol@6.0.1
- Do not fail when icons come from an expression
- Only set the maxResolution on a new view, instead of the whole resolutions array
- Fix an issue with `icon-color´ handling
- Fix an issue with parsing Google font names
- Add support for the
icon-anchor
property - More efficient handling or tilejson and shared vector tile sources
- More efficient midpoint rendering
- Only include style spec once
- Trim the label-field string
- Round text size to integer pixels
- Requires ol@6
- Uses new OpenLayers z-index ordering for decluttered content
- Support for the
text-rotation-alignment
property - Better
max-angle
handling in combination withtext-letter-spacing
- Load Google fonts with the correct weight and style
- Support for the
text-max-angle
layout property - More efficient color handling without cache
- Improve text wrapping for to avoid short lines
- Apply default resolutions (Mapbox zoom levels) to the view
- Do not create layers for unsupported layer types
- Support for the
text-translate
paint property - Improve performance for circle styles
- Smarter text wrapping. We now try to distribute text more evenly across lines
- Take letter spacing into account for calculating line breaks
- Add support for the
text-line-height
layout property - Respect text halo for text anchor
- Fix how we interpret the
text-halo-width
paint property - Respect
tileSize
for TileJSON when specified in the style doc
v4.1.0 brings a few performance improvements and bug fixes:
- More efficient font caching
- Always stroke polygons to be in line with the style spec
- Stroke polygons without drawing the outline a 2nd time
- Do not cache transparent colors, making hiding features more efficient
- Fix background opacity
- Respect minzoom from TileJSON sources, avoiding underzooming which can lead to loading thousands of tiles
The way how we handle zoom
, minzoom
and maxzoom
throughout the library has been reworked:
- When ol-mapbox-style creates an
ol/View
instance, it will be configured with the zoom level range that mapbox-gl uses. When updating from previous versions, you will notice that the zoom levels of the OpenLayers view will now match those in the Mapbox Style object. Previously OpenLayers zoom levels were higher by 1. - When a Mapbox Style object is configured with a
zoom
, the zoom level will now be interpreted like in mapbox-gl, i.e. you will be zoomed in one level deeper than before the update. minzoom
andmaxzoom
on a Mapbox Style layer were previously determined by the tile size of the underlying source. For raster sources with a tile size of 256, this means thatminzoom
andmaxzoom
are zoomed in one level deeper than before the update. For sources with a tile size of 512, nothing changes.minzoom
andmaxzoom
on a Mapbox Style source now influence theol/tilegrid/TileGrid
that ol-mapbox-style creates for a source in a different way. The resolutions will always match mapbox-gl default zoom levels.minzoom
andmaxzoom
on Mapbox Style layers no longer influences whether theol/layer/Layer
instance is setvisible
at a certain resolution. Instead, the layer'smaxResolution
andminResolution
are set.
- Add support for
text-letter-spacing
- Reduce garbage by reusing padding array
- Fix
getSource()
,getLayer()
andgetLayers()
utility functions - Add support for
text-padding
- Add
getLayers()
utility function
- Use karma for tests
- Fix handling of relative paths
- Use CircleCI for continuous integration
- Do not limit raster layers to a
maxzoom
of 24 - Fix visibility handling
- Fix raster layer
minzoom
andmaxzoom
- Support
minzoom
andmaxzoom
for raster layers
- Use TileJSON relative urls only when a TileJSON
url
was used
- Fix
icon-rotation
- Fix standalone build
- Use TileJSON for all raster and vector sources
- Add support for TileJSON bounds
- Transfer copyright to the contributors
- Fix source/layer extent handling
- Add support for
raster-opacity
- Do not set
zIndex
on layers - Add support for
icon-rotation-alignment
:'map'
- Set layer properties only once and use first index as
zIndex
- Improve docs, error handling and tests
- Stop using empty layer ids for
finalizeLayer()
- Add default export that returns a
Promise
instead of anol/Map
instance - Make layer ids for background unique
- Handle errors for unavailable TileJSON sources
- Factor out functions from
processStyle
's monster loop - Remove tile load transition for raster layers entirely
- Update dev dependencies
- Cleaned up
applyStyle()
and added tests - Add support for
circle-stroke-opacity
- Use block scope variables
- Use transpiled imports for mapbox-gl-style-spec
- Fix local font detection
- Add
mapbox-style
property to theol/Map
instance - Add
getSource()
andgetLayer()
helper functions - Move examples to ES6
- Allow users to specify custom resolutions
- Add support for
fill-pattern
- Add support for filter expressions
- Smarter font stack handling
- Opacity transition only for the bottom layer
- README updates
- Fix imports
- Use webpack and babel instead of browserify
- Add continuous integration, coverage reports and use sonarqube for language quality
- Use jest for testing
- Add attribution to sources created by
apply
- Depend on ol@5
- Move mapbox-to-ol-style package into this library
- Clear caches when
applyStyle
is called again - Provide a standalone build
- Do not use isomorphic-fetch
- Fix typos in API docs
- Respect existing map view when setting
center
andzoom
- Run eslint on the code
- Set
maxResolution
on the layer, respectingminzoom
of the source
- Update mapbox-to-ol-style and openlayers versions
- Fix background
- Do not fail when
setTarget(null)
is called on the map - Set center and zoom when no view was created
- Fix background color
- Revert to older
mapbox-gl-style-spec
version
- Fix numeric interpolation
- Simplify web font handling
- Fix sprite urls
- Properly initialize path parts
- Only set extent when it has not been set before
- Update examples
- Fallback to low-res sprites when
@2x
spritesheet is not available - Use native OpenLayers decluttering
- Make ESRI relative paths work with
apply()
- Make examples mobile and cross-browser ready
- Cleanup and documentation improvements
- Performance improvements
- Decluttering of labels and symbols
- Added support for horizontal
text-anchor
- Fixed a bug with function properties
- Respect
visibility
from all layers'slayout
- Add support for raster and tilejson sources
- Fix a minor point styling issue
- Fix polygon outline leaks when using line styles on polygons
- Add optional
path
argument toapplyStyle()
- Fix build on Windows
- Performance improvmeents from the
mapbox-to-ol-style
package
- Add support for
has
and!has
filters
- Added new `apply() function, which drastically simplifies the API.
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
For 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.