Skip to content

Releases: openlayers/openlayers

v7.1.0

Compare
Choose a tag to compare

The 7.1 release adds a handful of new features and updates the story for users of the full library build.

Draw with tracing

The draw interaction has a new trace option. When this is set, you can click on existing features to trace their outlines while creating new polygons or lines.

New GeoTIFF options

The GeoTIFF source now supports imagery with internal masks. In addition, the GeoTIFF source accepts a convertToRGB: 'auto' setting. With this new setting, the values will be converted to RGB in cases where the input data has three bands and the photometric interpretation is one of CMYK, YCbCr, CIELab, or ICCLab.

Notice to full build users

If you have been using the full build of the library, we now include this full build in the release package. This should mean stable URLs that you can point to in a <script> tag. See the https://openlayers.org/download/ page for more detail.

Deprecation of ol/AssertionError and error codes

Future versions will no longer throw ol/AssertionError with an error code. Instead, they will throw Error with just the error message.

Updating parameters in ol/source/ImageWMS and ol/source/TileWMS

The updateParams() method is the only way to update WMS parameters. Changes made directly to the params object passed as a constructor option will have no effect.

List of all changes

See below for a complete list of features and fixes.

Dependency Updates

New Contributors

Full Changelog: v7.0.0...v7.1.0

v7.0.0

Compare
Choose a tag to compare

The 7.0 release includes an impressive batch of features and fixes from over 90 pull requests. We're excited about a new foundation for WebGL vector rendering. The previous point rendering functionality has been extended to include lines and polygons. The rendering API is still low level and experimental. Future releases will include a higher level styling API.

In developing the new WebGL rendering functionality, we changed the signature for a number of methods on a helper class that had been marked as part of the API in 6.x releases. While this is technically a breaking change, it is unlikely that applications were using this helper class, so upgrades should be straightforward.

We took advantage of the breaking change in the WebGL helper class to remove a few other deprecated parts of the API. In addition, since Microsoft ended support for Internet Explorer a few months ago, we decided to do the same.

Backwards incompatible changes

Removal of deprecated properties and methods

  • The tilePixelRatio has been removed from the DataTile source.
  • The imageSmoothing option has been removed from sources.
  • The undefinedHTML option has been removed from the MousePosition control.
  • The forEachLayerAtPixel method has been removed from the Map class.
  • Deprecated options have been removed from the Overlay component.
  • The labelCache has been removed from the ol/render/canvas.js module.

Internet Explorer is no longer supported

Please see https://docs.microsoft.com/en-us/lifecycle/announcements/internet-explorer-11-end-of-support.

ol/webgl/Helper.js

The Helper constructor from the ol/webgl/Helper.js module is no longer part of the public API.

ol/coordinate.js

The toStringHDMS function from the ol/coordinate.js module now formats longitude, latitude pairs so that the minutes and seconds are omitted if they are zero. This changes the values displayed on graticules.

ol/layer/Graticule

The default intervals now align with integer minutes and seconds better suited to the default label formatter. If formatting in decimal degrees you may wish to specify custom intervals suited to that format.

ol/Collection

Inserting with setAt or insertAt beyond the current length used to create a sparse Collection with undefined inserted for any missing indexes. This will now throw an error instead.

ol/control/MousePosition

The control will now by default keep displaying the last mouse position when the mouse leaves the viewport. With placeholder: '&#160;' you can keep the old behaviour. The placeholder option no longer accepts false as a valid value, instead simply omit the option. The undefinedHTML option has been removed. You should use placeholder instead.

ol/PluggableMap

The PluggableMap class has been removed. If you want to create a custom map class, extend the Map class instead.

ol/style/Icon and ol/style/RegularShape

ol/style/Image and subclasses displacement is no longer scaled with the image. If you previously expected this unintended behavior you should now increase the displacement when setting the scale.

List of all changes

See below for a complete list of features and fixes.

Dependency Updates

v6.15.1

9613cb9
Compare
Choose a tag to compare

The 6.15.1 release is a patch to ensure that a layer gets rendered when its source has completed loading. See the changelog for 6.15.0 for new features and fixes since 6.14.

List of all changes:

  • Recover from incorrect rebase after removal of string enums (in #13835 by @ahocevar)

Full Changelog: v6.15.0...v6.15.1

v6.15.0

3b99134
Compare
Choose a tag to compare

Overview

The 6.15 release brings several fixes and improvements:

  • Faster vector tile rendering for soures with non-standard tile grids
  • Reduced canvas memory footprint for increased stability on iOS devices and better rendering performance
  • Fixed a bug that prevented tiles from expiring from the tile cache in the correct order
  • Better type safety with an increasing number of null checks and union types
  • New setFill and setStroke methods for RegularShape symbols
  • Vector symbol and text decluttering on the style level
  • Fixed pointer event handling on touch devices when layer visibility changes
  • New justify option for text styles
  • New Link interation for adding center, zoom, rotation and active layers to the URL
  • Easier css styling of the scale bar, and in addition to minWidth, the scale line can now also be configured with a maxWidth

Details

Deprecated tilePixelRatio option for data tile sources.

If you were previously trying to scale data tiles using the tilePixelRatio property for data tile sources (this is rare), you should now use the explicit tileSize and tileGrid properties. The source's tileSize represents the source tile dimensions and the tile grid's tileSize represents the desired rendered dimensions.

const source = new DataTileSource({
  tileSize: [512, 512], // source tile size
  tileGrid: createXYZ({tileSize: [256, 256]}), // rendered tile size
});

Fixed coordinate dimension handling in ol/proj's addCoordinateTransforms

The forward and inverse functions passed to addCooordinateTransforms now receive a coordinate with all dimensions of the original coordinate, not just two. If you previosly had coordinates with more than two dimensions and added a transform like

addCoordinateTransforms(
    'EPSG:4326',
    new Projection({code: 'latlong', units: 'degrees'}),
    function(coordinate) { return coordinate.reverse(); },
    function(coordinate) { return coordinate.reverse(); }
);

you have to change that to

addCoordinateTransforms(
    'EPSG:4326',
    new Projection({code: 'latlong', units: 'degrees'}),
    function(coordinate) { return coordinate.slice(0, 2).reverse() },
    function(coordinate) { return coordinate.slice(0, 2).reverse() }
);

Replacement of string enums with union types

This change only affects users that were using the non-API string enums

  • ol/OverlayPositioning
  • ol/extent/Corner
  • ol/format/FormatType
  • ol/geom/GeometryType
  • ol/source/State
  • ol/source/WMSServerType
  • ol/source/WMTSRequestEncoding

Instead of these, use the respective strings, which are now typesafe by means of union types.

List of all changes

See below for a complete list of features and fixes.

Dependency Updates

New Contributors

Full Changelog: v6.14.1...v6.15.0

6.14.1

Compare
Choose a tag to compare

The 6.14.1 release is a patch to correct a version discrepancy in the package-lock.json file. See the changelog for 6.14.0 for new features and fixes since 6.13.

6.14.0

Compare
Choose a tag to compare

The 6.14 release includes a few new features and fixes. The new loadstart and loadend events make it easy to add loading indicators to your maps. Enhancements to the snap interaction add support for snapping to points coincident with lines and improve performance. A change to WebGL rendering works around an issue in Safari 15.4. Find detail on these improvements and more in the full list of changes below.

List of all changes

See below for a complete list of features and fixes.

Dependency Updates

New Contributors

Full Changelog: v6.13.0...v6.14.0

v6.13.0

7bf014f
Compare
Choose a tag to compare

Overview

The 6.13 release brings several exciting new features and improvements:

  • A new layer.getData() method to get pixel data for a single layer (see details below).
  • Support for rich text labels in ol/style/Text, to use different font styles and fonts in a single label.
  • The useGeograpic() and setUserProjection() functions in the ol/proj module are now part of the official API. These functions make it easier to work with geographic coordinates or local projections.
  • Improvements for WebGL Tile and Points layers.
  • Performance improvements on ol/Feature, to avoid event creation when there are no listeners.
  • Update of geotiff.js to v2, to fix some build issues that users reported.
  • Improvements to the auto-generated TypeScript types.

Details

New layer.getData() method

Raster layers (static images, image tiles, data tiles) have a new layer.getData(pixel) method that returns the pixel data at the provided location. The return value depends on the underlying source data type. For example, a GeoTIFF may return a Float32Array with one value per band, while a PNG rendered from a tile layer will return a Uint8ClampedArray of RGBA values.

If you were previously using the map.forEachLayerAtPixel() method, you should use the new layer.getData() method instead. The old method returns composite pixel values from multiple layers and is limited to RGBA values. The new method doesn't suffer from these shortcomings and is more performant.

Deprecated map.forEachLayerAtPixel() method

The map.forEachLayerAtPixel() method has been deprecated. It will be removed (or its behavior may change) in the next major release. Please use the layer.getData() method instead.

List of all changes

See below for a complete list of features and fixes.

Dependency Updates

New Contributors

Full Changelog: v6.12.0...v6.13.0

6.12.0

b04d542
Compare
Choose a tag to compare

The 6.12 release brings a few small fixes and enhancements. See below for a complete list.

List of all changes

Dependency Updates

New Contributors

Full Changelog: v6.11.0...v6.12.0

6.11.0

bd8a454
Compare
Choose a tag to compare

This release follows up on the 6.10 release with a fix for Mapbox vector layers rendered over other layers. A handful of other fixes and features are included. See below for more detail.

List of all changes

Dependency Updates

New Contributors

Full Changelog: v6.10.0...v6.11.0

6.10.0

02c1f49
Compare
Choose a tag to compare

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