From 9b95cada56b75977d080a18bbbc8d937a315fe2c Mon Sep 17 00:00:00 2001 From: hcaillaud Date: Fri, 13 Dec 2024 14:29:21 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8C=9F=20control=20sur=20pluiseurs=20?= =?UTF-8?q?map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/carte/Carto.vue | 3 ++- src/components/carte/Controls.vue | 24 ++++++++++++++++++- src/components/carte/control/Attributions.vue | 5 ++-- src/components/carte/control/ControlList.vue | 5 ++-- src/components/carte/control/Drawing.vue | 5 ++-- .../carte/control/ElevationPath.vue | 5 ++-- src/components/carte/control/FullScreen.vue | 5 ++-- .../carte/control/GetFeatureInfo.vue | 5 ++-- src/components/carte/control/Isocurve.vue | 5 ++-- src/components/carte/control/LayerImport.vue | 5 ++-- .../carte/control/LayerSwitcher.vue | 4 ++-- src/components/carte/control/Legends.vue | 4 ++-- src/components/carte/control/MeasureArea.vue | 5 ++-- .../carte/control/MeasureAzimuth.vue | 5 ++-- .../carte/control/MeasureLength.vue | 5 ++-- .../carte/control/MousePosition.vue | 5 ++-- src/components/carte/control/OverviewMap.vue | 5 ++-- src/components/carte/control/Print.vue | 23 +++++++++++++++++- .../carte/control/ReverseGeocode.vue | 5 ++-- src/components/carte/control/Route.vue | 5 ++-- src/components/carte/control/ScaleLine.vue | 5 ++-- src/components/carte/control/SearchEngine.vue | 5 ++-- src/components/carte/control/Share.vue | 1 + src/components/carte/control/Territories.vue | 5 ++-- src/components/carte/control/Zoom.vue | 4 ++-- 25 files changed, 108 insertions(+), 45 deletions(-) diff --git a/src/components/carte/Carto.vue b/src/components/carte/Carto.vue index bfa909c..3dbc2c7 100644 --- a/src/components/carte/Carto.vue +++ b/src/components/carte/Carto.vue @@ -61,7 +61,8 @@ const mapIsReady = computed(() => { + :control-options="props.selectedControls" + :map-id="mainMap"/> diff --git a/src/components/carte/control/Attributions.vue b/src/components/carte/control/Attributions.vue index 7931c1b..5fd840b 100644 --- a/src/components/carte/control/Attributions.vue +++ b/src/components/carte/control/Attributions.vue @@ -7,13 +7,14 @@ import Attributions from 'ol/control/Attribution' // - tracker Eulerian !? const props = defineProps({ + mapId: String, visibility: Boolean, analytic: Boolean, attributionsOptions: Object }) -import { mainMap } from "@/composables/keys" -const map = inject(mainMap) + +const map = inject(props.mapId) const attributions = ref(new Attributions(props.attributionsOptions)) onMounted(() => { diff --git a/src/components/carte/control/ControlList.vue b/src/components/carte/control/ControlList.vue index 68b4154..ec4b799 100644 --- a/src/components/carte/control/ControlList.vue +++ b/src/components/carte/control/ControlList.vue @@ -5,10 +5,11 @@ import { useLogger } from 'vue-logger-plugin' import { ControlList } from 'geopf-extensions-openlayers' -import { mainMap } from "@/composables/keys" + import { selectedControls } from '@/composables/mapControls' const props = defineProps({ + mapId: String, visibility: Boolean, analytic: Boolean, controlListOptions: Object @@ -16,7 +17,7 @@ const props = defineProps({ const log = useLogger() -const map = inject(mainMap) +const map = inject(props.mapId) const controlList = ref(new ControlList(props.controlListOptions)) const isSmallScreen = useMatchMedia('SM') diff --git a/src/components/carte/control/Drawing.vue b/src/components/carte/control/Drawing.vue index 0a88733..fea93d3 100644 --- a/src/components/carte/control/Drawing.vue +++ b/src/components/carte/control/Drawing.vue @@ -1,15 +1,16 @@