Skip to content

Commit

Permalink
feat: remove forEachLayerAtPixel method from ol-map
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
The method `forEachLayerAtPixel` has been removed from the `Map`. Please refer to the [OpenLayers 7.0.0 Changelog](
https://github.com/openlayers/openlayers/releases/tag/v7.0.0).
  • Loading branch information
d-koppenhagen committed Apr 14, 2023
1 parent 30cb173 commit 78d94bd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
14 changes: 0 additions & 14 deletions docs/componentsguide/map/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,6 @@ Detect features that intersect a pixel on the viewport, and execute a callback
with each intersecting feature. Layers included in the detection can be configured
through the `layerFilter` option in `options`.

### forEachLayerAtPixel(pixel, callback, layerFilter)

- **Arguments**:
- `pixel {number[]}`
- `callback {function(ol.layer.Layer, ?(number[] | Uint8Array)): *}` Layer callback.
The callback will receive `layer` and array representing `[R, G, B, A]` pixel values.
To stop detection, callback functions can return a truthy value.
- `[layerFilter] {function(ol.layer.Layer): boolean | undefined}` Layer filter function.
- **Returns**: `*` Truthy value returned from the callback.

Detect layers that have a color value at a pixel on the viewport, and execute
a callback with each matching layer. Layers included in the detection can be
configured through `layerFilter`.

### getCoordinateFromPixel(pixel)

- **Arguments**:
Expand Down
3 changes: 0 additions & 3 deletions src/components/map/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export default {
const focus = () => map.focus();
const forEachFeatureAtPixel = (pixel, callback, options = {}) =>
map.forEachFeatureAtPixel(pixel, callback, options);
const forEachLayerAtPixel = (pixel, callback, layerFilter) =>
map.forEachLayerAtPixel(pixel, callback, layerFilter);
const getCoordinateFromPixel = (pixel) => map.getCoordinateFromPixel(pixel);
const refresh = () => map.refresh();
const render = () => map.render();
Expand All @@ -71,7 +69,6 @@ export default {
mapRef,
focus,
forEachFeatureAtPixel,
forEachLayerAtPixel,
getCoordinateFromPixel,
refresh,
render,
Expand Down

0 comments on commit 78d94bd

Please sign in to comment.