14 KiB
4.5.0
Summary
The 4.5 release includes enhancements and fixes from 50 or so pull requests. Headlining this release, vector layers got a new declutter option that can be used to avoid overlapping labels. See the street labels example for a demonstration of this feature.
Please note that if you are using closure-util to build your OpenLayers based application, it is time to migrate to using the ol package and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the 3.19 release; and with the 5.0 release we will be moving completely away from goog.require and goog.provide, dropping support for closure-util, and going with ES modules for our sources.
We will be adding details to the wiki about upcoming changes in 5.0 and tips on how to upgrade. We'll likely have a few more 4.x releases before the 5.0 release. But if you're interested in continuing to get feature enhancements in future releases, migrating to the ol package now will make the transition easier.
Upgrade notes
Removed GeoJSON crs workaround for GeoServer
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in ol.format.GeoJSON used to read this crs code is now removed.
Deprecation of ol.Attribution
ol.Attribution is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
Before:
var source = new ol.source.XYZ({
attributions: [
new ol.Attribution({html: 'some attribution'})
]
});
After:
var source = new ol.source.XYZ({
attributions: 'some attribution'
});
In addition to passing a string or an array of strings for the attributions option, you can also pass a function that will get called with the current frame state.
var source = new ol.source.XYZ({
attributions: function(frameState) {
// inspect the frame state and return attributions
return 'some attribution'; // or ['multiple', 'attributions'] or null
}
});
Detailed changes
See below for the full list of changes.
- #7456 - Retry if sauce connect fails (@tschaub)
- #7440 - Attempt to make font loading tests more stable (@ahocevar)
- #7444 - Simpler style management (@ahocevar)
- #7438 - Call getProjection() only once (@ahocevar)
- #7430 - Add support for hex colors with alpha (@tschaub)
- #7431 - Avoid returning undefined zoom (@tschaub)
- #7436 - Always use source projection loading image tiles (@pjeweb)
- #7433 - Don't use getHints if it's not needed (@fredj)
- #7362 - Added option to the ol.format.GeoJSON to allow the reading of the geometry_name from the geojson (@Alexandre27)
- #7426 - Update InteractionOptions.prototype.handleEvent docs (@glen-nu)
- #7423 - Get rendered features by coordinate when wrapping (@tschaub)
- #7421 - Keep longitude between -180 and 180 (@tschaub)
- #7420 - Fix MapGuide example resolves #7325 (@TDesjardins)
- #7340 - Clear label cache when fonts become available (@ahocevar)
- #7414 - Only split text at line angle changes (@ahocevar)
- #7411 - Add getLayers and setLayers functions to ol.format.WMSGetFeatureInfo (@fredj)
- #7328 - Declutter text and images (@ahocevar)
- #7406 - Add option to Zoomify source for setting custom extent (@lasselaakkonen)
- #7410 - Add getFeatureType and setFeatureType functions to ol.format.WFS (@fredj)
- #7379 - Add support for custom tile size to Zoomify source (@lasselaakkonen)
- #7376 - changed visibility of overlay properties to protected (@virtualcitySYSTEMS)
- #7377 - Add support to specify CSS class name when creating ol.Overlay (@notnotse)
- #7383 - Handle null tile coordinates correctly (@ahocevar)
- #7375 - Read 'Abstract', 'AccessConstraints' and 'Fees' in ol.format.OWS (@fredj)
- #7378 - Fix incorrect docs about ol.source.Raster (@notnotse)
- #7371 - Add @api annotation to ol.VectorTile.getExtent (@notnotse)
- #7369 - Always request the Bing API with the 'culture' value (@fredj)
- #7364 - Remove GeoJSON workaround for GeoServer (@fredj)
- #7355 - Pass pixel tolerance as a parameter to constructor of ol.interaction.Extent (@marcosox)
- #7356 - Fix documentation for target option in the controls (@EduardoNogueira)
- #7359 - Rename entry to input - regarding options to rollup lib - Issue #7358 (@akkumar)
- #7357 - Release v4.4.2 (@tschaub)
- #7350 - Calculate correct text box size (@ahocevar)
- #7349 - Do not use tileUrlFunction for renderer tile coordinates (@ahocevar)
- #7305 - Fix #7304: Re-calculate the resolution when the WMS source is reprojected (@oterral)
- #7346 - Pre-render text images for configured scale (@ahocevar)
- #7345 - Handle different lineWidth scaling in Safari (@ahocevar)
- #7344 - Make text height detection independent of css settings (@ahocevar)
- #7341 - Proper rendering of raster sources when there is a tile transition (@tschaub)
- #7339 - Use correct text stroke on HiDPI devices (@ahocevar)
- #7327 - Prune the tile cache after updating a source's URL (@tschaub)
- #7333 - Pluggable Map/Layers - function calls to handles and create (@waxenegger)
- #7329 - Reworked attribution handling (@tschaub)
- #7337 - Always create a new blank image to avoid CSP violations (@ahocevar)
- #7330 - Add upgrade notes to 4.4.0 changelog (@tschaub)
- #7321 - Release v4.4.1 (@tschaub)
- #7323 - Only clear the canvas when needed (@tschaub)
- #7313 - Use lowercase module identifiers until ol@5 (@tschaub)
- #7316 - fix copy-paste error in 4.4.0 changelog (@mprins)
- #7315 - Add new ol.format.filter.Contains spatial operator (@fredj)
- #7311 - Release v4.4.0 (@tschaub)
Additionally a number of updates where made to our dependencies:
Click to expand
- #7455 - Update eslint to the latest version 🚀 (@openlayers)
- #7447 - chore(package): update rollup-plugin-commonjs to version 8.2.6 (@openlayers)
- #7448 - chore(package): update debounce to version 1.1.0 (@openlayers)
- #7451 - chore(package): update karma to version 1.7.1 (@openlayers)
- #7446 - fix(package): update rollup to version 0.51.3 (@openlayers)
- #7428 - Update sinon to the latest version 🚀 (@openlayers)
- #7425 - Update async to the latest version 🚀 (@openlayers)
- #7418 - Update sinon to the latest version 🚀 (@openlayers)
- #7416 - Update sinon to the latest version 🚀 (@openlayers)
- #7417 - Update phantomjs-prebuilt to the latest version 🚀 (@openlayers)
- #7399 - Update eslint to the latest version 🚀 (@openlayers)
- #7395 - Update closure-util to the latest version 🚀 (@openlayers)
- #7392 - Update sinon to the latest version 🚀 (@openlayers)
- #7380 - Update rollup-plugin-cleanup to the latest version 🚀 (@openlayers)
- #7366 - Update handlebars to the latest version 🚀 (@openlayers)
- #7360 - Update eslint to the latest version 🚀 (@openlayers)
- #7354 - Update closure-util to the latest version 🚀 (@openlayers)
- #7319 - Update closure-util to the latest version 🚀 (@openlayers)
- #7314 - Update mocha to the latest version 🚀 (@openlayers)