@tschaub tschaub released this Nov 13, 2017 · 2539 commits to master since this release

Assets 4

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.

Additionally a number of updates where made to our dependencies:

Click to expand