npm ol 6.13.0
v6.13.0

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

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

Don't miss a new ol release

NewReleases is sending notifications on new releases.