diff --git a/src/Logic/ExtraFunctions.ts b/src/Logic/ExtraFunctions.ts index 261c6832c..bcdd2c901 100644 --- a/src/Logic/ExtraFunctions.ts +++ b/src/Logic/ExtraFunctions.ts @@ -258,24 +258,29 @@ class ClosestNObjectFunc implements ExtraFunction { const maxFeatures = options?.maxFeatures ?? 1 const maxDistance = options?.maxDistance ?? 500 const uniqueTag: string | undefined = options?.uniqueTag - let allFeatures: Feature[][] if (typeof features === "string") { features = [features] - } else { - allFeatures = [] - for (const spec of features) { - if (typeof spec === "string") { - const name = spec - const bbox = GeoOperations.bbox( - GeoOperations.buffer(GeoOperations.bbox(feature), maxDistance) - ) - const coors = <[number, number][]>bbox.geometry.coordinates - allFeatures.push(...params.getFeaturesWithin(name, new BBox(coors))) - } else { - allFeatures.push([spec]) - } + } + + let allFeatures: Feature[][] = [] + for (const spec of features) { + if (typeof spec === "string") { + const name = spec + const bbox = GeoOperations.bbox( + GeoOperations.buffer(GeoOperations.bbox(feature), maxDistance) + ) + const coors = <[number, number][]>bbox.geometry.coordinates + allFeatures.push(...params.getFeaturesWithin(name, new BBox(coors))) + } else { + allFeatures.push([spec]) } } + console.log( + "Determining features which are close to", + features, + "other features:", + allFeatures + ) if (features === undefined) { return } diff --git a/src/UI/AllThemesGui.svelte b/src/UI/AllThemesGui.svelte index 5aef762c7..15464fd27 100644 --- a/src/UI/AllThemesGui.svelte +++ b/src/UI/AllThemesGui.svelte @@ -19,6 +19,7 @@ import { LayoutInformation } from "../Models/ThemeConfig/LayoutConfig" import * as themeOverview from "../assets/generated/theme_overview.json" import UnofficialThemeList from "./BigComponents/UnofficialThemeList.svelte" + import Eye from "../assets/svg/Eye.svelte" const featureSwitches = new OsmConnectionFeatureSwitches() const osmConnection = new OsmConnection({