Skip to content

Commit b401086

Browse files
committed
widgets: map: add map widget edge arrow options
Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
1 parent a1b6884 commit b401086

File tree

1 file changed

+83
-19
lines changed

1 file changed

+83
-19
lines changed

src/components/widgets/Map.vue

Lines changed: 83 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
</template>
122122
</v-tooltip>
123123
<!-- POI Edge Arrows -->
124-
<template v-if="mapReady">
124+
<template v-if="mapReady && widget.options.showPoiArrows">
125125
<div v-for="arrow in poiEdgeArrows" :key="arrow.poiId" class="poi-edge-arrow" :style="arrow.style">
126126
<v-tooltip location="top" :text="arrow.tooltipText" content-class="poi-arrow-tooltip">
127127
<template #activator="{ props: tooltipProps }">
@@ -136,7 +136,7 @@
136136
</div>
137137
</template>
138138
<!-- Vehicle Edge Arrow -->
139-
<template v-if="mapReady">
139+
<template v-if="mapReady && vehicleEdgeArrow">
140140
<div class="poi-edge-arrow" :style="vehicleEdgeArrow.style">
141141
<v-tooltip location="top" :text="vehicleEdgeArrow.tooltipText" content-class="poi-arrow-tooltip">
142142
<template #activator="{ props: tooltipProps }">
@@ -155,7 +155,7 @@
155155
</div>
156156
</template>
157157
<!-- Home Edge Arrow -->
158-
<template v-if="mapReady">
158+
<template v-if="mapReady && homeEdgeArrow">
159159
<div class="poi-edge-arrow" :style="homeEdgeArrow.style">
160160
<v-tooltip location="top" :text="homeEdgeArrow.tooltipText" content-class="poi-arrow-tooltip">
161161
<template #activator="{ props: tooltipProps }">
@@ -186,24 +186,75 @@
186186
</ContextMenu>
187187

188188
<v-dialog v-model="widgetStore.widgetManagerVars(widget.hash).configMenuOpen" width="auto">
189-
<v-card class="pa-2" :style="interfaceStore.globalGlassMenuStyles">
190-
<v-card-title class="text-center">Map widget settings</v-card-title>
191-
<v-card-text>
192-
<v-switch
193-
v-model="widget.options.showVehiclePath"
194-
class="my-1"
195-
label="Show vehicle path"
196-
:color="widget.options.showVehiclePath ? 'white' : undefined"
197-
hide-details
198-
/>
199-
<v-switch
200-
v-model="widget.options.showCoordinateGrid"
201-
class="my-1"
202-
label="Show coordinate grid"
203-
:color="widget.options.showCoordinateGrid ? 'white' : undefined"
204-
hide-details
189+
<v-card class="pa-2 max-w-[800px]" :style="interfaceStore.globalGlassMenuStyles">
190+
<v-card-title class="flex justify-between items-center">
191+
<span class="text-center flex-1">Map widget settings</span>
192+
<v-btn
193+
icon="mdi-close"
194+
size="small"
195+
variant="text"
196+
class="absolute right-2 top-2 text-lg"
197+
@click="widgetStore.widgetManagerVars(widget.hash).configMenuOpen = false"
205198
/>
199+
</v-card-title>
200+
<v-card-text>
201+
<ExpansiblePanel compact :is-expanded="!interfaceStore.isOnSmallScreen" no-bottom-divider no-top-divider>
202+
<template #title>Display</template>
203+
<template #content>
204+
<v-row>
205+
<v-col cols="4">
206+
<v-switch
207+
v-model="widget.options.showVehiclePath"
208+
class="my-1"
209+
label="Vehicle path"
210+
:color="widget.options.showVehiclePath ? 'white' : undefined"
211+
hide-details
212+
/>
213+
</v-col>
214+
<v-col cols="4">
215+
<v-switch
216+
v-model="widget.options.showCoordinateGrid"
217+
class="my-1"
218+
label="Coordinate grid"
219+
:color="widget.options.showCoordinateGrid ? 'white' : undefined"
220+
hide-details
221+
/>
222+
</v-col>
223+
<v-col cols="4">
224+
<v-switch
225+
v-model="widget.options.showPoiArrows"
226+
class="my-1"
227+
label="Point of Interest arrows"
228+
:color="widget.options.showPoiArrows ? 'white' : undefined"
229+
hide-details
230+
/>
231+
</v-col>
232+
<v-col cols="4">
233+
<v-switch
234+
v-model="widget.options.showHomeArrow"
235+
class="my-1"
236+
label="Home arrow"
237+
:color="widget.options.showHomeArrow ? 'white' : undefined"
238+
hide-details
239+
/>
240+
</v-col>
241+
<v-col cols="4">
242+
<v-switch
243+
v-model="widget.options.showVehicleArrow"
244+
class="my-1"
245+
label="Vehicle arrow"
246+
:color="widget.options.showVehicleArrow ? 'white' : undefined"
247+
hide-details
248+
/>
249+
</v-col>
250+
</v-row>
251+
</template>
252+
</ExpansiblePanel>
206253
</v-card-text>
254+
<v-divider class="mx-10" />
255+
<v-card-actions class="flex justify-end pt-3">
256+
<v-btn @click="widgetStore.widgetManagerVars(widget.hash).configMenuOpen = false">Close</v-btn>
257+
</v-card-actions>
207258
</v-card>
208259
</v-dialog>
209260

@@ -273,6 +324,7 @@ import copterMarkerImage from '@/assets/arducopter-top-view.png'
273324
import blueboatMarkerImage from '@/assets/blueboat-marker.png'
274325
import brov2MarkerImage from '@/assets/brov2-marker.png'
275326
import genericVehicleMarkerImage from '@/assets/generic-vehicle-marker.png'
327+
import ExpansiblePanel from '@/components/ExpansiblePanel.vue'
276328
import GlobalOriginDialog from '@/components/GlobalOriginDialog.vue'
277329
import MissionChecklist from '@/components/MissionChecklist.vue'
278330
import PoiManager from '@/components/poi/PoiManager.vue'
@@ -487,12 +539,24 @@ onBeforeMount(() => {
487539
widget.value.options = {
488540
showVehiclePath: true,
489541
showCoordinateGrid: false,
542+
showPoiArrows: true,
543+
showHomeArrow: true,
544+
showVehicleArrow: true,
490545
}
491546
}
492547
// Ensure new options exist for existing widgets
493548
if (widget.value.options.showCoordinateGrid === undefined) {
494549
widget.value.options.showCoordinateGrid = false
495550
}
551+
if (widget.value.options.showPoiArrows === undefined) {
552+
widget.value.options.showPoiArrows = true
553+
}
554+
if (widget.value.options.showHomeArrow === undefined) {
555+
widget.value.options.showHomeArrow = true
556+
}
557+
if (widget.value.options.showVehicleArrow === undefined) {
558+
widget.value.options.showVehicleArrow = true
559+
}
496560
targetFollower.enableAutoUpdate()
497561
})
498562

0 commit comments

Comments
 (0)