From fe83ad6919a2c65abc69865afe016b04d8442a51 Mon Sep 17 00:00:00 2001 From: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com> Date: Tue, 31 Jan 2023 14:42:56 +0100 Subject: [PATCH 1/2] Remove generic type LineString | Point in favor of the default Geometry --- .../shared/exercise-map/utility/ol-map-manager.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts b/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts index b125d3b95..097fa29c3 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts @@ -424,13 +424,11 @@ export class OlMapManager { } this.layerFeatureManagerDictionary .get( - layer as VectorLayer< - VectorSource - > + layer as VectorLayer )! .onFeatureClicked( event, - feature as Feature + feature as Feature ); // we only want the top one -> a truthy return breaks this loop return true; @@ -474,14 +472,12 @@ export class OlMapManager { // We stop propagating the event as soon as the onFeatureDropped function returns true return this.layerFeatureManagerDictionary .get( - layer as VectorLayer> + layer as VectorLayer )! .onFeatureDrop( event, - event.features.getArray()[0] as Feature< - LineString | Point - >, - feature as Feature + event.features.getArray()[0]!, + feature as Feature ); }); }); From d601312b1bd4b336784a51d1fe5c5d3d66182ed0 Mon Sep 17 00:00:00 2001 From: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com> Date: Tue, 31 Jan 2023 14:52:00 +0100 Subject: [PATCH 2/2] Fix linter --- .../shared/exercise-map/utility/ol-map-manager.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts b/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts index 097fa29c3..624d24df9 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/ol-map-manager.ts @@ -423,13 +423,8 @@ export class OlMapManager { return false; } this.layerFeatureManagerDictionary - .get( - layer as VectorLayer - )! - .onFeatureClicked( - event, - feature as Feature - ); + .get(layer as VectorLayer)! + .onFeatureClicked(event, feature as Feature); // we only want the top one -> a truthy return breaks this loop return true; }, @@ -471,9 +466,7 @@ export class OlMapManager { } // We stop propagating the event as soon as the onFeatureDropped function returns true return this.layerFeatureManagerDictionary - .get( - layer as VectorLayer - )! + .get(layer as VectorLayer)! .onFeatureDrop( event, event.features.getArray()[0]!,