changelog/v10.4.0.md
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.
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 removalWebGL 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';
This version of OpenLayers is only compatible with [email protected] or higher.
onceReturning false from the listener function will now stop propagation, when the listener is added with once.
Previously this only worked with the on method.
filter option for WebGLPointsLayer has changedThe 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,
})
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.
See below for a complete list of features and fixes.
renderedProjection in web worker's offscreen canvas layer example (by @bilskip in https://github.com/openlayers/openlayers/pull/16522)