diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index a59c59f615..cdd7c077ad 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -8,6 +8,10 @@ Raster layers (static images, image tiles, data tiles) have a new `layer.getData 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. + ### v6.12.0 No special changes are required when upgrading to the 6.12.0 release. diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index ded8fb890f..82e35c79f3 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -710,6 +710,7 @@ class PluggableMap extends BaseObject { * callback execution, or the first truthy callback return value. * @template S,T * @api + * @deprecated */ forEachLayerAtPixel(pixel, callback, opt_options) { if (!this.frameState_) {