From 5644c7a8b87a0fb17e846a4c370ac432cc03ca15 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 19 May 2023 10:56:30 +0200 Subject: [PATCH] Fix: build; subtle bug --- UI/InputElement/Helpers/LocationInput.svelte | 2 +- UI/Map/MapLibreAdaptor.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/InputElement/Helpers/LocationInput.svelte b/UI/InputElement/Helpers/LocationInput.svelte index 15be7edd8..92abb1da6 100644 --- a/UI/InputElement/Helpers/LocationInput.svelte +++ b/UI/InputElement/Helpers/LocationInput.svelte @@ -7,7 +7,7 @@ import DragInvitation from "../../Base/DragInvitation.svelte"; import {GeoOperations} from "../../../Logic/GeoOperations"; import ShowDataLayer from "../../Map/ShowDataLayer"; - import * as boundsdisplay from "../../../assets/generated/layers/range.json" + import * as boundsdisplay from "../../../assets/layers/range/range.json" import StaticFeatureSource from "../../../Logic/FeatureSource/Sources/StaticFeatureSource"; import * as turf from "@turf/turf" import LayerConfig from "../../../Models/ThemeConfig/LayerConfig"; diff --git a/UI/Map/MapLibreAdaptor.ts b/UI/Map/MapLibreAdaptor.ts index bea888f4e..094931a64 100644 --- a/UI/Map/MapLibreAdaptor.ts +++ b/UI/Map/MapLibreAdaptor.ts @@ -50,6 +50,11 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { this._maplibreMap = maplibreMap this.location = state?.location ?? new UIEventSource({lon: 0, lat: 0}) + if(this.location.data){ + // The MapLibre adaptor updates the element in the location and then pings them + // Often, code setting this up doesn't expect the object they pass in to be changed, so we create a copy + this.location.setData({...this.location.data}) + } this.zoom = state?.zoom ?? new UIEventSource(1) this.minzoom = state?.minzoom ?? new UIEventSource(0) this.maxzoom = state?.maxzoom ?? new UIEventSource(24)