v6.13.0
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()
andsetUserProjection()
functions in theol/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.
- Update ol-mapbox-style for rich text labels support (by @ahocevar in #13418)
- Increase GeoTIFF resolutions tolerance (by @ahocevar in #13417)
- Check for graticule resolution change and fix unrotated size (by @mike-000 in #13415)
- Rich text labels (by @ahocevar in #13410)
- Clear image when source's image is not ready (by @yonda-yonda in #13398)
- Fix setting View resolution or center to undefined (by @MoonE in #13393)
- Fix clone of icon loses imgSize when cache is full (by @MoonE in #13390)
- Use same clipping method for vector and image tiles (by @ahocevar in #13392)
- Less clipping of target resolution tiles (by @ahocevar in #13391)
- Change remaining links to point to class page instead of module (by @MoonE in #13385)
- User projection API (by @ahocevar in #13383)
- Fix wrong types when using
"skipLibCheck": false
(by @seravifer in #13382) - Fix JsDoc references (by @MoonE in #13374)
- Fix VectorSource isEmpty without spatial index (by @MoonE in #13373)
- Document difference between Vector and VectorImage layers (by @ahocevar in #13371)
- Fix
ol/source/Cluster#setSource
type annotation (by @MoonE in #12998) - Preload tiles for WebGL tile layers (by @tschaub in #13357)
- Avoid event creation when there are no listeners (by @MoonE in #13358)
- Add floor, round and ceil to style expressions (by @mike-000 in #13363)
- Support WebGL layers in ol/source/Raster (by @mike-000 in #13361)
- Improve some null types to prepare for strictNullChecks (by @EvertEt in #13301)
- Reset globalAlpha back to its initial after mutating it for drawing layers (by @Amirh0sseinHZ in #13351)
- Removing an unnecessary word from DEVELOPING.md (by @Amirh0sseinHZ in #13352)
- Get pixel data (by @tschaub in #13338)
- Remove warning for
@type
annotation by jsdoc (by @MoonE in #13350) - Improve some null types for strictNullChecks (by @EvertEt in #13334)
- Dispose of webgl contexts (by @MoonE in #13336)
- Fix error when accessing ready property of renderer (by @MoonE in #13337)
- Pass tilePixelRatio and gutter to TileTexture (by @mike-000 in #13269)
- Improve some nullable map types (by @EvertEt in #13328)
- Avoid rendering outside WebGL layer and source extent (by @tschaub in #13333)
- Avoid duplicate imports (by @tschaub in #13332)
- Add updateStyleVariables method to WebGLPoints layer (by @ahocevar in #13294)
- Fix rendercomplete for WebGLPoints layer and subclasses (by @ahocevar in #13323)
- fix: fix casing for z-index (by @OSHistory in #13319)
- Fix typo CSS class name for the expanded attributions button (by @fredj in #13315)
- Improve types for tile layers (by @ahocevar in #13299)
- Document geometry type (by @ahocevar in #13298)
- Add function to convert RenderFeature to Feature (by @MoonE in #13297)
- Update to geotiff@2 (by @ahocevar in #13292)
- Re-assign style variables on setStyle() (by @ahocevar in #13293)
- add @api comment on getAllLayers method (by @XiaofengZeng in #13261)
- Allowing to pass additional options to the geotiff.js source (by @constantinius in #13290)
- Defaults for generic types (by @ahocevar in #13291)
- Load api navigation dynamically to reduce needed disk space (by @MoonE in #13229)
- Remove unneeded
src=""
(by @mike-000 in #13271) - Support multiple sources for WebGL tile layers (by @ahocevar in #13212)
- Add crossOrigin option to LiteralSymbolStyle (by @mike-000 in #13259)
- Avoid the redirect from unpkg.com (by @tschaub in #13242)
- Updates for the 6.12.0 release (by @openlayers in #13241)
Dependency Updates
- Bump express from 4.17.2 to 4.17.3 (by @openlayers in #13402)
- Bump puppeteer from 13.3.1 to 13.3.2 (by @openlayers in #13401)
- Bump mocha from 9.2.0 to 9.2.1 (by @openlayers in #13403)
- Bump webpack from 5.68.0 to 5.69.1 (by @openlayers in #13404)
- Bump ol-mapbox-style from 6.8.3 to 6.9.0 (by @openlayers in #13406)
- Bump rollup from 2.67.1 to 2.67.3 (by @openlayers in #13405)
- Bump @babel/core from 7.17.2 to 7.17.5 (by @openlayers in #13407)
- Bump @babel/core from 7.17.0 to 7.17.2 (by @openlayers in #13381)
- Bump karma from 6.3.15 to 6.3.16 (by @openlayers in #13379)
- Bump eslint from 8.8.0 to 8.9.0 (by @openlayers in #13377)
- Bump puppeteer from 13.1.3 to 13.3.1 (by @openlayers in #13376)
- Bump follow-redirects from 1.14.7 to 1.14.8 (by @openlayers in #13372)
- Bump geotiff from 2.0.3 to 2.0.4 (by @openlayers in #13339)
- Bump globby from 13.1.0 to 13.1.1 (by @openlayers in #13340)
- Bump rollup from 2.66.1 to 2.67.1 (by @openlayers in #13342)
- Bump @babel/core from 7.16.12 to 7.17.0 (by @openlayers in #13343)
- Bump karma from 6.3.12 to 6.3.15 (by @openlayers in #13344)
- Bump webpack from 5.67.0 to 5.68.0 (by @openlayers in #13345)
- Bump webpack-dev-server from 4.7.3 to 4.7.4 (by @openlayers in #13346)
- Bump sinon from 13.0.0 to 13.0.1 (by @openlayers in #13348)
- Bump rollup from 2.66.0 to 2.66.1 (by @openlayers in #13318)
- Bump karma from 6.3.11 to 6.3.12 (by @openlayers in #13314)
- Bump geotiff from 2.0.2 to 2.0.3 (by @openlayers in #13313)
- Bump puppeteer from 13.1.1 to 13.1.3 (by @openlayers in #13317)
- Bump sinon from 12.0.1 to 13.0.0 (by @openlayers in #13316)
- Bump jsdoc from 3.6.9 to 3.6.10 (by @openlayers in #13312)
- Bump copy-webpack-plugin from 10.2.1 to 10.2.4 (by @openlayers in #13311)
- Bump clean-css-cli from 5.5.0 to 5.5.2 (by @openlayers in #13310)
- Bump eslint from 8.7.0 to 8.8.0 (by @openlayers in #13309)
- Bump webpack-cli from 4.9.1 to 4.9.2 (by @openlayers in #13305)
- Bump globby from 13.0.0 to 13.1.0 (by @openlayers in #13308)
- Bump marked from 4.0.10 to 4.0.12 (by @openlayers in #13307)
- Use exactly typescript@4.6.0-beta (by @openlayers in #13306)
- Bump globby from 12.2.0 to 13.0.0 (by @openlayers in #13281)
- Bump @babel/core from 7.16.7 to 7.16.12 (by @openlayers in #13278)
- Bump webpack from 5.66.0 to 5.67.0 (by @openlayers in #13277)
- Bump puppeteer from 13.0.1 to 13.1.1 (by @openlayers in #13280)
- Bump rollup from 2.64.0 to 2.66.0 (by @openlayers in #13279)
- Bump @babel/preset-env from 7.16.8 to 7.16.11 (by @openlayers in #13276)
- Bump copy-webpack-plugin from 10.2.0 to 10.2.1 (by @openlayers in #13275)
- Bump jsdoc from 3.6.7 to 3.6.9 (by @openlayers in #13274)
- Bump ol-mapbox-style from 6.8.2 to 6.8.3 (by @openlayers in #13273)
- Bump mocha from 9.1.4 to 9.2.0 (by @openlayers in #13272)
- Bump eslint from 8.6.0 to 8.7.0 (by @openlayers in #13246)
- Bump mocha from 9.1.3 to 9.1.4 (by @openlayers in #13247)
- Bump webpack-sources from 3.2.2 to 3.2.3 (by @openlayers in #13248)
- Bump webpack from 5.65.0 to 5.66.0 (by @openlayers in #13249)
- Bump globby from 12.0.2 to 12.2.0 (by @openlayers in #13250)
- Bump @babel/preset-env from 7.16.7 to 7.16.8 (by @openlayers in #13251)
- Bump rollup from 2.63.0 to 2.64.0 (by @openlayers in #13252)
- Bump karma from 6.3.10 to 6.3.11 (by @openlayers in #13253)
- Bump marked from 4.0.9 to 4.0.10 (by @openlayers in #13243)
New Contributors
- @constantinius made their first contribution in #13290
- @XiaofengZeng made their first contribution in #13261
- @Amirh0sseinHZ made their first contribution in #13352
- @seravifer made their first contribution in #13382
- @yonda-yonda made their first contribution in #13398
Full Changelog: v6.12.0...v6.13.0