-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c7eb84
commit 87fb5e9
Showing
15 changed files
with
240 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
import { storeToRefs } from 'pinia' | ||
import FeatureElevationProfile from '@/components/feature-elevation-profile/feature-elevation-profile.vue' | ||
import { useProfileDrawv3Store } from '../../stores/profile-draw_v3.store' | ||
const profilev3Store = useProfileDrawv3Store() | ||
const { feature_v3 } = storeToRefs(profilev3Store) | ||
/** | ||
* This component is a wrapper to use original <feature-elevation-profile> in v3 | ||
* | ||
* @deprecated this component is meant to be removed when v4 is fully operational | ||
*/ | ||
</script> | ||
|
||
<template> | ||
<feature-elevation-profile :feature="feature_v3" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup lang="ts"> | ||
import { storeToRefs } from 'pinia' | ||
import FeatureElevationProfile from '@/components/feature-elevation-profile/feature-elevation-profile.vue' | ||
import { useProfileMeasuresv3Store } from '../../stores/profile-measures_v3.store' | ||
const profilev3Store = useProfileMeasuresv3Store() | ||
const { closeEvent_v3, feature_v3 } = storeToRefs(profilev3Store) | ||
/** | ||
* This component is a wrapper to use original <feature-elevation-profile> in v3 | ||
* | ||
* @deprecated this component is meant to be removed when v4 is fully operational | ||
*/ | ||
</script> | ||
|
||
<template> | ||
<feature-elevation-profile | ||
:feature="feature_v3" | ||
@close="() => (closeEvent_v3 = Date.now())" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Ref, ref } from 'vue' | ||
import { acceptHMRUpdate, defineStore } from 'pinia' | ||
import { Feature, Map } from 'ol' | ||
|
||
import { DrawnFeature } from '@/services/draw/drawn-feature' | ||
import { ProfileData } from '@/components/common/graph/elevation-profile' | ||
|
||
/** | ||
* This store is a wrapper to use original <feature-elevation-profile> in v3. | ||
* This store is used by any drawn feature graph v4 component in the v3 drawing panel. | ||
* | ||
* @deprecated this store is meant to be removed when v4 is fully operational | ||
*/ | ||
export const useProfileDrawv3Store = defineStore( | ||
'profile-draw-v3', | ||
() => { | ||
/** | ||
* Emulate a DrawnFeature with feature coming from v3 | ||
* @deprecated this property is meant to be removed when Drawing and Measures in v4 are fully operational | ||
*/ | ||
const feature_v3: Ref<DrawnFeature | undefined> = ref(undefined) | ||
|
||
function setProfileData( | ||
map: Map, | ||
feature: Feature & DrawnFeature, | ||
profileData: ProfileData | ||
) { | ||
feature_v3.value = undefined | ||
feature['map'] = map // Needed by CSV Exporter | ||
feature['label'] = feature['label'] ?? 'mnt' // Needed by CSV Exporter (= fileName) | ||
feature['getProfile'] = () => Promise.resolve(profileData) | ||
feature_v3.value = <DrawnFeature>feature | ||
} | ||
|
||
return { | ||
feature_v3, | ||
setProfileData, | ||
} | ||
}, | ||
{} | ||
) | ||
|
||
if (import.meta.hot) { | ||
import.meta.hot.accept( | ||
acceptHMRUpdate(useProfileDrawv3Store, import.meta.hot) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Ref, ref } from 'vue' | ||
import { acceptHMRUpdate, defineStore } from 'pinia' | ||
import { Feature, Map } from 'ol' | ||
|
||
import { DrawnFeature } from '@/services/draw/drawn-feature' | ||
import { ProfileData } from '@/components/common/graph/elevation-profile' | ||
|
||
/** | ||
* This store is a wrapper to use original <feature-elevation-profile> in v3. | ||
* This store is used by the v4 profile elevation component in v3 Measure tool. | ||
* | ||
* @deprecated this store is meant to be removed when v4 is fully operational | ||
*/ | ||
export const useProfileMeasuresv3Store = defineStore( | ||
'profile-measures-v3', | ||
() => { | ||
/** | ||
* Emulate closing event as it is impossible to attach onClose event on generated Custom Element with Vuejs | ||
* @deprecated this property is meant to be removed when Drawing and Measures in v4 are fully operational | ||
*/ | ||
const closeEvent_v3: Ref<number | undefined> = ref(undefined) | ||
|
||
/** | ||
* Emulate a DrawnFeature with feature coming from v3 | ||
* @deprecated this property is meant to be removed when Drawing and Measures in v4 are fully operational | ||
*/ | ||
const feature_v3: Ref<DrawnFeature | undefined> = ref(undefined) | ||
|
||
function setProfileData( | ||
map: Map, | ||
feature: Feature & DrawnFeature, | ||
profileData: ProfileData | ||
) { | ||
feature_v3.value = undefined | ||
feature['map'] = map // Needed by CSV Exporter | ||
feature['label'] = feature['label'] ?? 'mnt' // Needed by CSV Exporter (= fileName) | ||
feature['getProfile'] = () => Promise.resolve(profileData) | ||
feature_v3.value = <DrawnFeature>feature | ||
} | ||
|
||
return { | ||
closeEvent_v3, | ||
feature_v3, | ||
setProfileData, | ||
} | ||
}, | ||
{} | ||
) | ||
|
||
if (import.meta.hot) { | ||
import.meta.hot.accept( | ||
acceptHMRUpdate(useProfileMeasuresv3Store, import.meta.hot) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.