From 1f9cab71340bde21ce48c4e3cc93bbebbbc3fed1 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 21 Feb 2024 17:18:09 +0100 Subject: [PATCH] Remove obsolete method --- src/UI/Map/MapLibreAdaptor.ts | 5 +---- src/UI/Map/RasterLayerHandler.ts | 13 ------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index 8731d5acbd..0b9886443a 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -90,7 +90,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { this.lastClickLocation = lastClickLocation const self = this - const rasterLayerHandler = new RasterLayerHandler(this._maplibreMap, this.rasterLayer) + new RasterLayerHandler(this._maplibreMap, this.rasterLayer) function handleClick(e) { if (e.originalEvent["consumed"]) { @@ -114,7 +114,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { self.setMaxzoom(self.maxzoom.data) self.setBounds(self.bounds.data) self.setTerrain(self.useTerrain.data) - rasterLayerHandler.setBackground() this.updateStores(true) }) self.MoveMapToCurrentLoc(self.location.data) @@ -128,7 +127,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { self.setBounds(self.bounds.data) self.SetRotation(self.rotation.data) self.setTerrain(self.useTerrain.data) - rasterLayerHandler.setBackground() this.updateStores(true) map.on("moveend", () => this.updateStores()) map.on("click", (e) => { @@ -177,7 +175,6 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { }) }) - this.rasterLayer.addCallbackAndRun((_) => rasterLayerHandler.setBackground()) this.location.addCallbackAndRunD((loc) => { self.MoveMapToCurrentLoc(loc) }) diff --git a/src/UI/Map/RasterLayerHandler.ts b/src/UI/Map/RasterLayerHandler.ts index 28ec453bcf..1effc62596 100644 --- a/src/UI/Map/RasterLayerHandler.ts +++ b/src/UI/Map/RasterLayerHandler.ts @@ -144,23 +144,15 @@ class SingleBackgroundHandler { } export default class RasterLayerHandler { - private _map: Store - private _background: UIEventSource private _singleLayerHandlers: Record = {} constructor(map: Store, background: UIEventSource) { - this._map = map - this._background = background background.addCallbackAndRunD((l) => { const key = l.properties.id if (!this._singleLayerHandlers[key]) { this._singleLayerHandlers[key] = new SingleBackgroundHandler(map, l, background) } }) - map.addCallback((map) => { - map.on("load", () => this.setBackground()) - this.setBackground() - }) } public static prepareWmsSource(layer: RasterLayerProperties): SourceSpecification { @@ -203,9 +195,4 @@ export default class RasterLayerHandler { return url } - - /** - * Performs all necessary updates - */ - public setBackground() {} }