From 0cb03023860de698a25f72717eda0d726dbde1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= <sami.makinen@nls.fi> Date: Fri, 13 Dec 2024 12:26:58 +0200 Subject: [PATCH 1/2] Bump ol --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1f11bc222c..06ede023a6 100644 --- a/package.json +++ b/package.json @@ -77,9 +77,9 @@ "merge": "2.1.1", "mini-css-extract-plugin": "1.6.2", "mobile-detect": "1.4.5", - "ol": "9.2.4", + "ol": "10.3.1", "ol-mapbox-style": "12.3.5", - "olcs": "2.20", + "olcs": "2.22.1", "optimize-css-assets-webpack-plugin": "5.0.8", "query-string": "6.8.3", "react": "16.14.0", From 4dc4b35c67dd40dbb2c7626841d21bff4bf3c7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20M=C3=A4kinen?= <sami.makinen@nls.fi> Date: Fri, 13 Dec 2024 13:47:57 +0200 Subject: [PATCH 2/2] OL breaking change: ol/source/VectorTile: getFeaturesInExtent() method moved to ol/layer/VectorTile --- .../mapmodule/plugin/vectortilelayer/VectorTileLayerPlugin.js | 2 +- bundles/mapping/mapmodule/util/vectorfeatures/mvtHelper.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/mapping/mapmodule/plugin/vectortilelayer/VectorTileLayerPlugin.js b/bundles/mapping/mapmodule/plugin/vectortilelayer/VectorTileLayerPlugin.js index e1ab0cc995..b75aa2298c 100644 --- a/bundles/mapping/mapmodule/plugin/vectortilelayer/VectorTileLayerPlugin.js +++ b/bundles/mapping/mapmodule/plugin/vectortilelayer/VectorTileLayerPlugin.js @@ -218,7 +218,7 @@ class VectorTileLayerPlugin extends AbstractVectorLayerPlugin { }; return; } - const features = getMVTFeaturesInExtent(layerImpls[0].getSource(), extent); + const features = getMVTFeaturesInExtent(layerImpls[0], extent); if (!features) { return; } diff --git a/bundles/mapping/mapmodule/util/vectorfeatures/mvtHelper.js b/bundles/mapping/mapmodule/util/vectorfeatures/mvtHelper.js index 4950edc200..213649d3e5 100644 --- a/bundles/mapping/mapmodule/util/vectorfeatures/mvtHelper.js +++ b/bundles/mapping/mapmodule/util/vectorfeatures/mvtHelper.js @@ -1,6 +1,6 @@ -export const getMVTFeaturesInExtent = (source, extent, idPropName = 'id') => { +export const getMVTFeaturesInExtent = (layer, extent, idPropName = 'id') => { const featuresById = new Map(); - const features = source.getFeaturesInExtent(extent); + const features = layer.getFeaturesInExtent(extent); // map will only hold one feature/id so we get rid of duplicates features.forEach((feature) => { const id = feature.get(idPropName);