From 59fc900c9ad40b9f895e5bc3ef81b109a4431ba0 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sat, 27 Apr 2024 17:12:56 +0100 Subject: [PATCH] Refactor Geocoder --- web/package-lock.json | 13 +++++++----- web/package.json | 1 - web/src/common/Geocoder.svelte | 34 ------------------------------ web/src/common/Map.svelte | 2 ++ web/src/common/index.ts | 1 - web/src/lane-editor/App.svelte | 3 +-- web/src/street-explorer/App.svelte | 2 -- 7 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 web/src/common/Geocoder.svelte diff --git a/web/package-lock.json b/web/package-lock.json index 539a0521..e7ea761b 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -8,7 +8,6 @@ "name": "osm2streets-web", "version": "0.0.0", "dependencies": { - "@maptiler/geocoding-control": "^1.1.1", "@turf/bbox": "^6.5.0", "maplibre-draw-polygon": "github:dabreegster/maplibre-draw-polygon", "maplibre-gl": "^4.1.0", @@ -2069,9 +2068,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.1.0.tgz", - "integrity": "sha512-4RQFJSroo/JAJml6Rj2FFIZOfnjsqPp0O9kSp8aVXQUY0HGXNupltzPKbBZeucqi7ynRQHFeu+onTM3hY0Makw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.1.3.tgz", + "integrity": "sha512-nMy5h0kzq9Z66C6AIb3p2BvLIVHz75dGGQow22x+h9/VOihr0IPQI26ylAi6lHqvEy2VqjiRmKAMlFwt0xFKfQ==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -2844,7 +2843,11 @@ }, "node_modules/svelte-utils": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/a-b-street/svelte-utils.git#ad406fcbfd2f41d58d3459ac16719536a6a54c91", + "resolved": "git+ssh://git@github.com/a-b-street/svelte-utils.git#50c1382c51019e620bb9312f14274540487b90ac", + "dependencies": { + "@maptiler/geocoding-control": "^1.2.2", + "maplibre-gl": "^4.1.3" + }, "peerDependencies": { "svelte": "^4.0.0" } diff --git a/web/package.json b/web/package.json index 1527c6a1..ca274a79 100644 --- a/web/package.json +++ b/web/package.json @@ -30,7 +30,6 @@ "vite-plugin-wasm-pack": "^0.1.12" }, "dependencies": { - "@maptiler/geocoding-control": "^1.1.1", "@turf/bbox": "^6.5.0", "maplibre-draw-polygon": "github:dabreegster/maplibre-draw-polygon", "maplibre-gl": "^4.1.0", diff --git a/web/src/common/Geocoder.svelte b/web/src/common/Geocoder.svelte deleted file mode 100644 index 23d17794..00000000 --- a/web/src/common/Geocoder.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - -{#if mapController} -
- -
-{/if} - - diff --git a/web/src/common/Map.svelte b/web/src/common/Map.svelte index c220e8b3..d32d5884 100644 --- a/web/src/common/Map.svelte +++ b/web/src/common/Map.svelte @@ -3,6 +3,7 @@ import type { Map, StyleSpecification } from "maplibre-gl"; import { map as mapStore, basemap, maptilerApiKey } from "./store"; import { PolygonToolLayer } from "maplibre-draw-polygon"; + import { Geocoder } from "svelte-utils"; let map: Map; let loaded = false; @@ -39,6 +40,7 @@ + {/if} diff --git a/web/src/common/index.ts b/web/src/common/index.ts index 7b40d02d..5184f654 100644 --- a/web/src/common/index.ts +++ b/web/src/common/index.ts @@ -1,5 +1,4 @@ export { default as BasemapPicker } from "./BasemapPicker.svelte"; -export { default as Geocoder } from "./Geocoder.svelte"; export { default as Layout } from "./Layout.svelte"; export { default as Map } from "./Map.svelte"; export { default as StreetView } from "./StreetView.svelte"; diff --git a/web/src/lane-editor/App.svelte b/web/src/lane-editor/App.svelte index 34aa4cc3..de4b7c0b 100644 --- a/web/src/lane-editor/App.svelte +++ b/web/src/lane-editor/App.svelte @@ -6,7 +6,7 @@ import init from "osm2streets-js"; import { onMount } from "svelte"; import AppSwitcher from "../AppSwitcher.svelte"; - import { Geocoder, Layout, Map } from "../common"; + import { Layout, Map } from "../common"; import ImportControls from "../common/import/ImportControls.svelte"; import EditWayControls from "./EditWayControls.svelte"; import RenderBoundary from "../common/layers/RenderBoundary.svelte"; @@ -96,7 +96,6 @@ /> - diff --git a/web/src/street-explorer/App.svelte b/web/src/street-explorer/App.svelte index d8083e07..a99b69c9 100644 --- a/web/src/street-explorer/App.svelte +++ b/web/src/street-explorer/App.svelte @@ -8,7 +8,6 @@ StreetView, ThemePicker, BasemapPicker, - Geocoder, Layout, Map, } from "../common"; @@ -106,7 +105,6 @@ -