17 KiB
Changelog
Next version
9.1.0
apply()can now also apply to anol/layer/Group.
9.0.0
Breaking changes
- ol-mapbox-style now requires OpenLayers 7
icon-offsethas been fixed. If you previously worked around the x-value moving left instead of right with increasing offset, you have to remove this workaround now.
Other changes
- Added support for
text-justify
8.2.1
- Updated dependencies
- CI changes
8.2.0
- More secure regular expression for property templates; simplified template handling
- Avoid unnecessary TileJSON fetches
- New
SpriteImagetype for thetransformRequestoption
8.1.2
- Add require field to package.json's exports to avoid ESLint complaints
8.1.1
- Add main field to package.json to avoid ESLint complaints (was meant to go into 8.1.0 already)
8.1.0
- Add support for
icon-ignore-placementandicon-allow-overlap - Add main field to package.json to avoid ESLint complaints
8.0.8
- Fix relative source url handling for GeoJSON sources
- Fix website examples
8.0.7
- Use rollup instead of webpack for creating bundles
8.0.6
- Remove
webfont-matcherdependency. Instead, load Google fonts only when they are not available already. - Normalize Arial font name to make sure it can be detected.
- Use
sans-serifas fallback font.
8.0.5
- Do not advertise the
dist/olms.jscjs bundle inpackage.json, because its imports fromolare not cjs compliant. This should resolve problems with old bundlers that pick the cjs bundle instead of the ejs bundle.
8.0.4
- Add
Accept: application/jsonheader to requests for jsons. This avoids e.g. problems with Esri servers returning HTML instead of JSON - Reduce build size by stripping more fields from the style spec json.
8.0.3
- Fix
applyStyle()regression that broke the function when nosourceOrLayerwas provided
8.0.2
- Fix display of optional arguments in API docs
- Fix layer stack regression when layers from one source are spread across multiple OpenLayers layers
8.0.1
- Display API docs correctly on npmjs.com
8.0.0
Breaking changes
- The package now provides two separate bundles for umd and ejs.
dist/olms.jsis the umd bundle,dist/index.jsthe ejs bundle. No other JavaScript files are provided in thedist/folder any more. - Imports from the
dist/folder are no longer supported. They need to be replaced with imports from the package, e.g.import {stylefunction} from "ol-mapbox-style"instead ofimport stylefunction from "ol-mapbox-style/dist/stylefunction". - The
apply()function has been replaced with an alias of the default export. This means thatapply()now returns aPromise<Map>instead of aMap. - The auto-generated types are now stricter, because they reference OpenLayers types correctly, instead of using
any.
Other changes
apply(),applyStyle()andapplyBackground()now take anoptionsargument, which can contain atransformRequestoption. With that function, urls and requests for styles, sprites, tiles and data can be modified. This can be useful e.g. to fix relative urls or to add credentials.- Another available option is
accessToken. In combination with the new support formapbox://urls, it has become much easier to use maps and styles from Mapbox. - Finally, a set of resolutions can be configured in the
options. This makes it much easier to work with layers or maps in projections other than Web Mercator. - The
applyStyle()function has become more powerful and can now create and populate the source of the provided layer. feature-stateis now supported. The new functionssetFeatureState()andgetFeatureState()can be used to set and get the feature state.- The build size is now at least 80 kB smaller because of pre-processing of the style specification from the
@mapbox/mapbox-gl-style-specpackage. The umd bundle no longer contains the OpenLayers code that has been there by accident for a few releases, which had unnecessarily increased the build size by almost 400 kB. - The API docs are now generated with typedoc instead of documentation.js
7.1.1
- Do not use overflow for line labels
7.1.0
- Declutter also vector layers
- Allow text to overflow polygons
7.0.0
Breaking changes
ol-mapbox-style now requires OpenLayers >= 6.13.
All changes
- Add support for rich text labels (with OpenLayers v6.13+)
- Require ol >= 6.13
6.9.0
- Add support for the
icon-offsetlayout property - Fix
circlelayers with default radius
6.8.3
- Fix handling of fonts with two-word weights (e.g. "Semi Bold")
- Fix rendering of fill-outline when fill is fully transparent
6.8.2
- Use OpenLayers's fixed
ol/View#getProperties()method, if available - Avoid applying background if layout is none
6.8.1
- Fix color calculation for zero opacity when
renderTransparent(true)is set.
6.8.0
- New
renderTransparent()configuration option for more flexible hit detection - Add
stylefunctionmodule functions to legacy build - Better default view detection to avoid overwriting of view configurations
6.7.0
applyBackground()now also accepts an OpenLayers >= 6.10VectorTilelayer as first argument.
6.6.0
- Publish declaration source maps
- Fix TileJSON handling of relative urls
- Cache functions and filters per
stylefunctioninvocation
6.5.3
- Fix handling of
icon-color
6.5.2
- Publish auto-generated
.d.tsfiles for TypeScript
6.5.1
- Remove
olpeer dependency frompackage.jsonfor easier of use dev versions ofol
6.5.0
- Export
setupVectorSource()for use in OpenLayers
6.4.2
- Fix import of
@mapbox/mapbox-gl-style-spec
6.4.1
- Fix
webfont-matcherimport
6.4.0
- Change package to
"type": "module" - Updates to work seamlessly with ol > 6.5
6.3.2
- Support relative urls for TileJSON tiles (#320)
6.3.1
- Do not render icons when
icon-colorhas zero opacity (#317)
6.3.0
- New
stylefunction.recordStyleLayer()function to know which rendered layer a feature belongs to (#309)
6.2.1
- Improved support for relative urls in style documents (#307)
6.2.0
- Improved support for relative urls in style documents (#304)
- Allow empty spritesheets (#306)
- Added support for
fill-extrusion, using a 2D fallback (#303)
6.1.4
- Fix OpenLayers version mismatch with legacy builds (was missing in 6.1.3) #291
6.1.3
- Added
Object.assignpolyfill for compatibility with old browsers #281 - Fix line wrapping of text labels #283 #284
- Fix OpenLayers version mismatch with legacy builds #291
6.1.2
- No more polyfills for
Object.assignandString#startsWithneeded #276 - Fixed issue with disappearing labels #273
- MultiLineString labeling improvements #272
- Improved developer experience with proper TypeScript configuration #270
6.1.1
- Fix version issue with @mapbox/mapbox-gl-style-spec
6.1.0
- Improvements and bug fixes for multi-line text and wrapping
- Support for running
stylefunctionin web workers
6.0.0
Breaking changes
Module paths
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';
Other changes
- Allow mapbox:// urls for all layer types, not just vector
5.0.2
- 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
5.0.0-beta.3
- Fix an issue with `icon-color´ handling
- Fix an issue with parsing Google font names
- Add support for the
icon-anchorproperty - More efficient handling or tilejson and shared vector tile sources
5.0.0-beta.2
- More efficient midpoint rendering
- Only include style spec once
- Trim the label-field string
- Round text size to integer pixels
5.0.0-beta.1
- Requires ol@6
- Uses new OpenLayers z-index ordering for decluttered content
- Support for the
text-rotation-alignmentproperty - Better
max-anglehandling in combination withtext-letter-spacing
4.3.0
- Load Google fonts with the correct weight and style
- Support for the
text-max-anglelayout 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-translatepaint property - Improve performance for circle styles
4.2.1
- 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-heightlayout property - Respect text halo for text anchor
- Fix how we interpret the
text-halo-widthpaint property - Respect
tileSizefor TileJSON when specified in the style doc
4.1.0
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
4.0.0
Breaking changes
Zoom handling
The way how we handle zoom, minzoom and maxzoom throughout the library has been reworked:
- When ol-mapbox-style creates an
ol/Viewinstance, 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. minzoomandmaxzoomon 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 thatminzoomandmaxzoomare zoomed in one level deeper than before the update. For sources with a tile size of 512, nothing changes.minzoomandmaxzoomon a Mapbox Style source now influence theol/tilegrid/TileGridthat ol-mapbox-style creates for a source in a different way. The resolutions will always match mapbox-gl default zoom levels.minzoomandmaxzoomon Mapbox Style layers no longer influences whether theol/layer/Layerinstance is setvisibleat a certain resolution. Instead, the layer'smaxResolutionandminResolutionare set.
Other changes
- Add support for
text-letter-spacing
3.9.0
- Reduce garbage by reusing padding array
- Fix
getSource(),getLayer()andgetLayers()utility functions - Add support for
text-padding
3.8.0
- Add
getLayers()utility function
3.7.2
- Use karma for tests
- Fix handling of relative paths
- Use CircleCI for continuous integration
- Do not limit raster layers to a
maxzoomof 24 - Fix visibility handling
3.7.1
- Fix raster layer
minzoomandmaxzoom
3.7.0
- Support
minzoomandmaxzoomfor raster layers
3.6.4
- Use TileJSON relative urls only when a TileJSON
urlwas used
3.6.3
- Fix
icon-rotation
3.6.2
- Fix standalone build
3.6.1
- 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
3.5.0
- Do not set
zIndexon layers - Add support for
icon-rotation-alignment:'map'
3.4.0
- Set layer properties only once and use first index as
zIndex
3.3.0
- Improve docs, error handling and tests
- Stop using empty layer ids for
finalizeLayer() - Add default export that returns a
Promiseinstead of anol/Mapinstance - 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
3.2.0
- Update dev dependencies
- Cleaned up
applyStyle()and added tests - Add support for
circle-stroke-opacity - Use block scope variables
3.1.0
- Use transpiled imports for mapbox-gl-style-spec
3.0.1
- Fix local font detection
3.0.0
- Add
mapbox-styleproperty to theol/Mapinstance - 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
2.11.2
- README updates
- Fix imports
2.11.0
- 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
applyStyleis called again - Provide a standalone build
2.10.4
- Do not use isomorphic-fetch
- Fix typos in API docs
2.10.3
- Respect existing map view when setting
centerandzoom - Run eslint on the code
2.10.2
- Set
maxResolutionon the layer, respectingminzoomof the source
2.10.0
- Update mapbox-to-ol-style and openlayers versions
2.9.1
- Fix background
2.9.0
- Do not fail when
setTarget(null)is called on the map - Set center and zoom when no view was created
2.8.4
- Fix background color
2.8.3
- Revert to older
mapbox-gl-style-specversion
2.8.1
- Fix numeric interpolation
2.8.0
- Simplify web font handling
- Fix sprite urls
2.7.2
- Properly initialize path parts
2.7.1
- Only set extent when it has not been set before
- Update examples
2.7.0
- Fallback to low-res sprites when
@2xspritesheet is not available - Use native OpenLayers decluttering
2.6.6
- Make ESRI relative paths work with
apply()
2.6.5
- Make examples mobile and cross-browser ready
2.6.2
- Cleanup and documentation improvements
2.6.1
- Performance improvements
2.6.0
- Decluttering of labels and symbols
- Added support for horizontal
text-anchor
2.5.1
- Fixed a bug with function properties
2.5.0
- Respect
visibilityfrom all layers'slayout
2.4.0
- Add support for raster and tilejson sources
2.3.0
- Fix a minor point styling issue
- Fix polygon outline leaks when using line styles on polygons
- Add optional
pathargument toapplyStyle()
2.2.5
- Fix build on Windows
2.2.4
- Performance improvmeents from the
mapbox-to-ol-stylepackage
2.2.0
- Add support for
hasand!hasfilters
2.1.0
- Added new `apply() function, which drastically simplifies the API.
2.0.0
Switch to the ol package
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 package
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.
Google fonts no longer need to be included in the html
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.