@dative-gpi/foundation-shared-components 1.0.56 → 1.0.58-groupings
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/map/snow.png +0 -0
- package/components/FSAccordionPanel.vue +40 -21
- package/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +16 -16
- package/components/FSCalendar.vue +50 -12
- package/components/FSCalendarTwin.vue +95 -43
- package/components/FSCard.vue +61 -9
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSCheckbox.vue +5 -4
- package/components/FSChip.vue +73 -45
- package/components/FSChipGroup.vue +69 -0
- package/components/FSClickable.vue +11 -9
- package/components/FSClock.vue +30 -12
- package/components/FSCol.vue +11 -5
- package/components/FSColorIcon.vue +23 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +50 -31
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +79 -56
- package/components/FSDialogRemove.vue +7 -8
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +4 -3
- package/components/FSIconCard.vue +68 -12
- package/components/FSImage.vue +9 -2
- package/components/FSImageUI.vue +8 -15
- package/components/FSInformationsMenu.vue +142 -0
- package/components/FSInstantPicker.vue +269 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -10
- package/components/FSMenu.vue +47 -0
- package/components/FSOptionGroup.vue +57 -9
- package/components/FSOptionItem.vue +4 -4
- package/components/FSPagination.vue +1 -1
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRadio.vue +5 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSlider.vue +6 -5
- package/components/FSSpan.vue +12 -7
- package/components/FSSwitch.vue +47 -21
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +16 -5
- package/components/FSTagGroup.vue +4 -4
- package/components/FSText.vue +11 -7
- package/components/FSToggleSet.vue +7 -7
- package/components/FSWindow.vue +122 -5
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +50 -37
- package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
- package/components/agenda/FSAgendaHeader.vue +35 -10
- package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
- package/components/agenda/FSAgendaHoursRow.vue +48 -8
- package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
- package/components/agenda/FSDayAgenda.vue +1 -2
- package/components/agenda/FSMonthAgenda.vue +3 -9
- package/components/agenda/FSSelectAgendaMode.vue +2 -2
- package/components/agenda/FSWeekAgenda.vue +7 -13
- package/components/autocompletes/FSAutoCompleteAddress.vue +25 -20
- package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
- package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
- package/components/buttons/FSButtonAdd.vue +1 -1
- package/components/buttons/FSButtonAddLabel.vue +1 -1
- package/components/buttons/FSButtonCancel.vue +1 -1
- package/components/buttons/FSButtonCancelLabel.vue +1 -1
- package/components/buttons/FSButtonCheckbox.vue +4 -4
- package/components/buttons/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- package/components/buttons/FSButtonDuplicate.vue +1 -1
- package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
- package/components/buttons/FSButtonEdit.vue +1 -1
- package/components/buttons/FSButtonEditLabel.vue +1 -1
- package/components/buttons/FSButtonFile.vue +1 -1
- package/components/buttons/FSButtonFileLabel.vue +1 -1
- package/components/buttons/FSButtonNext.vue +1 -1
- package/components/buttons/FSButtonNextLabel.vue +1 -1
- package/components/buttons/FSButtonPrevious.vue +1 -1
- package/components/buttons/FSButtonPreviousLabel.vue +1 -1
- package/components/buttons/FSButtonRedo.vue +1 -1
- package/components/buttons/FSButtonRedoLabel.vue +1 -1
- package/components/buttons/FSButtonRemove.vue +1 -1
- package/components/buttons/FSButtonRemoveLabel.vue +1 -1
- package/components/buttons/FSButtonSave.vue +1 -1
- package/components/buttons/FSButtonSaveLabel.vue +1 -1
- package/components/buttons/FSButtonSearch.vue +1 -1
- package/components/buttons/FSButtonSearchLabel.vue +1 -1
- package/components/buttons/FSButtonUndo.vue +1 -1
- package/components/buttons/FSButtonUndoLabel.vue +1 -1
- package/components/buttons/FSButtonUpdate.vue +1 -1
- package/components/buttons/FSButtonUpdateLabel.vue +1 -1
- package/components/buttons/FSButtonValidate.vue +1 -1
- package/components/buttons/FSButtonValidateLabel.vue +1 -1
- package/components/calendar/FSSimpleCalendar.vue +145 -0
- package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
- package/components/calendar/FSSimpleMonthSelector.vue +138 -0
- package/components/deviceOrganisations/FSConnectivity.vue +16 -4
- package/components/deviceOrganisations/FSConnectivityCard.vue +17 -45
- package/components/deviceOrganisations/FSStatus.vue +16 -4
- package/components/deviceOrganisations/FSStatusCard.vue +33 -59
- package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +8 -2
- package/components/deviceOrganisations/FSWorstAlert.vue +37 -42
- package/components/deviceOrganisations/FSWorstAlertCard.vue +35 -84
- package/components/fields/FSAutocompleteField.vue +85 -82
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +54 -30
- package/components/fields/FSClosableSearchField.vue +83 -0
- package/components/fields/FSColorField.vue +48 -44
- package/components/fields/FSCommentField.vue +28 -16
- package/components/fields/FSDateField.vue +13 -10
- package/components/fields/FSDateRangeField.vue +6 -5
- package/components/fields/FSDateTimeField.vue +14 -11
- package/components/fields/FSDateTimeRangeDialog.vue +160 -0
- package/components/fields/FSDateTimeRangeField.vue +23 -115
- package/components/fields/FSEntityFieldUI.vue +36 -19
- package/components/fields/FSGradientField.vue +5 -5
- package/components/fields/FSIconField.vue +16 -9
- package/components/fields/FSMagicConfigField.vue +15 -7
- package/components/fields/FSMagicField.vue +7 -2
- package/components/fields/FSNumberField.vue +9 -4
- package/components/fields/FSPasswordField.vue +7 -7
- package/components/fields/FSRichTextField.vue +78 -58
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +69 -71
- package/components/fields/FSTagField.vue +10 -10
- package/components/fields/FSTermField.vue +72 -47
- package/components/fields/FSTextArea.vue +17 -11
- package/components/fields/FSTextField.vue +15 -10
- package/components/fields/FSTimeField.vue +14 -10
- package/components/fields/FSTimeRangeField.vue +310 -0
- package/components/fields/FSTimeStepField.vue +5 -5
- package/components/fields/FSTranslateField.vue +10 -10
- package/components/fields/FSTranslateRichTextField.vue +41 -20
- package/components/fields/FSTranslateTextArea.vue +10 -10
- package/components/fields/FSTreeViewField.vue +15 -13
- package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
- package/components/fields/periodicField/FSPeriodicField.vue +15 -15
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
- package/components/lists/FSDataIteratorItem.vue +23 -67
- package/components/lists/FSDataTableUI.vue +220 -137
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +14 -16
- package/components/lists/FSHeaderButton.vue +11 -9
- package/components/lists/FSHiddenButton.vue +9 -9
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +96 -102
- package/components/lists/FSSimpleListItem.vue +131 -0
- package/components/map/FSMap.vue +146 -158
- package/components/map/FSMapFeatureGroup.vue +7 -1
- package/components/map/FSMapLayerButton.vue +4 -3
- package/components/map/FSMapMarker.vue +70 -48
- package/components/map/FSMapMarkerClusterGroup.vue +32 -7
- package/components/map/FSMapOverlay.vue +44 -24
- package/components/map/FSMapPolygon.vue +16 -4
- package/components/map/FSMapTileLayer.vue +26 -9
- package/components/map/layers.ts +0 -0
- package/components/selects/FSSelectAutoRefresh.vue +8 -8
- package/components/selects/FSSelectDashboardVariableType.vue +4 -3
- package/components/selects/FSSelectDateSetting.vue +2 -2
- package/components/selects/FSSelectDays.vue +8 -8
- package/components/selects/FSSelectListMode.vue +2 -2
- package/components/selects/FSSelectMapLayer.vue +68 -0
- package/components/selects/FSSelectMonths.vue +13 -13
- package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
- package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
- package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
- package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
- package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
- package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
- package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
- package/components/tiles/FSAlertTileUI.vue +90 -0
- package/components/tiles/FSChartTileUI.vue +61 -52
- package/components/tiles/FSCommentTileUI.vue +38 -13
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
- package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -6
- package/components/tiles/FSGroupTileUI.vue +58 -110
- package/components/tiles/FSGroupingTileUI.vue +115 -0
- package/components/tiles/FSLoadTile.vue +16 -10
- package/components/tiles/FSLocationTileUI.vue +63 -55
- package/components/tiles/FSModelTileUI.vue +5 -46
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
- package/components/tiles/FSSimpleTileUI.vue +34 -29
- package/components/tiles/FSTile.vue +46 -39
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -140
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +211 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/index.ts +1 -0
- package/composables/useAddress.ts +40 -8
- package/composables/useBreakpoints.ts +40 -4
- package/composables/useColors.ts +16 -7
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useMapLayers.ts +62 -0
- package/composables/useSlots.ts +2 -1
- package/models/colors.ts +2 -1
- package/models/deviceAlerts.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +12 -10
- package/models/rules.ts +6 -3
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +4 -0
- package/styles/components/fs_agenda_event.scss +1 -1
- package/styles/components/fs_agenda_hours_row.scss +0 -8
- package/styles/components/fs_autocomplete_field.scss +0 -13
- package/styles/components/fs_breadcrumbs.scss +18 -36
- package/styles/components/fs_button.scss +7 -5
- package/styles/components/fs_calendar.scss +1 -0
- package/styles/components/fs_card.scss +9 -0
- package/styles/components/fs_chip.scss +13 -7
- package/styles/components/fs_clickable.scss +16 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_col.scss +1 -1
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +4 -10
- package/styles/components/fs_dialog_menu.scss +4 -2
- package/styles/components/fs_draggable.scss +0 -5
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_hidden_button.scss +2 -7
- package/styles/components/fs_image_card.scss +6 -4
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +57 -17
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_password_field.scss +4 -2
- package/styles/components/fs_progress_bar.scss +14 -0
- package/styles/components/fs_radio.scss +0 -11
- package/styles/components/fs_rich_text_field.scss +1 -10
- package/styles/components/fs_select_field.scss +4 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +13 -5
- package/styles/components/fs_status_rich_card.scss +6 -0
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +19 -33
- package/styles/components/fs_tag.scss +8 -22
- package/styles/components/fs_text_area.scss +2 -21
- package/styles/components/fs_tile.scss +0 -19
- package/styles/components/fs_window.scss +3 -1
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +2 -6
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +28 -61
- package/styles/globals/scrollbars.scss +8 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/styles/globals/touchscreen.scss +2 -2
- package/tools/alertsTools.ts +87 -12
- package/tools/chartsTools.ts +143 -16
- package/tools/index.ts +3 -1
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/badge.ts +9 -5
- package/utils/filter.ts +7 -4
- package/utils/index.ts +1 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +108 -0
- package/utils/sort.ts +2 -2
- package/utils/time.ts +16 -16
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -350
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/styles/components/fs_data_iterator_item.scss +0 -33
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_search_field.scss +0 -3
- package/styles/components/fs_tag_field.scss +0 -8
- package/styles/components/fs_time_field.scss +0 -12
- package/styles/components/fs_timeslot_field.scss +0 -12
- package/styles/globals/breakpoints.scss +0 -20
- package/styles/globals/fixes.scss +0 -5
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSTile
|
|
3
|
+
v-bind="$props.tileProps"
|
|
4
|
+
:width="$props.width"
|
|
5
|
+
height="fit-content"
|
|
6
|
+
>
|
|
7
|
+
<slot
|
|
8
|
+
name="item"
|
|
9
|
+
:item="{ label, icon, imageId, id }"
|
|
10
|
+
>
|
|
11
|
+
<FSRow
|
|
12
|
+
align="center-left"
|
|
13
|
+
height="24px"
|
|
14
|
+
:wrap="false"
|
|
15
|
+
>
|
|
16
|
+
<FSButtonDragIcon
|
|
17
|
+
v-if="showDraggable"
|
|
18
|
+
/>
|
|
19
|
+
<slot
|
|
20
|
+
name="itemContent"
|
|
21
|
+
:item="{ label, icon, imageId, id }"
|
|
22
|
+
>
|
|
23
|
+
<!-- TODO : add draggable option -->
|
|
24
|
+
<FSImage
|
|
25
|
+
v-if="$props.imageId"
|
|
26
|
+
width="24px"
|
|
27
|
+
height="24px"
|
|
28
|
+
:imageId="$props.imageId"
|
|
29
|
+
:thumbnail="true"
|
|
30
|
+
/>
|
|
31
|
+
<FSIcon
|
|
32
|
+
size="24px"
|
|
33
|
+
v-else-if="$props.icon"
|
|
34
|
+
:icon="$props.icon"
|
|
35
|
+
/>
|
|
36
|
+
<FSSpan
|
|
37
|
+
font="text-overline"
|
|
38
|
+
>
|
|
39
|
+
{{ $props.label }}
|
|
40
|
+
</FSSpan>
|
|
41
|
+
</slot>
|
|
42
|
+
<FSRow
|
|
43
|
+
v-if="showEdit || showRemove"
|
|
44
|
+
align="center-right"
|
|
45
|
+
:wrap="false"
|
|
46
|
+
>
|
|
47
|
+
<FSButtonEditIcon
|
|
48
|
+
v-if="showEdit"
|
|
49
|
+
@click="$emit('click:edit', $props.id)"
|
|
50
|
+
/>
|
|
51
|
+
<FSButtonRemoveIcon
|
|
52
|
+
v-if="showRemove"
|
|
53
|
+
@click="$emit('click:remove', $props.id)"
|
|
54
|
+
/>
|
|
55
|
+
</FSRow>
|
|
56
|
+
</FSRow>
|
|
57
|
+
</slot>
|
|
58
|
+
</FSTile>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
<script lang="ts">
|
|
63
|
+
import { defineComponent, type PropType } from "vue";
|
|
64
|
+
|
|
65
|
+
import FSRow from "../FSRow.vue";
|
|
66
|
+
import FSIcon from "../FSIcon.vue";
|
|
67
|
+
import FSSpan from "../FSSpan.vue";
|
|
68
|
+
import FSImage from "../FSImage.vue";
|
|
69
|
+
import FSTile from "../tiles/FSTile.vue";
|
|
70
|
+
import FSButtonEditIcon from "../buttons/FSButtonEditIcon.vue";
|
|
71
|
+
import FSButtonDragIcon from "../buttons/FSButtonDragIcon.vue";
|
|
72
|
+
import FSButtonRemoveIcon from "../buttons/FSButtonRemoveIcon.vue";
|
|
73
|
+
|
|
74
|
+
export default defineComponent({
|
|
75
|
+
name: "FSSimpleListItem",
|
|
76
|
+
components: {
|
|
77
|
+
FSRow,
|
|
78
|
+
FSTile,
|
|
79
|
+
FSIcon,
|
|
80
|
+
FSSpan,
|
|
81
|
+
FSImage,
|
|
82
|
+
FSButtonEditIcon,
|
|
83
|
+
FSButtonDragIcon,
|
|
84
|
+
FSButtonRemoveIcon,
|
|
85
|
+
},
|
|
86
|
+
props: {
|
|
87
|
+
tileProps: {
|
|
88
|
+
type: Object as PropType<Record<string, any>>,
|
|
89
|
+
required: false,
|
|
90
|
+
default: () => ({})
|
|
91
|
+
},
|
|
92
|
+
showEdit: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
required: false,
|
|
95
|
+
default: true
|
|
96
|
+
},
|
|
97
|
+
showRemove: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
required: false,
|
|
100
|
+
default: true
|
|
101
|
+
},
|
|
102
|
+
showDraggable: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
required: false,
|
|
105
|
+
default: false
|
|
106
|
+
},
|
|
107
|
+
width:{
|
|
108
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null | undefined>,
|
|
109
|
+
required: false,
|
|
110
|
+
default: undefined
|
|
111
|
+
},
|
|
112
|
+
id: {
|
|
113
|
+
type: String,
|
|
114
|
+
required: true
|
|
115
|
+
},
|
|
116
|
+
label: {
|
|
117
|
+
type: String,
|
|
118
|
+
required: true
|
|
119
|
+
},
|
|
120
|
+
icon: {
|
|
121
|
+
type: String,
|
|
122
|
+
required: false
|
|
123
|
+
},
|
|
124
|
+
imageId: {
|
|
125
|
+
type: String as PropType<string | null>,
|
|
126
|
+
required: false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
emits: ["click:edit", "click:remove"]
|
|
130
|
+
});
|
|
131
|
+
</script>
|
package/components/map/FSMap.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
v-if="map"
|
|
15
15
|
>
|
|
16
16
|
<FSMapTileLayer
|
|
17
|
-
:
|
|
17
|
+
:layers="actualLayer"
|
|
18
18
|
/>
|
|
19
19
|
<FSMapMarker
|
|
20
20
|
v-if="gpsPosition"
|
|
@@ -22,43 +22,14 @@
|
|
|
22
22
|
:color="ColorEnum.Primary"
|
|
23
23
|
:latlng="gpsPosition"
|
|
24
24
|
/>
|
|
25
|
-
|
|
26
|
-
<FSMapFeatureGroup
|
|
27
|
-
v-if="$props.areas"
|
|
28
|
-
:expected-layers="$props.areas.length"
|
|
29
|
-
@update:bounds="(bounds) => areaGroupBounds = bounds"
|
|
30
|
-
>
|
|
31
|
-
<FSMapPolygon
|
|
32
|
-
v-for="area in areas"
|
|
33
|
-
:key="area.id"
|
|
34
|
-
:color="area.color"
|
|
35
|
-
:latlngs="area.coordinates.map((coord) => ({lat: coord.latitude, lng: coord.longitude}))"
|
|
36
|
-
@click="$emit('update:selectedAreaId', area.id)"
|
|
37
|
-
/>
|
|
38
|
-
</FSMapFeatureGroup>
|
|
39
|
-
|
|
40
|
-
<FSMapMarkerClusterGroup
|
|
41
|
-
v-if="$props.locations"
|
|
42
|
-
:expected-layers="$props.locations.length"
|
|
43
|
-
:disableClusteringAtZoom="defaultZoom"
|
|
44
|
-
@update:bounds="(bounds) => locationGroupBounds = bounds"
|
|
45
|
-
>
|
|
46
|
-
<FSMapMarker
|
|
47
|
-
v-for="location in $props.locations"
|
|
48
|
-
:selected="location.id === $props.selectedLocationId"
|
|
49
|
-
:key="location.id"
|
|
50
|
-
:color="location.color"
|
|
51
|
-
:icon="location.icon"
|
|
52
|
-
:latlng="{lat: location.address.latitude, lng: location.address.longitude}"
|
|
53
|
-
@click="$emit('update:selectedLocationId', location.id)"
|
|
54
|
-
/>
|
|
55
|
-
</FSMapMarkerClusterGroup>
|
|
25
|
+
<slot />
|
|
56
26
|
</template>
|
|
57
27
|
</div>
|
|
58
28
|
|
|
59
29
|
<FSMapLayerButton
|
|
60
30
|
v-if="$props.allowedLayers?.length && $props.allowedLayers.length > 1"
|
|
61
|
-
:
|
|
31
|
+
:disabled="$props.disabled"
|
|
32
|
+
:layers="layers.filter((layer) => $props.allowedLayers?.includes(layer.name) ?? true)"
|
|
62
33
|
:modelValue="$props.currentLayer"
|
|
63
34
|
@update:model-value="$emit('update:currentLayer', $event)"
|
|
64
35
|
/>
|
|
@@ -69,6 +40,7 @@
|
|
|
69
40
|
>
|
|
70
41
|
<FSButton
|
|
71
42
|
v-if="$props.showMyLocation"
|
|
43
|
+
:disabled="$props.disabled"
|
|
72
44
|
icon="mdi-crosshairs-gps"
|
|
73
45
|
color="primary"
|
|
74
46
|
variant="full"
|
|
@@ -83,12 +55,14 @@
|
|
|
83
55
|
gap="0"
|
|
84
56
|
>
|
|
85
57
|
<FSButton
|
|
58
|
+
:disabled="$props.disabled"
|
|
86
59
|
class="fs-map-zoom-plus-button"
|
|
87
60
|
icon="mdi-plus"
|
|
88
61
|
@click="() => map!.zoomIn()"
|
|
89
62
|
:border="false"
|
|
90
63
|
/>
|
|
91
64
|
<FSButton
|
|
65
|
+
:disabled="$props.disabled"
|
|
92
66
|
class="fs-map-zoom-minus-button"
|
|
93
67
|
icon="mdi-minus"
|
|
94
68
|
@click="() => map!.zoomOut()"
|
|
@@ -99,17 +73,19 @@
|
|
|
99
73
|
</FSCol>
|
|
100
74
|
|
|
101
75
|
<FSMapOverlay
|
|
102
|
-
v-if="
|
|
76
|
+
v-if="overlaySlots && Object.keys(overlaySlots).length"
|
|
103
77
|
:mode="$props.overlayMode"
|
|
104
78
|
@update:mode="$emit('update:overlayMode', $event)"
|
|
105
79
|
@update:height="(height) => overlayHeight = height"
|
|
106
80
|
@update:width="(width) => overlayWidth = width"
|
|
107
81
|
>
|
|
108
82
|
<template
|
|
109
|
-
|
|
83
|
+
v-for="(_, name) in overlaySlots"
|
|
84
|
+
v-slot:[name]="slotData"
|
|
110
85
|
>
|
|
111
86
|
<slot
|
|
112
|
-
name="overlay"
|
|
87
|
+
:name="'overlay-' + name"
|
|
88
|
+
v-bind="slotData"
|
|
113
89
|
/>
|
|
114
90
|
</template>
|
|
115
91
|
</FSMapOverlay>
|
|
@@ -120,13 +96,10 @@
|
|
|
120
96
|
import { computed, defineComponent, onMounted, type Ref, provide, type PropType, ref, type StyleValue, watch, onUnmounted, markRaw } from "vue";
|
|
121
97
|
|
|
122
98
|
import type {} from "leaflet.markercluster";
|
|
123
|
-
import { map as createMap, control,
|
|
99
|
+
import { map as createMap, control, latLngBounds, latLng, type LatLng, type FitBoundsOptions, type ZoomPanOptions, type LatLngBounds } from "leaflet";
|
|
124
100
|
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
|
|
128
|
-
import { useBreakpoints, useColors } from "../../composables";
|
|
129
|
-
import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
|
|
101
|
+
import { useBreakpoints, useColors, useMapLayers, useSlots } from "../../composables";
|
|
102
|
+
import { ColorEnum, MapLayers, MapOverlayPositions } from "../../models";
|
|
130
103
|
|
|
131
104
|
import FSMapLayerButton from "./FSMapLayerButton.vue";
|
|
132
105
|
import FSMapOverlay from "./FSMapOverlay.vue";
|
|
@@ -136,19 +109,12 @@ import FSCol from "../FSCol.vue";
|
|
|
136
109
|
|
|
137
110
|
import FSMapMarker from "./FSMapMarker.vue";
|
|
138
111
|
import FSMapTileLayer from "./FSMapTileLayer.vue";
|
|
139
|
-
import FSMapFeatureGroup from "./FSMapFeatureGroup.vue";
|
|
140
|
-
import FSMapMarkerClusterGroup from "./FSMapMarkerClusterGroup.vue";
|
|
141
|
-
import FSMapPolygon from "./FSMapPolygon.vue";
|
|
142
112
|
|
|
143
113
|
export default defineComponent({
|
|
144
114
|
name: "FSMap",
|
|
145
115
|
components: {
|
|
146
116
|
FSMapMarker,
|
|
147
117
|
FSMapTileLayer,
|
|
148
|
-
FSMapFeatureGroup,
|
|
149
|
-
FSMapMarkerClusterGroup,
|
|
150
|
-
FSMapPolygon,
|
|
151
|
-
|
|
152
118
|
FSMapLayerButton,
|
|
153
119
|
FSMapOverlay,
|
|
154
120
|
FSButton,
|
|
@@ -166,15 +132,20 @@ export default defineComponent({
|
|
|
166
132
|
required: false,
|
|
167
133
|
default: '100%'
|
|
168
134
|
},
|
|
135
|
+
disabled: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
required: false,
|
|
138
|
+
default: false
|
|
139
|
+
},
|
|
169
140
|
grayscale: {
|
|
170
141
|
type: Boolean,
|
|
171
142
|
required: false,
|
|
172
143
|
default: false
|
|
173
144
|
},
|
|
174
145
|
overlayMode: {
|
|
175
|
-
type: String as PropType<
|
|
146
|
+
type: String as PropType<MapOverlayPositions>,
|
|
176
147
|
required: false,
|
|
177
|
-
default:
|
|
148
|
+
default: MapOverlayPositions.Collapse
|
|
178
149
|
},
|
|
179
150
|
showMyLocation: {
|
|
180
151
|
type: Boolean,
|
|
@@ -192,50 +163,39 @@ export default defineComponent({
|
|
|
192
163
|
default: false
|
|
193
164
|
},
|
|
194
165
|
center: {
|
|
195
|
-
type: Array as PropType<number[]>,
|
|
196
|
-
required: false,
|
|
197
|
-
default: () => [45.71, 5.07]
|
|
198
|
-
},
|
|
199
|
-
locations: {
|
|
200
|
-
type: Array as PropType<FSLocation[]>,
|
|
166
|
+
type: Array as PropType<number[] | null>,
|
|
201
167
|
required: false,
|
|
202
|
-
default:
|
|
168
|
+
default: null
|
|
203
169
|
},
|
|
204
|
-
|
|
205
|
-
type:
|
|
170
|
+
bounds: {
|
|
171
|
+
type: Object as PropType<LatLngBounds | null>,
|
|
206
172
|
required: false,
|
|
207
|
-
default:
|
|
173
|
+
default: null
|
|
208
174
|
},
|
|
209
175
|
currentLayer: {
|
|
210
|
-
type: String as PropType<
|
|
176
|
+
type: String as PropType<MapLayers>,
|
|
211
177
|
required: false,
|
|
212
|
-
default:
|
|
178
|
+
default: MapLayers.Map
|
|
213
179
|
},
|
|
214
180
|
allowedLayers: {
|
|
215
|
-
type: Array as PropType<
|
|
181
|
+
type: Array as PropType<MapLayers[]>,
|
|
216
182
|
required: false,
|
|
217
|
-
default: () => [
|
|
183
|
+
default: () => [MapLayers.Map, MapLayers.Imagery]
|
|
218
184
|
},
|
|
219
|
-
|
|
220
|
-
type:
|
|
185
|
+
zoom: {
|
|
186
|
+
type: Number,
|
|
221
187
|
required: false,
|
|
222
|
-
default:
|
|
223
|
-
},
|
|
224
|
-
selectedAreaId: {
|
|
225
|
-
type: String as PropType<string | null>,
|
|
226
|
-
required: false,
|
|
227
|
-
default: null
|
|
188
|
+
default: 16
|
|
228
189
|
}
|
|
229
190
|
},
|
|
230
|
-
emits: [
|
|
191
|
+
emits: ['update:overlayMode', 'update:currentLayer', "click:latlng", "update:zoom", "update:center"],
|
|
231
192
|
setup(props, { emit }) {
|
|
232
|
-
const {
|
|
233
|
-
const { getColors } = useColors();
|
|
193
|
+
const { layers } = useMapLayers();
|
|
234
194
|
const { isExtraSmall } = useBreakpoints();
|
|
195
|
+
const { getColors } = useColors();
|
|
196
|
+
const { slots } = useSlots();
|
|
235
197
|
|
|
236
198
|
const leafletContainer = ref<HTMLElement>();
|
|
237
|
-
const locationGroupBounds = ref<LatLngBounds>();
|
|
238
|
-
const areaGroupBounds = ref<LatLngBounds>();
|
|
239
199
|
const gpsPosition : Ref<LatLng | null> = ref(null);
|
|
240
200
|
const map: Ref<L.Map | null> = ref(null);
|
|
241
201
|
const overlayHeight = ref<number>();
|
|
@@ -243,7 +203,6 @@ export default defineComponent({
|
|
|
243
203
|
|
|
244
204
|
provide('map', map);
|
|
245
205
|
|
|
246
|
-
const defaultZoom = 16;
|
|
247
206
|
const mapResizeObserver = new ResizeObserver(() => {
|
|
248
207
|
if(!map.value) {
|
|
249
208
|
return;
|
|
@@ -251,31 +210,8 @@ export default defineComponent({
|
|
|
251
210
|
map.value.invalidateSize();
|
|
252
211
|
});
|
|
253
212
|
|
|
254
|
-
const mapLayers: MapLayer[] = [
|
|
255
|
-
{
|
|
256
|
-
name: "map",
|
|
257
|
-
label: $tr("ui.map.layer.map", "Map"),
|
|
258
|
-
image: new URL("../../assets/images/map/map.png", import.meta.url).href,
|
|
259
|
-
layer: tileLayer(`http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=${import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? ""}`, {
|
|
260
|
-
maxZoom: 22,
|
|
261
|
-
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
|
|
262
|
-
attribution: '© Google Map Data'
|
|
263
|
-
})
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: "imagery",
|
|
267
|
-
label: $tr("ui.map.layer.imagery", "Imagery"),
|
|
268
|
-
image: new URL("../../assets/images/map/imagery.png", import.meta.url).href,
|
|
269
|
-
layer: tileLayer(`http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}&key=${import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? ""}`, {
|
|
270
|
-
maxZoom: 22,
|
|
271
|
-
subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
|
|
272
|
-
attribution: '© Google Map Data'
|
|
273
|
-
})
|
|
274
|
-
}
|
|
275
|
-
];
|
|
276
|
-
|
|
277
213
|
const bottomOffset = computed(() => {
|
|
278
|
-
if (props.overlayMode !==
|
|
214
|
+
if (props.overlayMode !== MapOverlayPositions.Expand && overlayHeight.value && isExtraSmall.value) {
|
|
279
215
|
return overlayHeight.value;
|
|
280
216
|
}
|
|
281
217
|
return 0;
|
|
@@ -297,20 +233,14 @@ export default defineComponent({
|
|
|
297
233
|
}));
|
|
298
234
|
|
|
299
235
|
const actualLayer = computed(() => {
|
|
300
|
-
return
|
|
236
|
+
return layers.find((mapLayer) => mapLayer.name === props.currentLayer)?.layers ?? layers[0].layers;
|
|
301
237
|
});
|
|
302
238
|
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
if(bounds && areaGroupBounds.value) {
|
|
309
|
-
bounds.extend(areaGroupBounds.value);
|
|
310
|
-
} else if(areaGroupBounds.value) {
|
|
311
|
-
bounds = areaGroupBounds.value;
|
|
312
|
-
}
|
|
313
|
-
return bounds as LatLngBounds;
|
|
239
|
+
const overlaySlots = computed(() => {
|
|
240
|
+
return Object.keys(slots).filter((slot) => slot.startsWith("overlay-")).reduce((acc, slot) => {
|
|
241
|
+
acc[slot.replace("overlay-", "")] = slots[slot];
|
|
242
|
+
return acc;
|
|
243
|
+
}, {} as Record<string, unknown>);
|
|
314
244
|
});
|
|
315
245
|
|
|
316
246
|
const calculateTargetPosition = (target: L.LatLng, zoom?: number) => {
|
|
@@ -322,30 +252,55 @@ export default defineComponent({
|
|
|
322
252
|
return map.value.unproject(targetPoint, zoom);
|
|
323
253
|
}
|
|
324
254
|
|
|
325
|
-
const flyTo = (lat: number, lng: number, zoom: number
|
|
255
|
+
const flyTo = (lat: number, lng: number, zoom: number, options?: ZoomPanOptions) => {
|
|
326
256
|
if(!map.value) {
|
|
327
257
|
return;
|
|
328
258
|
}
|
|
329
|
-
|
|
259
|
+
|
|
260
|
+
if(isExtraSmall.value) {
|
|
261
|
+
// We wait for bottom offset to be calculated and stable to focus on the right position
|
|
262
|
+
let tries = 0;
|
|
263
|
+
let oldBottomOffset = bottomOffset.value;
|
|
264
|
+
const interval = setInterval(() => {
|
|
265
|
+
if(oldBottomOffset === bottomOffset.value || tries >= 30) {
|
|
266
|
+
clearInterval(interval);
|
|
267
|
+
map.value!.flyTo(calculateTargetPosition(latLng(lat, lng), zoom), zoom, options);
|
|
268
|
+
}
|
|
269
|
+
oldBottomOffset = bottomOffset.value;
|
|
270
|
+
tries++;
|
|
271
|
+
}, 20);
|
|
272
|
+
|
|
273
|
+
} else {
|
|
274
|
+
map.value.flyTo(calculateTargetPosition(latLng(lat, lng), zoom), zoom, options);
|
|
275
|
+
}
|
|
330
276
|
}
|
|
331
277
|
|
|
332
278
|
const setView = (lat: number, lng: number, zoom: number) => {
|
|
333
279
|
if(!map.value) {
|
|
334
280
|
return;
|
|
335
281
|
}
|
|
336
|
-
map.value.setView(calculateTargetPosition(latLng(lat, lng)), zoom);
|
|
282
|
+
map.value.setView(calculateTargetPosition(latLng(lat, lng), zoom), zoom);
|
|
337
283
|
}
|
|
338
284
|
|
|
339
285
|
const fitBounds = (bounds: LatLngBounds, options?: FitBoundsOptions) => {
|
|
340
|
-
if(!map.value) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
286
|
+
if (!map.value) {return;}
|
|
287
|
+
const paddingTopLeft: [number, number] = [
|
|
288
|
+
leftOffset.value + 24,
|
|
289
|
+
24
|
|
290
|
+
];
|
|
291
|
+
|
|
292
|
+
const paddingBottomRight: [number, number] = [
|
|
293
|
+
24,
|
|
294
|
+
bottomOffset.value + 24
|
|
295
|
+
];
|
|
296
|
+
const paddingOptions = {
|
|
297
|
+
paddingTopLeft,
|
|
298
|
+
paddingBottomRight,
|
|
299
|
+
...options,
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
map.value.fitBounds(bounds, paddingOptions);
|
|
303
|
+
};
|
|
349
304
|
|
|
350
305
|
onMounted(() => {
|
|
351
306
|
if(!leafletContainer.value) {
|
|
@@ -354,22 +309,39 @@ export default defineComponent({
|
|
|
354
309
|
|
|
355
310
|
const mapOptions = {
|
|
356
311
|
zoomControl: false,
|
|
357
|
-
scrollWheelZoom: props.enableScrollWheelZoom,
|
|
312
|
+
scrollWheelZoom: props.enableScrollWheelZoom && !props.disabled,
|
|
313
|
+
dragging: !props.disabled,
|
|
314
|
+
doubleClickZoom: false,
|
|
358
315
|
minZoom: 2,
|
|
359
316
|
maxZoom: 22,
|
|
360
317
|
maxBounds: latLngBounds(latLng(-90, -180), latLng(90, 180)),
|
|
361
|
-
maxBoundsViscosity: 1.0
|
|
362
|
-
|
|
318
|
+
maxBoundsViscosity: 1.0,
|
|
319
|
+
zoom: props.zoom,
|
|
320
|
+
center: props.center ? latLng(props.center[0], props.center[1]) : latLng(48.85782, 2.29521)
|
|
321
|
+
} satisfies L.MapOptions;
|
|
363
322
|
|
|
364
323
|
map.value = markRaw(createMap(leafletContainer.value, mapOptions));
|
|
365
|
-
setView(props.center[0], props.center[1], defaultZoom);
|
|
366
324
|
|
|
367
325
|
map.value.on('click', (e: L.LeafletMouseEvent) => {
|
|
368
326
|
emit('click:latlng', e.latlng);
|
|
369
327
|
});
|
|
370
328
|
|
|
329
|
+
map.value.on('zoomend', () => {
|
|
330
|
+
if(!map.value) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
emit('update:zoom', map.value.getZoom());
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
map.value.on('moveend', () => {
|
|
337
|
+
if(!map.value) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const center = map.value.getCenter();
|
|
341
|
+
emit('update:center', [center.lat, center.lng]);
|
|
342
|
+
});
|
|
343
|
+
|
|
371
344
|
map.value.attributionControl.remove();
|
|
372
|
-
// to display google attribution in bottom left corner
|
|
373
345
|
control.attribution({ position: 'bottomleft' }).addTo(map.value);
|
|
374
346
|
|
|
375
347
|
map.value.on('locationfound', (e: L.LocationEvent) => {
|
|
@@ -383,7 +355,7 @@ export default defineComponent({
|
|
|
383
355
|
return;
|
|
384
356
|
}
|
|
385
357
|
|
|
386
|
-
flyTo(e.latlng.lat, e.latlng.lng);
|
|
358
|
+
flyTo(e.latlng.lat, e.latlng.lng, 14);
|
|
387
359
|
});
|
|
388
360
|
|
|
389
361
|
mapResizeObserver.observe(leafletContainer.value);
|
|
@@ -393,56 +365,72 @@ export default defineComponent({
|
|
|
393
365
|
mapResizeObserver.disconnect();
|
|
394
366
|
});
|
|
395
367
|
|
|
396
|
-
watch (() => props.center, (
|
|
397
|
-
if(!map.value) {
|
|
368
|
+
watch ([() => props.center, () => props.zoom], ([newCenter, newZoom], [oldCenter, oldZoom]) => {
|
|
369
|
+
if(!map.value || !props.center || !newCenter) {
|
|
398
370
|
return;
|
|
399
371
|
}
|
|
400
|
-
setView(center[0], center[1], defaultZoom);
|
|
401
|
-
});
|
|
402
372
|
|
|
403
|
-
|
|
404
|
-
if(!map.value) {
|
|
373
|
+
if(map.value.getZoom() === newZoom && map.value.getCenter().equals(latLng(newCenter[0], newCenter[1]))) {
|
|
405
374
|
return;
|
|
406
375
|
}
|
|
407
|
-
|
|
408
|
-
if(
|
|
409
|
-
|
|
376
|
+
|
|
377
|
+
if((newCenter[0] !== oldCenter?.[0] || newCenter[1] !== oldCenter?.[1]) && newZoom !== oldZoom) {
|
|
378
|
+
setView(newCenter[0], newCenter[1], newZoom);
|
|
379
|
+
}
|
|
380
|
+
else if ((newCenter[0] !== oldCenter?.[0] || newCenter[1] !== oldCenter?.[1])) {
|
|
381
|
+
setView(newCenter[0], newCenter[1], map.value.getZoom());
|
|
382
|
+
}
|
|
383
|
+
else if(newZoom !== oldZoom) {
|
|
384
|
+
map.value.setZoom(newZoom);
|
|
410
385
|
}
|
|
411
|
-
flyTo(selectedLocation?.address.latitude, selectedLocation?.address.longitude);
|
|
412
386
|
}, { immediate: true });
|
|
413
387
|
|
|
414
|
-
watch(() => props.
|
|
415
|
-
if(!map.value) {
|
|
388
|
+
watch([() => props.bounds, () => map.value], () => {
|
|
389
|
+
if(!map.value || !props.bounds) {
|
|
416
390
|
return;
|
|
417
391
|
}
|
|
418
|
-
|
|
419
|
-
|
|
392
|
+
|
|
393
|
+
//console.log("Bounds changed", props.bounds);
|
|
394
|
+
fitBounds(props.bounds, { maxZoom: 14 });
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
watch(() => props.enableScrollWheelZoom, (newValue) => {
|
|
398
|
+
if(!map.value) {
|
|
420
399
|
return;
|
|
421
400
|
}
|
|
422
|
-
|
|
423
|
-
|
|
401
|
+
if(newValue) {
|
|
402
|
+
map.value.scrollWheelZoom.enable();
|
|
403
|
+
} else {
|
|
404
|
+
map.value.scrollWheelZoom.disable();
|
|
405
|
+
}
|
|
424
406
|
}, { immediate: true });
|
|
425
407
|
|
|
426
|
-
watch(
|
|
427
|
-
if(!map.value
|
|
408
|
+
watch(() => props.disabled, (newValue) => {
|
|
409
|
+
if(!map.value) {
|
|
428
410
|
return;
|
|
429
411
|
}
|
|
430
|
-
|
|
431
|
-
|
|
412
|
+
if(newValue) {
|
|
413
|
+
map.value.dragging.disable();
|
|
414
|
+
map.value.scrollWheelZoom.disable();
|
|
415
|
+
} else {
|
|
416
|
+
map.value.dragging.enable();
|
|
417
|
+
if(props.enableScrollWheelZoom) {
|
|
418
|
+
map.value.scrollWheelZoom.enable();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}, { immediate: true });
|
|
432
422
|
|
|
433
423
|
return {
|
|
434
424
|
ColorEnum,
|
|
435
|
-
defaultZoom,
|
|
436
425
|
leafletContainer,
|
|
437
|
-
locationGroupBounds,
|
|
438
426
|
overlayHeight,
|
|
439
427
|
overlayWidth,
|
|
440
|
-
areaGroupBounds,
|
|
441
428
|
map,
|
|
442
429
|
actualLayer,
|
|
443
|
-
|
|
430
|
+
layers,
|
|
444
431
|
gpsPosition,
|
|
445
|
-
style
|
|
432
|
+
style,
|
|
433
|
+
overlaySlots
|
|
446
434
|
};
|
|
447
435
|
}
|
|
448
436
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
6
|
-
import { inject, provide, ref, type Ref } from 'vue';
|
|
6
|
+
import { inject, provide, ref, type Ref, onUnmounted } from 'vue';
|
|
7
7
|
|
|
8
8
|
import { type Map, FeatureGroup } from 'leaflet';
|
|
9
9
|
import { MAP } from './keys';
|
|
@@ -46,6 +46,12 @@ export default {
|
|
|
46
46
|
emit("update:bounds", featureGroup.value.getBounds());
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
|
|
50
|
+
onUnmounted(() => {
|
|
51
|
+
if (map.value && map.value.hasLayer(featureGroup.value as unknown as FeatureGroup)) {
|
|
52
|
+
map.value.removeLayer(featureGroup.value as unknown as FeatureGroup);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
49
55
|
}
|
|
50
56
|
};
|
|
51
57
|
</script>
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
icon="mdi-layers-outline"
|
|
5
5
|
:elevation="true"
|
|
6
6
|
@click="dialog = true"
|
|
7
|
+
v-bind="$attrs"
|
|
7
8
|
/>
|
|
8
9
|
<FSDialog
|
|
9
10
|
v-model="dialog"
|
|
10
|
-
|
|
11
|
-
:
|
|
11
|
+
:title="$tr('ui.map-layer.select', 'Select layer')"
|
|
12
|
+
:contained="true"
|
|
12
13
|
>
|
|
13
14
|
<template
|
|
14
15
|
v-slot:body
|
|
15
16
|
>
|
|
16
17
|
<FSRow
|
|
17
18
|
align="center-center"
|
|
18
|
-
|
|
19
|
+
:wrap="false"
|
|
19
20
|
>
|
|
20
21
|
<FSImageCard
|
|
21
22
|
v-for="layer in layers"
|