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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user