10.4.0
With more than 40 pull requests, the 10.4 release brings performance improvements, bug fixes, better TypeScript generics and new features. New features include a convenience Image layer loader for debugging MapServer map files using the MapServer CGI API, and an experimental WebGLVectorTile layer.
Upgrade notes
Deprecation of ol/layer/WebGLPoints
Use ol/layer/WebGLVector instead. Besides rendering points it will also render lines and polygons.
In most cases this is a drop-in replacement. To use filtering the style and filter have to be in a nested object.
// Before
new WebGLPointsLayer({
filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
style: {
'circle-radius': 8,
'circle-fill-color': 'blue',
},
source: vectorSource,
})
// After
new WebGLVectorLayer({
style: {
filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
style: {
'circle-radius': 8,
'circle-fill-color': 'blue',
},
},
source: vectorSource,
})
ol/style/webgl module removal
WebGL renderers used to rely on the WebGLStyle type in the ol/style/webgl module. This is not the case anymore, all renderers now rely on FlatStyle from ol/style/flat.
-import type { WebGLStyle } from 'ol/style/webgl';
+import type { FlatStyle } from 'ol/style/flat';
ol-mapbox-style compatibility
This version of OpenLayers is only compatible with ol-mapbox-style@12.4.0 or higher.
Returning false from a one-time listener added with once
Returning false from the listener function will now stop propagation, when the listener is added with once.
Previously this only worked with the on method.
The filter option for WebGLPointsLayer has changed
The filter option for the WebGLPointsLayer must now be specified alongside other options instead of being part of the style object. Note that the WebGLPointsLayer is not part of the stable API and is subject to breaking changes between major releases.
// Before
new WebGLPointsLayer({
style: {
filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
'circle-radius': 8,
'circle-fill-color': 'blue',
},
source: vectorSource,
})
// Now
new WebGLPointsLayer({
filter: ['between', ['get', 'year'], ['var', 'minYear'], ['var', 'maxYear']],
style: {
'circle-radius': 8,
'circle-fill-color': 'blue',
},
source: vectorSource,
})
Get ready for future changes
We're planning to stop providing barrel files, which will impact how you import modules from OpenLayers. See #16461 for details. To get your code ready for that upcoming change, you can already help us test the replace-barrel-imports codemod from the @openlayers/codemod package.
List of all changes
See below for a complete list of features and fixes.
- New ImageMapServer source (by @geographika in https://github.com/openlayers/openlayers/pull/16591)
- Add color-rgba types (by @MoonE in https://github.com/openlayers/openlayers/pull/16590)
- Re-arm TypeScript libcheck tests, fix TypeScript issues (by @ahocevar in https://github.com/openlayers/openlayers/pull/16579)
- WebGL / Filter geometries before processing them for rendering (reworked) (by @jahow in https://github.com/openlayers/openlayers/pull/16564)
- Fix text background rendering (by @ahocevar in https://github.com/openlayers/openlayers/pull/16557)
- Do not fail when reprojecting geometries with empty coordinate arrays (by @ahocevar in https://github.com/openlayers/openlayers/pull/16556)
- Set WMS TRANSPARENT parameter default value to the correct value according to the specification (by @MelkorCC in https://github.com/openlayers/openlayers/pull/16560)
- Register move and up event on parent map's owner document (by @ahocevar in https://github.com/openlayers/openlayers/pull/16545)
- Add test for XYZ source retina tile reprojection (by @mike-000 in https://github.com/openlayers/openlayers/pull/16540)
- Make forEachFeatureAtCoordinate work when decluttering without features (by @ahocevar in https://github.com/openlayers/openlayers/pull/16539)
- Introduce a WebGLVectorTileLayer class (by @jahow in https://github.com/openlayers/openlayers/pull/16524)
- Deprecate ol/layer/WebGLPoints (by @MoonE in https://github.com/openlayers/openlayers/pull/16529)
- Fix WebGLPoints layer with non-point geometry (by @MoonE in https://github.com/openlayers/openlayers/pull/16437)
- Reset layer style when original GeoTIFF source is ready (by @jcphill in https://github.com/openlayers/openlayers/pull/16490)
- Fix considering insertVertexCondition on segment hover in modify interaction (by @viktorijasolovjova in https://github.com/openlayers/openlayers/pull/16506)
- Ignore empty tiles to avoid endless loop (by @mike-000 in https://github.com/openlayers/openlayers/pull/16519)
- Ignore site build directory (by @ahocevar in https://github.com/openlayers/openlayers/pull/16518)
- Fix VectorTile source removeSourceTiles (by @MoonE in https://github.com/openlayers/openlayers/pull/16427)
- Fix for undefined
renderedProjectionin web worker's offscreen canvas layer example (by @bilskip in https://github.com/openlayers/openlayers/pull/16522) - Only peek tiles we're not sure we're going to use (by @ahocevar in https://github.com/openlayers/openlayers/pull/16509)
- An EMPTY tile stays EMPTY (by @ahocevar in https://github.com/openlayers/openlayers/pull/16513)
- Merge style/webgl and style/flat formats into a single one (by @jahow in https://github.com/openlayers/openlayers/pull/16492)
- Update test docs (by @ahocevar in https://github.com/openlayers/openlayers/pull/16496)
- Clear renderer on layer source changes (by @MelkorCC in https://github.com/openlayers/openlayers/pull/16488)
- Add validation to prevent incorrect calculations when handling undefined values in the updateElement_ method (by @edsonmsj in https://github.com/openlayers/openlayers/pull/16468)
- Include site directory in npm run lint (by @MoonE in https://github.com/openlayers/openlayers/pull/16482)
- Fix return type of ImageObjectPromiseLoader (by @MoonE in https://github.com/openlayers/openlayers/pull/16480)
- Fix function or null/undefined types (by @MoonE in https://github.com/openlayers/openlayers/pull/16481)
- Returning false from once-listener should stop event propagation (by @MoonE in https://github.com/openlayers/openlayers/pull/16469)
- Templatize TileQueue (by @MoonE in https://github.com/openlayers/openlayers/pull/16470)
- Remove IE11 only MSFullscreenChange event handling (by @MoonE in https://github.com/openlayers/openlayers/pull/16471)
- Lazily initialize VectorStyleRenderer Worker (by @M393 in https://github.com/openlayers/openlayers/pull/16460)
- Consistent use of relative imports (by @tschaub in https://github.com/openlayers/openlayers/pull/16464)
- Replace barrel imports in examples (by @tschaub in https://github.com/openlayers/openlayers/pull/16465)
- Update High DPI WMTS capabilities url (by @mike-000 in https://github.com/openlayers/openlayers/pull/16463)
- Remove expandUrl re-export (by @ahocevar in https://github.com/openlayers/openlayers/pull/16459)
- fix: check for ImageBitmap support in ImageWrapper load (by @rwd in https://github.com/openlayers/openlayers/pull/16458)
- Change tile state to EMPTY when releasing tiles (by @ahocevar in https://github.com/openlayers/openlayers/pull/16455)
- Updates to work with ESLint 9 (by @tschaub in https://github.com/openlayers/openlayers/pull/16441)
- Remove duplicate property from CanvasTileLayerRenderer (by @MoonE in https://github.com/openlayers/openlayers/pull/16445)
- Intersection performance improvements (by @MoonE in https://github.com/openlayers/openlayers/pull/16442)
- Skip tiles not in rotated viewport (by @MoonE in https://github.com/openlayers/openlayers/pull/16443)
- Updates for the 10.3.1 release (by @openlayers in https://github.com/openlayers/openlayers/pull/16435)
Dependency Updates
- Bump rollup from 4.31.0 to 4.32.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16587)
- Bump eslint from 9.18.0 to 9.19.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16586)
- Bump dawidd6/action-download-artifact from 7 to 8 (by @openlayers in https://github.com/openlayers/openlayers/pull/16588)
- Bump puppeteer from 24.1.0 to 24.1.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16585)
- Bump color-space from 2.0.1 to 2.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16584)
- Bump @typescript-eslint/parser from 8.20.0 to 8.21.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16583)
- Bump mocha from 11.0.1 to 11.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16582)
- Bump ol-stac from 1.0.0-beta.10 to 1.0.0-rc.5 (by @openlayers in https://github.com/openlayers/openlayers/pull/16581)
- Bump @types/geojson from 7946.0.15 to 7946.0.16 (by @openlayers in https://github.com/openlayers/openlayers/pull/16580)
- Bump pmtiles from 4.1.0 to 4.2.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16569)
- Bump fs-extra from 11.2.0 to 11.3.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16568)
- Bump @typescript-eslint/parser from 8.19.1 to 8.20.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16566)
- Bump rollup from 4.30.1 to 4.31.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16567)
- Bump puppeteer from 24.0.0 to 24.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16565)
- Bump rollup from 4.30.0 to 4.30.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16551)
- Bump @octokit/rest from 21.0.2 to 21.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16553)
- Bump marked from 15.0.5 to 15.0.6 (by @openlayers in https://github.com/openlayers/openlayers/pull/16552)
- Bump eslint from 9.17.0 to 9.18.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16550)
- Bump @typescript-eslint/parser from 8.19.0 to 8.19.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16549)
- Bump puppeteer from 23.11.1 to 24.0.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16548)
- Bump typescript from 5.7.2 to 5.7.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/16547)
- Bump @types/proj4 from 2.5.5 to 2.5.6 (by @openlayers in https://github.com/openlayers/openlayers/pull/16525)
- Bump marked from 15.0.4 to 15.0.5 (by @openlayers in https://github.com/openlayers/openlayers/pull/16526)
- Bump @typescript-eslint/parser from 8.18.2 to 8.19.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16527)
- Bump rollup from 4.29.1 to 4.30.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16528)
- Bump @typescript-eslint/parser from 8.18.1 to 8.18.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/16517)
- Bump @turf/along from 7.1.0 to 7.2.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16516)
- Bump @turf/length from 7.1.0 to 7.2.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16515)
- Bump @typescript-eslint/parser from 8.18.0 to 8.18.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16505)
- Bump webpack-cli from 5.1.4 to 6.0.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16504)
- Bump puppeteer from 23.10.4 to 23.11.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16503)
- Bump rollup from 4.28.1 to 4.29.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16502)
- Bump earcut from 3.0.0 to 3.0.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16501)
- Bump @rollup/plugin-node-resolve from 15.3.0 to 16.0.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16475)
- Bump pmtiles from 4.0.1 to 4.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16472)
- Bump eslint from 9.16.0 to 9.17.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16477)
- Bump @typescript-eslint/parser from 8.17.0 to 8.18.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16479)
- Bump webpack-dev-server from 5.1.0 to 5.2.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/16476)
- Bump @rollup/plugin-commonjs from 28.0.1 to 28.0.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/16478)
- Bump marked from 15.0.3 to 15.0.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/16474)
- Bump puppeteer from 23.10.1 to 23.10.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/16473)
- Bump express from 4.21.1 to 4.21.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/16452)
- Bump webpack from 5.96.1 to 5.97.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16451)
- Bump mocha from 10.8.2 to 11.0.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16450)
- Bump rollup from 4.28.0 to 4.28.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16449)
- Bump puppeteer from 23.9.0 to 23.10.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16448)
- Bump @types/geojson from 7946.0.14 to 7946.0.15 (by @openlayers in https://github.com/openlayers/openlayers/pull/16447)
- Bump dawidd6/action-download-artifact from 6 to 7 (by @openlayers in https://github.com/openlayers/openlayers/pull/16421)
- Bump pmtiles from 3.2.1 to 4.0.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/16418)