From a66e1765459eef610c39e98ad47577bc6c0c87cf Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 21 Jun 2024 13:58:43 +0100 Subject: [PATCH] Visualize center-with-width changes, to better debug. The output itself is very broken. --- web/src/App.svelte | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/web/src/App.svelte b/web/src/App.svelte index e8a74a2..1eac70c 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -11,6 +11,7 @@ GeoJSON, MapLibre, hoverStateFilter, + CircleLayer, } from "svelte-maplibre"; import type { FeatureCollection, @@ -132,6 +133,31 @@ }; } + function addLinestringEndpoints( + input: FeatureCollection, + ): FeatureCollection { + let output = { + type: "FeatureCollection" as const, + features: [], + }; + for (let f of input.features) { + for (let pt of [ + f.geometry.coordinates[0], + f.geometry.coordinates[f.geometry.coordinates.length - 1], + ]) { + output.features.push({ + type: "Feature", + properties: {}, + geometry: { + type: "Point", + coordinates: JSON.parse(JSON.stringify(pt)), + }, + }); + } + } + return output; + } + $: if (currentTestCase != "") { // @ts-expect-error let test = testCases[currentTestCase]; @@ -299,6 +325,17 @@ + + +