-
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.
Gestion des controles par defaut Openlayers
- Loading branch information
1 parent
9d20512
commit 90a8ef2
Showing
7 changed files
with
120 additions
and
5 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
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,34 @@ | ||
<script setup lang="js"> | ||
import Attributions from 'ol/control/Attribution' | ||
const props = defineProps({ | ||
visibility: Boolean, | ||
attributionsOptions: Object | ||
}) | ||
const map = inject('map') | ||
const attributions = ref(new Attributions(props.attributionsOptions)) | ||
onMounted(() => { | ||
if (props.visibility) { | ||
map.addControl(attributions.value) | ||
} | ||
}) | ||
onBeforeUpdate(() => { | ||
if (!props.visibility) { | ||
map.removeControl(attributions.value) | ||
} | ||
}) | ||
onUpdated(() => { | ||
if (props.visibility) { | ||
map.addControl(attributions.value) | ||
} | ||
}) | ||
</script> | ||
|
||
<template></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup lang="js"> | ||
import Zoom from 'ol/control/Zoom' | ||
const props = defineProps({ | ||
visibility: Boolean, | ||
zoomOptions: Object | ||
}) | ||
const map = inject('map') | ||
const zoom = ref(new Zoom(props.zoomOptions)) | ||
onMounted(() => { | ||
if (props.visibility) { | ||
map.addControl(zoom.value) | ||
} | ||
}) | ||
onBeforeUpdate(() => { | ||
if (!props.visibility) { | ||
map.removeControl(zoom.value) | ||
} | ||
}) | ||
onUpdated(() => { | ||
if (props.visibility) { | ||
map.addControl(zoom.value) | ||
} | ||
}) | ||
</script> | ||
|
||
<template></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export const useControls = { | ||
OverviewMap: 'OverviewMap', | ||
SearchEngine: 'SearchEngine', | ||
ScaleLine: 'ScaleLine' | ||
ScaleLine: 'ScaleLine', | ||
Zoom: 'Zoom', | ||
// Attributions: 'Attributions' | ||
} |