Enhance map functionality with bookmark features and UI improvements

- Introduced a new MapBookmarkNameModal for adding and editing bookmarks.
- Updated MapView to manage selected markers for bookmarking and handle bookmark name submissions.
- Enhanced MapContextMenu with an option to add markers to bookmarks.
- Improved MapBookmarks component to support editing bookmark names and adding selected markers.
- Refactored MapControls and MapControlsContent to integrate selected marker functionality for bookmarks.
- Updated useMapBookmarks composable to include bookmark updating logic.
- Removed unused grid coordinates toggle from the UI for a cleaner interface.
This commit is contained in:
2026-03-03 20:05:42 +03:00
parent d27eb2651e
commit 52c34ef8f2
15 changed files with 425 additions and 244 deletions

View File

@@ -53,6 +53,16 @@ export function useMapBookmarks() {
return id
}
function update(id: string, patch: { name: string }) {
const list = loadBookmarks()
const idx = list.findIndex((b) => b.id === id)
if (idx < 0) return false
list[idx] = { ...list[idx], name: patch.name }
saveBookmarks(list)
refresh()
return true
}
function remove(id: string) {
const list = loadBookmarks().filter((b) => b.id !== id)
saveBookmarks(list)
@@ -70,6 +80,7 @@ export function useMapBookmarks() {
bookmarks: readonly(bookmarks),
refresh,
add,
update,
remove,
clear,
}