From 4926b22b657e277ca4db0c8301bb0c7a44885895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 26 Aug 2024 11:18:12 +0200 Subject: [PATCH] Fix new OpenLayers types --- src/lidar/Manager.ts | 7 ++++--- src/lidar/Plot.ts | 2 +- src/map/FeatureOverlayMgr.ts | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lidar/Manager.ts b/src/lidar/Manager.ts index 7861c9b864a3..d86bee8a642d 100644 --- a/src/lidar/Manager.ts +++ b/src/lidar/Manager.ts @@ -47,6 +47,7 @@ import olStyleStyle from 'ol/style/Style'; import {select as d3select} from 'd3'; import OlMap from 'ol/Map'; +import OlFeature from 'ol/Feature'; import OlOverlay from 'ol/Overlay'; import OlLayerVector from 'ol/layer/Vector'; import OlSourceVector from 'ol/source/Vector'; @@ -88,13 +89,13 @@ export class LidarprofileManager { /** * The hovered point geometry (point) in D3 profile highlighted on the 2D map. */ - lidarPointHighlight: OlLayerVector>; + lidarPointHighlight: OlLayerVector>>; /** * The profile footpring represented as a LineString represented * with real mapunites stroke width. */ - lidarBuffer: OlLayerVector>; + lidarBuffer: OlLayerVector>>; /** * The variable where all points of the profile are stored. @@ -632,7 +633,7 @@ export class LidarprofileManager { domainX[1], ); - const source: olSourceVector = this.lidarBuffer.getSource(); + const source: olSourceVector> = this.lidarBuffer.getSource(); source.clear(); source.addFeature(clip.bufferGeom); this.lidarBuffer.setStyle(clip.bufferStyle); diff --git a/src/lidar/Plot.ts b/src/lidar/Plot.ts index eca67d79d0ed..6058ef65d956 100644 --- a/src/lidar/Plot.ts +++ b/src/lidar/Plot.ts @@ -515,7 +515,7 @@ export default class { ); } - source.addFeature(lidarPointFeature); + source.addFeature(lidarPointFeature); // eslint-disable-line @typescript-eslint/no-unsafe-call } else { source.clear(); svg.select('#highlightCircle').remove(); diff --git a/src/map/FeatureOverlayMgr.ts b/src/map/FeatureOverlayMgr.ts index 76f4d8bdfa8f..e66fb4bc333e 100644 --- a/src/map/FeatureOverlayMgr.ts +++ b/src/map/FeatureOverlayMgr.ts @@ -66,9 +66,9 @@ export class FeatureOverlayMgr { groups_: MapFeatureOverlayGroup[]; - source_: OlSourceVector; + source_: OlSourceVector>; - layer_: OlLayerVector>; + layer_: OlLayerVector>>; constructor() { this.featureUidToGroupIndex_ = {}; @@ -137,7 +137,7 @@ export class FeatureOverlayMgr { /** * @returns {olLayerVector>} The vector layer used internally. */ - getLayer(): olLayerVector> { + getLayer(): olLayerVector>> { return this.layer_; }