From d8d9487784324fc1c1d41cf4435fb58d7c6de6cd Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 2 Feb 2023 14:09:28 +0100 Subject: [PATCH] Remove leaflet import, remove unused import --- Models/BaseLayer.ts | 4 +--- Models/ThemeConfig/PointRenderingConfig.ts | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Models/BaseLayer.ts b/Models/BaseLayer.ts index dd249998b..1e4c2a933 100644 --- a/Models/BaseLayer.ts +++ b/Models/BaseLayer.ts @@ -1,9 +1,7 @@ -import { TileLayer } from "leaflet" - export default interface BaseLayer { id: string name: string - layer: () => TileLayer + layer: () => any /*leaflet.TileLayer - not importing as it breaks scripts*/ max_zoom: number min_zoom: number feature: any diff --git a/Models/ThemeConfig/PointRenderingConfig.ts b/Models/ThemeConfig/PointRenderingConfig.ts index 03242f33c..f70a656d5 100644 --- a/Models/ThemeConfig/PointRenderingConfig.ts +++ b/Models/ThemeConfig/PointRenderingConfig.ts @@ -12,7 +12,6 @@ import { FixedUiElement } from "../../UI/Base/FixedUiElement" import Img from "../../UI/Base/Img" import Combine from "../../UI/Base/Combine" import { VariableUiElement } from "../../UI/Base/VariableUIElement" -import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson" export default class PointRenderingConfig extends WithContextLoader { private static readonly allowed_location_codes = new Set([ @@ -37,6 +36,10 @@ export default class PointRenderingConfig extends WithContextLoader { constructor(json: PointRenderingConfigJson, context: string) { super(json, context) + if (json === undefined || json === null) { + throw "Invalid PointRenderingConfig: undefined or null" + } + if (typeof json.location === "string") { json.location = [json.location] }