Releases: openlayers/openlayers
v4.6.3
v4.6.2
v4.6.1
v4.6.0
v4.6.0
Summary
The 4.6 release includes enhancements and fixes from 30 or so pull requests. Headlining this release, vector layers got new textBackgroundFill
, textBackgroundStroke
and padding
options that can be used to render background boxes for text. ol.source.ImageVector
is now deprecated and replaced by a more convenient way to render vectors as images: by simply setting renderMode: 'image'
on the vector layer.
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.
See the wiki about upcoming changes in 5.0 and tips on how to upgrade. We likely won't have another 4.x release before the 5.0 release. 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
Renamed exceedLength
option of ol.style.Text
to overflow
To update your applications, simply replace exceedLength
with overflow
.
Deprecation of ol.source.ImageVector
Rendering vector sources as image is now directly supported by ol.layer.Vector
with the new renderMode: 'image'
configuration option. Change code like this:
new ol.layer.Image({
source: new ol.source.ImageVector({
style: myStyle,
source: new ol.source.Vector({
url: 'my/data.json',
format: new ol.format.GeoJSON()
})
})
});
to:
new ol.layer.Vector({
renderMode: 'image',
style: myStyle,
source: new ol.source.Vector({
url: 'my/data.json',
format: new ol.format.GeoJSON()
})
});
Detailed changes
See below for the full list of changes.
- #7538 - removeFromLoadedExtents to remove extents that failed to load (@ahocevar)
- #7537 - Fix Draw.removeLastPoint exception when no points to remove (@walkermatt)
- #7461 - Use the matrixSet projection by default (@oterral)
- #5883 - Fixes setUrl() for WMTS sources (ol.source.WMTS) (@bylexus)
- #7531 - Update the ol package readme (@ahocevar)
- #7372 - Add method to set max cache size in ol.style.IconImageCache (@notnotse)
- #7530 - Check forward/back 1 world if wrapping (@raiyni)
- #7526 - Allow clicks to be stopped while drawing (@tschaub)
- #7524 - Snap view center to pixel (@ahocevar)
- #7521 - fix setMinZoom/setMaxZoom (@cs09g)
- #7519 - Reuse declutter tree for hit detection (@ahocevar)
- #7499 - Remove attributions from olx.FrameState instances (@openlayers)
- #7501 - Option to render vector layers as images (@ahocevar)
- #7516 - Deprecate exceedLength and replace with overflow (@ahocevar)
- #7510 - Do not fade the states layer (@ahocevar)
- #7513 - Make strokeKey safer (@ahocevar)
- #7514 - Prune the label cache less aggressively (@ahocevar)
- #7505 - Remove ol.DeviceOrientation link from API index (@fredj)
- #7497 - Use getGeometry (@nicholas-l)
- #7495 - Remove layer renderers when viewport is removed (@ahocevar)
- #7492 - Remove unneeded type cast from examples (@fredj)
- #7489 - Allow string to be passed as ol.interaction.Draw type (@fredj)
- #7445 - Load css rules from full-screen.css in examples (@fredj)
- #7481 - Make zoom to extent control extensible (@gberaudo)
- #7477 - Make text states available for replay time (@ahocevar)
- #7482 - Reset rotation after rendering (@ahocevar)
- #7480 - Create a new image when loading tile after an error (@ahocevar)
- #7476 - Reset text measurements when available fonts change (@ahocevar)
- #7454 - Add text background rendering and text padding (@ahocevar)
- #7468 - Add new API-key for HERE example (@chrismayer)
- #7465 - Export ol.proj.Projection#getAxisOrientation function (@fredj)
- #7462 - Respect metersPerUnit in ScaleLine control (@ahocevar)
Additionally a number of updates where made to our dependencies:
- #7536 - Update fs-extra to the latest version 🚀 (@openlayers)
- #7533 - Update marked to the latest version 🚀 (@openlayers)
- #7527 - Update eslint to the latest version 🚀 (@openlayers)
- #7511 - Update rollup to the latest version 🚀 (@openlayers)
- #7512 - Update eslint to the latest version 🚀 (@openlayers)
- #7484 - Update closure-util to the latest version 🚀 (@openlayers)
v4.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](https://github.com/openlayers/openlayers/p...
v4.4.2
The v4.4.2 release fixes a number of rendering issues in the 4.4 releases.
Fixes
- #7327 - Prune the tile cache after updating a source's URL (@tschaub)
- #7341 - Proper rendering of raster sources when there is a tile transition (@tschaub)
- #7339 - Use correct text stroke on HiDPI devices (@ahocevar)
- #7345 - Handle different lineWidth scaling in Safari (@ahocevar)
- #7346 - Pre-render text images for configured scale (@ahocevar)
- #7350 - Calculate correct text box size (@ahocevar)
v4.4.1
v4.4.0
4.4.0
Summary
The 4.4.0 release includes features and fixes from 80 pull requests, including first time contributions from @EduardoNogueira, @ath0mas, @f7o, @trevorblades, @viethang, and @wb14123. There are some really nice rendering enhancements included in this release. It is now possible to render labels along lines (see #7239 for more detail) and polygon labels are only rendered if they fit within the polygon (#7292). In addition, we now render tiles with an opacity transition, so tiled layers more gracefully fade in (#7267).
Upgrade notes
Behavior change for polygon labels
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your ol.style.Text
with exceedLength: true
.
Minor change for custom tileLoadFunction
with ol.source.VectorTile
It is no longer necessary to set the projection on the tile. Instead, the readFeatures
method must be called with the tile's extent as extent
option and the view's projection as featureProjection
.
Before:
tile.setLoader(function() {
var data = // ... fetch data
var format = tile.getFormat();
tile.setFeatures(format.readFeatures(data));
tile.setProjection(format.readProjection(data));
// uncomment the line below for ol.format.MVT only
//tile.setExtent(format.getLastExtent());
});
After:
tile.setLoader(function() {
var data = // ... fetch data
var format = tile.getFormat();
tile.setFeatures(format.readFeatures(data, {
featureProjection: map.getView().getProjection(),
// uncomment the line below for ol.format.MVT only
//extent: tile.getExtent()
}));
);
Deprecation of ol.DeviceOrientation
ol.DeviceOrientation
is deprecated and will be removed in the next major version.
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
Detailed changes
See below for the full list of changes.
- #7306 - Enable mouse wheel in freehand draw mode (@trevorblades)
- #7297 - Fix multipoint instruction set (@ahocevar)
- #7267 - Render tiles with an opacity transition (@tschaub)
- #7292 - Only render polygon labels when they fit (@ahocevar)
- #7289 - Release v4.3.4 (@openlayers)
- #7287 - Fix vertical stroke/fill alignment for text along lines (@ahocevar)
- #7285 - Convert pointerId to string for object lookups (@tschaub)
- #7280 - Updated docs for deleteCondition (@EduardoNogueira)
- #7274 - Add ability to change the loader of a vector source (@bartvde)
- #7259 - Add missing param doc tag for ol.format.WKT.prototype.writeFeatures (@fredj)
- #7260 - Release v4.3.3 (@openlayers)
- #7258 - Revert changes made in #7098. (@ahocevar)
- #7220 - Mark ol.format.filter.Spatial as abstract class (@fredj)
- #7249 - Script to rename files so the case matches the module name (@ahocevar)
- #7252 - fix osmxml to read ways before the definition of nodes (@wb14123)
- #7253 - Nicer wording in the issue template (@openlayers)
- #7236 - reusing images in ol.style.Icon#clone (@KlausBenndorf)
- #7246 - Compare measured lengths with a tolerance (@marcjansen)
- #7247 - Raise tolerance of rendering tests to pass on Firefox 55 (GNU/Linux) (@marcjansen)
- #7239 - Render text along lines (@ahocevar)
- #7242 - Use EMPTY and LOADED state properly on ol.VectorImageTile (@ahocevar)
- #7234 - Fix abort handling of tileload events (@ahocevar)
- #7221 - update zoomify source to accept tileIndex placeholders and handle iip… (@thhomas)
- #6871 - Correct controls position in Center example (@ath0mas)
- #7229 - Fix JSDoc paths for custom builds (@ahocevar)
- #7230 - Remove unused context handling for ol.Image (@ahocevar)
- #7225 - Fix hit detection for image layers (@ahocevar)
- #7223 - Transform updates (@tschaub)
- #7219 - Change cartodb domain from cartodb.com to carto.com (@fredj)
- #7210 - Avoid unnecessary calculations for a zoom factor of 2 (@tschaub)
- #7209 - Remove grid.getTileRangeForExtentAndResolution() (@tschaub)
- #7201 - Prerender text to images (@ahocevar)
- #7208 - Do not calculate coverage when running tests locally (@ahocevar)
- #7206 - Only load source tiles that intersect the source tile grid's extent (@ahocevar)
- #7203 - Enable Edge tests on SauceLabs (@ahocevar)
- #7194 - Deprecate ol.DeviceOrientation (@fredj)
- #7198 - Use geometry name in WFS updates (@bartvde)
- #7205 - Release v4.3.2 (@openlayers)
- #7172 - added clear method to vectortile source (@f7o)
- #7196 - renderSync() to make sure overlay is initially visible (@ahocevar)
- #7193 - Fix KML links for documents created locally in Safari (@ahocevar)
- #6977 - Fixed modify feature test (@KlausBenndorf)
- #7190 - Use jsts version 1.4.0 in example (@openlayers)
- #7191 - Fix provide/require for autogenerated shader files (@ahocevar)
- #7192 - Fix typo (@viethang)
- #7133 - Issue/6991/WFS Write Dimension (@Sol1du2)
- #7141 - Issue/6990/Wfs Read srsDimension (@Sol1du2)
- #7187 - Simpler tile pixel handling and faster parsing for ol.format.MVT vector tiles (@ahocevar)
- #7182 - Avoid instanceof checks in global test extensions (@tschaub)
- #7168 - Exclude greenkeeper merges from changelog (@gberaudo)
- #7162 - Bring back coverage (@marcjansen)
- #7165 - More assorted test fix...