-
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.
Ajout du widget ElevationPath (#325)
- Loading branch information
Showing
9 changed files
with
115 additions
and
15 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
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,72 @@ | ||
<script setup lang="js"> | ||
import { useActionButtonEulerian } from '@/composables/actionEulerian.js'; | ||
import { useLogger } from 'vue-logger-plugin' | ||
import { | ||
ElevationPath | ||
} from 'geopf-extensions-openlayers' | ||
const props = defineProps({ | ||
visibility: Boolean, | ||
analytic: Boolean, | ||
elevationPathOptions: Object | ||
}) | ||
const log = useLogger() | ||
const map = inject('map') | ||
const elevationPath = ref(new ElevationPath(props.elevationPathOptions)) | ||
onMounted(() => { | ||
if (props.visibility) { | ||
map.addControl(elevationPath.value); | ||
/* abonnement au widget | ||
* @fires elevationpath:drawstart | ||
* @fires elevationpath:drawend | ||
* @fires elevationpath:compute | ||
*/ | ||
elevationPath.value.on("elevationpath:drawstart", onDrawStart); | ||
elevationPath.value.on("elevationpath:drawend", onDrawEnd); | ||
elevationPath.value.on("elevationpath:compute", onCompute); | ||
if (props.analytic) { | ||
var el = elevationPath.value.element.querySelector("button[id^=GPshowElevationPathPicto-]"); | ||
useActionButtonEulerian(el); | ||
} | ||
} | ||
}) | ||
onBeforeUpdate(() => { | ||
if (!props.visibility) { | ||
map.removeControl(elevationPath.value); | ||
} | ||
}) | ||
onUpdated(() => { | ||
if (props.visibility) { | ||
map.addControl(elevationPath.value); | ||
if (props.analytic) { | ||
var el = elevationPath.value.element.querySelector("button[id^=GPshowElevationPathPicto-]"); | ||
useActionButtonEulerian(el); | ||
} | ||
} | ||
}) | ||
/** | ||
* gestionnaire d'evenement sur les abonnements | ||
*/ | ||
const onDrawStart = (e) => { | ||
log.debug(e); | ||
} | ||
const onDrawEnd = (e) => { | ||
log.debug(e); | ||
} | ||
const onCompute = (e) => { | ||
log.debug(e); | ||
} | ||
</script> | ||
|
||
<template> | ||
<!-- TODO ajouter l'emprise du widget pour la gestion des collisions --> | ||
</template> | ||
|
||
<style scoped></style> |
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
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