npm ol 6.10.0

latest releases: 7.3.1-dev.1678058258888, 7.3.1-dev.1677975735802, 7.3.0...
2 years ago

Just in time for the new year, the 6.10 release brings another great batch of features and fixes for your OpenLayers applications.

WebGL rendering

You can now update the style for your WebGL tile layers with layer.setStyle(). Keep in mind that it is more efficient to use style variables if you want to adjust styling on every render frame. However, in cases where you want to completely reconfigure the style, you can use the new layer.setStyle() method.

Additional WebGL tile layer rendering enhancements:

  • A new palette operator was added that allows styling raster data based on a colormap.
  • The band operator accepts expressions for the band number (in addition to numeric literals) – allowing for bands to be set by user provided style variables, for example.
  • Tile layers now dispatch prerender, postrender, precompose and postcompose events with access to the WebGL rendering context.
  • Layers that are adjacent to one another now share a single canvas element and rendering context – allowing for more layers in your maps before exhausting the browser's context limit.

Vector tiles

The Mapbox vector layer now works more easily with other vector tile providers. In addition, vector tile layers can now be configured with a background color.

New interpolate option for sources

Sources now have an interpolate option. This option controls whether data from the source is interpolated when resampling.

For ol/source/DataTile sources, the default is interpolate: false. This means that when a data tile source is used with a WebGL tile layer renderer, your style expression will have access to pixel values in the data tiles without interpolation. If this option is set to true, linear interpolation will be used when over- or under-sampling the data.

Deprecation of the imageSmoothing option for sources

The imageSmoothing option for sources has been deprecated and will be removed in the next major release. Use the interpolate option instead.

// if you were using `imageSmoothing`
const before = new TileSource({
  imageSmoothing: false
});

// use the `interpolate` option instead
const after = new TileSource({
  interpolate: false
});

List of all changes

See below for more features and fixes.

Dependency Updates

Don't miss a new ol release

NewReleases is sending notifications on new releases.