]> git.openstreetmap.org Git - nominatim-ui.git/commit
Replace map store with global map state (#291)
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 22 Aug 2025 23:14:53 +0000 (01:14 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Aug 2025 23:14:53 +0000 (01:14 +0200)
commitdf88eccbe93870f1c214e31ee43638cd0a1fbf53
treeabc81b6305a25c501b13bfc9effa2e86fbb4a517
parent60f7885a035b4140c8c3e655db6963b0b09f40f2
Replace map store with global map state (#291)

* move button for minimized MapPosition into component

This means the button can no longer be a leaflet control.
But we can use svelte reactivity for switching between modes.

* convert MapPosition info fields to properties

Instead of registering events on the map itself, have the parent
map hand in all the info we want to display.

* make map state globally available

Removes the existing map_store and exports a globally available
set of map states instead. Components can now simply listen to
the map state using Svelte reactivity instead of registering their
own event handlers to the map.

* use Svelte runes for main app
src/App.svelte
src/components/Header.svelte
src/components/Map.svelte
src/components/MapPosition.svelte
src/components/SearchSection.svelte
src/components/SearchSectionReverse.svelte
src/lib/stores.js
src/pages/ReversePage.svelte
src/state/MapState.svelte.js [new file with mode: 0644]
test/search.js