From 2bbbd046573eff6e8f2d2ad35579b6874f0e6f7d Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 24 Sep 2021 20:15:10 +0200 Subject: [PATCH] Client - use tile server and map attribution from app config --- .../components/Workout/WorkoutDetail/WorkoutMap.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutMap.vue b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutMap.vue index ecd6ac97..f74f5749 100644 --- a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutMap.vue +++ b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutMap.vue @@ -12,7 +12,8 @@ @ready="fitBounds(bounds)" > @@ -26,8 +27,11 @@ import { LGeoJson, LMap, LTileLayer } from '@vue-leaflet/vue-leaflet' import { ComputedRef, PropType, computed, defineComponent, ref } from 'vue' + import { ROOT_STORE } from '@/store/constants' import { GeoJSONData } from '@/types/geojson' import { IWorkoutState } from '@/types/workouts' + import { useStore } from '@/use/useStore' + import { getApiUrl } from '@/utils' export default defineComponent({ name: 'WorkoutMap', @@ -42,6 +46,7 @@ }, }, setup(props) { + const store = useStore() const workoutMap = ref null } }>(null) @@ -85,8 +90,12 @@ ] : [] ) + const appConfig = computed( + () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG] + ) return { + appConfig, bounds: bounds, center: computed(() => getCenter(bounds)), geoJson: computed(() => @@ -97,6 +106,7 @@ options: { zoom: 13 }, workoutMap, fitBounds, + getApiUrl, } }, })