|
120 | 120 | /> |
121 | 121 | </template> |
122 | 122 | </v-tooltip> |
| 123 | + <PoiMapArrows |
| 124 | + :map-ready="mapReady" |
| 125 | + :show-poi-arrows="widget.options.showPoiArrows" |
| 126 | + :show-home-arrow="widget.options.showHomeArrow" |
| 127 | + :show-vehicle-arrow="widget.options.showVehicleArrow" |
| 128 | + :vehicle-position="vehiclePosition" |
| 129 | + :home="home" |
| 130 | + :map-center="mapCenter" |
| 131 | + :zoom="zoom" |
| 132 | + :widget="widget" |
| 133 | + :target-follower="targetFollower" |
| 134 | + /> |
123 | 135 | </div> |
124 | 136 | </div> |
125 | 137 |
|
@@ -223,7 +235,9 @@ import genericVehicleMarkerImage from '@/assets/generic-vehicle-marker.png' |
223 | 235 | import GlobalOriginDialog from '@/components/GlobalOriginDialog.vue' |
224 | 236 | import MissionChecklist from '@/components/MissionChecklist.vue' |
225 | 237 | import PoiManager from '@/components/poi/PoiManager.vue' |
| 238 | +import PoiMapArrows from '@/components/poi/PoiMapArrows.vue' |
226 | 239 | import { useInteractionDialog } from '@/composables/interactionDialog' |
| 240 | +import { setMapLayer } from '@/composables/map/useMapLayer' |
227 | 241 | import { openSnackbar } from '@/composables/snackbar' |
228 | 242 | import { MavType } from '@/libs/connection/m2r/messages/mavlink2rest-enum' |
229 | 243 | import { datalogger, DatalogVariable } from '@/libs/sensors-logging' |
@@ -260,8 +274,9 @@ const router = useRouter() |
260 | 274 |
|
261 | 275 | // Declare the general variables |
262 | 276 | const map = shallowRef<Map | undefined>() |
263 | | -const zoom = ref(missionStore.userLastMapZoom ?? missionStore.defaultMapZoom) |
264 | | -const mapCenter = ref<WaypointCoordinates>(missionStore.userLastMapCenter ?? missionStore.defaultMapCenter) |
| 277 | +
|
| 278 | +const zoom = ref(missionStore.defaultMapZoom) |
| 279 | +const mapCenter = ref<WaypointCoordinates>(missionStore.defaultMapCenter) |
265 | 280 | const home = ref() |
266 | 281 | const mapId = computed(() => `map-${widget.value.hash}`) |
267 | 282 | const showButtons = computed(() => isMouseOver.value || downloadMenuOpen.value) |
@@ -608,6 +623,9 @@ onMounted(async () => { |
608 | 623 | attributionControl: false, |
609 | 624 | }).setView(mapCenter.value as LatLngTuple, zoom.value) as Map |
610 | 625 |
|
| 626 | + // Set map layer in composable for child components |
| 627 | + setMapLayer(map.value) |
| 628 | +
|
611 | 629 | // Listen for base layer changes to save user preference |
612 | 630 | map.value.on('baselayerchange', (event: LayersControlEvent) => { |
613 | 631 | const name = event.name |
@@ -895,6 +913,9 @@ onBeforeUnmount(() => { |
895 | 913 |
|
896 | 914 | mapBase.value?.removeEventListener('touchstart', onTouchStart) |
897 | 915 | mapBase.value?.removeEventListener('touchend', onTouchEnd) |
| 916 | +
|
| 917 | + // Clear map layer from composable |
| 918 | + setMapLayer(undefined) |
898 | 919 | }) |
899 | 920 |
|
900 | 921 | // Pan when variables change |
|
0 commit comments