From 46e7cf58333eda32946b0605fc9c1631a6af51d9 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 6 Oct 2023 15:14:51 +0200 Subject: [PATCH] Some tweaking --- src/UI/Map/MapLibreAdaptor.ts | 22 +++++++++++----------- src/UI/Map/ShowDataLayer.ts | 5 +---- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index d41bcc25dd..a94a32f6d1 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -1,14 +1,14 @@ -import { Store, UIEventSource } from "../../Logic/UIEventSource" -import type { Map as MLMap } from "maplibre-gl" -import { Map as MlMap, SourceSpecification } from "maplibre-gl" -import { AvailableRasterLayers, RasterLayerPolygon } from "../../Models/RasterLayers" -import { Utils } from "../../Utils" -import { BBox } from "../../Logic/BBox" -import { ExportableMap, MapProperties } from "../../Models/MapProperties" -import SvelteUIElement from "../Base/SvelteUIElement" -import MaplibreMap from "./MaplibreMap.svelte" -import { RasterLayerProperties } from "../../Models/RasterLayerProperties" -import * as htmltoimage from "html-to-image" +import { Store, UIEventSource } from "../../Logic/UIEventSource"; +import type { Map as MLMap } from "maplibre-gl"; +import { Map as MlMap, SourceSpecification } from "maplibre-gl"; +import { AvailableRasterLayers, RasterLayerPolygon } from "../../Models/RasterLayers"; +import { Utils } from "../../Utils"; +import { BBox } from "../../Logic/BBox"; +import { ExportableMap, MapProperties } from "../../Models/MapProperties"; +import SvelteUIElement from "../Base/SvelteUIElement"; +import MaplibreMap from "./MaplibreMap.svelte"; +import { RasterLayerProperties } from "../../Models/RasterLayerProperties"; +import * as htmltoimage from "html-to-image"; /** * The 'MapLibreAdaptor' bridges 'MapLibre' with the various properties of the `MapProperties` diff --git a/src/UI/Map/ShowDataLayer.ts b/src/UI/Map/ShowDataLayer.ts index 34ac01078b..121f007194 100644 --- a/src/UI/Map/ShowDataLayer.ts +++ b/src/UI/Map/ShowDataLayer.ts @@ -230,10 +230,7 @@ class LineRenderingLayer { const self = this features.features.addCallbackAndRunD(() => self.update(features.features)) - map.on("styledata", () => { - self._listenerInstalledOn.clear() - return self.update(features.features); - }) + map.on("styledata", () => self.update(features.features)) } public destruct(): void {