Skip to content

Commit

Permalink
Merge pull request #431 from IGNF/recette/print-64
Browse files Browse the repository at this point in the history
Recette/print 64
  • Loading branch information
elias75015 authored Dec 16, 2024
2 parents f3824ad + 38b4e34 commit a0589bf
Show file tree
Hide file tree
Showing 26 changed files with 176 additions and 72 deletions.
3 changes: 2 additions & 1 deletion src/components/carte/Carto.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const mapIsReady = computed(() => {
<!-- Composant pour selectionner les widgets à afficher sur la carte -->
<Controls
v-if="mapIsReady"
:control-options="props.selectedControls"/>
:control-options="props.selectedControls"
:map-id="mainMap"/>
<!-- Composant pour ajouter les couches sur la carte -->
<Layers
:map-Id="mainMap"
Expand Down
24 changes: 23 additions & 1 deletion src/components/carte/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import { useControls } from '@/composables/controls';
import { useLogger } from 'vue-logger-plugin';
const props = defineProps({
controlOptions: Array
controlOptions: Array,
mapId: String
});
// INFO
Expand Down Expand Up @@ -377,126 +378,147 @@ const layerImportOptions = {
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Print.id)"
:print-options="printOptions"
:map-id="mapId"
/>
<LayerSwitcher
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.LayerSwitcher.id)"
:analytic="useControls.LayerSwitcher.analytic"
:layer-switcher-options="layerSwitcherOptions"
:map-id="mapId"
/>
<Legends
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Legends.id)"
:analytic="useControls.Legends.analytic"
:legends-options="legendsOptions"
:map-id="mapId"
/>
<Route
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Route.id)"
:analytic="useControls.Route.analytic"
:route-options="routeOptions"
:map-id="mapId"
/>
<Isocurve
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Isocurve.id)"
:analytic="useControls.Isocurve.analytic"
:isocurve-options="isocurveOptions"
:map-id="mapId"
/>
<ReverseGeocode
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.ReverseGeocode.id)"
:analytic="useControls.ReverseGeocode.analytic"
:reverse-geocode-options="reverseGeocodeOptions"
:map-id="mapId"
/>
<FullScreen
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.FullScreen.id)"
:analytic="useControls.FullScreen.analytic"
:fullscreen-options="fullscreenOptions"
:map-id="mapId"
/>
<Zoom
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Zoom.id)"
:analytic="useControls.Zoom.analytic"
:zoom-options="zoomOptions"
:map-id="mapId"
/>
<SearchEngine
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.SearchEngine.id)"
:analytic="useControls.SearchEngine.analytic"
:search-engine-options="searchEngineOptions"
:map-id="mapId"
/>
<GetFeatureInfo
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.GetFeatureInfo.id)"
:analytic="useControls.GetFeatureInfo.analytic"
:get-feature-info-options="getFeatureInfoOptions"
:map-id="mapId"
/>
<ScaleLine
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.ScaleLine.id)"
:analytic="useControls.ScaleLine.analytic"
:scale-line-options="scaleLineOptions"
:map-id="mapId"
/>
<OverviewMap
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.OverviewMap.id)"
:analytic="useControls.OverviewMap.analytic"
:overview-map-options="overviewMapOptions"
:map-id="mapId"
/>
<Territories
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Territories.id)"
:analytic="useControls.Territories.analytic"
:territories-options="territoriesOptions"
:map-id="mapId"
/>
<MeasureLength
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.MeasureLength.id)"
:analytic="useControls.MeasureLength.analytic"
:measure-length-options="measureLengthOptions"
:map-id="mapId"
/>
<MeasureArea
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.MeasureArea.id)"
:analytic="useControls.MeasureArea.analytic"
:measure-area-options="measureAreaOptions"
:map-id="mapId"
/>
<MeasureAzimuth
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.MeasureAzimuth.id)"
:analytic="useControls.MeasureAzimuth.analytic"
:measure-azimuth-options="measureAzimuthOptions"
:map-id="mapId"
/>
<MousePosition
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.MousePosition.id)"
:analytic="useControls.MousePosition.analytic"
:mouse-position-options="mousePositionOptions"
:map-id="mapId"
/>
<Drawing
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.Drawing.id)"
:analytic="useControls.Drawing.analytic"
:drawing-options="drawingOptions"
:map-id="mapId"
/>
<ElevationPath
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.ElevationPath.id)"
:analytic="useControls.ElevationPath.analytic"
:elevation-path-options="elevationPathOptions"
:map-id="mapId"
/>
<LayerImport
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.LayerImport.id)"
:analytic="useControls.LayerImport.analytic"
:layer-import-options="layerImportOptions"
:map-id="mapId"
/>
<ControlList
v-if="controlOptions"
:visibility="props.controlOptions.includes(useControls.ControlList.id)"
:analytic="useControls.ControlList.analytic"
:control-list-options="controlListOptions"
:map-id="mapId"
/>
</template>

Expand Down
4 changes: 2 additions & 2 deletions src/components/carte/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ const mapRef = ref(null)
* Map
* default controls are removed (rotate, zoom and attributions)
*/
const map = reactive(new Map({
const map = new Map({
target: props.mapId,
controls: [] // on supprime les contrôles par defaut !
}))
})
provide(props.mapId, map)
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/Attributions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/ControlList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ 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
})
const log = useLogger()
const map = inject(mainMap)
const map = inject(props.mapId)
const controlList = ref(new ControlList(props.controlListOptions))
const isSmallScreen = useMatchMedia('SM')
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/Drawing.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<script setup lang="js">
import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { Drawing } from 'geopf-extensions-openlayers';
import { mainMap } from "@/composables/keys"
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
drawingOptions: Object
});
const map = inject(mainMap)
const map = inject(props.mapId)
const drawing = ref(new Drawing(props.drawingOptions));
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/ElevationPath.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import {
} from 'geopf-extensions-openlayers'
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
elevationPathOptions: Object
})
const log = useLogger()
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const elevationPath = ref(new ElevationPath(props.elevationPathOptions))
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/FullScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { GeoportalFullScreen } from 'geopf-extensions-openlayers'
// ajouter un ID sur le bouton pour y ajouter un tracker Eulerian
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
fullscreenOptions: Object
})
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const fullscreen = ref(new GeoportalFullScreen(props.fullscreenOptions))
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/GetFeatureInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { GetFeatureInfo } from 'geopf-extensions-openlayers';
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
getFeatureInfoOptions: Object
});
const log = useLogger();
import { mainMap } from "@/composables/keys"
const map = inject(mainMap);
const map = inject(props.mapId);
const getFeatureInfo = ref(new GetFeatureInfo(props.getFeatureInfoOptions));
const isSmallScreen = useMatchMedia('SM')
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/Isocurve.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { Isocurve } from 'geopf-extensions-openlayers'
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
isocurveOptions: Object
Expand All @@ -15,8 +16,8 @@ const props = defineProps({
const log = useLogger()
const store = useDataStore();
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const isocurve = ref(new Isocurve(props.isocurveOptions))
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/LayerImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import {
} from 'geopf-extensions-openlayers'
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
layerImportOptions: Object
})
const log = useLogger()
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const layerImport = ref(new LayerImport(props.layerImportOptions))
onMounted(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/carte/control/LayerSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { LayerSwitcher } from 'geopf-extensions-openlayers';
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
layerSwitcherOptions: Object
Expand All @@ -21,8 +22,7 @@ const log = useLogger();
const mapStore = useMapStore();
const dataStore = useDataStore();
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const layerSwitcher = ref(new LayerSwitcher(props.layerSwitcherOptions));
onMounted(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/carte/control/Legends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { Legends } from 'geopf-extensions-openlayers';
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
legendsOptions: Object
});
import { mainMap } from "@/composables/keys"
const map = inject(mainMap);
const map = inject(props.mapId);
const legends = ref(new Legends(props.legendsOptions));
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/MeasureArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { MeasureArea } from 'geopf-extensions-openlayers';
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
measureAreaOptions: Object
})
import { mainMap } from "@/composables/keys"
const map = inject(mainMap);
const map = inject(props.mapId);
const measureArea = ref(new MeasureArea(props.measureAreaOptions));
onMounted(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/carte/control/MeasureAzimuth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { useActionButtonEulerian } from '@/composables/actionEulerian.js';
import { MeasureAzimuth } from 'geopf-extensions-openlayers';
const props = defineProps({
mapId: String,
visibility: Boolean,
analytic: Boolean,
measureAzimuthOptions: Object
})
import { mainMap } from "@/composables/keys"
const map = inject(mainMap)
const map = inject(props.mapId)
const measureAzimuth = ref(new MeasureAzimuth(props.measureAzimuthOptions))
onMounted(() => {
Expand Down
Loading

0 comments on commit a0589bf

Please sign in to comment.