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:
@@ -55,15 +55,6 @@
|
||||
<icons-icon-eye class="size-3.5 opacity-80" aria-hidden="true" />
|
||||
Display
|
||||
</h3>
|
||||
<label class="label cursor-pointer justify-start gap-2 py-0 hover:bg-base-200/50 rounded-lg px-2 -mx-2 touch-manipulation" :class="touchFriendly ? 'min-h-11' : ''">
|
||||
<input
|
||||
v-model="showGridCoordinates"
|
||||
type="checkbox"
|
||||
class="checkbox checkbox-sm"
|
||||
data-testid="show-grid-coordinates"
|
||||
/>
|
||||
<span>Show grid coordinates</span>
|
||||
</label>
|
||||
<label class="label cursor-pointer justify-start gap-2 py-0 hover:bg-base-200/50 rounded-lg px-2 -mx-2 touch-manipulation" :class="touchFriendly ? 'min-h-11' : ''">
|
||||
<input v-model="hideMarkers" type="checkbox" class="checkbox checkbox-sm" />
|
||||
<span>Hide markers</span>
|
||||
@@ -125,6 +116,7 @@
|
||||
:maps="maps"
|
||||
:current-map-id="currentMapId ?? null"
|
||||
:current-coords="currentCoords ?? null"
|
||||
:selected-marker-for-bookmark="selectedMarkerForBookmark ?? null"
|
||||
:touch-friendly="touchFriendly"
|
||||
/>
|
||||
</div>
|
||||
@@ -132,6 +124,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { MapInfo } from '~/types/api'
|
||||
import type { SelectedMarkerForBookmark } from '~/components/map/MapBookmarks.vue'
|
||||
import MapBookmarks from '~/components/map/MapBookmarks.vue'
|
||||
|
||||
interface QuestGiver {
|
||||
@@ -156,8 +149,9 @@ const props = withDefaults(
|
||||
selectedPlayerIdSelect: string
|
||||
currentMapId?: number
|
||||
currentCoords?: { x: number; y: number; z: number } | null
|
||||
selectedMarkerForBookmark?: SelectedMarkerForBookmark
|
||||
}>(),
|
||||
{ touchFriendly: false, currentMapId: 0, currentCoords: null }
|
||||
{ touchFriendly: false, currentMapId: 0, currentCoords: null, selectedMarkerForBookmark: null }
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -165,7 +159,6 @@ const emit = defineEmits<{
|
||||
zoomOut: []
|
||||
resetView: []
|
||||
jumpToMarker: [id: number]
|
||||
'update:showGridCoordinates': [v: boolean]
|
||||
'update:hideMarkers': [v: boolean]
|
||||
'update:selectedMapIdSelect': [v: string]
|
||||
'update:overlayMapId': [v: number]
|
||||
@@ -173,7 +166,6 @@ const emit = defineEmits<{
|
||||
'update:selectedPlayerIdSelect': [v: string]
|
||||
}>()
|
||||
|
||||
const showGridCoordinates = defineModel<boolean>('showGridCoordinates', { required: true })
|
||||
const hideMarkers = defineModel<boolean>('hideMarkers', { required: true })
|
||||
|
||||
const selectedMapIdSelect = computed({
|
||||
|
||||
Reference in New Issue
Block a user