@m3ui-vue/m3ui-vue 1.8.0 → 1.9.0
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/dist/API.md +34 -19
- package/dist/MButton-LiZRRP4h.js +171 -0
- package/dist/MButton-LiZRRP4h.js.map +1 -0
- package/dist/{MColorPickerModal-H8nuX0Wu.js → MColorPickerModal-IjciC8zh.js} +185 -184
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/MDialog-BLpfgIA3.js +167 -0
- package/dist/MDialog-BLpfgIA3.js.map +1 -0
- package/dist/MIcon-BSsJZhK7.js +116 -0
- package/dist/MIcon-BSsJZhK7.js.map +1 -0
- package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
- package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
- package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
- package/dist/MListItem-BBQ-6i3v.js.map +1 -0
- package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
- package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
- package/dist/MMenuItem-E31tMzOt.js +577 -0
- package/dist/MMenuItem-E31tMzOt.js.map +1 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js +1866 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js.map +1 -0
- package/dist/MProgressBar-CPrZhQbA.js +179 -0
- package/dist/MProgressBar-CPrZhQbA.js.map +1 -0
- package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
- package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
- package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
- package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
- package/dist/MSignaturePad-Bqr-1R9f.js +140 -0
- package/dist/MSignaturePad-Bqr-1R9f.js.map +1 -0
- package/dist/MSlider-B7dIcHVn.js +745 -0
- package/dist/MSlider-B7dIcHVn.js.map +1 -0
- package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
- package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
- package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
- package/dist/MTextField-CryHMs8-.js.map +1 -0
- package/dist/MTooltip-Cn_DYm9M.js +90 -0
- package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
- package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
- package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
- package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
- package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +129 -128
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
- package/dist/components/MBadge.vue.d.ts +2 -2
- package/dist/components/MBar.vue.d.ts +1 -1
- package/dist/components/MBeforeAfter.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MContainerTransform.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +1 -1
- package/dist/components/MCreditCardInput.vue.d.ts +2 -2
- package/dist/components/MDiffViewer.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +2 -2
- package/dist/components/MExpansionPanel.vue.d.ts +1 -1
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +1 -1
- package/dist/components/MFilterBuilder.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +2 -2
- package/dist/components/MFormRenderer.vue.d.ts +2 -2
- package/dist/components/MGantt.vue.d.ts +2 -2
- package/dist/components/MGanttControls.vue.d.ts +1 -1
- package/dist/components/MGrid.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -5
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MMapMeasure.vue.d.ts +2 -2
- package/dist/components/MMenu.vue.d.ts +6 -3
- package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MOdontogram.vue.d.ts +2 -2
- package/dist/components/MPdfSigner.vue.d.ts +1 -1
- package/dist/components/MPhoneInput.vue.d.ts +2 -2
- package/dist/components/MPinInput.vue.d.ts +3 -3
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MProductConfigurator.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +2 -2
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchBar.vue.d.ts +2 -2
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeatMap.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +2 -2
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +2 -2
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSubtitle.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +3 -3
- package/dist/components/MTimeScroll.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +2 -2
- package/dist/components/MVitalsChart.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
- package/dist/composables/_fieldLayout.d.ts +8 -8
- package/dist/composables/_popupPosition.d.ts +3 -2
- package/dist/composables/_rtl.d.ts +26 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +4 -0
- package/dist/draw.js +5 -5
- package/dist/flow.js +2 -2
- package/dist/gantt.js +3 -3
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +768 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +11962 -12039
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +1127 -1149
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/media.js +7 -7
- package/dist/pdf-sign.d.ts +3 -0
- package/dist/pdf-sign.js +548 -0
- package/dist/pdf-sign.js.map +1 -0
- package/dist/pdf.d.ts +0 -3
- package/dist/pdf.js +1 -2400
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -77
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +5 -2
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
- package/dist/useLocale-ybIju59R.js.map +1 -0
- package/dist/vTooltip-xESB2YOb.js +154 -0
- package/dist/vTooltip-xESB2YOb.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MAddressField.test.ts +1 -1
- package/src/__tests__/MChip.test.ts +3 -3
- package/src/__tests__/MFab.test.ts +6 -6
- package/src/__tests__/MListItemNestedControl.test.ts +2 -2
- package/src/__tests__/MScheduler.test.ts +1 -1
- package/src/__tests__/MTrackingTimeline.test.ts +1 -1
- package/src/__tests__/MWindow.test.ts +16 -0
- package/src/__tests__/fieldOverflow.test.ts +9 -9
- package/src/__tests__/hydration.test.ts +39 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/rtl.test.ts +167 -0
- package/src/__tests__/ssr.test.ts +6 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MAutocomplete.vue +7 -7
- package/src/components/MAvailabilityCalendar.vue +5 -3
- package/src/components/MBadge.vue +12 -3
- package/src/components/MBar.vue +1 -1
- package/src/components/MBottomAppBar.vue +1 -1
- package/src/components/MCalendar.vue +3 -3
- package/src/components/MCalendarHeatmap.vue +3 -3
- package/src/components/MChatBubble.vue +3 -3
- package/src/components/MChip.vue +6 -6
- package/src/components/MCodeEditor.vue +7 -3
- package/src/components/MColorPicker.vue +1 -1
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContainerTransform.vue +1 -1
- package/src/components/MContextMenu.vue +1 -1
- package/src/components/MDataTable.vue +5 -5
- package/src/components/MDatePicker.vue +3 -2
- package/src/components/MDateRangePicker.vue +3 -2
- package/src/components/MDialog.vue +5 -5
- package/src/components/MDiffViewer.vue +1 -1
- package/src/components/MDivider.vue +1 -1
- package/src/components/MDragDropList.vue +1 -1
- package/src/components/MEmojiSelector.vue +11 -7
- package/src/components/MExpansionPanel.vue +1 -1
- package/src/components/MFab.vue +5 -5
- package/src/components/MFormBuilder.vue +3 -3
- package/src/components/MIcon.vue +14 -2
- package/src/components/MJsonEditor.vue +1 -3
- package/src/components/MJsonViewer.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MListDetail.vue +2 -2
- package/src/components/MListGroup.vue +1 -1
- package/src/components/MListItem.vue +5 -5
- package/src/components/MListSubheader.vue +1 -1
- package/src/components/MMapDraw.vue +3 -2
- package/src/components/MMapHover.vue +2 -1
- package/src/components/MMapMeasure.vue +2 -1
- package/src/components/MMapRoute.vue +2 -1
- package/src/components/MMarkdown.vue +9 -6
- package/src/components/MMaskField.vue +6 -6
- package/src/components/MMenu.vue +13 -6
- package/src/components/MMenuItem.vue +8 -6
- package/src/components/MMultiAutocomplete.vue +9 -8
- package/src/components/MMultiSelect.vue +9 -8
- package/src/components/MNavigationDrawer.vue +39 -27
- package/src/components/MNavigationRail.vue +28 -19
- package/src/components/MNavigationSuite.vue +1 -1
- package/src/components/MNotificationCenter.vue +1 -1
- package/src/components/MNotificationHost.vue +1 -1
- package/src/components/MNumberField.vue +6 -6
- package/src/components/MOrderTicket.vue +1 -1
- package/src/components/MPageProgress.vue +1 -1
- package/src/components/MPdfSigner.vue +1 -1
- package/src/components/MPhoneInput.vue +5 -4
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MPosKeypad.vue +2 -1
- package/src/components/MProductConfigurator.vue +2 -1
- package/src/components/MProgressBar.vue +2 -2
- package/src/components/MRichTextEditor.vue +8 -4
- package/src/components/MScheduler.vue +14 -14
- package/src/components/MSearchField.vue +1 -1
- package/src/components/MSeatMap.vue +2 -1
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSelect.vue +7 -7
- package/src/components/MSideSheet.vue +3 -2
- package/src/components/MSimpleCarousel.vue +20 -11
- package/src/components/MSlider.vue +15 -5
- package/src/components/MSnackbar.vue +2 -2
- package/src/components/MSplitButton.vue +3 -2
- package/src/components/MSplitter.vue +6 -3
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +5 -5
- package/src/components/MTable.vue +3 -3
- package/src/components/MTabs.vue +4 -1
- package/src/components/MTagInput.vue +6 -6
- package/src/components/MTerminal.vue +1 -1
- package/src/components/MText.vue +1 -1
- package/src/components/MTextField.vue +7 -7
- package/src/components/MTimePicker.vue +3 -2
- package/src/components/MTimePickerModal.vue +2 -2
- package/src/components/MTimeScroll.vue +1 -1
- package/src/components/MTimeline.vue +12 -12
- package/src/components/MToolbar.vue +3 -3
- package/src/components/MTrackingTimeline.vue +3 -2
- package/src/components/MTransition.vue +8 -3
- package/src/components/MTreeTable.vue +1 -1
- package/src/components/MTypewriter.vue +1 -1
- package/src/components/MVirtualTable.vue +2 -2
- package/src/components/MWindow.vue +4 -3
- package/src/components/_MColorPanel.vue +5 -4
- package/src/components/_MDrawerItemList.vue +9 -5
- package/src/components/_MMapAttribution.vue +2 -1
- package/src/components/_MMonthYearButton.vue +1 -1
- package/src/components/_MTransferPane.vue +8 -1
- package/src/components/_MTreeNode.vue +3 -3
- package/src/components/_MYearGrid.vue +4 -2
- package/src/composables/_fieldLayout.ts +19 -19
- package/src/composables/_popupPosition.ts +5 -3
- package/src/composables/_rtl.ts +76 -0
- package/src/composables/_useMenuNav.ts +24 -17
- package/src/composables/_useSheetMotion.ts +10 -3
- package/src/composables/pdfSign.ts +2 -2
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/ar.ts +798 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/zh.ts +2 -0
- package/src/pdf-sign.ts +5 -0
- package/src/pdf.ts +0 -3
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-H8nuX0Wu.js.map +0 -1
- package/dist/MDialog-B42Mhn8W.js +0 -331
- package/dist/MDialog-B42Mhn8W.js.map +0 -1
- package/dist/MIcon-DpajuUTJ.js +0 -33
- package/dist/MIcon-DpajuUTJ.js.map +0 -1
- package/dist/MListItem-DiOAxaN7.js.map +0 -1
- package/dist/MMenuItem-BuxYoASE.js +0 -574
- package/dist/MMenuItem-BuxYoASE.js.map +0 -1
- package/dist/MSignaturePad-BTqGaPXA.js +0 -313
- package/dist/MSignaturePad-BTqGaPXA.js.map +0 -1
- package/dist/MSlider-D_O8J9YH.js +0 -739
- package/dist/MSlider-D_O8J9YH.js.map +0 -1
- package/dist/MTextField-CYk9yFvi.js.map +0 -1
- package/dist/MTooltip-CK39Zon4.js +0 -183
- package/dist/MTooltip-CK39Zon4.js.map +0 -1
- package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
- package/dist/pdf.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
package/dist/map.js
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import { t as e } from "./MIcon-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as s } from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as u } from "./
|
|
8
|
-
import { t as d } from "./
|
|
9
|
-
import { t as f } from "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as b } from "./
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { t as e } from "./MIcon-BSsJZhK7.js";
|
|
2
|
+
import { t } from "./vTooltip-xESB2YOb.js";
|
|
3
|
+
import { i as n } from "./motion-BcejVTeX.js";
|
|
4
|
+
import { d as r, f as i, l as a, t as o, u as s } from "./MIconButton-CNjN0xwW.js";
|
|
5
|
+
import { i as c } from "./useLocale-ybIju59R.js";
|
|
6
|
+
import { o as l } from "./_storageKeys-C4W_4xK4.js";
|
|
7
|
+
import { t as u } from "./useThemeTokens-DyAdPQB0.js";
|
|
8
|
+
import { t as d } from "./MTextField-CryHMs8-.js";
|
|
9
|
+
import { t as f } from "./MSlider-B7dIcHVn.js";
|
|
10
|
+
import { t as p } from "./MTooltip-Cn_DYm9M.js";
|
|
11
|
+
import { n as m, r as h } from "./_popupPosition-C_lxj9qU.js";
|
|
12
|
+
import { a as g, l as _, n as v, s as y, t as b } from "./MListItem-BBQ-6i3v.js";
|
|
13
|
+
import { t as x } from "./MSpinner-CXLY7lWw.js";
|
|
14
|
+
import { n as S, t as C } from "./_useFieldValidation-CvZnZfl-.js";
|
|
15
|
+
import { Fragment as w, Teleport as T, Transition as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createSlots as M, createTextVNode as N, createVNode as P, defineComponent as F, getCurrentInstance as I, inject as L, markRaw as R, mergeProps as z, nextTick as ee, normalizeClass as B, normalizeStyle as te, onBeforeUnmount as ne, onMounted as V, onUnmounted as re, openBlock as H, provide as U, reactive as W, ref as G, renderList as ie, renderSlot as K, shallowRef as q, toDisplayString as J, toValue as Y, unref as X, useId as ae, useSlots as oe, watch as Z, watchEffect as se, withCtx as Q, withDirectives as ce, withModifiers as le } from "vue";
|
|
15
16
|
// src/composables/useMap.ts
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
|
|
17
|
+
var ue;
|
|
18
|
+
function de(e) {
|
|
19
|
+
ue = e;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
21
|
+
function fe() {
|
|
22
|
+
return ue;
|
|
22
23
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
let t =
|
|
24
|
+
var pe = Symbol("m3-map");
|
|
25
|
+
function me(e) {
|
|
26
|
+
let t = L(pe, null);
|
|
26
27
|
if (t || e === void 0) return t;
|
|
27
|
-
let n =
|
|
28
|
-
let t =
|
|
28
|
+
let n = D(() => {
|
|
29
|
+
let t = Y(e);
|
|
29
30
|
return t ? "context" in t ? t.context : t : void 0;
|
|
30
31
|
}), r = {
|
|
31
|
-
map:
|
|
32
|
-
maplibre:
|
|
33
|
-
styleVersion:
|
|
34
|
-
model:
|
|
32
|
+
map: D(() => n.value?.map.value),
|
|
33
|
+
maplibre: D(() => n.value?.maplibre.value),
|
|
34
|
+
styleVersion: D(() => n.value?.styleVersion.value ?? 0),
|
|
35
|
+
model: D(() => n.value?.model.value),
|
|
35
36
|
layerState: new Proxy({
|
|
36
37
|
visible: {},
|
|
37
38
|
opacity: {}
|
|
38
39
|
}, { get: (e, t) => Reflect.get(n.value?.layerState ?? e, t) }),
|
|
39
|
-
activeTool:
|
|
40
|
+
activeTool: D({
|
|
40
41
|
get: () => n.value?.activeTool.value ?? null,
|
|
41
42
|
set: (e) => {
|
|
42
43
|
n.value && (n.value.activeTool.value = e);
|
|
43
44
|
}
|
|
44
45
|
})
|
|
45
46
|
};
|
|
46
|
-
return
|
|
47
|
+
return U(pe, r), r;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
let t =
|
|
49
|
+
function he(e) {
|
|
50
|
+
let t = me(e);
|
|
50
51
|
if (!t) throw Error("useMap() must be called in a component inside <MMap>, or be given one");
|
|
51
52
|
let n = [];
|
|
52
|
-
|
|
53
|
+
I() && ne(() => n.splice(0).forEach((e) => e()));
|
|
53
54
|
function r(e) {
|
|
54
55
|
let r = () => {
|
|
55
56
|
if (t.map.value && t.maplibre.value) return e(t.map.value, t.maplibre.value);
|
|
56
|
-
let r =
|
|
57
|
+
let r = Z(t.map, (n) => {
|
|
57
58
|
n && t.maplibre.value && (r(), e(n, t.maplibre.value));
|
|
58
59
|
});
|
|
59
60
|
n.push(r);
|
|
60
|
-
}, i =
|
|
61
|
-
i && !i.isMounted ?
|
|
61
|
+
}, i = I();
|
|
62
|
+
i && !i.isMounted ? V(r) : r();
|
|
62
63
|
}
|
|
63
64
|
function i(e, t) {
|
|
64
65
|
r((r) => {
|
|
@@ -71,9 +72,9 @@ function me(e) {
|
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
return {
|
|
74
|
-
map:
|
|
75
|
-
maplibre:
|
|
76
|
-
styleVersion:
|
|
75
|
+
map: D(() => t.map.value),
|
|
76
|
+
maplibre: D(() => t.maplibre.value),
|
|
77
|
+
styleVersion: D(() => t.styleVersion.value),
|
|
77
78
|
activeTool: t.activeTool,
|
|
78
79
|
onReady: r,
|
|
79
80
|
on: i,
|
|
@@ -81,10 +82,10 @@ function me(e) {
|
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
// src/components/MMapControl.vue?vue&type=script&setup=true&lang.ts
|
|
84
|
-
var
|
|
85
|
+
var ge = { class: "hidden" }, _e = {
|
|
85
86
|
key: 0,
|
|
86
87
|
class: "m3-map-control-panel-in"
|
|
87
|
-
},
|
|
88
|
+
}, ve = /* @__PURE__ */ F({
|
|
88
89
|
inheritAttrs: !1,
|
|
89
90
|
__name: "MMapControl",
|
|
90
91
|
props: {
|
|
@@ -103,12 +104,12 @@ var he = { class: "hidden" }, ge = {
|
|
|
103
104
|
}
|
|
104
105
|
},
|
|
105
106
|
emits: ["update:expanded"],
|
|
106
|
-
setup(e, { emit:
|
|
107
|
-
let
|
|
108
|
-
|
|
107
|
+
setup(e, { emit: t }) {
|
|
108
|
+
let o = e, c = t, l = oe(), u = G(), { onReady: d } = he(), f = G(o.expanded);
|
|
109
|
+
Z(() => o.expanded, (e) => {
|
|
109
110
|
f.value = e;
|
|
110
111
|
});
|
|
111
|
-
let p =
|
|
112
|
+
let p = D(() => f.value && !!l.panel);
|
|
112
113
|
function m(e) {
|
|
113
114
|
e !== f.value && (f.value = e, c("update:expanded", e));
|
|
114
115
|
}
|
|
@@ -132,110 +133,105 @@ var he = { class: "hidden" }, ge = {
|
|
|
132
133
|
h: u.value.offsetHeight
|
|
133
134
|
};
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
+
function E() {
|
|
136
137
|
let e = u.value;
|
|
137
138
|
if (!e || b) return;
|
|
138
139
|
let t = T();
|
|
139
|
-
y && (t.w !== y.w || t.h !== y.h) &&
|
|
140
|
+
y && (t.w !== y.w || t.h !== y.h) && o.animate && !s() && O(e, y, t), y = t;
|
|
140
141
|
}
|
|
141
|
-
function O(e,
|
|
142
|
-
if (S =
|
|
143
|
-
width: `${
|
|
144
|
-
height: `${
|
|
145
|
-
})), !b) return
|
|
146
|
-
b.onfinish = () =>
|
|
142
|
+
function O(e, t, r) {
|
|
143
|
+
if (S = t, C = r, x = i(0, 1, 0, n.standard.defaultSpatial, .002), e.style.overflow = "hidden", b = a(e, x, (e) => ({
|
|
144
|
+
width: `${t.w + (r.w - t.w) * e}px`,
|
|
145
|
+
height: `${t.h + (r.h - t.h) * e}px`
|
|
146
|
+
})), !b) return k(e);
|
|
147
|
+
b.onfinish = () => k(e);
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function k(e) {
|
|
149
150
|
b?.cancel(), b = null, e.style.overflow = "";
|
|
150
151
|
let t = T();
|
|
151
|
-
t.w !== C.w || t.h !== C.h ? (y = C,
|
|
152
|
+
t.w !== C.w || t.h !== C.h ? (y = C, E()) : y = t;
|
|
152
153
|
}
|
|
153
154
|
function M() {
|
|
154
155
|
if (!u.value || !b) return;
|
|
155
|
-
let e =
|
|
156
|
+
let e = r(x, b.currentTime), t = {
|
|
156
157
|
w: S.w + (C.w - S.w) * e,
|
|
157
158
|
h: S.h + (C.h - S.h) * e
|
|
158
159
|
};
|
|
159
|
-
b.onfinish = null, b.cancel(), b = null, y = t,
|
|
160
|
+
b.onfinish = null, b.cancel(), b = null, y = t, E();
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
+
Z(p, M, { flush: "post" });
|
|
162
163
|
let N, P = {
|
|
163
164
|
onAdd: () => u.value,
|
|
164
165
|
onRemove: () => u.value?.remove()
|
|
165
166
|
};
|
|
166
167
|
return d((e) => {
|
|
167
|
-
N = e, u.value && e.addControl(P,
|
|
168
|
-
}),
|
|
168
|
+
N = e, u.value && e.addControl(P, o.position);
|
|
169
|
+
}), Z(() => o.position, (e) => {
|
|
169
170
|
N && u.value && (N.removeControl(P), N.addControl(P, e));
|
|
170
|
-
}),
|
|
171
|
-
document.addEventListener("pointerdown", _, !0), typeof ResizeObserver < "u" && u.value && (w = new ResizeObserver(
|
|
171
|
+
}), V(() => {
|
|
172
|
+
document.addEventListener("pointerdown", _, !0), typeof ResizeObserver < "u" && u.value && (w = new ResizeObserver(E), w.observe(u.value));
|
|
172
173
|
}), ne(() => {
|
|
173
174
|
document.removeEventListener("pointerdown", _, !0), w?.disconnect(), b?.cancel(), N?.hasControl(P) && N.removeControl(P);
|
|
174
|
-
}), (t, n) => (
|
|
175
|
+
}), (t, n) => (H(), A("div", ge, [j("div", z({
|
|
175
176
|
ref_key: "el",
|
|
176
177
|
ref: u,
|
|
177
178
|
class: ["maplibregl-ctrl m3-map-control", p.value ? "m3-map-control-panel" : e.group ? "maplibregl-ctrl-group" : ""]
|
|
178
|
-
}, t.$attrs, { onKeydown: v }), [p.value ? (
|
|
179
|
+
}, t.$attrs, { onKeydown: v }), [p.value ? (H(), A("div", _e, [K(t.$slots, "panel", { close: g })])) : K(t.$slots, "default", {
|
|
179
180
|
expanded: f.value,
|
|
180
181
|
toggle: h
|
|
181
182
|
}, void 0, void 0, 1)], 16)]));
|
|
182
183
|
}
|
|
183
|
-
}),
|
|
184
|
-
"title",
|
|
185
|
-
"aria-label",
|
|
186
|
-
"aria-expanded"
|
|
187
|
-
], ye = ["innerHTML"], be = /* @__PURE__ */ P({
|
|
184
|
+
}), ye = ["aria-label", "aria-expanded"], be = ["innerHTML"], xe = /* @__PURE__ */ F({
|
|
188
185
|
__name: "_MMapAttribution",
|
|
189
186
|
props: { position: {} },
|
|
190
|
-
setup(
|
|
191
|
-
let
|
|
192
|
-
function
|
|
193
|
-
if (!
|
|
194
|
-
let e =
|
|
187
|
+
setup(n) {
|
|
188
|
+
let r = n, i = c(), { on: a, onReady: o } = he(), s = G([]), l = G(!0), u = G(0), d;
|
|
189
|
+
function f() {
|
|
190
|
+
if (!d) return;
|
|
191
|
+
let e = d.getStyle?.();
|
|
195
192
|
if (!e?.sources) return;
|
|
196
193
|
let t = new Set(e.layers?.map((e) => e.source).filter(Boolean)), n = [];
|
|
197
194
|
for (let [r, i] of Object.entries(e.sources)) {
|
|
198
195
|
if (t.size && !t.has(r)) continue;
|
|
199
|
-
let e =
|
|
196
|
+
let e = d.getSource(r)?.attribution ?? i.attribution;
|
|
200
197
|
e && !n.includes(e) && n.push(e);
|
|
201
198
|
}
|
|
202
199
|
let r = n.filter((e) => !n.some((t) => t !== e && t.includes(e)));
|
|
203
|
-
r.join("\n") !==
|
|
200
|
+
r.join("\n") !== s.value.join("\n") && (s.value = r), u.value = Math.max(0, d.getContainer().clientWidth - 20);
|
|
204
201
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}),
|
|
208
|
-
|
|
202
|
+
o((e) => {
|
|
203
|
+
d = e, f();
|
|
204
|
+
}), a("styledata", f), a("sourcedata", f), a("resize", f), a("dragstart", () => {
|
|
205
|
+
l.value = !1;
|
|
209
206
|
});
|
|
210
|
-
let
|
|
211
|
-
return (
|
|
207
|
+
let p = D(() => s.value.join(" ")), m = D(() => r.position.endsWith("right"));
|
|
208
|
+
return (r, a) => p.value ? (H(), O(ve, {
|
|
212
209
|
key: 0,
|
|
213
|
-
position:
|
|
210
|
+
position: n.position,
|
|
214
211
|
group: !1,
|
|
215
|
-
class:
|
|
212
|
+
class: B(["m3-map-attrib", l.value ? "m3-map-attrib-open" : ""])
|
|
216
213
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
class:
|
|
219
|
-
style: te(
|
|
220
|
-
}, [A("button", {
|
|
214
|
+
default: Q(() => [j("div", {
|
|
215
|
+
class: B(["m3-map-attrib-row", m.value ? "flex-row-reverse" : ""]),
|
|
216
|
+
style: te(u.value ? { maxWidth: `${u.value}px` } : void 0)
|
|
217
|
+
}, [ce((H(), A("button", {
|
|
221
218
|
type: "button",
|
|
222
219
|
class: "m3-map-attrib-button",
|
|
223
|
-
|
|
224
|
-
"aria-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}, [N(e, {
|
|
220
|
+
"aria-label": X(i).mapToggleAttribution,
|
|
221
|
+
"aria-expanded": l.value,
|
|
222
|
+
onClick: a[0] ||= (e) => l.value = !l.value
|
|
223
|
+
}, [P(e, {
|
|
228
224
|
name: "info",
|
|
229
225
|
size: 20
|
|
230
|
-
})], 8,
|
|
226
|
+
})], 8, ye)), [[X(t), X(i).mapToggleAttribution]]), l.value ? (H(), A("div", {
|
|
231
227
|
key: 0,
|
|
232
|
-
class:
|
|
233
|
-
innerHTML:
|
|
234
|
-
}, null, 10,
|
|
228
|
+
class: B(["m3-map-attrib-text", m.value ? "pl-3.5" : "pr-3.5"]),
|
|
229
|
+
innerHTML: p.value
|
|
230
|
+
}, null, 10, be)) : k("", !0)], 6)]),
|
|
235
231
|
_: 1
|
|
236
|
-
}, 8, ["position", "class"])) :
|
|
232
|
+
}, 8, ["position", "class"])) : k("", !0);
|
|
237
233
|
}
|
|
238
|
-
}),
|
|
234
|
+
}), Se = {
|
|
239
235
|
fill: ["fill-opacity"],
|
|
240
236
|
line: ["line-opacity"],
|
|
241
237
|
circle: ["circle-opacity", "circle-stroke-opacity"],
|
|
@@ -244,27 +240,27 @@ var he = { class: "hidden" }, ge = {
|
|
|
244
240
|
heatmap: ["heatmap-opacity"],
|
|
245
241
|
"fill-extrusion": ["fill-extrusion-opacity"]
|
|
246
242
|
};
|
|
247
|
-
function
|
|
248
|
-
return
|
|
243
|
+
function Ce() {
|
|
244
|
+
return W({
|
|
249
245
|
visible: {},
|
|
250
246
|
opacity: {}
|
|
251
247
|
});
|
|
252
248
|
}
|
|
253
|
-
function
|
|
249
|
+
function we(e, t, n) {
|
|
254
250
|
let r = {}, i = {};
|
|
255
251
|
for (let e of n?.layers ?? []) {
|
|
256
252
|
let n = t.getLayer(e.id);
|
|
257
253
|
if (!n) continue;
|
|
258
254
|
r[e.id] = t.getLayoutProperty(e.id, "visibility") !== "none";
|
|
259
|
-
let a =
|
|
255
|
+
let a = Se[n.type]?.[0], o = a ? t.getPaintProperty(e.id, a) : void 0;
|
|
260
256
|
i[e.id] = typeof o == "number" ? o : 1;
|
|
261
257
|
}
|
|
262
258
|
e.visible = r, e.opacity = i;
|
|
263
259
|
}
|
|
264
|
-
function
|
|
265
|
-
let t =
|
|
260
|
+
function Te(e) {
|
|
261
|
+
let t = me(e);
|
|
266
262
|
if (!t) throw Error("useMapLayers() must be called in a component inside <MMap>, or be given one");
|
|
267
|
-
let { map: n, model: r, layerState: i } = t, a =
|
|
263
|
+
let { map: n, model: r, layerState: i } = t, a = D(() => r.value?.layers ?? []), o = D(() => new Map(a.value.map((e) => [e.id, e])));
|
|
268
264
|
function s(e) {
|
|
269
265
|
return i.visible[e] ?? !0;
|
|
270
266
|
}
|
|
@@ -281,7 +277,7 @@ function Ce(e) {
|
|
|
281
277
|
}
|
|
282
278
|
function d(e, t) {
|
|
283
279
|
let r = n.value, a = r?.getLayer(e);
|
|
284
|
-
if (a) for (let n of
|
|
280
|
+
if (a) for (let n of Se[a.type] ?? []) r.setPaintProperty(e, n, t);
|
|
285
281
|
i.opacity[e] = t;
|
|
286
282
|
for (let n of o.value.get(e)?.children ?? []) d(n, t);
|
|
287
283
|
}
|
|
@@ -295,12 +291,12 @@ function Ce(e) {
|
|
|
295
291
|
function m(e, t) {
|
|
296
292
|
for (let n of f(e)) c(n.id, t);
|
|
297
293
|
}
|
|
298
|
-
let h =
|
|
294
|
+
let h = D(() => a.value.filter((e) => e.base)), g = D(() => h.value.find((e) => s(e.id))?.id ?? null);
|
|
299
295
|
function _(e) {
|
|
300
296
|
for (let t of h.value) c(t.id, t.id === e);
|
|
301
297
|
}
|
|
302
298
|
return {
|
|
303
|
-
model:
|
|
299
|
+
model: D(() => r.value),
|
|
304
300
|
layers: a,
|
|
305
301
|
isVisible: s,
|
|
306
302
|
setVisible: c,
|
|
@@ -322,7 +318,7 @@ function $(e) {
|
|
|
322
318
|
layers: new Set((e?.layers ?? []).map((e) => e.id))
|
|
323
319
|
};
|
|
324
320
|
}
|
|
325
|
-
function
|
|
321
|
+
function Ee(e, t, n, r = () => !0) {
|
|
326
322
|
if (!e) return t;
|
|
327
323
|
let i = new Set(t.layers.map((e) => e.id)), a = e.layers.filter((e) => !n.layers.has(e.id) && !i.has(e.id) && r(e)), o = { ...t.sources };
|
|
328
324
|
for (let [t, r] of Object.entries(e.sources)) !n.sources.has(t) && !(t in o) && (o[t] = r);
|
|
@@ -333,7 +329,7 @@ function we(e, t, n, r = () => !0) {
|
|
|
333
329
|
};
|
|
334
330
|
}
|
|
335
331
|
// src/components/MMap.vue?vue&type=script&setup=true&lang.ts
|
|
336
|
-
var
|
|
332
|
+
var De = 600, Oe = /* @__PURE__ */ F({
|
|
337
333
|
__name: "MMap",
|
|
338
334
|
props: {
|
|
339
335
|
mapStyle: {},
|
|
@@ -383,19 +379,19 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
383
379
|
"update:pitch"
|
|
384
380
|
],
|
|
385
381
|
setup(e, { expose: t, emit: n }) {
|
|
386
|
-
let r = e, i = n, a =
|
|
387
|
-
map:
|
|
382
|
+
let r = e, i = n, a = G(), o = G(), s = q(), u = q(), d = G(0), f, p = q(), m = Ce(), h = {
|
|
383
|
+
map: s,
|
|
388
384
|
maplibre: u,
|
|
389
385
|
styleVersion: d,
|
|
390
386
|
model: p,
|
|
391
387
|
layerState: m,
|
|
392
|
-
activeTool:
|
|
388
|
+
activeTool: G(null)
|
|
393
389
|
};
|
|
394
|
-
|
|
390
|
+
U(pe, h);
|
|
395
391
|
function g(e) {
|
|
396
|
-
p.value = r.adapter ? r.adapter(e.getStyle(), { styleUrl: typeof r.mapStyle == "string" ? r.mapStyle : void 0 }) : void 0,
|
|
392
|
+
p.value = r.adapter ? r.adapter(e.getStyle(), { styleUrl: typeof r.mapStyle == "string" ? r.mapStyle : void 0 }) : void 0, we(m, e, p.value);
|
|
397
393
|
}
|
|
398
|
-
let _ =
|
|
394
|
+
let _ = c(), v = () => typeof r.persist == "string" ? r.persist : r.persist ? l("m3-map-view") : null;
|
|
399
395
|
function y() {
|
|
400
396
|
let e = v();
|
|
401
397
|
if (!e) return {};
|
|
@@ -440,7 +436,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
440
436
|
}
|
|
441
437
|
}, S = /* @__PURE__ */ new Map();
|
|
442
438
|
function C(e) {
|
|
443
|
-
let t =
|
|
439
|
+
let t = s.value, n = u.value;
|
|
444
440
|
if (!t || !n) return;
|
|
445
441
|
let i = S.get(e);
|
|
446
442
|
i && (t.removeControl(i), S.delete(e));
|
|
@@ -449,7 +445,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
449
445
|
let o = x[e].create(n);
|
|
450
446
|
t.addControl(o, a === !0 ? x[e].corner : a), S.set(e, o);
|
|
451
447
|
}
|
|
452
|
-
for (let e of Object.keys(x))
|
|
448
|
+
for (let e of Object.keys(x)) Z(() => r[e], () => C(e));
|
|
453
449
|
function w() {
|
|
454
450
|
return {
|
|
455
451
|
"AttributionControl.ToggleAttribution": _.mapToggleAttribution,
|
|
@@ -469,8 +465,8 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
469
465
|
"CooperativeGesturesHandler.MobileHelpText": _.mapTwoFingers
|
|
470
466
|
};
|
|
471
467
|
}
|
|
472
|
-
let
|
|
473
|
-
function
|
|
468
|
+
let T = G(null), D, M;
|
|
469
|
+
function N(e) {
|
|
474
470
|
let t = e.getAttribute("title");
|
|
475
471
|
t && e.closest(".maplibregl-ctrl") && (e.setAttribute("data-m3-tip", t), e.hasAttribute("aria-label") || e.setAttribute("aria-label", t), e.removeAttribute("title"));
|
|
476
472
|
}
|
|
@@ -478,7 +474,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
478
474
|
let t = e.getAttribute("data-m3-tip"), n = a.value?.getBoundingClientRect();
|
|
479
475
|
if (!t || !n) return;
|
|
480
476
|
let r = e.getBoundingClientRect(), i = r.left + r.width / 2 > n.left + n.width / 2;
|
|
481
|
-
|
|
477
|
+
T.value = {
|
|
482
478
|
text: t,
|
|
483
479
|
left: i,
|
|
484
480
|
x: (i ? r.left - 8 : r.right + 8) - n.left,
|
|
@@ -486,26 +482,26 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
486
482
|
};
|
|
487
483
|
}
|
|
488
484
|
function I() {
|
|
489
|
-
clearTimeout(
|
|
485
|
+
clearTimeout(D), T.value = null;
|
|
490
486
|
}
|
|
491
|
-
let
|
|
492
|
-
function
|
|
493
|
-
let t =
|
|
494
|
-
t && e.pointerType !== "touch" && (clearTimeout(
|
|
487
|
+
let L = (e) => e.target?.closest?.(".maplibregl-ctrl [data-m3-tip]") ?? null;
|
|
488
|
+
function z(e) {
|
|
489
|
+
let t = L(e);
|
|
490
|
+
t && e.pointerType !== "touch" && (clearTimeout(D), D = setTimeout(() => F(t), De));
|
|
495
491
|
}
|
|
496
|
-
function
|
|
497
|
-
let t =
|
|
492
|
+
function ee(e) {
|
|
493
|
+
let t = L(e);
|
|
498
494
|
t && !t.contains(e.relatedTarget) && I();
|
|
499
495
|
}
|
|
500
|
-
function
|
|
501
|
-
let t =
|
|
496
|
+
function W(e) {
|
|
497
|
+
let t = L(e);
|
|
502
498
|
t?.matches(":focus-visible") && F(t);
|
|
503
499
|
}
|
|
504
|
-
|
|
500
|
+
V(() => {
|
|
505
501
|
let e = a.value;
|
|
506
|
-
e && (e.querySelectorAll("[title]").forEach(
|
|
507
|
-
for (let t of e) t.type === "attributes" ?
|
|
508
|
-
e instanceof Element && (
|
|
502
|
+
e && (e.querySelectorAll("[title]").forEach(N), M = new MutationObserver((e) => {
|
|
503
|
+
for (let t of e) t.type === "attributes" ? N(t.target) : t.addedNodes.forEach((e) => {
|
|
504
|
+
e instanceof Element && (N(e), e.querySelectorAll("[title]").forEach(N));
|
|
509
505
|
});
|
|
510
506
|
}), M.observe(e, {
|
|
511
507
|
subtree: !0,
|
|
@@ -514,119 +510,119 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
514
510
|
attributeFilter: ["title"]
|
|
515
511
|
}));
|
|
516
512
|
}), ne(() => {
|
|
517
|
-
M?.disconnect(), clearTimeout(
|
|
513
|
+
M?.disconnect(), clearTimeout(D);
|
|
518
514
|
});
|
|
519
|
-
let
|
|
520
|
-
|
|
515
|
+
let ie = !1;
|
|
516
|
+
V(async () => {
|
|
521
517
|
let e = await import("maplibre-gl"), t = "Map" in e ? e : e.default;
|
|
522
|
-
if (
|
|
523
|
-
let n = r.workerUrl ??
|
|
518
|
+
if (ie || !o.value) return;
|
|
519
|
+
let n = r.workerUrl ?? fe();
|
|
524
520
|
n && t.setWorkerUrl(n);
|
|
525
|
-
let a = y(),
|
|
521
|
+
let a = y(), c = {
|
|
526
522
|
center: a.center ?? r.center,
|
|
527
523
|
zoom: a.zoom ?? r.zoom,
|
|
528
524
|
bearing: a.bearing ?? r.bearing,
|
|
529
525
|
pitch: a.pitch ?? r.pitch
|
|
530
|
-
},
|
|
526
|
+
}, l = R(new t.Map({
|
|
531
527
|
container: o.value,
|
|
532
528
|
style: r.mapStyle,
|
|
533
529
|
attributionControl: !1,
|
|
534
530
|
locale: w(),
|
|
535
|
-
...Object.fromEntries(Object.entries(
|
|
531
|
+
...Object.fromEntries(Object.entries(c).filter(([, e]) => e !== void 0)),
|
|
536
532
|
...r.options
|
|
537
533
|
}));
|
|
538
|
-
u.value = t,
|
|
539
|
-
f ||= $(
|
|
540
|
-
}),
|
|
541
|
-
let e = b(
|
|
534
|
+
u.value = t, l.on("style.load", () => {
|
|
535
|
+
f ||= $(l.getStyle()), g(l), d.value++;
|
|
536
|
+
}), l.on("click", (e) => i("click", e)), l.on("moveend", () => {
|
|
537
|
+
let e = b(l);
|
|
542
538
|
i("update:center", e.center), i("update:zoom", e.zoom), i("update:bearing", e.bearing), i("update:pitch", e.pitch);
|
|
543
539
|
let t = v();
|
|
544
540
|
if (t) try {
|
|
545
541
|
localStorage.setItem(t, JSON.stringify(e));
|
|
546
542
|
} catch {}
|
|
547
|
-
}),
|
|
548
|
-
|
|
543
|
+
}), l.once("load", () => {
|
|
544
|
+
s.value = l;
|
|
549
545
|
for (let e of Object.keys(x)) C(e);
|
|
550
|
-
i("ready",
|
|
546
|
+
i("ready", l);
|
|
551
547
|
});
|
|
552
548
|
}), re(() => {
|
|
553
|
-
|
|
549
|
+
ie = !0, s.value?.remove(), s.value = void 0;
|
|
554
550
|
});
|
|
555
|
-
let
|
|
556
|
-
return
|
|
557
|
-
let e =
|
|
551
|
+
let Y = (e, t) => Math.abs(e - t) < 1e-9;
|
|
552
|
+
return Z(() => r.center?.join(","), () => {
|
|
553
|
+
let e = s.value;
|
|
558
554
|
if (!e || !r.center) return;
|
|
559
555
|
let t = e.getCenter();
|
|
560
|
-
|
|
561
|
-
}),
|
|
562
|
-
|
|
563
|
-
}),
|
|
564
|
-
|
|
565
|
-
}),
|
|
566
|
-
|
|
567
|
-
}),
|
|
568
|
-
|
|
569
|
-
}),
|
|
556
|
+
Y(t.lng, r.center[0]) && Y(t.lat, r.center[1]) || e.jumpTo({ center: r.center });
|
|
557
|
+
}), Z(() => r.zoom, (e) => {
|
|
558
|
+
s.value && e !== void 0 && !Y(s.value.getZoom(), e) && s.value.jumpTo({ zoom: e });
|
|
559
|
+
}), Z(() => r.bearing, (e) => {
|
|
560
|
+
s.value && e !== void 0 && !Y(s.value.getBearing(), e) && s.value.jumpTo({ bearing: e });
|
|
561
|
+
}), Z(() => r.pitch, (e) => {
|
|
562
|
+
s.value && e !== void 0 && !Y(s.value.getPitch(), e) && s.value.jumpTo({ pitch: e });
|
|
563
|
+
}), Z(() => r.adapter, () => {
|
|
564
|
+
s.value && g(s.value);
|
|
565
|
+
}), Z(() => r.mapStyle, (e) => s.value?.setStyle(e, {
|
|
570
566
|
diff: !1,
|
|
571
567
|
transformStyle: (e, t) => {
|
|
572
568
|
let n = f ?? $(void 0);
|
|
573
569
|
f = $(t);
|
|
574
|
-
let i = r.keepLayers, a = i === !1 ? t :
|
|
570
|
+
let i = r.keepLayers, a = i === !1 ? t : Ee(e, t, n, typeof i == "function" ? i : void 0);
|
|
575
571
|
return r.transformStyle && (a = r.transformStyle(e, a)), a;
|
|
576
572
|
}
|
|
577
573
|
})), t({
|
|
578
|
-
map:
|
|
574
|
+
map: s,
|
|
579
575
|
context: h
|
|
580
|
-
}), (t, n) => (
|
|
576
|
+
}), (t, n) => (H(), A("div", {
|
|
581
577
|
ref_key: "root",
|
|
582
578
|
ref: a,
|
|
583
579
|
class: "m3-map relative overflow-hidden",
|
|
584
|
-
onPointerover:
|
|
585
|
-
onPointerout:
|
|
580
|
+
onPointerover: z,
|
|
581
|
+
onPointerout: ee,
|
|
586
582
|
onPointerdown: I,
|
|
587
|
-
onFocusin:
|
|
583
|
+
onFocusin: W,
|
|
588
584
|
onFocusout: I
|
|
589
585
|
}, [
|
|
590
|
-
|
|
586
|
+
j("div", {
|
|
591
587
|
ref_key: "container",
|
|
592
588
|
ref: o,
|
|
593
589
|
class: "h-full w-full"
|
|
594
590
|
}, null, 512),
|
|
595
|
-
|
|
591
|
+
s.value && e.attribution ? (H(), O(xe, {
|
|
596
592
|
key: 0,
|
|
597
593
|
position: e.attribution === !0 ? "bottom-right" : e.attribution
|
|
598
|
-
}, null, 8, ["position"])) :
|
|
599
|
-
|
|
600
|
-
|
|
594
|
+
}, null, 8, ["position"])) : k("", !0),
|
|
595
|
+
s.value ? K(t.$slots, "default", {}, void 0, void 0, 1) : k("", !0),
|
|
596
|
+
P(E, {
|
|
601
597
|
"enter-active-class": "transition-opacity duration-150",
|
|
602
598
|
"enter-from-class": "opacity-0",
|
|
603
599
|
"leave-active-class": "transition-opacity duration-100",
|
|
604
600
|
"leave-to-class": "opacity-0"
|
|
605
601
|
}, {
|
|
606
|
-
default:
|
|
602
|
+
default: Q(() => [T.value ? (H(), A("div", {
|
|
607
603
|
key: 0,
|
|
608
604
|
role: "tooltip",
|
|
609
|
-
class:
|
|
605
|
+
class: B(["pointer-events-none absolute z-10 min-h-6 max-w-[200px] -translate-y-1/2 rounded bg-inverse-surface px-2 py-1 text-body-small whitespace-nowrap text-inverse-on-surface", T.value.left ? "-translate-x-full" : ""]),
|
|
610
606
|
style: te({
|
|
611
|
-
left: `${
|
|
612
|
-
top: `${
|
|
607
|
+
left: `${T.value.x}px`,
|
|
608
|
+
top: `${T.value.y}px`
|
|
613
609
|
})
|
|
614
|
-
},
|
|
610
|
+
}, J(T.value.text), 7)) : k("", !0)]),
|
|
615
611
|
_: 1
|
|
616
612
|
})
|
|
617
613
|
], 544));
|
|
618
614
|
}
|
|
619
|
-
}),
|
|
615
|
+
}), ke = 13.5, Ae = ke / Math.SQRT2, je = [0, -14], Me = {
|
|
620
616
|
center: [0, 0],
|
|
621
617
|
top: [0, 0],
|
|
622
618
|
"top-left": [0, 0],
|
|
623
619
|
"top-right": [0, 0],
|
|
624
620
|
bottom: [0, -38.1],
|
|
625
|
-
"bottom-left": [
|
|
626
|
-
"bottom-right": [-
|
|
627
|
-
left: [
|
|
621
|
+
"bottom-left": [Ae, (24.6 + Ae) * -1],
|
|
622
|
+
"bottom-right": [-Ae, (24.6 + Ae) * -1],
|
|
623
|
+
left: [ke, -24.6],
|
|
628
624
|
right: [-13.5, -24.6]
|
|
629
|
-
},
|
|
625
|
+
}, Ne = { class: "hidden" }, Pe = /* @__PURE__ */ F({
|
|
630
626
|
inheritAttrs: !1,
|
|
631
627
|
__name: "MMapMarker",
|
|
632
628
|
props: {
|
|
@@ -642,7 +638,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
642
638
|
},
|
|
643
639
|
emits: ["update:lngLat", "click"],
|
|
644
640
|
setup(e, { expose: t, emit: n }) {
|
|
645
|
-
let r = e, i = n, a =
|
|
641
|
+
let r = e, i = n, a = oe(), o = G(), s = G(), { onReady: c } = he(), l, u = !1;
|
|
646
642
|
c((e, t) => {
|
|
647
643
|
u = !!a.default && !!o.value, l = new t.Marker({
|
|
648
644
|
...u ? { element: o.value } : { color: r.color ?? "currentColor" },
|
|
@@ -661,20 +657,20 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
661
657
|
function d(e) {
|
|
662
658
|
i("click", e);
|
|
663
659
|
}
|
|
664
|
-
return
|
|
660
|
+
return Z(() => r.lngLat.join(","), () => l?.setLngLat(r.lngLat)), Z(() => r.draggable, (e) => l?.setDraggable(e)), Z(() => r.rotation, (e) => l?.setRotation(e)), Z(() => r.offset?.join(","), () => l?.setOffset(r.offset ?? (u ? [0, 0] : je))), ne(() => {
|
|
665
661
|
l?.getElement().removeEventListener("click", d), l?.getPopup()?.remove(), l?.remove();
|
|
666
|
-
}), t({ marker: () => l }), (e, t) => (
|
|
662
|
+
}), t({ marker: () => l }), (e, t) => (H(), A("div", Ne, [e.$slots.default ? (H(), A("div", z({
|
|
667
663
|
key: 0,
|
|
668
664
|
ref_key: "content",
|
|
669
665
|
ref: o,
|
|
670
666
|
class: "m3-map-marker"
|
|
671
|
-
}, e.$attrs), [
|
|
667
|
+
}, e.$attrs), [K(e.$slots, "default")], 16)) : k("", !0), e.$slots.popup ? (H(), A("div", {
|
|
672
668
|
key: 1,
|
|
673
669
|
ref_key: "popupContent",
|
|
674
670
|
ref: s
|
|
675
|
-
}, [
|
|
671
|
+
}, [K(e.$slots, "popup")], 512)) : k("", !0)]));
|
|
676
672
|
}
|
|
677
|
-
}),
|
|
673
|
+
}), Fe = { class: "hidden" }, Ie = /* @__PURE__ */ F({
|
|
678
674
|
inheritAttrs: !1,
|
|
679
675
|
__name: "MMapPopup",
|
|
680
676
|
props: {
|
|
@@ -697,7 +693,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
697
693
|
},
|
|
698
694
|
emits: ["update:open"],
|
|
699
695
|
setup(e, { expose: t, emit: n }) {
|
|
700
|
-
let r = e, i = n, a =
|
|
696
|
+
let r = e, i = n, a = G(), { onReady: o } = he(), s, c, l = !1;
|
|
701
697
|
function u() {
|
|
702
698
|
s && c && !s.isOpen() && s.setLngLat(r.lngLat).addTo(c);
|
|
703
699
|
}
|
|
@@ -713,16 +709,16 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
713
709
|
}), a.value && s.setDOMContent(a.value), s.on("close", () => {
|
|
714
710
|
l || i("update:open", !1);
|
|
715
711
|
}), r.open && u();
|
|
716
|
-
}),
|
|
712
|
+
}), Z(() => r.open, (e) => {
|
|
717
713
|
e ? u() : s?.isOpen() && (l = !0, s.remove(), l = !1);
|
|
718
|
-
}),
|
|
714
|
+
}), Z(() => r.lngLat.join(","), () => s?.setLngLat(r.lngLat)), Z(() => r.maxWidth, (e) => s?.setMaxWidth(e)), Z(() => r.offset, (e) => s?.setOffset(e ?? 0)), ne(() => {
|
|
719
715
|
l = !0, s?.remove();
|
|
720
|
-
}), t({ popup: () => s }), (e, t) => (
|
|
716
|
+
}), t({ popup: () => s }), (e, t) => (H(), A("div", Fe, [j("div", z({
|
|
721
717
|
ref_key: "content",
|
|
722
718
|
ref: a
|
|
723
|
-
}, e.$attrs), [
|
|
719
|
+
}, e.$attrs), [K(e.$slots, "default")], 16)]));
|
|
724
720
|
}
|
|
725
|
-
}),
|
|
721
|
+
}), Le = /* @__PURE__ */ F({
|
|
726
722
|
inheritAttrs: !1,
|
|
727
723
|
__name: "MMapGeoJson",
|
|
728
724
|
props: {
|
|
@@ -738,19 +734,19 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
738
734
|
},
|
|
739
735
|
emits: ["click"],
|
|
740
736
|
setup(e, { expose: t, emit: n }) {
|
|
741
|
-
let r = e, i = n, a = r.id ?? `m3-geojson-${
|
|
737
|
+
let r = e, i = n, a = r.id ?? `m3-geojson-${ae()}`, { onReady: o, styleVersion: s } = he(), c = u(["primary", "surface"]), l = (...e) => [
|
|
742
738
|
"match",
|
|
743
739
|
["geometry-type"],
|
|
744
740
|
e,
|
|
745
741
|
!0,
|
|
746
742
|
!1
|
|
747
|
-
], d =
|
|
743
|
+
], d = D(() => {
|
|
748
744
|
let { primary: e, surface: t } = c.value;
|
|
749
745
|
return [
|
|
750
746
|
{
|
|
751
747
|
id: `${a}-fill`,
|
|
752
748
|
type: "fill",
|
|
753
|
-
filter:
|
|
749
|
+
filter: l("Polygon", "MultiPolygon"),
|
|
754
750
|
paint: {
|
|
755
751
|
"fill-color": e,
|
|
756
752
|
"fill-opacity": .24
|
|
@@ -759,7 +755,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
759
755
|
{
|
|
760
756
|
id: `${a}-line`,
|
|
761
757
|
type: "line",
|
|
762
|
-
filter:
|
|
758
|
+
filter: l("Polygon", "MultiPolygon", "LineString", "MultiLineString"),
|
|
763
759
|
paint: {
|
|
764
760
|
"line-color": e,
|
|
765
761
|
"line-width": 2
|
|
@@ -768,7 +764,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
768
764
|
{
|
|
769
765
|
id: `${a}-circle`,
|
|
770
766
|
type: "circle",
|
|
771
|
-
filter:
|
|
767
|
+
filter: l("Point", "MultiPoint"),
|
|
772
768
|
paint: {
|
|
773
769
|
"circle-color": e,
|
|
774
770
|
"circle-radius": 6,
|
|
@@ -777,7 +773,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
777
773
|
}
|
|
778
774
|
}
|
|
779
775
|
];
|
|
780
|
-
}), f =
|
|
776
|
+
}), f = D(() => (r.layers ?? d.value).map((e, t) => ({
|
|
781
777
|
...e,
|
|
782
778
|
id: e.id ?? `${a}-${t}`,
|
|
783
779
|
source: a
|
|
@@ -807,14 +803,14 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
807
803
|
}
|
|
808
804
|
return o((e) => {
|
|
809
805
|
p = e, b();
|
|
810
|
-
}),
|
|
806
|
+
}), Z(s, () => b()), Z(() => r.data, (e) => (p?.getSource(a))?.setData(e)), Z(() => JSON.stringify(f.value), () => y()), Z(() => r.before, () => y()), ne(() => {
|
|
811
807
|
p &&= (v(), p.getSource(a) && p.removeSource(a), void 0);
|
|
812
808
|
}), t({
|
|
813
809
|
sourceId: a,
|
|
814
810
|
layerIds: () => [...m]
|
|
815
811
|
}), (e, t) => null;
|
|
816
812
|
}
|
|
817
|
-
}),
|
|
813
|
+
}), Re = ["aria-label", "onClick"], ze = /* @__PURE__ */ F({
|
|
818
814
|
inheritAttrs: !1,
|
|
819
815
|
__name: "MMapCluster",
|
|
820
816
|
props: {
|
|
@@ -837,12 +833,12 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
837
833
|
},
|
|
838
834
|
emits: ["click", "cluster-click"],
|
|
839
835
|
setup(e, { expose: t, emit: n }) {
|
|
840
|
-
let r = e, i = n, a = r.id ?? `m3-cluster-${
|
|
836
|
+
let r = e, i = n, a = r.id ?? `m3-cluster-${ae()}`, o = c(), { onReady: s, styleVersion: l } = he(), d = u([
|
|
841
837
|
"primary",
|
|
842
838
|
"secondary",
|
|
843
839
|
"tertiary",
|
|
844
840
|
"surface"
|
|
845
|
-
]), f = ["!", ["has", "point_count"]], p =
|
|
841
|
+
]), f = ["!", ["has", "point_count"]], p = D(() => {
|
|
846
842
|
let e = d.value[r.color];
|
|
847
843
|
return (r.pointLayers ?? [{
|
|
848
844
|
type: "circle",
|
|
@@ -866,14 +862,14 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
866
862
|
function h(e) {
|
|
867
863
|
return e < 10 ? 32 : e < 100 ? 40 : e < 1e3 ? 48 : 56;
|
|
868
864
|
}
|
|
869
|
-
let g =
|
|
865
|
+
let g = D(() => {
|
|
870
866
|
let e = typeof document < "u" && document.documentElement.lang || void 0;
|
|
871
867
|
return new Intl.NumberFormat(e, {
|
|
872
868
|
notation: "compact",
|
|
873
869
|
maximumFractionDigits: 1
|
|
874
870
|
});
|
|
875
|
-
}), _, v, y = [], b = /* @__PURE__ */ new Map(), x =
|
|
876
|
-
function
|
|
871
|
+
}), _, v, y = [], b = /* @__PURE__ */ new Map(), x = q([]), S = () => _?.getSource(a);
|
|
872
|
+
function C(e, t, n) {
|
|
877
873
|
return {
|
|
878
874
|
id: e,
|
|
879
875
|
count: t,
|
|
@@ -888,8 +884,8 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
888
884
|
leaves: async (t = Infinity) => await S()?.getClusterLeaves(e, t, 0) ?? []
|
|
889
885
|
};
|
|
890
886
|
}
|
|
891
|
-
function
|
|
892
|
-
if (
|
|
887
|
+
function E() {
|
|
888
|
+
if (k = 0, !_ || !v || !_.getSource(a)) return;
|
|
893
889
|
let e = /* @__PURE__ */ new Set();
|
|
894
890
|
for (let t of _.querySourceFeatures(a, { filter: ["has", "point_count"] })) {
|
|
895
891
|
let n = t.properties, r = n.cluster_id;
|
|
@@ -908,7 +904,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
908
904
|
anchor: "center"
|
|
909
905
|
}).setLngLat([i, a]).addTo(_);
|
|
910
906
|
b.set(r, {
|
|
911
|
-
...
|
|
907
|
+
...C(r, n.point_count, [i, a]),
|
|
912
908
|
el: s,
|
|
913
909
|
marker: c
|
|
914
910
|
});
|
|
@@ -916,9 +912,9 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
916
912
|
for (let [t, n] of b) e.has(t) || (n.marker.remove(), b.delete(t));
|
|
917
913
|
x.value = [...b.values()];
|
|
918
914
|
}
|
|
919
|
-
let
|
|
915
|
+
let k = 0;
|
|
920
916
|
function M() {
|
|
921
|
-
|
|
917
|
+
k ||= requestAnimationFrame(E);
|
|
922
918
|
}
|
|
923
919
|
let N = (e) => {
|
|
924
920
|
e.sourceId === a && M();
|
|
@@ -939,7 +935,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
939
935
|
for (let e of p.value) _.addLayer(e, r.before && _.getLayer(r.before) ? r.before : void 0), _.on("click", e.id, P), _.on("mouseenter", e.id, F), _.on("mouseleave", e.id, I), y.push(e.id);
|
|
940
936
|
}
|
|
941
937
|
}
|
|
942
|
-
function
|
|
938
|
+
function z() {
|
|
943
939
|
return {
|
|
944
940
|
type: "geojson",
|
|
945
941
|
data: r.data,
|
|
@@ -949,22 +945,22 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
949
945
|
clusterMaxZoom: r.maxZoom
|
|
950
946
|
};
|
|
951
947
|
}
|
|
952
|
-
function
|
|
953
|
-
_ && (_.getSource(a) || (_.addSource(a,
|
|
948
|
+
function ee() {
|
|
949
|
+
_ && (_.getSource(a) || (_.addSource(a, z()), y = []), y.length && _.getLayer(y[0]) || R(), M());
|
|
954
950
|
}
|
|
955
|
-
function
|
|
956
|
-
_ && (L(), _.getSource(a) && _.removeSource(a),
|
|
951
|
+
function V() {
|
|
952
|
+
_ && (L(), _.getSource(a) && _.removeSource(a), ee());
|
|
957
953
|
}
|
|
958
|
-
|
|
959
|
-
_ = e, v = t,
|
|
960
|
-
}),
|
|
954
|
+
s((e, t) => {
|
|
955
|
+
_ = e, v = t, ee(), _.on("sourcedata", N), _.on("move", M), _.on("moveend", M);
|
|
956
|
+
}), Z(l, () => ee()), Z(() => r.data, (e) => {
|
|
961
957
|
S()?.setData(e), M();
|
|
962
|
-
}),
|
|
958
|
+
}), Z(() => [
|
|
963
959
|
r.radius,
|
|
964
960
|
r.maxZoom,
|
|
965
961
|
JSON.stringify(r.sourceOptions)
|
|
966
|
-
].join("|"),
|
|
967
|
-
function
|
|
962
|
+
].join("|"), V), Z(() => JSON.stringify(p.value), () => R()), Z(() => r.before, () => R());
|
|
963
|
+
function re(e) {
|
|
968
964
|
let t = {
|
|
969
965
|
id: e.id,
|
|
970
966
|
count: e.count,
|
|
@@ -976,7 +972,7 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
976
972
|
}
|
|
977
973
|
let U = (e) => o.mapClusterZoom.replace("{count}", String(e));
|
|
978
974
|
return ne(() => {
|
|
979
|
-
|
|
975
|
+
k && cancelAnimationFrame(k);
|
|
980
976
|
for (let e of b.values()) e.marker.remove();
|
|
981
977
|
b.clear(), x.value = [], _ &&= (_.off("sourcedata", N), _.off("move", M), _.off("moveend", M), L(), _.getSource(a) && _.removeSource(a), void 0);
|
|
982
978
|
}), t({
|
|
@@ -989,62 +985,62 @@ var Te = 600, Ee = /* @__PURE__ */ P({
|
|
|
989
985
|
zoomIn: r,
|
|
990
986
|
leaves: i
|
|
991
987
|
}))
|
|
992
|
-
}), (t, n) => (
|
|
988
|
+
}), (t, n) => (H(!0), A(w, null, ie(x.value, (n) => (H(), O(T, {
|
|
993
989
|
key: n.id,
|
|
994
990
|
to: n.el
|
|
995
|
-
}, [
|
|
991
|
+
}, [K(t.$slots, "cluster", {
|
|
996
992
|
id: n.id,
|
|
997
993
|
count: n.count,
|
|
998
994
|
label: g.value.format(n.count),
|
|
999
995
|
lngLat: n.lngLat,
|
|
1000
996
|
zoomIn: n.zoomIn,
|
|
1001
997
|
leaves: n.leaves
|
|
1002
|
-
}, () => [
|
|
998
|
+
}, () => [j("button", {
|
|
1003
999
|
type: "button",
|
|
1004
|
-
class:
|
|
1000
|
+
class: B(["m3-map-cluster__bubble relative grid cursor-pointer place-items-center rounded-full border-2 border-surface text-label-large font-medium shadow-elevation-1 outline-none transition-[transform,box-shadow] duration-150 after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:opacity-0 after:transition-opacity hover:shadow-elevation-2 hover:after:opacity-8 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-secondary active:after:opacity-10", m[e.color]]),
|
|
1005
1001
|
style: te({
|
|
1006
1002
|
width: `${h(n.count)}px`,
|
|
1007
1003
|
height: `${h(n.count)}px`
|
|
1008
1004
|
}),
|
|
1009
1005
|
"aria-label": U(n.count),
|
|
1010
|
-
onClick:
|
|
1011
|
-
},
|
|
1006
|
+
onClick: le((e) => re(n), ["stop"])
|
|
1007
|
+
}, J(g.value.format(n.count)), 15, Re)])], 8, ["to"]))), 128));
|
|
1012
1008
|
}
|
|
1013
|
-
}),
|
|
1014
|
-
function
|
|
1015
|
-
let n = (t[1] - e[1]) *
|
|
1016
|
-
return 2 *
|
|
1009
|
+
}), Be = 6371008.8, Ve = Math.PI / 180;
|
|
1010
|
+
function He(e, t) {
|
|
1011
|
+
let n = (t[1] - e[1]) * Ve, r = (t[0] - e[0]) * Ve, i = Math.sin(n / 2) ** 2 + Math.cos(e[1] * Ve) * Math.cos(t[1] * Ve) * Math.sin(r / 2) ** 2;
|
|
1012
|
+
return 2 * Be * Math.asin(Math.min(1, Math.sqrt(i)));
|
|
1017
1013
|
}
|
|
1018
|
-
function
|
|
1014
|
+
function Ue(e) {
|
|
1019
1015
|
let t = 0;
|
|
1020
|
-
for (let n = 1; n < e.length; n++) t +=
|
|
1016
|
+
for (let n = 1; n < e.length; n++) t += He(e[n - 1], e[n]);
|
|
1021
1017
|
return t;
|
|
1022
1018
|
}
|
|
1023
|
-
function
|
|
1019
|
+
function We(e, t) {
|
|
1024
1020
|
let [n, r, i, a] = [
|
|
1025
|
-
e[0] *
|
|
1026
|
-
e[1] *
|
|
1027
|
-
t[0] *
|
|
1028
|
-
t[1] *
|
|
1021
|
+
e[0] * Ve,
|
|
1022
|
+
e[1] * Ve,
|
|
1023
|
+
t[0] * Ve,
|
|
1024
|
+
t[1] * Ve
|
|
1029
1025
|
], o = Math.cos(a) * Math.cos(i - n), s = Math.cos(a) * Math.sin(i - n), c = Math.atan2(Math.sin(r) + Math.sin(a), Math.sqrt((Math.cos(r) + o) ** 2 + s ** 2));
|
|
1030
|
-
return [(n + Math.atan2(s, Math.cos(r) + o)) /
|
|
1026
|
+
return [(n + Math.atan2(s, Math.cos(r) + o)) / Ve, c / Ve];
|
|
1031
1027
|
}
|
|
1032
|
-
function
|
|
1033
|
-
let t =
|
|
1028
|
+
function Ge(e) {
|
|
1029
|
+
let t = Ke(e), n = t.length - 1;
|
|
1034
1030
|
if (n <= 2) return 0;
|
|
1035
1031
|
let r = 0;
|
|
1036
1032
|
for (let e = 0; e < n; e++) {
|
|
1037
1033
|
let i = t[e], a = t[e + 1 === n ? 0 : e + 1], o = t[e + 2 >= n ? (e + 2) % n : e + 2];
|
|
1038
|
-
r += (o[0] - i[0]) *
|
|
1034
|
+
r += (o[0] - i[0]) * Ve * Math.sin(a[1] * Ve);
|
|
1039
1035
|
}
|
|
1040
|
-
return Math.abs(r *
|
|
1036
|
+
return Math.abs(r * Be * Be / 2);
|
|
1041
1037
|
}
|
|
1042
|
-
function
|
|
1038
|
+
function Ke(e) {
|
|
1043
1039
|
let t = e[0], n = e[e.length - 1];
|
|
1044
1040
|
return t && n && (t[0] !== n[0] || t[1] !== n[1]) ? [...e, t] : e;
|
|
1045
1041
|
}
|
|
1046
|
-
function
|
|
1047
|
-
let t =
|
|
1042
|
+
function qe(e) {
|
|
1043
|
+
let t = Ke(e), n = 0, r = 0, i = 0;
|
|
1048
1044
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1049
1045
|
let [a, o] = t[e], [s, c] = t[e + 1], l = a * c - s * o;
|
|
1050
1046
|
n += l, r += (a + s) * l, i += (o + c) * l;
|
|
@@ -1056,17 +1052,17 @@ function Ge(e) {
|
|
|
1056
1052
|
return [r / (3 * n), i / (3 * n)];
|
|
1057
1053
|
}
|
|
1058
1054
|
// src/composables/_routeGeometry.ts
|
|
1059
|
-
var
|
|
1060
|
-
function
|
|
1055
|
+
var Je = Math.PI / 180;
|
|
1056
|
+
function Ye(e) {
|
|
1061
1057
|
let t = [0];
|
|
1062
|
-
for (let n = 1; n < e.length; n++) t.push(t[n - 1] +
|
|
1058
|
+
for (let n = 1; n < e.length; n++) t.push(t[n - 1] + He(e[n - 1], e[n]));
|
|
1063
1059
|
return t;
|
|
1064
1060
|
}
|
|
1065
|
-
function
|
|
1066
|
-
let n = e[1] *
|
|
1067
|
-
return (Math.atan2(a, o) /
|
|
1061
|
+
function Xe(e, t) {
|
|
1062
|
+
let n = e[1] * Je, r = t[1] * Je, i = (t[0] - e[0]) * Je, a = Math.sin(i) * Math.cos(r), o = Math.cos(n) * Math.sin(r) - Math.sin(n) * Math.cos(r) * Math.cos(i);
|
|
1063
|
+
return (Math.atan2(a, o) / Je + 360) % 360;
|
|
1068
1064
|
}
|
|
1069
|
-
function
|
|
1065
|
+
function Ze(e, t) {
|
|
1070
1066
|
let n = 0, r = e.length - 1;
|
|
1071
1067
|
for (; r - n > 1;) {
|
|
1072
1068
|
let i = n + r >> 1;
|
|
@@ -1074,7 +1070,7 @@ function Ye(e, t) {
|
|
|
1074
1070
|
}
|
|
1075
1071
|
return n;
|
|
1076
1072
|
}
|
|
1077
|
-
function
|
|
1073
|
+
function Qe(e, t, n) {
|
|
1078
1074
|
if (e.length === 0) return {
|
|
1079
1075
|
lngLat: [0, 0],
|
|
1080
1076
|
bearing: 0
|
|
@@ -1083,35 +1079,35 @@ function Xe(e, t, n) {
|
|
|
1083
1079
|
lngLat: e[0],
|
|
1084
1080
|
bearing: 0
|
|
1085
1081
|
};
|
|
1086
|
-
let r = t[t.length - 1], i = Math.min(Math.max(n, 0), r), a = Math.min(
|
|
1082
|
+
let r = t[t.length - 1], i = Math.min(Math.max(n, 0), r), a = Math.min(Ze(t, i), e.length - 2), o = e[a], s = e[a + 1], c = t[a + 1] - t[a], l = c > 0 ? (i - t[a]) / c : 0;
|
|
1087
1083
|
return {
|
|
1088
1084
|
lngLat: [o[0] + (s[0] - o[0]) * l, o[1] + (s[1] - o[1]) * l],
|
|
1089
|
-
bearing:
|
|
1085
|
+
bearing: $e(e, t, a)
|
|
1090
1086
|
};
|
|
1091
1087
|
}
|
|
1092
|
-
function
|
|
1093
|
-
for (let r = n; r < e.length - 1; r++) if (t[r + 1] > t[r]) return
|
|
1094
|
-
for (let r = n - 1; r >= 0; r--) if (t[r + 1] > t[r]) return
|
|
1088
|
+
function $e(e, t, n) {
|
|
1089
|
+
for (let r = n; r < e.length - 1; r++) if (t[r + 1] > t[r]) return Xe(e[r], e[r + 1]);
|
|
1090
|
+
for (let r = n - 1; r >= 0; r--) if (t[r + 1] > t[r]) return Xe(e[r], e[r + 1]);
|
|
1095
1091
|
return 0;
|
|
1096
1092
|
}
|
|
1097
|
-
function
|
|
1093
|
+
function et(e, t, n, r) {
|
|
1098
1094
|
if (e.length < 2) return [...e];
|
|
1099
|
-
let i = t[t.length - 1], a = Math.min(Math.max(n, 0), i), o = Math.min(Math.max(r, a), i), s = [
|
|
1095
|
+
let i = t[t.length - 1], a = Math.min(Math.max(n, 0), i), o = Math.min(Math.max(r, a), i), s = [Qe(e, t, a).lngLat];
|
|
1100
1096
|
for (let n = 0; n < e.length; n++) t[n] > a && t[n] < o && s.push(e[n]);
|
|
1101
|
-
return s.push(
|
|
1097
|
+
return s.push(Qe(e, t, o).lngLat), s;
|
|
1102
1098
|
}
|
|
1103
|
-
function
|
|
1099
|
+
function tt(e, t, n) {
|
|
1104
1100
|
if (e.length < 2) return 0;
|
|
1105
|
-
let r = Math.cos(n[1] *
|
|
1101
|
+
let r = Math.cos(n[1] * Je), i = Infinity, a = 0;
|
|
1106
1102
|
for (let o = 0; o < e.length - 1; o++) {
|
|
1107
1103
|
let s = e[o], c = e[o + 1], l = s[0] * r, u = s[1], d = c[0] * r, f = c[1], p = n[0] * r, m = n[1], h = d - l, g = f - u, _ = h * h + g * g, v = _ > 0 ? Math.min(1, Math.max(0, ((p - l) * h + (m - u) * g) / _)) : 0, y = l + h * v - p, b = u + g * v - m, x = y * y + b * b;
|
|
1108
1104
|
x < i && (i = x, a = t[o] + (t[o + 1] - t[o]) * v);
|
|
1109
1105
|
}
|
|
1110
1106
|
return a;
|
|
1111
1107
|
}
|
|
1112
|
-
function
|
|
1108
|
+
function nt(e, t, n, r, i = 25) {
|
|
1113
1109
|
if (e.length < 2) return 0;
|
|
1114
|
-
let a = Math.cos(n[1] *
|
|
1110
|
+
let a = Math.cos(n[1] * Je), o = t[t.length - 1];
|
|
1115
1111
|
if (r >= o) return o;
|
|
1116
1112
|
let s = Infinity, c = r;
|
|
1117
1113
|
for (let o = 0; o < e.length - 1; o++) {
|
|
@@ -1121,13 +1117,13 @@ function et(e, t, n, r, i = 25) {
|
|
|
1121
1117
|
}
|
|
1122
1118
|
return Math.max(c, r);
|
|
1123
1119
|
}
|
|
1124
|
-
function
|
|
1120
|
+
function rt(e) {
|
|
1125
1121
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
|
|
1126
1122
|
for (let [a, o] of e) t = Math.min(t, a), r = Math.max(r, a), n = Math.min(n, o), i = Math.max(i, o);
|
|
1127
1123
|
return [[t, n], [r, i]];
|
|
1128
1124
|
}
|
|
1129
1125
|
// src/components/MMapRoute.vue?vue&type=script&setup=true&lang.ts
|
|
1130
|
-
var
|
|
1126
|
+
var it = { class: "hidden" }, at = ["aria-label"], ot = ["aria-label"], st = { style: { transform: "rotate(0.01deg)" } }, ct = /* @__PURE__ */ F({
|
|
1131
1127
|
inheritAttrs: !1,
|
|
1132
1128
|
__name: "MMapRoute",
|
|
1133
1129
|
props: {
|
|
@@ -1171,54 +1167,54 @@ var nt = { class: "hidden" }, rt = ["aria-label", "title"], it = ["aria-label"],
|
|
|
1171
1167
|
"route",
|
|
1172
1168
|
"error"
|
|
1173
1169
|
],
|
|
1174
|
-
setup(
|
|
1175
|
-
let
|
|
1170
|
+
setup(n, { expose: r, emit: i }) {
|
|
1171
|
+
let a = n, o = i, l = oe(), d = c(), f = a.id ?? `m3-route-${ae()}`, { onReady: p, styleVersion: m } = he(), h = u([
|
|
1176
1172
|
"primary",
|
|
1177
1173
|
"outline",
|
|
1178
1174
|
"surface"
|
|
1179
|
-
]),
|
|
1175
|
+
]), g = q(null), _ = D(() => a.path && a.path.length > 1 ? a.path : g.value && g.value.length > 1 ? g.value : a.stops.map((e) => e.lngLat)), v = D(() => JSON.stringify(_.value)), y = D(() => Ye(_.value)), b = D(() => y.value[y.value.length - 1] ?? 0), x = D(() => {
|
|
1180
1176
|
let e = 0;
|
|
1181
|
-
return
|
|
1182
|
-
}),
|
|
1183
|
-
function
|
|
1184
|
-
if (
|
|
1185
|
-
let e =
|
|
1186
|
-
return
|
|
1177
|
+
return a.stops.map((t) => e = nt(_.value, y.value, t.lngLat, e, 0));
|
|
1178
|
+
}), S = null;
|
|
1179
|
+
function C() {
|
|
1180
|
+
if (a.vehicle) {
|
|
1181
|
+
let e = a.snap === "nearest" || S == null ? tt(_.value, y.value, a.vehicle) : nt(_.value, y.value, a.vehicle, S);
|
|
1182
|
+
return S = e, e;
|
|
1187
1183
|
}
|
|
1188
|
-
return
|
|
1189
|
-
}
|
|
1190
|
-
let
|
|
1191
|
-
|
|
1192
|
-
() =>
|
|
1193
|
-
() =>
|
|
1194
|
-
() =>
|
|
1195
|
-
], () =>
|
|
1196
|
-
let
|
|
1197
|
-
async function
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1184
|
+
return S = null, a.progress != null && Number.isFinite(a.progress) ? Math.min(Math.max(a.progress, 0), 1) * b.value : null;
|
|
1185
|
+
}
|
|
1186
|
+
let T = G(C());
|
|
1187
|
+
Z([
|
|
1188
|
+
() => a.vehicle?.join(","),
|
|
1189
|
+
() => a.progress,
|
|
1190
|
+
() => a.snap
|
|
1191
|
+
], () => T.value = C());
|
|
1192
|
+
let E;
|
|
1193
|
+
async function k() {
|
|
1194
|
+
if (E?.abort(), !a.provider || a.path && a.path.length > 1 || a.stops.length < 2) {
|
|
1195
|
+
g.value = null;
|
|
1200
1196
|
return;
|
|
1201
1197
|
}
|
|
1202
|
-
let e =
|
|
1198
|
+
let e = E = new AbortController();
|
|
1203
1199
|
try {
|
|
1204
|
-
let t = await
|
|
1200
|
+
let t = await a.provider(a.stops.map((e) => e.lngLat), { signal: e.signal });
|
|
1205
1201
|
if (e.signal.aborted) return;
|
|
1206
|
-
|
|
1202
|
+
g.value = t.path, o("route", t);
|
|
1207
1203
|
} catch (t) {
|
|
1208
|
-
e.signal.aborted || (
|
|
1204
|
+
e.signal.aborted || (g.value = null, o("error", t));
|
|
1209
1205
|
}
|
|
1210
1206
|
}
|
|
1211
|
-
|
|
1212
|
-
() => JSON.stringify(
|
|
1213
|
-
() =>
|
|
1214
|
-
() => !!(
|
|
1215
|
-
], () =>
|
|
1216
|
-
let
|
|
1217
|
-
`${
|
|
1218
|
-
`${
|
|
1219
|
-
`${
|
|
1207
|
+
V(k), Z([
|
|
1208
|
+
() => JSON.stringify(a.stops.map((e) => e.lngLat)),
|
|
1209
|
+
() => a.provider,
|
|
1210
|
+
() => !!(a.path && a.path.length > 1)
|
|
1211
|
+
], () => k());
|
|
1212
|
+
let F = 0, I = G(0), L = G(0), R = 0, z = 0, ee = (e) => a.stops[e]?.done ?? (T.value != null && I.value >= x.value[e] - 1), re = D(() => a.color ?? h.value.primary), U, W, Y = G(), se = [
|
|
1213
|
+
`${f}-rest`,
|
|
1214
|
+
`${f}-casing`,
|
|
1215
|
+
`${f}-done`
|
|
1220
1216
|
];
|
|
1221
|
-
function
|
|
1217
|
+
function le(e) {
|
|
1222
1218
|
let t = (e, t) => ({
|
|
1223
1219
|
type: "Feature",
|
|
1224
1220
|
properties: { part: t },
|
|
@@ -1229,19 +1225,19 @@ var nt = { class: "hidden" }, rt = ["aria-label", "title"], it = ["aria-label"],
|
|
|
1229
1225
|
});
|
|
1230
1226
|
return {
|
|
1231
1227
|
type: "FeatureCollection",
|
|
1232
|
-
features: [t(
|
|
1228
|
+
features: [t(_.value, "rest"), t(et(_.value, y.value, 0, e), "done")]
|
|
1233
1229
|
};
|
|
1234
1230
|
}
|
|
1235
|
-
function
|
|
1236
|
-
let e =
|
|
1231
|
+
function ue() {
|
|
1232
|
+
let e = a.width, t = {
|
|
1237
1233
|
"line-cap": "round",
|
|
1238
1234
|
"line-join": "round"
|
|
1239
1235
|
};
|
|
1240
1236
|
return [
|
|
1241
1237
|
{
|
|
1242
|
-
id:
|
|
1238
|
+
id: se[0],
|
|
1243
1239
|
type: "line",
|
|
1244
|
-
source:
|
|
1240
|
+
source: f,
|
|
1245
1241
|
filter: [
|
|
1246
1242
|
"==",
|
|
1247
1243
|
["get", "part"],
|
|
@@ -1252,15 +1248,15 @@ var nt = { class: "hidden" }, rt = ["aria-label", "title"], it = ["aria-label"],
|
|
|
1252
1248
|
"line-join": "round"
|
|
1253
1249
|
},
|
|
1254
1250
|
paint: {
|
|
1255
|
-
"line-color":
|
|
1251
|
+
"line-color": h.value.outline,
|
|
1256
1252
|
"line-width": e * .8,
|
|
1257
|
-
"line-dasharray":
|
|
1253
|
+
"line-dasharray": be(Math.max(Ce, 0))
|
|
1258
1254
|
}
|
|
1259
1255
|
},
|
|
1260
1256
|
{
|
|
1261
|
-
id:
|
|
1257
|
+
id: se[1],
|
|
1262
1258
|
type: "line",
|
|
1263
|
-
source:
|
|
1259
|
+
source: f,
|
|
1264
1260
|
filter: [
|
|
1265
1261
|
"==",
|
|
1266
1262
|
["get", "part"],
|
|
@@ -1268,14 +1264,14 @@ var nt = { class: "hidden" }, rt = ["aria-label", "title"], it = ["aria-label"],
|
|
|
1268
1264
|
],
|
|
1269
1265
|
layout: t,
|
|
1270
1266
|
paint: {
|
|
1271
|
-
"line-color":
|
|
1267
|
+
"line-color": h.value.surface,
|
|
1272
1268
|
"line-width": e + 4
|
|
1273
1269
|
}
|
|
1274
1270
|
},
|
|
1275
1271
|
{
|
|
1276
|
-
id:
|
|
1272
|
+
id: se[2],
|
|
1277
1273
|
type: "line",
|
|
1278
|
-
source:
|
|
1274
|
+
source: f,
|
|
1279
1275
|
filter: [
|
|
1280
1276
|
"==",
|
|
1281
1277
|
["get", "part"],
|
|
@@ -1289,188 +1285,187 @@ var nt = { class: "hidden" }, rt = ["aria-label", "title"], it = ["aria-label"],
|
|
|
1289
1285
|
}
|
|
1290
1286
|
];
|
|
1291
1287
|
}
|
|
1292
|
-
function
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1288
|
+
function de() {
|
|
1289
|
+
if (U) {
|
|
1290
|
+
U.getSource(f) || U.addSource(f, {
|
|
1295
1291
|
type: "geojson",
|
|
1296
|
-
data:
|
|
1292
|
+
data: le(F),
|
|
1297
1293
|
tolerance: 0
|
|
1298
1294
|
});
|
|
1299
|
-
for (let e of
|
|
1295
|
+
for (let e of ue()) U.getLayer(e.id) && U.removeLayer(e.id), U.addLayer(e, a.before && U.getLayer(a.before) ? a.before : void 0);
|
|
1300
1296
|
}
|
|
1301
1297
|
}
|
|
1302
|
-
let
|
|
1303
|
-
function
|
|
1304
|
-
if (n || !
|
|
1305
|
-
let r =
|
|
1298
|
+
let fe = -1, pe = null;
|
|
1299
|
+
function me(e, t, n) {
|
|
1300
|
+
if (n || !U || fe < 0 || !pe) return e !== fe || fe < 0;
|
|
1301
|
+
let r = U.project(t), i = U.project(pe);
|
|
1306
1302
|
return Math.hypot(r.x - i.x, r.y - i.y) >= 2;
|
|
1307
1303
|
}
|
|
1308
|
-
function
|
|
1309
|
-
|
|
1310
|
-
let { lngLat: n } =
|
|
1311
|
-
if (
|
|
1312
|
-
let t =
|
|
1313
|
-
t && (t.setData(
|
|
1304
|
+
function ge(e, t = !0) {
|
|
1305
|
+
F = e;
|
|
1306
|
+
let { lngLat: n } = Qe(_.value, y.value, e), r = Oe(e);
|
|
1307
|
+
if (me(e, n, t)) {
|
|
1308
|
+
let t = U?.getSource(f);
|
|
1309
|
+
t && (t.setData(le(e)), fe = e, pe = n);
|
|
1314
1310
|
}
|
|
1315
|
-
|
|
1311
|
+
W?.setLngLat(n), ke.value && W?.setRotation(r), R = r, l.vehicle && (L.value = r), r > 200 && r < 340 ? ve.value = !0 : r > 20 && r < 160 && (ve.value = !1), a.follow && U?.jumpTo({ center: n }), _e(e) !== _e(I.value) && (I.value = e);
|
|
1316
1312
|
}
|
|
1317
|
-
let
|
|
1318
|
-
function
|
|
1313
|
+
let _e = (e) => x.value.filter((t) => e >= t - 1).length, ve = G(!1), ye = 1.6;
|
|
1314
|
+
function be(e) {
|
|
1319
1315
|
let t = 2.6, n = e / 16 * t;
|
|
1320
|
-
return n <=
|
|
1316
|
+
return n <= ye ? [
|
|
1321
1317
|
0,
|
|
1322
1318
|
n,
|
|
1323
1319
|
1,
|
|
1324
|
-
|
|
1320
|
+
ye - n
|
|
1325
1321
|
] : [
|
|
1326
|
-
n -
|
|
1327
|
-
|
|
1322
|
+
n - ye,
|
|
1323
|
+
ye,
|
|
1328
1324
|
t - n,
|
|
1329
1325
|
0
|
|
1330
1326
|
];
|
|
1331
1327
|
}
|
|
1332
|
-
let
|
|
1333
|
-
function
|
|
1334
|
-
let t = 2.6 *
|
|
1335
|
-
n !==
|
|
1328
|
+
let xe = 0, Se = 0, Ce = -1;
|
|
1329
|
+
function we(e) {
|
|
1330
|
+
let t = 2.6 * a.width * .8, n = Math.floor((e - Se) / 1e3 * 16 / t * 16) % 16;
|
|
1331
|
+
n !== Ce && U?.getLayer(se[0]) && (Ce = n, U.setPaintProperty(se[0], "line-dasharray", be(n))), xe = requestAnimationFrame(we);
|
|
1336
1332
|
}
|
|
1337
|
-
let
|
|
1338
|
-
function
|
|
1339
|
-
!$ &&
|
|
1333
|
+
let Te = !0, $;
|
|
1334
|
+
function Ee() {
|
|
1335
|
+
!$ && U && typeof IntersectionObserver < "u" && ($ = new IntersectionObserver(([e]) => {
|
|
1340
1336
|
let t = !!e?.isIntersecting;
|
|
1341
|
-
t !==
|
|
1342
|
-
}), $.observe(
|
|
1343
|
-
}
|
|
1344
|
-
function
|
|
1345
|
-
cancelAnimationFrame(
|
|
1346
|
-
}
|
|
1347
|
-
function
|
|
1348
|
-
let t =
|
|
1349
|
-
return t[0] === n[0] && t[1] === n[1] ?
|
|
1350
|
-
}
|
|
1351
|
-
let
|
|
1352
|
-
function
|
|
1353
|
-
if (
|
|
1354
|
-
if (
|
|
1355
|
-
let e = performance.now(), t = e -
|
|
1356
|
-
return
|
|
1357
|
-
}
|
|
1358
|
-
function
|
|
1359
|
-
cancelAnimationFrame(
|
|
1360
|
-
let t =
|
|
1337
|
+
t !== Te && (Te = t, De());
|
|
1338
|
+
}), $.observe(U.getContainer()));
|
|
1339
|
+
}
|
|
1340
|
+
function De() {
|
|
1341
|
+
cancelAnimationFrame(xe), Ce = -1, Ee(), (Te || !a.flow) && (a.flow && U && !s() ? (Se = performance.now(), xe = requestAnimationFrame(we)) : U?.getLayer(se[0]) && U.setPaintProperty(se[0], "line-dasharray", be(0)));
|
|
1342
|
+
}
|
|
1343
|
+
function Oe(e) {
|
|
1344
|
+
let t = Qe(_.value, y.value, Math.max(e - 10, 0)).lngLat, n = Qe(_.value, y.value, Math.min(e + 25, b.value)).lngLat;
|
|
1345
|
+
return t[0] === n[0] && t[1] === n[1] ? Qe(_.value, y.value, e).bearing : Xe(t, n);
|
|
1346
|
+
}
|
|
1347
|
+
let ke = D(() => a.rotateVehicle ?? (a.vehicleIcon === "navigation" && !l.vehicle)), Ae = 0, je = 0;
|
|
1348
|
+
function Me() {
|
|
1349
|
+
if (s()) return 0;
|
|
1350
|
+
if (a.duration !== "auto") return a.duration;
|
|
1351
|
+
let e = performance.now(), t = e - Ae;
|
|
1352
|
+
return Ae && t <= 5e3 && (je = je ? (je + Math.max(t, 100)) / 2 : Math.max(t, 100)), Ae = e, je || 1e3;
|
|
1353
|
+
}
|
|
1354
|
+
function Ne(e) {
|
|
1355
|
+
cancelAnimationFrame(z);
|
|
1356
|
+
let t = F, n = Me();
|
|
1361
1357
|
if (n <= 0 || t === e) {
|
|
1362
|
-
|
|
1358
|
+
ge(e), I.value = e, Ie();
|
|
1363
1359
|
return;
|
|
1364
1360
|
}
|
|
1365
1361
|
let r = performance.now(), i = (a) => {
|
|
1366
1362
|
let o = Math.min(1, (a - r) / n);
|
|
1367
|
-
|
|
1363
|
+
ge(t + (e - t) * o, o >= 1), o < 1 ? z = requestAnimationFrame(i) : (I.value = e, Ie());
|
|
1368
1364
|
};
|
|
1369
|
-
|
|
1365
|
+
z = requestAnimationFrame(i);
|
|
1370
1366
|
}
|
|
1371
|
-
let
|
|
1372
|
-
function
|
|
1373
|
-
let e =
|
|
1374
|
-
e && !
|
|
1367
|
+
let Fe = !1;
|
|
1368
|
+
function Ie() {
|
|
1369
|
+
let e = b.value > 0 && F >= b.value - 1;
|
|
1370
|
+
e && !Fe && o("arrive"), Fe = e;
|
|
1375
1371
|
}
|
|
1376
|
-
function
|
|
1377
|
-
!
|
|
1378
|
-
padding:
|
|
1379
|
-
duration:
|
|
1372
|
+
function Le() {
|
|
1373
|
+
!U || _.value.length < 2 || U.fitBounds(rt(_.value), {
|
|
1374
|
+
padding: a.padding,
|
|
1375
|
+
duration: s() ? 0 : 600
|
|
1380
1376
|
});
|
|
1381
1377
|
}
|
|
1382
|
-
let
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
element:
|
|
1386
|
-
rotationAlignment:
|
|
1378
|
+
let Re = D(() => a.showVehicle && T.value != null);
|
|
1379
|
+
p((e, t) => {
|
|
1380
|
+
U = e, F = T.value ?? 0, I.value = F, de(), Y.value && (W = new t.Marker({
|
|
1381
|
+
element: Y.value,
|
|
1382
|
+
rotationAlignment: ke.value ? "map" : "viewport",
|
|
1387
1383
|
subpixelPositioning: !0
|
|
1388
|
-
}),
|
|
1389
|
-
}),
|
|
1390
|
-
|
|
1391
|
-
}),
|
|
1392
|
-
e == null ?
|
|
1393
|
-
}),
|
|
1394
|
-
|
|
1395
|
-
}),
|
|
1396
|
-
|
|
1397
|
-
}),
|
|
1384
|
+
}), Re.value && W.setLngLat(Qe(_.value, y.value, F).lngLat).addTo(e)), ge(F), Fe = b.value > 0 && F >= b.value - 1, a.fit && Le(), De();
|
|
1385
|
+
}), Z(() => a.flow, De), Z(m, () => de()), Z(ke, (e) => {
|
|
1386
|
+
W?.setRotationAlignment(e ? "map" : "viewport"), W?.setRotation(e ? R : 0);
|
|
1387
|
+
}), Z(T, (e) => {
|
|
1388
|
+
e == null ? Ae = je = 0 : U && Ne(e);
|
|
1389
|
+
}), Z(Re, (e) => {
|
|
1390
|
+
U && W && (e ? W.setLngLat(Qe(_.value, y.value, F).lngLat).addTo(U) : W.remove());
|
|
1391
|
+
}), Z(v, () => {
|
|
1392
|
+
S = null, fe = -1, T.value = C(), U && (F = Math.min(T.value ?? 0, b.value), I.value = F, ge(F), a.fit && Le());
|
|
1393
|
+
}), Z(() => [
|
|
1398
1394
|
re.value,
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
], () =>
|
|
1404
|
-
if (
|
|
1405
|
-
for (let e of
|
|
1406
|
-
|
|
1395
|
+
h.value.outline,
|
|
1396
|
+
h.value.surface,
|
|
1397
|
+
a.width,
|
|
1398
|
+
a.before
|
|
1399
|
+
], () => de()), ne(() => {
|
|
1400
|
+
if (E?.abort(), cancelAnimationFrame(xe), $?.disconnect(), cancelAnimationFrame(z), W?.remove(), U) {
|
|
1401
|
+
for (let e of se) U.getLayer(e) && U.removeLayer(e);
|
|
1402
|
+
U.getSource(f) && U.removeSource(f);
|
|
1407
1403
|
}
|
|
1408
|
-
|
|
1404
|
+
U = void 0;
|
|
1409
1405
|
});
|
|
1410
|
-
let
|
|
1411
|
-
return
|
|
1412
|
-
fit:
|
|
1413
|
-
length:
|
|
1414
|
-
travelled:
|
|
1415
|
-
sourceId:
|
|
1416
|
-
}), (
|
|
1417
|
-
key:
|
|
1418
|
-
"lng-lat":
|
|
1419
|
-
onClick: (e) =>
|
|
1420
|
-
},
|
|
1421
|
-
default:
|
|
1422
|
-
stop:
|
|
1423
|
-
index:
|
|
1424
|
-
done: ee(
|
|
1425
|
-
}, () => [A("span", {
|
|
1406
|
+
let ze = (e, t) => e.icon ?? (t === a.stops.length - 1 ? "flag" : t === 0 ? "trip_origin" : void 0), Be = (e, t) => e.label ?? `${d.mapRouteStop} ${t + 1}`;
|
|
1407
|
+
return r({
|
|
1408
|
+
fit: Le,
|
|
1409
|
+
length: b,
|
|
1410
|
+
travelled: I,
|
|
1411
|
+
sourceId: f
|
|
1412
|
+
}), (r, i) => (H(), A("div", it, [(H(!0), A(w, null, ie(n.stops, (i, a) => (H(), O(Pe, {
|
|
1413
|
+
key: a,
|
|
1414
|
+
"lng-lat": i.lngLat,
|
|
1415
|
+
onClick: (e) => o("stop-click", i, a)
|
|
1416
|
+
}, M({
|
|
1417
|
+
default: Q(() => [K(r.$slots, "stop", {
|
|
1418
|
+
stop: i,
|
|
1419
|
+
index: a,
|
|
1420
|
+
done: ee(a)
|
|
1421
|
+
}, () => [ce((H(), A("span", {
|
|
1426
1422
|
role: "img",
|
|
1427
|
-
"aria-label":
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
color: t.color
|
|
1423
|
+
"aria-label": Be(i, a),
|
|
1424
|
+
class: B(["m3-map-route-stop flex h-7 w-7 items-center justify-center rounded-full border-2 text-label-medium font-medium shadow-elevation-1 transition-colors duration-300", ee(a) ? "border-transparent bg-primary text-on-primary" : "border-primary bg-surface text-primary"]),
|
|
1425
|
+
style: te(n.color ? ee(a) ? { background: n.color } : {
|
|
1426
|
+
borderColor: n.color,
|
|
1427
|
+
color: n.color
|
|
1433
1428
|
} : void 0)
|
|
1434
|
-
}, [
|
|
1429
|
+
}, [ze(i, a) ? (H(), O(e, {
|
|
1435
1430
|
key: 0,
|
|
1436
|
-
name:
|
|
1431
|
+
name: ze(i, a),
|
|
1437
1432
|
size: 16
|
|
1438
|
-
}, null, 8, ["name"])) : (
|
|
1433
|
+
}, null, 8, ["name"])) : (H(), A(w, { key: 1 }, [N(J(a), 1)], 64))], 14, at)), [[X(t), Be(i, a)]])])]),
|
|
1439
1434
|
_: 2
|
|
1440
|
-
}, [
|
|
1435
|
+
}, [r.$slots["stop-popup"] ? {
|
|
1441
1436
|
name: "popup",
|
|
1442
|
-
fn:
|
|
1443
|
-
stop:
|
|
1444
|
-
index:
|
|
1445
|
-
done: ee(
|
|
1437
|
+
fn: Q(() => [K(r.$slots, "stop-popup", {
|
|
1438
|
+
stop: i,
|
|
1439
|
+
index: a,
|
|
1440
|
+
done: ee(a)
|
|
1446
1441
|
})]),
|
|
1447
1442
|
key: "0"
|
|
1448
|
-
} : void 0]), 1032, ["lng-lat", "onClick"]))), 128)),
|
|
1443
|
+
} : void 0]), 1032, ["lng-lat", "onClick"]))), 128)), j("div", {
|
|
1449
1444
|
ref_key: "vehicleEl",
|
|
1450
|
-
ref:
|
|
1445
|
+
ref: Y,
|
|
1451
1446
|
class: "m3-map-route-vehicle",
|
|
1452
|
-
"aria-label":
|
|
1447
|
+
"aria-label": X(d).mapRouteVehicle,
|
|
1453
1448
|
role: "img"
|
|
1454
|
-
}, [
|
|
1455
|
-
bearing:
|
|
1456
|
-
west:
|
|
1457
|
-
}, () => [
|
|
1449
|
+
}, [j("div", st, [K(r.$slots, "vehicle", {
|
|
1450
|
+
bearing: L.value,
|
|
1451
|
+
west: ve.value
|
|
1452
|
+
}, () => [j("span", {
|
|
1458
1453
|
class: "flex h-10 w-10 items-center justify-center rounded-full border-2 border-surface bg-primary text-on-primary shadow-elevation-2",
|
|
1459
|
-
style: te(
|
|
1460
|
-
}, [
|
|
1461
|
-
name:
|
|
1454
|
+
style: te(n.color ? { background: n.color } : void 0)
|
|
1455
|
+
}, [P(e, {
|
|
1456
|
+
name: n.vehicleIcon,
|
|
1462
1457
|
size: 22,
|
|
1463
|
-
filled:
|
|
1464
|
-
style: te(!
|
|
1458
|
+
filled: n.vehicleIcon === "navigation",
|
|
1459
|
+
style: te(!ke.value && ve.value ? { transform: "scaleX(-1)" } : void 0)
|
|
1465
1460
|
}, null, 8, [
|
|
1466
1461
|
"name",
|
|
1467
1462
|
"filled",
|
|
1468
1463
|
"style"
|
|
1469
|
-
])], 4)])])], 8,
|
|
1464
|
+
])], 4)])])], 8, ot)]));
|
|
1470
1465
|
}
|
|
1471
1466
|
});
|
|
1472
1467
|
// src/composables/mapRouting.ts
|
|
1473
|
-
function
|
|
1468
|
+
function lt(e = {}) {
|
|
1474
1469
|
let t = (e.url ?? "https://router.project-osrm.org").replace(/\/$/, ""), n = e.profile ?? "driving";
|
|
1475
1470
|
return async (r, { signal: i }) => {
|
|
1476
1471
|
if (r.length < 2) return {
|
|
@@ -1494,19 +1489,19 @@ function st(e = {}) {
|
|
|
1494
1489
|
};
|
|
1495
1490
|
}
|
|
1496
1491
|
// src/components/_MMapLayerItem.vue?vue&type=script&setup=true&lang.ts
|
|
1497
|
-
var
|
|
1492
|
+
var ut = { class: "flex min-w-0 flex-1 flex-col" }, dt = ["aria-label", "aria-pressed"], ft = { class: "flex min-w-0 flex-1 flex-col" }, pt = {
|
|
1498
1493
|
key: 0,
|
|
1499
1494
|
class: "truncate text-label-small text-on-surface-variant"
|
|
1500
|
-
},
|
|
1495
|
+
}, mt = {
|
|
1501
1496
|
key: 0,
|
|
1502
1497
|
class: "rounded-full bg-primary/8 px-2 py-0.5 text-label-small tabular-nums text-primary"
|
|
1503
|
-
},
|
|
1498
|
+
}, ht = { class: "min-h-0 overflow-hidden" }, gt = { class: "flex flex-col gap-3 px-3 pb-3" }, _t = {
|
|
1504
1499
|
key: 0,
|
|
1505
1500
|
class: "text-body-small text-on-surface-variant"
|
|
1506
|
-
},
|
|
1501
|
+
}, vt = { class: "flex items-center gap-2 rounded-2xl bg-surface-container-highest/60 px-3 py-1" }, yt = ["src"], bt = {
|
|
1507
1502
|
key: 2,
|
|
1508
1503
|
class: "flex flex-wrap items-center gap-2"
|
|
1509
|
-
},
|
|
1504
|
+
}, xt = ["href"], St = /* @__PURE__ */ F({
|
|
1510
1505
|
__name: "_MMapLayerItem",
|
|
1511
1506
|
props: {
|
|
1512
1507
|
layer: {},
|
|
@@ -1514,80 +1509,80 @@ var ct = { class: "flex min-w-0 flex-1 flex-col" }, lt = ["aria-label", "aria-pr
|
|
|
1514
1509
|
},
|
|
1515
1510
|
emits: ["toggle-expanded"],
|
|
1516
1511
|
setup(t, { emit: n }) {
|
|
1517
|
-
let r = n, i =
|
|
1518
|
-
return (n,
|
|
1512
|
+
let r = n, i = c(), { isVisible: a, toggle: o, opacityOf: s, setOpacity: l } = Te();
|
|
1513
|
+
return (n, c) => (H(), A("div", { class: B(["flex overflow-hidden rounded-2xl bg-surface-container", X(a)(t.layer.id) ? "" : "opacity-75"]) }, [j("div", { class: B(["w-1 shrink-0 transition-colors duration-200", X(a)(t.layer.id) ? "bg-primary" : "bg-outline-variant"]) }, null, 2), j("div", ut, [j("div", {
|
|
1519
1514
|
class: "flex cursor-pointer items-center gap-2 px-3 py-2",
|
|
1520
|
-
onClick:
|
|
1515
|
+
onClick: c[1] ||= (e) => r("toggle-expanded")
|
|
1521
1516
|
}, [
|
|
1522
|
-
|
|
1517
|
+
j("button", {
|
|
1523
1518
|
type: "button",
|
|
1524
|
-
class:
|
|
1525
|
-
"aria-label":
|
|
1526
|
-
"aria-pressed":
|
|
1527
|
-
onClick:
|
|
1528
|
-
}, [
|
|
1529
|
-
name:
|
|
1519
|
+
class: B(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", X(a)(t.layer.id) ? "bg-primary/12 text-primary" : "bg-on-surface/5 text-on-surface-variant"]),
|
|
1520
|
+
"aria-label": X(a)(t.layer.id) ? X(i).mapHideLayer : X(i).mapShowLayer,
|
|
1521
|
+
"aria-pressed": X(a)(t.layer.id),
|
|
1522
|
+
onClick: c[0] ||= le((e) => X(o)(t.layer.id), ["stop"])
|
|
1523
|
+
}, [P(e, {
|
|
1524
|
+
name: X(a)(t.layer.id) ? "visibility" : "visibility_off",
|
|
1530
1525
|
size: 18
|
|
1531
|
-
}, null, 8, ["name"])], 10,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1526
|
+
}, null, 8, ["name"])], 10, dt),
|
|
1527
|
+
j("div", ft, [j("span", { class: B(["truncate text-body-medium", X(a)(t.layer.id) ? "text-on-surface" : "text-on-surface-variant"]) }, J(t.layer.title), 3), t.layer.description && !t.expanded ? (H(), A("span", pt, J(t.layer.description), 1)) : k("", !0)]),
|
|
1528
|
+
X(a)(t.layer.id) && X(s)(t.layer.id) < 1 ? (H(), A("span", mt, J(Math.round(X(s)(t.layer.id) * 100)) + "% ", 1)) : k("", !0),
|
|
1529
|
+
P(e, {
|
|
1535
1530
|
name: "expand_more",
|
|
1536
1531
|
size: 18,
|
|
1537
|
-
class:
|
|
1532
|
+
class: B(["shrink-0 text-on-surface-variant transition-transform duration-300", t.expanded ? "rotate-180" : ""])
|
|
1538
1533
|
}, null, 8, ["class"])
|
|
1539
|
-
]),
|
|
1534
|
+
]), j("div", {
|
|
1540
1535
|
class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
1541
1536
|
style: te({ gridTemplateRows: t.expanded ? "1fr" : "0fr" })
|
|
1542
|
-
}, [
|
|
1543
|
-
t.layer.description ? (
|
|
1544
|
-
|
|
1537
|
+
}, [j("div", ht, [j("div", gt, [
|
|
1538
|
+
t.layer.description ? (H(), A("p", _t, J(t.layer.description), 1)) : k("", !0),
|
|
1539
|
+
j("div", vt, [P(e, {
|
|
1545
1540
|
name: "opacity",
|
|
1546
1541
|
size: 16,
|
|
1547
1542
|
class: "shrink-0 text-on-surface-variant"
|
|
1548
|
-
}),
|
|
1549
|
-
"model-value":
|
|
1543
|
+
}), P(f, {
|
|
1544
|
+
"model-value": X(s)(t.layer.id),
|
|
1550
1545
|
min: 0,
|
|
1551
1546
|
max: 1,
|
|
1552
1547
|
step: .01,
|
|
1553
|
-
label:
|
|
1548
|
+
label: X(i).mapOpacity,
|
|
1554
1549
|
class: "flex-1",
|
|
1555
|
-
"onUpdate:modelValue":
|
|
1550
|
+
"onUpdate:modelValue": c[2] ||= (e) => X(l)(t.layer.id, Number(e))
|
|
1556
1551
|
}, null, 8, ["model-value", "label"])]),
|
|
1557
|
-
t.layer.legend ? (
|
|
1552
|
+
t.layer.legend ? (H(), A("img", {
|
|
1558
1553
|
key: 1,
|
|
1559
1554
|
src: t.layer.legend,
|
|
1560
1555
|
alt: "",
|
|
1561
1556
|
class: "max-w-full self-start",
|
|
1562
1557
|
loading: "lazy"
|
|
1563
|
-
}, null, 8,
|
|
1564
|
-
t.layer.download || n.$slots.actions ? (
|
|
1558
|
+
}, null, 8, yt)) : k("", !0),
|
|
1559
|
+
t.layer.download || n.$slots.actions ? (H(), A("div", bt, [t.layer.download ? (H(), A("a", {
|
|
1565
1560
|
key: 0,
|
|
1566
1561
|
href: t.layer.download,
|
|
1567
1562
|
target: "_blank",
|
|
1568
1563
|
rel: "noopener",
|
|
1569
1564
|
download: "",
|
|
1570
1565
|
class: "inline-flex items-center gap-1 rounded-full px-3 py-1.5 text-label-large text-primary hover:bg-primary/8"
|
|
1571
|
-
}, [
|
|
1566
|
+
}, [P(e, {
|
|
1572
1567
|
name: "download",
|
|
1573
1568
|
size: 18
|
|
1574
|
-
}),
|
|
1569
|
+
}), N(" " + J(X(i).mapDownload), 1)], 8, xt)) : k("", !0), K(n.$slots, "actions", {
|
|
1575
1570
|
layer: t.layer,
|
|
1576
|
-
visible:
|
|
1577
|
-
})])) :
|
|
1571
|
+
visible: X(a)(t.layer.id)
|
|
1572
|
+
})])) : k("", !0)
|
|
1578
1573
|
])])], 4)])], 2));
|
|
1579
1574
|
}
|
|
1580
|
-
}),
|
|
1575
|
+
}), Ct = { class: "flex flex-col gap-3" }, wt = ["onClick"], Tt = [
|
|
1581
1576
|
"aria-label",
|
|
1582
1577
|
"aria-pressed",
|
|
1583
1578
|
"onClick"
|
|
1584
|
-
],
|
|
1579
|
+
], Et = { class: "flex-1 select-none truncate text-label-large text-on-surface" }, Dt = { class: "rounded-full bg-surface-container-highest px-2 py-0.5 text-label-small tabular-nums text-on-surface-variant" }, Ot = {
|
|
1585
1580
|
key: 1,
|
|
1586
1581
|
class: "flex flex-col gap-1.5"
|
|
1587
|
-
},
|
|
1582
|
+
}, kt = {
|
|
1588
1583
|
key: 2,
|
|
1589
1584
|
class: "flex flex-col items-center gap-3 py-8"
|
|
1590
|
-
},
|
|
1585
|
+
}, At = { class: "grid size-14 place-items-center rounded-full bg-surface-container-highest" }, jt = { class: "text-body-medium text-on-surface-variant" }, Mt = /* @__PURE__ */ F({
|
|
1591
1586
|
__name: "MMapLayers",
|
|
1592
1587
|
props: {
|
|
1593
1588
|
search: {
|
|
@@ -1601,98 +1596,98 @@ var ct = { class: "flex min-w-0 flex-1 flex-col" }, lt = ["aria-label", "aria-pr
|
|
|
1601
1596
|
map: {}
|
|
1602
1597
|
},
|
|
1603
1598
|
setup(t) {
|
|
1604
|
-
let n = t, r =
|
|
1599
|
+
let n = t, r = c(), { model: i, layersOf: a, isVisible: o, groupState: s, setGroupVisible: l } = Te(() => n.map), u = G(""), f = (e) => !u.value || e.title.toLowerCase().includes(u.value.toLowerCase()), p = D(() => (i.value?.groups ?? []).map((e) => ({
|
|
1605
1600
|
...e,
|
|
1606
1601
|
all: a(e.name),
|
|
1607
1602
|
layers: a(e.name).filter(f)
|
|
1608
|
-
})).filter((e) => e.layers.length)), m =
|
|
1603
|
+
})).filter((e) => e.layers.length)), m = D(() => a(null).filter(f)), h = G(/* @__PURE__ */ new Set()), g = (e) => h.value.has(e) === n.collapsed;
|
|
1609
1604
|
function _(e) {
|
|
1610
1605
|
let t = new Set(h.value);
|
|
1611
1606
|
t.delete(e) || t.add(e), h.value = t;
|
|
1612
1607
|
}
|
|
1613
|
-
let v =
|
|
1608
|
+
let v = G(/* @__PURE__ */ new Set());
|
|
1614
1609
|
function y(e) {
|
|
1615
1610
|
let t = new Set(v.value);
|
|
1616
1611
|
t.delete(e) || t.add(e), v.value = t;
|
|
1617
1612
|
}
|
|
1618
1613
|
let b = (e) => e.filter((e) => o(e.id)).length;
|
|
1619
|
-
return (n, i) => (
|
|
1620
|
-
t.search ? (
|
|
1614
|
+
return (n, i) => (H(), A("div", Ct, [
|
|
1615
|
+
t.search ? (H(), O(d, {
|
|
1621
1616
|
key: 0,
|
|
1622
|
-
modelValue:
|
|
1623
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
1624
|
-
label:
|
|
1617
|
+
modelValue: u.value,
|
|
1618
|
+
"onUpdate:modelValue": i[0] ||= (e) => u.value = e,
|
|
1619
|
+
label: X(r).mapSearchLayers,
|
|
1625
1620
|
"leading-icon": "search",
|
|
1626
1621
|
variant: "outlined",
|
|
1627
1622
|
clearable: ""
|
|
1628
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1629
|
-
(
|
|
1623
|
+
}, null, 8, ["modelValue", "label"])) : k("", !0),
|
|
1624
|
+
(H(!0), A(w, null, ie(p.value, (t) => (H(), A("section", {
|
|
1630
1625
|
key: t.name,
|
|
1631
1626
|
class: "flex flex-col"
|
|
1632
|
-
}, [
|
|
1627
|
+
}, [j("div", {
|
|
1633
1628
|
class: "m3-map-layers-row flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5",
|
|
1634
1629
|
onClick: (e) => _(t.name)
|
|
1635
1630
|
}, [
|
|
1636
|
-
|
|
1631
|
+
j("button", {
|
|
1637
1632
|
type: "button",
|
|
1638
|
-
class:
|
|
1639
|
-
"aria-label":
|
|
1640
|
-
"aria-pressed":
|
|
1641
|
-
onClick:
|
|
1642
|
-
}, [
|
|
1643
|
-
name:
|
|
1633
|
+
class: B(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", X(s)(t.name) === "visible" ? "bg-primary-container text-on-primary-container" : X(s)(t.name) === "partial" ? "bg-secondary-container text-on-secondary-container" : "bg-on-surface/8 text-on-surface-variant"]),
|
|
1634
|
+
"aria-label": X(s)(t.name) === "hidden" ? X(r).mapShowLayer : X(r).mapHideLayer,
|
|
1635
|
+
"aria-pressed": X(s)(t.name) !== "hidden",
|
|
1636
|
+
onClick: le((e) => X(l)(t.name, X(s)(t.name) !== "visible"), ["stop"])
|
|
1637
|
+
}, [P(e, {
|
|
1638
|
+
name: X(s)(t.name) === "hidden" ? "visibility_off" : "visibility",
|
|
1644
1639
|
size: 18
|
|
1645
|
-
}, null, 8, ["name"])], 10,
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1640
|
+
}, null, 8, ["name"])], 10, Tt),
|
|
1641
|
+
j("span", Et, J(t.title), 1),
|
|
1642
|
+
j("span", Dt, J(b(t.all)) + "/" + J(t.all.length), 1),
|
|
1643
|
+
P(e, {
|
|
1649
1644
|
name: "expand_more",
|
|
1650
1645
|
size: 18,
|
|
1651
|
-
class:
|
|
1646
|
+
class: B(["text-on-surface-variant transition-transform duration-300", g(t.name) ? "rotate-180" : ""])
|
|
1652
1647
|
}, null, 8, ["class"])
|
|
1653
|
-
], 8,
|
|
1648
|
+
], 8, wt), j("div", {
|
|
1654
1649
|
class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
1655
1650
|
style: te({ gridTemplateRows: g(t.name) ? "1fr" : "0fr" })
|
|
1656
|
-
}, [
|
|
1651
|
+
}, [j("div", { class: B(["flex min-h-0 flex-col gap-1.5 overflow-hidden", g(t.name) ? "pt-1.5" : ""]) }, [(H(!0), A(w, null, ie(t.layers, (e) => (H(), O(St, {
|
|
1657
1652
|
key: e.id,
|
|
1658
1653
|
layer: e,
|
|
1659
1654
|
expanded: v.value.has(e.id),
|
|
1660
1655
|
onToggleExpanded: (t) => y(e.id)
|
|
1661
|
-
},
|
|
1656
|
+
}, M({ _: 2 }, [n.$slots.actions ? {
|
|
1662
1657
|
name: "actions",
|
|
1663
|
-
fn:
|
|
1658
|
+
fn: Q((e) => [K(n.$slots, "actions", z({ ref_for: !0 }, e))]),
|
|
1664
1659
|
key: "0"
|
|
1665
1660
|
} : void 0]), 1032, [
|
|
1666
1661
|
"layer",
|
|
1667
1662
|
"expanded",
|
|
1668
1663
|
"onToggleExpanded"
|
|
1669
1664
|
]))), 128))], 2)], 4)]))), 128)),
|
|
1670
|
-
m.value.length ? (
|
|
1665
|
+
m.value.length ? (H(), A("div", Ot, [(H(!0), A(w, null, ie(m.value, (e) => (H(), O(St, {
|
|
1671
1666
|
key: e.id,
|
|
1672
1667
|
layer: e,
|
|
1673
1668
|
expanded: v.value.has(e.id),
|
|
1674
1669
|
onToggleExpanded: (t) => y(e.id)
|
|
1675
|
-
},
|
|
1670
|
+
}, M({ _: 2 }, [n.$slots.actions ? {
|
|
1676
1671
|
name: "actions",
|
|
1677
|
-
fn:
|
|
1672
|
+
fn: Q((e) => [K(n.$slots, "actions", z({ ref_for: !0 }, e))]),
|
|
1678
1673
|
key: "0"
|
|
1679
1674
|
} : void 0]), 1032, [
|
|
1680
1675
|
"layer",
|
|
1681
1676
|
"expanded",
|
|
1682
1677
|
"onToggleExpanded"
|
|
1683
|
-
]))), 128))])) :
|
|
1684
|
-
!p.value.length && !m.value.length ? (
|
|
1678
|
+
]))), 128))])) : k("", !0),
|
|
1679
|
+
!p.value.length && !m.value.length ? (H(), A("div", kt, [j("div", At, [P(e, {
|
|
1685
1680
|
name: "layers_clear",
|
|
1686
1681
|
size: 28,
|
|
1687
1682
|
class: "text-on-surface-variant"
|
|
1688
|
-
})]),
|
|
1683
|
+
})]), j("p", jt, J(X(r).mapNoLayers), 1)])) : k("", !0)
|
|
1689
1684
|
]));
|
|
1690
1685
|
}
|
|
1691
|
-
}),
|
|
1686
|
+
}), Nt = [
|
|
1692
1687
|
"aria-label",
|
|
1693
1688
|
"aria-checked",
|
|
1694
1689
|
"onClick"
|
|
1695
|
-
],
|
|
1690
|
+
], Pt = ["src"], Ft = ["aria-label", "aria-checked"], It = /* @__PURE__ */ F({
|
|
1696
1691
|
__name: "MMapBaseLayers",
|
|
1697
1692
|
props: {
|
|
1698
1693
|
imageBase: { default: "" },
|
|
@@ -1707,101 +1702,101 @@ var ct = { class: "flex min-w-0 flex-1 flex-col" }, lt = ["aria-label", "aria-pr
|
|
|
1707
1702
|
map: {}
|
|
1708
1703
|
},
|
|
1709
1704
|
setup(t) {
|
|
1710
|
-
let n = t, r =
|
|
1711
|
-
return (n,
|
|
1712
|
-
class:
|
|
1705
|
+
let n = t, r = c(), { baseLayers: i, baseLayer: a, setBaseLayer: o } = Te(() => n.map), s = (e, t) => /^(https?:|data:|\/\/)/.test(e) ? e : `${t}${e}`;
|
|
1706
|
+
return (n, c) => (H(), A("div", {
|
|
1707
|
+
class: B(["flex gap-2", t.vertical ? "flex-col" : "flex-row flex-wrap"]),
|
|
1713
1708
|
role: "radiogroup"
|
|
1714
|
-
}, [(
|
|
1709
|
+
}, [(H(!0), A(w, null, ie(X(i), (n) => (H(), O(p, {
|
|
1715
1710
|
key: n.id,
|
|
1716
1711
|
text: n.title,
|
|
1717
1712
|
placement: t.vertical ? "right" : "top"
|
|
1718
1713
|
}, {
|
|
1719
|
-
default:
|
|
1714
|
+
default: Q(() => [j("button", {
|
|
1720
1715
|
type: "button",
|
|
1721
1716
|
role: "radio",
|
|
1722
|
-
class:
|
|
1717
|
+
class: B(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", X(a) === n.id ? "m3-map-base--active border-primary" : "border-transparent"]),
|
|
1723
1718
|
"aria-label": n.title,
|
|
1724
|
-
"aria-checked":
|
|
1725
|
-
onClick: (e) =>
|
|
1726
|
-
}, [n.base?.image ? (
|
|
1719
|
+
"aria-checked": X(a) === n.id,
|
|
1720
|
+
onClick: (e) => X(o)(n.id)
|
|
1721
|
+
}, [n.base?.image ? (H(), A("img", {
|
|
1727
1722
|
key: 0,
|
|
1728
|
-
src:
|
|
1723
|
+
src: s(n.base.image, t.imageBase),
|
|
1729
1724
|
alt: "",
|
|
1730
1725
|
class: "size-full object-cover"
|
|
1731
|
-
}, null, 8,
|
|
1726
|
+
}, null, 8, Pt)) : (H(), O(e, {
|
|
1732
1727
|
key: 1,
|
|
1733
1728
|
name: "map",
|
|
1734
1729
|
size: 22,
|
|
1735
1730
|
class: "text-on-surface-variant"
|
|
1736
|
-
}))], 10,
|
|
1731
|
+
}))], 10, Nt)]),
|
|
1737
1732
|
_: 2
|
|
1738
|
-
}, 1032, ["text", "placement"]))), 128)), t.none ? (
|
|
1733
|
+
}, 1032, ["text", "placement"]))), 128)), t.none ? (H(), O(p, {
|
|
1739
1734
|
key: 0,
|
|
1740
|
-
text:
|
|
1735
|
+
text: X(r).mapNoBaseLayer,
|
|
1741
1736
|
placement: t.vertical ? "right" : "top"
|
|
1742
1737
|
}, {
|
|
1743
|
-
default:
|
|
1738
|
+
default: Q(() => [j("button", {
|
|
1744
1739
|
type: "button",
|
|
1745
1740
|
role: "radio",
|
|
1746
|
-
class:
|
|
1747
|
-
"aria-label":
|
|
1748
|
-
"aria-checked":
|
|
1749
|
-
onClick:
|
|
1750
|
-
}, [
|
|
1741
|
+
class: B(["m3-map-base grid size-12 shrink-0 cursor-pointer place-items-center rounded-full border-2 bg-surface-variant transition-[border-color,transform] duration-150 hover:scale-110", X(a) === null ? "m3-map-base--active border-primary" : "border-transparent"]),
|
|
1742
|
+
"aria-label": X(r).mapNoBaseLayer,
|
|
1743
|
+
"aria-checked": X(a) === null,
|
|
1744
|
+
onClick: c[0] ||= (e) => X(o)(null)
|
|
1745
|
+
}, [P(e, {
|
|
1751
1746
|
name: "layers_clear",
|
|
1752
1747
|
size: 22,
|
|
1753
1748
|
class: "text-on-surface-variant"
|
|
1754
|
-
})], 10,
|
|
1749
|
+
})], 10, Ft)]),
|
|
1755
1750
|
_: 1
|
|
1756
|
-
}, 8, ["text", "placement"])) :
|
|
1751
|
+
}, 8, ["text", "placement"])) : k("", !0)], 2));
|
|
1757
1752
|
}
|
|
1758
|
-
}),
|
|
1753
|
+
}), Lt = { class: "flex flex-col gap-2" }, Rt = { class: "flex items-center gap-2 bg-primary-container/40 px-4 py-2" }, zt = { class: "text-label-large text-on-primary-container" }, Bt = { class: "flex flex-col px-4 py-1" }, Vt = { class: "text-label-small text-on-surface-variant" }, Ht = { class: "text-body-medium text-on-surface" }, Ut = {
|
|
1759
1754
|
key: 0,
|
|
1760
1755
|
class: "break-words"
|
|
1761
|
-
},
|
|
1756
|
+
}, Wt = {
|
|
1762
1757
|
key: 1,
|
|
1763
1758
|
class: "text-body-small italic text-on-surface-variant"
|
|
1764
|
-
},
|
|
1759
|
+
}, Gt = /* @__PURE__ */ F({
|
|
1765
1760
|
__name: "MMapFeatureInfo",
|
|
1766
1761
|
props: { results: {} },
|
|
1767
1762
|
setup(t) {
|
|
1768
|
-
let n =
|
|
1769
|
-
return (r, i) => (
|
|
1763
|
+
let n = c();
|
|
1764
|
+
return (r, i) => (H(), A("div", Lt, [(H(!0), A(w, null, ie(t.results, (t, i) => (H(), A("div", {
|
|
1770
1765
|
key: i,
|
|
1771
1766
|
class: "overflow-hidden rounded-2xl bg-surface-container"
|
|
1772
|
-
}, [
|
|
1767
|
+
}, [j("div", Rt, [P(e, {
|
|
1773
1768
|
name: "layers",
|
|
1774
1769
|
size: 16,
|
|
1775
1770
|
class: "text-on-primary-container"
|
|
1776
|
-
}),
|
|
1771
|
+
}), j("span", zt, J(t.layer.title), 1)]), j("dl", Bt, [(H(!0), A(w, null, ie(t.fields, (e) => (H(), A("div", {
|
|
1777
1772
|
key: e.key,
|
|
1778
1773
|
class: "flex flex-col gap-0.5 border-b border-outline-variant py-1.5 last:border-b-0"
|
|
1779
|
-
}, [
|
|
1774
|
+
}, [j("dt", Vt, J(e.label), 1), j("dd", Ht, [K(r.$slots, "value", {
|
|
1780
1775
|
field: e,
|
|
1781
1776
|
result: t
|
|
1782
|
-
}, () => [e.value ? (
|
|
1777
|
+
}, () => [e.value ? (H(), A("span", Ut, J(e.value), 1)) : (H(), A("span", Wt, J(X(n).mapNoValue), 1))])])]))), 128))])]))), 128))]));
|
|
1783
1778
|
}
|
|
1784
|
-
}),
|
|
1779
|
+
}), Kt = (e) => e.metadata, qt = /* @__PURE__ */ new Set([
|
|
1785
1780
|
"fill",
|
|
1786
1781
|
"line",
|
|
1787
1782
|
"circle",
|
|
1788
1783
|
"symbol",
|
|
1789
1784
|
"fill-extrusion",
|
|
1790
1785
|
"heatmap"
|
|
1791
|
-
]),
|
|
1792
|
-
let t = e.layers.filter((e) => e.type !== "background"), n = (e) => e?.base === !0 || typeof e?.base == "object" && e.base !== null ? e : void 0, r = (e) => Array.isArray(e?.children) ? e.children : [], i = new Set(t.flatMap((e) => n(
|
|
1786
|
+
]), Jt = (e) => {
|
|
1787
|
+
let t = e.layers.filter((e) => e.type !== "background"), n = (e) => e?.base === !0 || typeof e?.base == "object" && e.base !== null ? e : void 0, r = (e) => Array.isArray(e?.children) ? e.children : [], i = new Set(t.flatMap((e) => n(Kt(e)) ? r(Kt(e)) : []));
|
|
1793
1788
|
return {
|
|
1794
1789
|
title: e.name,
|
|
1795
1790
|
groups: [],
|
|
1796
1791
|
layers: t.map((e) => {
|
|
1797
|
-
let t =
|
|
1792
|
+
let t = Kt(e), a = n(t);
|
|
1798
1793
|
return {
|
|
1799
1794
|
id: e.id,
|
|
1800
1795
|
title: t?.title ?? e.id,
|
|
1801
1796
|
listed: !a && !i.has(e.id) && t?.listed !== !1,
|
|
1802
1797
|
base: a ? { image: t.base.image ?? t.image } : void 0,
|
|
1803
1798
|
children: r(t),
|
|
1804
|
-
identify:
|
|
1799
|
+
identify: qt.has(e.type) && !a && !i.has(e.id) ? {
|
|
1805
1800
|
format: {},
|
|
1806
1801
|
exclude: []
|
|
1807
1802
|
} : !1,
|
|
@@ -1810,9 +1805,9 @@ var ct = { class: "flex min-w-0 flex-1 flex-col" }, lt = ["aria-label", "aria-pr
|
|
|
1810
1805
|
})
|
|
1811
1806
|
};
|
|
1812
1807
|
};
|
|
1813
|
-
function
|
|
1808
|
+
function Yt(e = {}) {
|
|
1814
1809
|
let t = e.legend ?? ((e, t) => {
|
|
1815
|
-
let n =
|
|
1810
|
+
let n = Kt(e)?.legend;
|
|
1816
1811
|
if (n?.show === !1) return;
|
|
1817
1812
|
if (n?.wmslegend) return n.wmslegend;
|
|
1818
1813
|
if (!t?.includes("/services/styles/")) return;
|
|
@@ -1828,7 +1823,7 @@ function qt(e = {}) {
|
|
|
1828
1823
|
title: e.alias ?? e.name
|
|
1829
1824
|
})),
|
|
1830
1825
|
layers: e.layers.filter((e) => e.type !== "background").map((e) => {
|
|
1831
|
-
let r =
|
|
1826
|
+
let r = Kt(e) ?? {}, i = { ...r.fields }, a = i.exclude ?? [];
|
|
1832
1827
|
delete i.exclude;
|
|
1833
1828
|
let o = {};
|
|
1834
1829
|
for (let [e, t] of Object.entries(i)) o[e] = {
|
|
@@ -1865,10 +1860,10 @@ function qt(e = {}) {
|
|
|
1865
1860
|
};
|
|
1866
1861
|
};
|
|
1867
1862
|
}
|
|
1868
|
-
function
|
|
1863
|
+
function Xt(e, t) {
|
|
1869
1864
|
return t?.label ?? e.charAt(0).toUpperCase() + e.slice(1);
|
|
1870
1865
|
}
|
|
1871
|
-
function
|
|
1866
|
+
function Zt(e, t) {
|
|
1872
1867
|
if (e == null || String(e).trim() === "") return "";
|
|
1873
1868
|
let n = String(e), r = typeof e == "number" ? e : Number(e);
|
|
1874
1869
|
if (t?.mask && !Number.isNaN(r)) {
|
|
@@ -1881,23 +1876,23 @@ function Yt(e, t) {
|
|
|
1881
1876
|
}
|
|
1882
1877
|
return t?.prefix && (n = `${t.prefix} ${n}`), t?.suffix && (n = `${n} ${t.suffix}`), n;
|
|
1883
1878
|
}
|
|
1884
|
-
var
|
|
1879
|
+
var Qt = /* @__PURE__ */ new Set([
|
|
1885
1880
|
"coordinates",
|
|
1886
1881
|
"mapCoordinates",
|
|
1887
1882
|
"layerId",
|
|
1888
1883
|
"__layerMetadata"
|
|
1889
1884
|
]);
|
|
1890
|
-
function
|
|
1885
|
+
function $t(e, t, n) {
|
|
1891
1886
|
let r = new Map((n?.layers ?? []).filter((t) => t.identify && e.getLayer(t.id)).map((e) => [e.id, e]));
|
|
1892
1887
|
if (!r.size) return [];
|
|
1893
1888
|
let i = [];
|
|
1894
1889
|
for (let n of e.queryRenderedFeatures(t, { layers: [...r.keys()] })) {
|
|
1895
1890
|
let e = r.get(n.layer.id);
|
|
1896
1891
|
if (!e || !e.identify) continue;
|
|
1897
|
-
let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !
|
|
1892
|
+
let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !Qt.has(e) && !a.includes(e) && !t[e]?.hidden).map(([e, n]) => ({
|
|
1898
1893
|
key: e,
|
|
1899
|
-
label:
|
|
1900
|
-
value:
|
|
1894
|
+
label: Xt(e, t[e]),
|
|
1895
|
+
value: Zt(n, t[e])
|
|
1901
1896
|
}));
|
|
1902
1897
|
o.length && i.push({
|
|
1903
1898
|
layer: e,
|
|
@@ -1908,7 +1903,7 @@ function Zt(e, t, n) {
|
|
|
1908
1903
|
return i;
|
|
1909
1904
|
}
|
|
1910
1905
|
// src/components/MMapIdentify.vue?vue&type=script&setup=true&lang.ts
|
|
1911
|
-
var
|
|
1906
|
+
var en = { class: "hidden" }, tn = /* @__PURE__ */ F({
|
|
1912
1907
|
inheritAttrs: !1,
|
|
1913
1908
|
__name: "MMapIdentify",
|
|
1914
1909
|
props: {
|
|
@@ -1927,16 +1922,16 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
1927
1922
|
},
|
|
1928
1923
|
emits: ["identify"],
|
|
1929
1924
|
setup(e, { expose: t, emit: n }) {
|
|
1930
|
-
let r = e, i = n, { on: a, onReady: o, activeTool: s } =
|
|
1925
|
+
let r = e, i = n, { on: a, onReady: o, activeTool: s } = he(), { model: c } = Te(), l = q([]), u = G([0, 0]), d = G(!1);
|
|
1931
1926
|
a("click", (e) => {
|
|
1932
1927
|
if (!r.enabled || s.value) return;
|
|
1933
1928
|
let t = e.target;
|
|
1934
|
-
l.value =
|
|
1929
|
+
l.value = $t(t, e.point, c.value), u.value = [e.lngLat.lng, e.lngLat.lat], d.value = l.value.length > 0, i("identify", l.value, u.value);
|
|
1935
1930
|
});
|
|
1936
1931
|
function f() {
|
|
1937
1932
|
d.value = !1;
|
|
1938
1933
|
}
|
|
1939
|
-
|
|
1934
|
+
Z(() => r.enabled, (e) => {
|
|
1940
1935
|
e || f();
|
|
1941
1936
|
});
|
|
1942
1937
|
let p, m = [], h = () => {
|
|
@@ -1953,38 +1948,34 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
1953
1948
|
}
|
|
1954
1949
|
return o((e) => {
|
|
1955
1950
|
p = e, _();
|
|
1956
|
-
}),
|
|
1951
|
+
}), Z(c, _), ne(() => {
|
|
1957
1952
|
m.forEach((e) => {
|
|
1958
1953
|
p?.off("mouseenter", e, h), p?.off("mouseleave", e, g);
|
|
1959
1954
|
});
|
|
1960
|
-
}), t({ close: f }), (t, n) => (
|
|
1955
|
+
}), t({ close: f }), (t, n) => (H(), A("div", en, [e.marker && d.value ? (H(), O(Pe, {
|
|
1961
1956
|
key: 0,
|
|
1962
1957
|
"lng-lat": u.value
|
|
1963
|
-
}, null, 8, ["lng-lat"])) :
|
|
1958
|
+
}, null, 8, ["lng-lat"])) : k("", !0), e.popup && l.value.length ? (H(), O(Ie, {
|
|
1964
1959
|
key: 1,
|
|
1965
1960
|
open: d.value,
|
|
1966
1961
|
"onUpdate:open": n[0] ||= (e) => d.value = e,
|
|
1967
1962
|
"lng-lat": u.value,
|
|
1968
1963
|
"max-width": "360px",
|
|
1969
|
-
offset: e.marker ?
|
|
1964
|
+
offset: e.marker ? X(Me) : void 0
|
|
1970
1965
|
}, {
|
|
1971
|
-
default:
|
|
1966
|
+
default: Q(() => [j("div", z({ class: "max-h-80 overflow-y-auto" }, t.$attrs), [K(t.$slots, "default", {
|
|
1972
1967
|
results: l.value,
|
|
1973
1968
|
lngLat: u.value,
|
|
1974
1969
|
close: f
|
|
1975
|
-
}, () => [
|
|
1970
|
+
}, () => [P(Gt, { results: l.value }, null, 8, ["results"])])], 16)]),
|
|
1976
1971
|
_: 3
|
|
1977
1972
|
}, 8, [
|
|
1978
1973
|
"open",
|
|
1979
1974
|
"lng-lat",
|
|
1980
1975
|
"offset"
|
|
1981
|
-
])) :
|
|
1976
|
+
])) : k("", !0)]));
|
|
1982
1977
|
}
|
|
1983
|
-
}),
|
|
1984
|
-
"title",
|
|
1985
|
-
"aria-label",
|
|
1986
|
-
"aria-pressed"
|
|
1987
|
-
], nn = { class: "-mx-4 -mt-3 mb-1 bg-primary-container px-3 py-1.5 text-label-medium text-on-primary-container" }, rn = { class: "flex flex-col" }, an = { class: "text-label-small text-on-surface-variant" }, on = { class: "text-body-small text-on-surface" }, sn = /* @__PURE__ */ P({
|
|
1978
|
+
}), nn = { class: "hidden" }, rn = ["aria-label", "aria-pressed"], an = { class: "-mx-4 -mt-3 mb-1 bg-primary-container px-3 py-1.5 text-label-medium text-on-primary-container" }, on = { class: "flex flex-col" }, sn = { class: "text-label-small text-on-surface-variant" }, cn = { class: "text-body-small text-on-surface" }, ln = /* @__PURE__ */ F({
|
|
1988
1979
|
__name: "MMapHover",
|
|
1989
1980
|
props: {
|
|
1990
1981
|
modelValue: {
|
|
@@ -1997,77 +1988,72 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
1997
1988
|
}
|
|
1998
1989
|
},
|
|
1999
1990
|
emits: ["update:modelValue"],
|
|
2000
|
-
setup(
|
|
2001
|
-
let
|
|
2002
|
-
function
|
|
2003
|
-
let t = e.features?.[0], n =
|
|
1991
|
+
setup(n, { emit: r }) {
|
|
1992
|
+
let i = n, a = r, o = c(), { onReady: s } = he(), { model: l } = Te(), u = D(() => (l.value?.layers ?? []).filter((e) => e.hover && e.hover.fields.length)), d = q(null), f = G([0, 0]), p = G(!1), m, h = [];
|
|
1993
|
+
function g(e) {
|
|
1994
|
+
let t = e.features?.[0], n = u.value.find((e) => e.id === t?.layer.id);
|
|
2004
1995
|
if (!t || !n || !n.hover) return;
|
|
2005
1996
|
let r = t.properties ?? {};
|
|
2006
|
-
|
|
1997
|
+
d.value = {
|
|
2007
1998
|
layer: n,
|
|
2008
1999
|
fields: n.hover.fields.map((e) => ({
|
|
2009
2000
|
key: e.key,
|
|
2010
|
-
label:
|
|
2011
|
-
value:
|
|
2001
|
+
label: Xt(e.key, e),
|
|
2002
|
+
value: Zt(r[e.key], e)
|
|
2012
2003
|
})).filter((e) => e.value)
|
|
2013
|
-
},
|
|
2014
|
-
}
|
|
2015
|
-
function g() {
|
|
2016
|
-
f.value = !1;
|
|
2004
|
+
}, f.value = [e.lngLat.lng, e.lngLat.lat], p.value = !0;
|
|
2017
2005
|
}
|
|
2018
2006
|
function _() {
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2007
|
+
p.value = !1;
|
|
2008
|
+
}
|
|
2009
|
+
function v() {
|
|
2010
|
+
if (m) {
|
|
2011
|
+
for (let e of h) m.off("mousemove", e, g), m.off("mouseleave", e, _);
|
|
2012
|
+
h = i.modelValue ? u.value.map((e) => e.id) : [];
|
|
2013
|
+
for (let e of h) m.on("mousemove", e, g), m.on("mouseleave", e, _);
|
|
2014
|
+
i.modelValue || (p.value = !1);
|
|
2024
2015
|
}
|
|
2025
2016
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
}),
|
|
2029
|
-
for (let e of
|
|
2017
|
+
s((e) => {
|
|
2018
|
+
m = e, v();
|
|
2019
|
+
}), Z([() => i.modelValue, u], v), ne(() => {
|
|
2020
|
+
for (let e of h) m?.off("mousemove", e, g), m?.off("mouseleave", e, _);
|
|
2030
2021
|
});
|
|
2031
|
-
let
|
|
2032
|
-
return (
|
|
2022
|
+
let y = D(() => i.control === !0 ? "top-right" : i.control || "top-right");
|
|
2023
|
+
return (r, i) => (H(), A("div", nn, [n.control && u.value.length ? (H(), O(ve, {
|
|
2033
2024
|
key: 0,
|
|
2034
|
-
position:
|
|
2025
|
+
position: y.value
|
|
2035
2026
|
}, {
|
|
2036
|
-
default:
|
|
2027
|
+
default: Q(() => [ce((H(), A("button", {
|
|
2037
2028
|
type: "button",
|
|
2038
2029
|
class: "grid place-items-center",
|
|
2039
|
-
|
|
2040
|
-
"aria-
|
|
2041
|
-
"
|
|
2042
|
-
|
|
2043
|
-
}, [N(e, {
|
|
2030
|
+
"aria-label": X(o).mapHoverInfo,
|
|
2031
|
+
"aria-pressed": n.modelValue,
|
|
2032
|
+
onClick: i[0] ||= (e) => a("update:modelValue", !n.modelValue)
|
|
2033
|
+
}, [P(e, {
|
|
2044
2034
|
name: "ads_click",
|
|
2045
2035
|
size: 20
|
|
2046
|
-
})], 8,
|
|
2036
|
+
})], 8, rn)), [[X(t), X(o).mapHoverInfo]])]),
|
|
2047
2037
|
_: 1
|
|
2048
|
-
}, 8, ["position"])) :
|
|
2038
|
+
}, 8, ["position"])) : k("", !0), d.value ? (H(), O(Ie, {
|
|
2049
2039
|
key: 1,
|
|
2050
|
-
open:
|
|
2051
|
-
"onUpdate:open":
|
|
2052
|
-
"lng-lat":
|
|
2040
|
+
open: p.value,
|
|
2041
|
+
"onUpdate:open": i[1] ||= (e) => p.value = e,
|
|
2042
|
+
"lng-lat": f.value,
|
|
2053
2043
|
"close-button": !1,
|
|
2054
2044
|
"close-on-click": !1,
|
|
2055
2045
|
offset: 12,
|
|
2056
2046
|
"max-width": "280px",
|
|
2057
2047
|
class: "m3-map-hover"
|
|
2058
2048
|
}, {
|
|
2059
|
-
default:
|
|
2049
|
+
default: Q(() => [j("p", an, J(d.value.layer.title), 1), j("dl", on, [(H(!0), A(w, null, ie(d.value.fields, (e) => (H(), A("div", {
|
|
2060
2050
|
key: e.key,
|
|
2061
2051
|
class: "border-b border-outline-variant py-1 last:border-b-0"
|
|
2062
|
-
}, [
|
|
2052
|
+
}, [j("dt", sn, J(e.label), 1), j("dd", cn, J(e.value), 1)]))), 128))])]),
|
|
2063
2053
|
_: 1
|
|
2064
|
-
}, 8, ["open", "lng-lat"])) :
|
|
2054
|
+
}, 8, ["open", "lng-lat"])) : k("", !0)]));
|
|
2065
2055
|
}
|
|
2066
|
-
}),
|
|
2067
|
-
"aria-label",
|
|
2068
|
-
"title",
|
|
2069
|
-
"onClick"
|
|
2070
|
-
], pn = /* @__PURE__ */ P({
|
|
2056
|
+
}), un = { class: "hidden" }, dn = ["title", "aria-pressed"], fn = ["title", "aria-pressed"], pn = ["title", "disabled"], mn = ["aria-label", "onClick"], hn = /* @__PURE__ */ F({
|
|
2071
2057
|
__name: "MMapMeasure",
|
|
2072
2058
|
props: {
|
|
2073
2059
|
modelValue: { default: null },
|
|
@@ -2077,15 +2063,15 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2077
2063
|
}
|
|
2078
2064
|
},
|
|
2079
2065
|
emits: ["update:modelValue", "change"],
|
|
2080
|
-
setup(
|
|
2081
|
-
let
|
|
2082
|
-
done: `${
|
|
2083
|
-
draft: `${
|
|
2084
|
-
handles: `${
|
|
2085
|
-
},
|
|
2066
|
+
setup(n, { expose: r, emit: i }) {
|
|
2067
|
+
let a = n, o = i, s = c(), { onReady: l, styleVersion: d, activeTool: f } = he(), p = u(["primary", "surface"]), m = `m3-measure-${ae()}`, g = {
|
|
2068
|
+
done: `${m}-done`,
|
|
2069
|
+
draft: `${m}-draft`,
|
|
2070
|
+
handles: `${m}-handles`
|
|
2071
|
+
}, _ = `${g.handles}-vertex`, v = `${g.handles}-midpoint`, y = [], b = [], x = null, S = !1, C = null, T = 0, E, M = G(null), F = G(0), I = q([]), L = () => typeof document < "u" && document.documentElement.lang || void 0, R = (e, t) => new Intl.NumberFormat(L(), {
|
|
2086
2072
|
minimumFractionDigits: t,
|
|
2087
2073
|
maximumFractionDigits: t
|
|
2088
|
-
}).format(e),
|
|
2074
|
+
}).format(e), z = (e) => e === 0 ? "" : e < 1e3 ? `${R(Math.round(e), 0)} m` : `${R(e / 1e3, 2)} km`, ee = (e) => e >= 1e6 ? `${R(e / 1e6, 2)} km²` : e >= 1e4 ? `${R(e / 1e4, 2)} ha` : `${R(Math.round(e), 0)} m²`, te = (e, t = {}) => ({
|
|
2089
2075
|
type: "Feature",
|
|
2090
2076
|
geometry: {
|
|
2091
2077
|
type: "Point",
|
|
@@ -2093,7 +2079,7 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2093
2079
|
},
|
|
2094
2080
|
properties: t
|
|
2095
2081
|
});
|
|
2096
|
-
function
|
|
2082
|
+
function V(e, t, n, r) {
|
|
2097
2083
|
let i = e.map((e) => te(e)), a = [];
|
|
2098
2084
|
if (e.length < 2) return {
|
|
2099
2085
|
features: i,
|
|
@@ -2107,26 +2093,26 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2107
2093
|
},
|
|
2108
2094
|
properties: {}
|
|
2109
2095
|
});
|
|
2110
|
-
let
|
|
2096
|
+
let o = (e) => {
|
|
2111
2097
|
for (let t = 0; t < e.length - 1; t++) {
|
|
2112
|
-
let r =
|
|
2098
|
+
let r = z(He(e[t], e[t + 1]));
|
|
2113
2099
|
r && a.push({
|
|
2114
2100
|
key: `${n}-s${t}`,
|
|
2115
|
-
at:
|
|
2101
|
+
at: We(e[t], e[t + 1]),
|
|
2116
2102
|
text: r,
|
|
2117
2103
|
kind: "segment"
|
|
2118
2104
|
});
|
|
2119
2105
|
}
|
|
2120
2106
|
};
|
|
2121
|
-
if (t === "distance")
|
|
2107
|
+
if (t === "distance") o(e), a.push({
|
|
2122
2108
|
key: `${n}-t`,
|
|
2123
2109
|
at: e[e.length - 1],
|
|
2124
|
-
text: `${
|
|
2110
|
+
text: `${s.mapTotal}: ${z(Ue(e))}`,
|
|
2125
2111
|
kind: "total",
|
|
2126
2112
|
m: r
|
|
2127
2113
|
});
|
|
2128
2114
|
else if (e.length >= 3) {
|
|
2129
|
-
let t =
|
|
2115
|
+
let t = Ke(e);
|
|
2130
2116
|
i.push({
|
|
2131
2117
|
type: "Feature",
|
|
2132
2118
|
geometry: {
|
|
@@ -2134,17 +2120,17 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2134
2120
|
coordinates: [t]
|
|
2135
2121
|
},
|
|
2136
2122
|
properties: {}
|
|
2137
|
-
}),
|
|
2123
|
+
}), o(t), a.push({
|
|
2138
2124
|
key: `${n}-a`,
|
|
2139
|
-
at:
|
|
2140
|
-
text: ee(
|
|
2125
|
+
at: qe(t),
|
|
2126
|
+
text: ee(Ge(t)),
|
|
2141
2127
|
kind: "area",
|
|
2142
2128
|
m: r
|
|
2143
2129
|
});
|
|
2144
2130
|
} else a.push({
|
|
2145
2131
|
key: `${n}-t`,
|
|
2146
2132
|
at: e[e.length - 1],
|
|
2147
|
-
text:
|
|
2133
|
+
text: z(Ue(e)),
|
|
2148
2134
|
kind: "total",
|
|
2149
2135
|
m: r
|
|
2150
2136
|
});
|
|
@@ -2156,44 +2142,44 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2156
2142
|
let re = (e) => ({
|
|
2157
2143
|
type: "FeatureCollection",
|
|
2158
2144
|
features: e
|
|
2159
|
-
}),
|
|
2160
|
-
function
|
|
2161
|
-
if (!
|
|
2162
|
-
let e =
|
|
2145
|
+
}), U = (e, t) => (E?.getSource(e))?.setData(re(t));
|
|
2146
|
+
function W() {
|
|
2147
|
+
if (!E) return;
|
|
2148
|
+
let e = y.map((e, t) => V(e.points, e.mode, `m${t}`, t)), t = M.value && b.length ? V(x ? [...b, x] : b, M.value, "draft") : {
|
|
2163
2149
|
features: [],
|
|
2164
2150
|
labels: []
|
|
2165
2151
|
};
|
|
2166
|
-
|
|
2152
|
+
U(g.done, e.flatMap((e) => e.features)), U(g.draft, t.features);
|
|
2167
2153
|
let n = [];
|
|
2168
|
-
|
|
2154
|
+
M.value || y.forEach((e, t) => {
|
|
2169
2155
|
(e.closed ? e.points.slice(0, -1) : e.points).forEach((e, r) => n.push(te(e, {
|
|
2170
2156
|
handle: "vertex",
|
|
2171
2157
|
m: t,
|
|
2172
2158
|
v: r
|
|
2173
2159
|
})));
|
|
2174
|
-
for (let r = 0; r < e.points.length - 1; r++) n.push(te(
|
|
2160
|
+
for (let r = 0; r < e.points.length - 1; r++) n.push(te(We(e.points[r], e.points[r + 1]), {
|
|
2175
2161
|
handle: "midpoint",
|
|
2176
2162
|
m: t,
|
|
2177
2163
|
after: r
|
|
2178
2164
|
}));
|
|
2179
|
-
}),
|
|
2165
|
+
}), U(g.handles, n), I.value = [...e.flatMap((e) => e.labels), ...t.labels];
|
|
2180
2166
|
}
|
|
2181
|
-
function
|
|
2182
|
-
|
|
2167
|
+
function K() {
|
|
2168
|
+
F.value = y.length, o("change", y.map((e) => ({
|
|
2183
2169
|
mode: e.mode,
|
|
2184
2170
|
points: e.points.map((e) => [...e]),
|
|
2185
2171
|
closed: e.closed,
|
|
2186
|
-
length:
|
|
2187
|
-
...e.mode === "area" || e.closed ? { area:
|
|
2172
|
+
length: Ue(e.points),
|
|
2173
|
+
...e.mode === "area" || e.closed ? { area: Ge(e.points) } : {}
|
|
2188
2174
|
})));
|
|
2189
2175
|
}
|
|
2190
|
-
let
|
|
2176
|
+
let Y = (e) => [
|
|
2191
2177
|
"==",
|
|
2192
2178
|
["geometry-type"],
|
|
2193
2179
|
e
|
|
2194
2180
|
];
|
|
2195
|
-
function
|
|
2196
|
-
let { primary: e, surface: t } =
|
|
2181
|
+
function oe() {
|
|
2182
|
+
let { primary: e, surface: t } = p.value;
|
|
2197
2183
|
return {
|
|
2198
2184
|
fill: { "fill-color": e },
|
|
2199
2185
|
line: { "line-color": e },
|
|
@@ -2203,20 +2189,20 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2203
2189
|
}
|
|
2204
2190
|
};
|
|
2205
2191
|
}
|
|
2206
|
-
function
|
|
2207
|
-
if (!
|
|
2208
|
-
for (let e of Object.values(
|
|
2192
|
+
function se() {
|
|
2193
|
+
if (!E) return;
|
|
2194
|
+
for (let e of Object.values(g)) E.getSource(e) || E.addSource(e, {
|
|
2209
2195
|
type: "geojson",
|
|
2210
2196
|
data: re([])
|
|
2211
2197
|
});
|
|
2212
|
-
let e =
|
|
2213
|
-
|
|
2198
|
+
let e = oe(), t = (e) => {
|
|
2199
|
+
E.getLayer(e.id) || E.addLayer(e);
|
|
2214
2200
|
};
|
|
2215
|
-
for (let [n, r] of [[
|
|
2201
|
+
for (let [n, r] of [[g.done, !1], [g.draft, !0]]) t({
|
|
2216
2202
|
id: `${n}-fill`,
|
|
2217
2203
|
type: "fill",
|
|
2218
2204
|
source: n,
|
|
2219
|
-
filter:
|
|
2205
|
+
filter: Y("Polygon"),
|
|
2220
2206
|
paint: {
|
|
2221
2207
|
...e.fill,
|
|
2222
2208
|
"fill-opacity": r ? .15 : .2
|
|
@@ -2239,7 +2225,7 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2239
2225
|
id: `${n}-points`,
|
|
2240
2226
|
type: "circle",
|
|
2241
2227
|
source: n,
|
|
2242
|
-
filter:
|
|
2228
|
+
filter: Y("Point"),
|
|
2243
2229
|
paint: {
|
|
2244
2230
|
...e.vertices,
|
|
2245
2231
|
"circle-radius": 5,
|
|
@@ -2247,9 +2233,9 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2247
2233
|
}
|
|
2248
2234
|
});
|
|
2249
2235
|
t({
|
|
2250
|
-
id:
|
|
2236
|
+
id: v,
|
|
2251
2237
|
type: "circle",
|
|
2252
|
-
source:
|
|
2238
|
+
source: g.handles,
|
|
2253
2239
|
filter: [
|
|
2254
2240
|
"==",
|
|
2255
2241
|
["get", "handle"],
|
|
@@ -2262,9 +2248,9 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2262
2248
|
"circle-opacity": .7
|
|
2263
2249
|
}
|
|
2264
2250
|
}), t({
|
|
2265
|
-
id:
|
|
2251
|
+
id: _,
|
|
2266
2252
|
type: "circle",
|
|
2267
|
-
source:
|
|
2253
|
+
source: g.handles,
|
|
2268
2254
|
filter: [
|
|
2269
2255
|
"==",
|
|
2270
2256
|
["get", "handle"],
|
|
@@ -2277,198 +2263,197 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2277
2263
|
}
|
|
2278
2264
|
});
|
|
2279
2265
|
}
|
|
2280
|
-
|
|
2281
|
-
if (!
|
|
2282
|
-
let e =
|
|
2283
|
-
if (
|
|
2266
|
+
Z(p, () => {
|
|
2267
|
+
if (!E) return;
|
|
2268
|
+
let e = oe(), t = (e, t) => {
|
|
2269
|
+
if (E.getLayer(e)) for (let [n, r] of Object.entries(t)) E.setPaintProperty(e, n, r);
|
|
2284
2270
|
};
|
|
2285
|
-
for (let n of [
|
|
2286
|
-
t(
|
|
2271
|
+
for (let n of [g.done, g.draft]) t(`${n}-fill`, e.fill), t(`${n}-line`, e.line), t(`${n}-points`, e.vertices);
|
|
2272
|
+
t(v, e.vertices), t(_, e.vertices);
|
|
2287
2273
|
});
|
|
2288
|
-
let
|
|
2289
|
-
function
|
|
2290
|
-
if (
|
|
2291
|
-
let t =
|
|
2274
|
+
let ue = (e) => [e.lngLat.lng, e.lngLat.lat];
|
|
2275
|
+
function de(e) {
|
|
2276
|
+
if (b.length >= 2) {
|
|
2277
|
+
let t = E.project(b[0]);
|
|
2292
2278
|
if (Math.hypot(t.x - e.point.x, t.y - e.point.y) < 20) {
|
|
2293
|
-
|
|
2279
|
+
S = !0, Ce();
|
|
2294
2280
|
return;
|
|
2295
2281
|
}
|
|
2296
2282
|
}
|
|
2297
|
-
|
|
2298
|
-
}
|
|
2299
|
-
function de(e) {
|
|
2300
|
-
b = le(e), w ||= requestAnimationFrame(() => {
|
|
2301
|
-
w = 0, U();
|
|
2302
|
-
});
|
|
2283
|
+
b.push(ue(e)), W();
|
|
2303
2284
|
}
|
|
2304
2285
|
function fe(e) {
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2286
|
+
x = ue(e), T ||= requestAnimationFrame(() => {
|
|
2287
|
+
T = 0, W();
|
|
2288
|
+
});
|
|
2308
2289
|
}
|
|
2309
2290
|
function pe(e) {
|
|
2310
|
-
e.
|
|
2291
|
+
if (e.preventDefault(), b.length < 2) return;
|
|
2292
|
+
let t = E.project(b[b.length - 1]), n = E.project(b[b.length - 2]);
|
|
2293
|
+
Math.hypot(t.x - n.x, t.y - n.y) < 10 && b.pop(), Ce();
|
|
2311
2294
|
}
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
function ve() {
|
|
2315
|
-
j.value && document.fullscreenElement && he()?.lock && he().lock(["Escape"]).then(() => {
|
|
2316
|
-
ge = !0;
|
|
2317
|
-
}, () => {});
|
|
2295
|
+
function me(e) {
|
|
2296
|
+
e.key === "Enter" && Ce();
|
|
2318
2297
|
}
|
|
2298
|
+
h(() => !!M.value, () => Ce(!0));
|
|
2299
|
+
let ge = () => typeof navigator < "u" ? navigator.keyboard : void 0, _e = !1;
|
|
2319
2300
|
function ye() {
|
|
2320
|
-
|
|
2301
|
+
M.value && document.fullscreenElement && ge()?.lock && ge().lock(["Escape"]).then(() => {
|
|
2302
|
+
_e = !0;
|
|
2303
|
+
}, () => {});
|
|
2321
2304
|
}
|
|
2322
2305
|
function be() {
|
|
2306
|
+
M.value || (_e && ge()?.unlock?.(), _e = !1);
|
|
2307
|
+
}
|
|
2308
|
+
function xe() {
|
|
2323
2309
|
let e, t = () => {
|
|
2324
|
-
document.removeEventListener("keyup", n, !0), clearTimeout(e), setTimeout(
|
|
2310
|
+
document.removeEventListener("keyup", n, !0), clearTimeout(e), setTimeout(be);
|
|
2325
2311
|
}, n = (e) => {
|
|
2326
2312
|
e.key === "Escape" && t();
|
|
2327
2313
|
};
|
|
2328
2314
|
document.addEventListener("keyup", n, !0), e = setTimeout(t, 1500);
|
|
2329
2315
|
}
|
|
2330
|
-
function
|
|
2331
|
-
if (
|
|
2332
|
-
if (
|
|
2333
|
-
|
|
2316
|
+
function Se(e) {
|
|
2317
|
+
if (E) {
|
|
2318
|
+
if (M.value === e) return Ce();
|
|
2319
|
+
M.value && Ce(), M.value = e, f.value = "measure", b = [], x = null, E.getCanvas().style.cursor = "crosshair", E.doubleClickZoom.disable(), E.on("click", de), E.on("mousemove", fe), E.on("dblclick", pe), document.addEventListener("keydown", me), document.addEventListener("fullscreenchange", ye), ye(), W(), a.modelValue !== e && o("update:modelValue", e);
|
|
2334
2320
|
}
|
|
2335
2321
|
}
|
|
2336
|
-
function
|
|
2337
|
-
if (!
|
|
2338
|
-
cancelAnimationFrame(
|
|
2339
|
-
let t =
|
|
2340
|
-
|
|
2341
|
-
mode:
|
|
2342
|
-
points: t ? [...
|
|
2322
|
+
function Ce(e = !1) {
|
|
2323
|
+
if (!E || !M.value) return;
|
|
2324
|
+
cancelAnimationFrame(T), T = 0;
|
|
2325
|
+
let t = b.length >= 3 && (S || M.value === "area");
|
|
2326
|
+
b.length >= 2 && y.push({
|
|
2327
|
+
mode: M.value,
|
|
2328
|
+
points: t ? [...b, [...b[0]]] : b,
|
|
2343
2329
|
closed: t
|
|
2344
|
-
}),
|
|
2330
|
+
}), b = [], x = null, S = !1, M.value = null, f.value === "measure" && (f.value = null), E.getCanvas().style.cursor = "", E.doubleClickZoom.enable(), E.off("click", de), E.off("mousemove", fe), E.off("dblclick", pe), document.removeEventListener("keydown", me), document.removeEventListener("fullscreenchange", ye), e && _e ? xe() : be(), W(), K(), a.modelValue !== null && o("update:modelValue", null);
|
|
2345
2331
|
}
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2332
|
+
function we(e) {
|
|
2333
|
+
y[e] && (y.splice(e, 1), W(), K());
|
|
2348
2334
|
}
|
|
2349
|
-
function
|
|
2350
|
-
|
|
2335
|
+
function Te() {
|
|
2336
|
+
M.value && Ce(), y.length = 0, W(), K();
|
|
2351
2337
|
}
|
|
2352
2338
|
function $(e) {
|
|
2353
2339
|
let t = e.features?.[0];
|
|
2354
|
-
if (!t ||
|
|
2340
|
+
if (!t || M.value || !E) return;
|
|
2355
2341
|
e.preventDefault();
|
|
2356
|
-
let n = t.properties.m, r =
|
|
2342
|
+
let n = t.properties.m, r = y[n];
|
|
2357
2343
|
if (!r) return;
|
|
2358
2344
|
let i = t.properties.v;
|
|
2359
|
-
t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0,
|
|
2345
|
+
t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0, ue(e))), C = {
|
|
2360
2346
|
m: n,
|
|
2361
2347
|
v: i
|
|
2362
|
-
},
|
|
2348
|
+
}, f.value = "measure", E.getCanvas().style.cursor = "grabbing";
|
|
2363
2349
|
let a = e.type === "touchstart";
|
|
2364
|
-
a &&
|
|
2350
|
+
a && E.dragPan.disable(), E.on(a ? "touchmove" : "mousemove", Ee), E.once(a ? "touchend" : "mouseup", De), W();
|
|
2365
2351
|
}
|
|
2366
|
-
function
|
|
2367
|
-
if (!
|
|
2368
|
-
let t =
|
|
2352
|
+
function Ee(e) {
|
|
2353
|
+
if (!C) return;
|
|
2354
|
+
let t = y[C.m];
|
|
2369
2355
|
if (!t) return;
|
|
2370
|
-
let n =
|
|
2371
|
-
t.points[
|
|
2356
|
+
let n = ue(e);
|
|
2357
|
+
t.points[C.v] = n, t.closed && C.v === 0 && (t.points[t.points.length - 1] = n), W();
|
|
2372
2358
|
}
|
|
2373
|
-
function
|
|
2374
|
-
|
|
2375
|
-
|
|
2359
|
+
function De() {
|
|
2360
|
+
E && (C = null, E.off("mousemove", Ee), E.off("touchmove", Ee), E.dragPan.enable(), E.getCanvas().style.cursor = "", K(), setTimeout(() => {
|
|
2361
|
+
f.value === "measure" && !M.value && (f.value = null);
|
|
2376
2362
|
}));
|
|
2377
2363
|
}
|
|
2378
|
-
let
|
|
2379
|
-
|
|
2380
|
-
},
|
|
2381
|
-
|
|
2364
|
+
let Oe = () => {
|
|
2365
|
+
E && !C && !M.value && (E.getCanvas().style.cursor = "grab");
|
|
2366
|
+
}, ke = () => {
|
|
2367
|
+
E && !C && !M.value && (E.getCanvas().style.cursor = "");
|
|
2382
2368
|
};
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
for (let t of [
|
|
2386
|
-
|
|
2387
|
-
}),
|
|
2388
|
-
|
|
2389
|
-
}),
|
|
2390
|
-
e && e !==
|
|
2369
|
+
l((e) => {
|
|
2370
|
+
E = e, se();
|
|
2371
|
+
for (let t of [_, v]) e.on("mousedown", t, $), e.on("touchstart", t, $), e.on("mouseenter", t, Oe), e.on("mouseleave", t, ke);
|
|
2372
|
+
a.modelValue && Se(a.modelValue);
|
|
2373
|
+
}), Z(d, () => {
|
|
2374
|
+
se(), W();
|
|
2375
|
+
}), Z(() => a.modelValue, (e) => {
|
|
2376
|
+
e && e !== M.value ? Se(e) : !e && M.value && Ce();
|
|
2391
2377
|
}), ne(() => {
|
|
2392
|
-
if (!
|
|
2393
|
-
|
|
2394
|
-
for (let e of [
|
|
2378
|
+
if (!E) return;
|
|
2379
|
+
M.value && Ce();
|
|
2380
|
+
for (let e of [_, v]) E.off("mousedown", e, $), E.off("touchstart", e, $), E.off("mouseenter", e, Oe), E.off("mouseleave", e, ke);
|
|
2395
2381
|
let e = [
|
|
2396
|
-
g,
|
|
2397
2382
|
_,
|
|
2398
|
-
|
|
2383
|
+
v,
|
|
2384
|
+
...[g.done, g.draft].flatMap((e) => [
|
|
2399
2385
|
`${e}-points`,
|
|
2400
2386
|
`${e}-line`,
|
|
2401
2387
|
`${e}-fill`
|
|
2402
2388
|
])
|
|
2403
2389
|
];
|
|
2404
|
-
for (let t of e)
|
|
2405
|
-
for (let e of Object.values(
|
|
2390
|
+
for (let t of e) E.getLayer(t) && E.removeLayer(t);
|
|
2391
|
+
for (let e of Object.values(g)) E.getSource(e) && E.removeSource(e);
|
|
2406
2392
|
});
|
|
2407
|
-
let
|
|
2408
|
-
return
|
|
2409
|
-
start:
|
|
2410
|
-
finish:
|
|
2411
|
-
clear:
|
|
2412
|
-
remove:
|
|
2413
|
-
}), (
|
|
2393
|
+
let Ae = D(() => a.control === !0 ? "top-right" : a.control || "top-right");
|
|
2394
|
+
return r({
|
|
2395
|
+
start: Se,
|
|
2396
|
+
finish: Ce,
|
|
2397
|
+
clear: Te,
|
|
2398
|
+
remove: we
|
|
2399
|
+
}), (r, i) => (H(), A("div", un, [n.control ? (H(), O(ve, {
|
|
2414
2400
|
key: 0,
|
|
2415
|
-
position:
|
|
2401
|
+
position: Ae.value
|
|
2416
2402
|
}, {
|
|
2417
|
-
default:
|
|
2418
|
-
|
|
2403
|
+
default: Q(() => [
|
|
2404
|
+
j("button", {
|
|
2419
2405
|
type: "button",
|
|
2420
2406
|
class: "grid place-items-center",
|
|
2421
|
-
title:
|
|
2422
|
-
"aria-pressed":
|
|
2423
|
-
onClick:
|
|
2424
|
-
}, [
|
|
2407
|
+
title: X(s).mapMeasureDistance,
|
|
2408
|
+
"aria-pressed": M.value === "distance",
|
|
2409
|
+
onClick: i[0] ||= (e) => Se("distance")
|
|
2410
|
+
}, [P(e, {
|
|
2425
2411
|
name: "straighten",
|
|
2426
2412
|
size: 20
|
|
2427
|
-
})], 8,
|
|
2428
|
-
|
|
2413
|
+
})], 8, dn),
|
|
2414
|
+
j("button", {
|
|
2429
2415
|
type: "button",
|
|
2430
2416
|
class: "grid place-items-center",
|
|
2431
|
-
title:
|
|
2432
|
-
"aria-pressed":
|
|
2433
|
-
onClick:
|
|
2434
|
-
}, [
|
|
2417
|
+
title: X(s).mapMeasureArea,
|
|
2418
|
+
"aria-pressed": M.value === "area",
|
|
2419
|
+
onClick: i[1] ||= (e) => Se("area")
|
|
2420
|
+
}, [P(e, {
|
|
2435
2421
|
name: "square_foot",
|
|
2436
2422
|
size: 20
|
|
2437
|
-
})], 8,
|
|
2438
|
-
|
|
2423
|
+
})], 8, fn),
|
|
2424
|
+
j("button", {
|
|
2439
2425
|
type: "button",
|
|
2440
2426
|
class: "grid place-items-center",
|
|
2441
|
-
title:
|
|
2442
|
-
disabled: !
|
|
2443
|
-
onClick:
|
|
2444
|
-
}, [
|
|
2427
|
+
title: X(s).mapClearMeasurements,
|
|
2428
|
+
disabled: !F.value && !M.value,
|
|
2429
|
+
onClick: Te
|
|
2430
|
+
}, [P(e, {
|
|
2445
2431
|
name: "delete",
|
|
2446
2432
|
size: 20
|
|
2447
|
-
})], 8,
|
|
2433
|
+
})], 8, pn)
|
|
2448
2434
|
]),
|
|
2449
2435
|
_: 1
|
|
2450
|
-
}, 8, ["position"])) :
|
|
2451
|
-
key:
|
|
2452
|
-
"lng-lat":
|
|
2453
|
-
anchor:
|
|
2454
|
-
offset:
|
|
2436
|
+
}, 8, ["position"])) : k("", !0), (H(!0), A(w, null, ie(I.value, (n) => (H(), O(Pe, {
|
|
2437
|
+
key: n.key,
|
|
2438
|
+
"lng-lat": n.at,
|
|
2439
|
+
anchor: n.kind === "area" ? "center" : "top",
|
|
2440
|
+
offset: n.kind === "area" ? [0, 0] : [0, 8],
|
|
2455
2441
|
class: "pointer-events-none"
|
|
2456
2442
|
}, {
|
|
2457
|
-
default:
|
|
2443
|
+
default: Q(() => [j("span", { class: B(["flex items-center gap-1 whitespace-nowrap rounded-full py-0.5 shadow-elevation-1", [n.kind === "segment" ? "bg-surface-container-highest text-label-small text-on-surface" : "bg-primary text-label-medium text-on-primary", n.m === void 0 ? "px-2" : "pr-0.5 pl-2"]]) }, [N(J(n.text) + " ", 1), n.m === void 0 ? k("", !0) : ce((H(), A("button", {
|
|
2458
2444
|
key: 0,
|
|
2459
2445
|
type: "button",
|
|
2460
2446
|
class: "pointer-events-auto grid size-5 cursor-pointer place-items-center rounded-full hover:bg-on-primary/12 focus-visible:outline-2 focus-visible:outline-on-primary",
|
|
2461
|
-
"aria-label":
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
}, [N(e, {
|
|
2447
|
+
"aria-label": X(s).mapDeleteMeasurement,
|
|
2448
|
+
onClick: le((e) => we(n.m), ["stop"]),
|
|
2449
|
+
onPointerdown: i[2] ||= le(() => {}, ["stop"]),
|
|
2450
|
+
onMousedown: i[3] ||= le(() => {}, ["stop"]),
|
|
2451
|
+
onTouchstart: i[4] ||= le(() => {}, ["stop"]),
|
|
2452
|
+
onDblclick: i[5] ||= le(() => {}, ["stop"])
|
|
2453
|
+
}, [P(e, {
|
|
2469
2454
|
name: "close",
|
|
2470
2455
|
size: 14
|
|
2471
|
-
})], 40,
|
|
2456
|
+
})], 40, mn)), [[X(t), X(s).mapDeleteMeasurement]])], 2)]),
|
|
2472
2457
|
_: 2
|
|
2473
2458
|
}, 1032, [
|
|
2474
2459
|
"lng-lat",
|
|
@@ -2476,16 +2461,11 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2476
2461
|
"offset"
|
|
2477
2462
|
]))), 128))]));
|
|
2478
2463
|
}
|
|
2479
|
-
}),
|
|
2480
|
-
"title",
|
|
2464
|
+
}), gn = { class: "hidden" }, _n = [
|
|
2481
2465
|
"aria-label",
|
|
2482
2466
|
"aria-pressed",
|
|
2483
2467
|
"onClick"
|
|
2484
|
-
],
|
|
2485
|
-
"title",
|
|
2486
|
-
"aria-label",
|
|
2487
|
-
"disabled"
|
|
2488
|
-
], _n = "draw", vn = 6, yn = /* @__PURE__ */ P({
|
|
2468
|
+
], vn = ["aria-label", "disabled"], yn = "draw", bn = 6, xn = /* @__PURE__ */ F({
|
|
2489
2469
|
__name: "MMapDraw",
|
|
2490
2470
|
props: {
|
|
2491
2471
|
modelValue: {},
|
|
@@ -2510,38 +2490,38 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2510
2490
|
"update:mode",
|
|
2511
2491
|
"select"
|
|
2512
2492
|
],
|
|
2513
|
-
setup(
|
|
2514
|
-
let
|
|
2493
|
+
setup(n, { expose: r, emit: i }) {
|
|
2494
|
+
let a = n, o = i, s = c(), { onReady: l, styleVersion: d, activeTool: f } = he(), p = u([
|
|
2515
2495
|
"primary",
|
|
2516
2496
|
"secondary",
|
|
2517
2497
|
"tertiary",
|
|
2518
2498
|
"surface"
|
|
2519
|
-
]),
|
|
2520
|
-
shapes: `${
|
|
2521
|
-
draft: `${
|
|
2522
|
-
handles: `${
|
|
2523
|
-
},
|
|
2524
|
-
`${
|
|
2525
|
-
`${
|
|
2526
|
-
`${
|
|
2527
|
-
],
|
|
2528
|
-
function
|
|
2529
|
-
|
|
2530
|
-
for (let e of
|
|
2531
|
-
|
|
2532
|
-
}
|
|
2533
|
-
function
|
|
2499
|
+
]), m = `m3-draw-${ae()}`, g = {
|
|
2500
|
+
shapes: `${m}-shapes`,
|
|
2501
|
+
draft: `${m}-draft`,
|
|
2502
|
+
handles: `${m}-handles`
|
|
2503
|
+
}, _ = [
|
|
2504
|
+
`${g.shapes}-fill`,
|
|
2505
|
+
`${g.shapes}-line`,
|
|
2506
|
+
`${g.shapes}-point`
|
|
2507
|
+
], v = `${g.handles}-vertex`, y = `${g.handles}-midpoint`, b = [], x = "", S = 1, C = [], T = null, E = null, j = 0, M, N = G(null), F = G(null), I = (e) => JSON.parse(JSON.stringify(e)), L = (e) => e === null ? void 0 : b.find((t) => t.id === e);
|
|
2508
|
+
function R(e) {
|
|
2509
|
+
b = I(e?.features ?? []);
|
|
2510
|
+
for (let e of b) (e.id === void 0 || e.id === null) && (e.id = Ce());
|
|
2511
|
+
F.value !== null && !L(F.value) && (F.value = null);
|
|
2512
|
+
}
|
|
2513
|
+
function z() {
|
|
2534
2514
|
let e = {
|
|
2535
2515
|
type: "FeatureCollection",
|
|
2536
|
-
features:
|
|
2516
|
+
features: I(b)
|
|
2537
2517
|
};
|
|
2538
|
-
|
|
2518
|
+
x = JSON.stringify(e.features), o("update:modelValue", e);
|
|
2539
2519
|
}
|
|
2540
2520
|
function ee(e) {
|
|
2541
2521
|
let t = e.geometry;
|
|
2542
2522
|
return t.type === "Point" ? [t.coordinates] : t.type === "LineString" ? t.coordinates : t.type === "Polygon" ? (t.coordinates[0] ?? []).slice(0, -1) : null;
|
|
2543
2523
|
}
|
|
2544
|
-
function
|
|
2524
|
+
function B(e, t) {
|
|
2545
2525
|
let n = e.geometry;
|
|
2546
2526
|
if (n.type === "Point") n.coordinates = t[0];
|
|
2547
2527
|
else if (n.type === "LineString") n.coordinates = t;
|
|
@@ -2550,7 +2530,7 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2550
2530
|
e[0] = [...t, [...t[0]]];
|
|
2551
2531
|
}
|
|
2552
2532
|
}
|
|
2553
|
-
let te = (e) => e.geometry.type === "Polygon" ? 3 : e.geometry.type === "LineString" ? 2 : 1,
|
|
2533
|
+
let te = (e) => e.geometry.type === "Polygon" ? 3 : e.geometry.type === "LineString" ? 2 : 1, V = (e, t = {}) => ({
|
|
2554
2534
|
type: "Feature",
|
|
2555
2535
|
geometry: {
|
|
2556
2536
|
type: "Point",
|
|
@@ -2560,29 +2540,29 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2560
2540
|
}), re = (e) => ({
|
|
2561
2541
|
type: "FeatureCollection",
|
|
2562
2542
|
features: e
|
|
2563
|
-
}),
|
|
2564
|
-
function
|
|
2565
|
-
if (!
|
|
2566
|
-
|
|
2543
|
+
}), U = (e, t) => (M?.getSource(e))?.setData(re(t));
|
|
2544
|
+
function W() {
|
|
2545
|
+
if (!M) return;
|
|
2546
|
+
U(g.shapes, b.map((e) => ({
|
|
2567
2547
|
type: "Feature",
|
|
2568
2548
|
geometry: e.geometry,
|
|
2569
2549
|
properties: {
|
|
2570
2550
|
...e.properties,
|
|
2571
2551
|
__draw_id: String(e.id),
|
|
2572
|
-
__draw_selected: e.id ===
|
|
2552
|
+
__draw_selected: e.id === F.value
|
|
2573
2553
|
}
|
|
2574
2554
|
})));
|
|
2575
2555
|
let e = [];
|
|
2576
|
-
if (
|
|
2577
|
-
let t =
|
|
2578
|
-
|
|
2556
|
+
if (N.value && N.value !== "point" && C.length) {
|
|
2557
|
+
let t = T ? [...C, T] : C;
|
|
2558
|
+
C.forEach((t) => e.push(V(t))), t.length >= 2 && e.push({
|
|
2579
2559
|
type: "Feature",
|
|
2580
2560
|
geometry: {
|
|
2581
2561
|
type: "LineString",
|
|
2582
|
-
coordinates:
|
|
2562
|
+
coordinates: N.value === "polygon" && t.length >= 3 ? [...t, t[0]] : t
|
|
2583
2563
|
},
|
|
2584
2564
|
properties: {}
|
|
2585
|
-
}),
|
|
2565
|
+
}), N.value === "polygon" && t.length >= 3 && e.push({
|
|
2586
2566
|
type: "Feature",
|
|
2587
2567
|
geometry: {
|
|
2588
2568
|
type: "Polygon",
|
|
@@ -2591,44 +2571,44 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2591
2571
|
properties: {}
|
|
2592
2572
|
});
|
|
2593
2573
|
}
|
|
2594
|
-
|
|
2595
|
-
let t = [], n =
|
|
2596
|
-
if (n && r && (r.forEach((e, n) => t.push(
|
|
2574
|
+
U(g.draft, e);
|
|
2575
|
+
let t = [], n = L(F.value), r = n && !N.value && a.editable ? ee(n) : null;
|
|
2576
|
+
if (n && r && (r.forEach((e, n) => t.push(V(e, {
|
|
2597
2577
|
handle: "vertex",
|
|
2598
2578
|
v: n
|
|
2599
2579
|
}))), n.geometry.type !== "Point")) {
|
|
2600
2580
|
let e = n.geometry.type === "Polygon" ? [...r, r[0]] : r;
|
|
2601
|
-
for (let n = 0; n < e.length - 1; n++) t.push(
|
|
2581
|
+
for (let n = 0; n < e.length - 1; n++) t.push(V(We(e[n], e[n + 1]), {
|
|
2602
2582
|
handle: "midpoint",
|
|
2603
2583
|
after: n
|
|
2604
2584
|
}));
|
|
2605
2585
|
}
|
|
2606
|
-
|
|
2586
|
+
U(g.handles, t);
|
|
2607
2587
|
}
|
|
2608
|
-
function
|
|
2609
|
-
|
|
2610
|
-
|
|
2588
|
+
function K() {
|
|
2589
|
+
j ||= requestAnimationFrame(() => {
|
|
2590
|
+
j = 0, W();
|
|
2611
2591
|
});
|
|
2612
2592
|
}
|
|
2613
|
-
let
|
|
2593
|
+
let q = (...e) => [
|
|
2614
2594
|
"match",
|
|
2615
2595
|
["geometry-type"],
|
|
2616
2596
|
e,
|
|
2617
2597
|
!0,
|
|
2618
2598
|
!1
|
|
2619
|
-
],
|
|
2599
|
+
], J = [
|
|
2620
2600
|
"==",
|
|
2621
2601
|
["get", "__draw_selected"],
|
|
2622
2602
|
!0
|
|
2623
2603
|
];
|
|
2624
|
-
function
|
|
2625
|
-
let e =
|
|
2604
|
+
function Y() {
|
|
2605
|
+
let e = p.value[a.color], t = p.value.surface;
|
|
2626
2606
|
return {
|
|
2627
2607
|
fill: {
|
|
2628
2608
|
"fill-color": e,
|
|
2629
2609
|
"fill-opacity": [
|
|
2630
2610
|
"case",
|
|
2631
|
-
|
|
2611
|
+
J,
|
|
2632
2612
|
.3,
|
|
2633
2613
|
.18
|
|
2634
2614
|
]
|
|
@@ -2637,7 +2617,7 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2637
2617
|
"line-color": e,
|
|
2638
2618
|
"line-width": [
|
|
2639
2619
|
"case",
|
|
2640
|
-
|
|
2620
|
+
J,
|
|
2641
2621
|
4,
|
|
2642
2622
|
2.5
|
|
2643
2623
|
]
|
|
@@ -2646,7 +2626,7 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2646
2626
|
"circle-color": e,
|
|
2647
2627
|
"circle-radius": [
|
|
2648
2628
|
"case",
|
|
2649
|
-
|
|
2629
|
+
J,
|
|
2650
2630
|
8,
|
|
2651
2631
|
6
|
|
2652
2632
|
],
|
|
@@ -2664,63 +2644,63 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2664
2644
|
}
|
|
2665
2645
|
};
|
|
2666
2646
|
}
|
|
2667
|
-
function
|
|
2668
|
-
if (!
|
|
2669
|
-
for (let e of Object.values(
|
|
2647
|
+
function oe() {
|
|
2648
|
+
if (!M) return;
|
|
2649
|
+
for (let e of Object.values(g)) M.getSource(e) || M.addSource(e, {
|
|
2670
2650
|
type: "geojson",
|
|
2671
2651
|
data: re([])
|
|
2672
2652
|
});
|
|
2673
|
-
let e =
|
|
2674
|
-
|
|
2653
|
+
let e = Y(), t = (e) => {
|
|
2654
|
+
M.getLayer(e.id) || M.addLayer(e);
|
|
2675
2655
|
};
|
|
2676
2656
|
t({
|
|
2677
|
-
id:
|
|
2657
|
+
id: _[0],
|
|
2678
2658
|
type: "fill",
|
|
2679
|
-
source:
|
|
2680
|
-
filter:
|
|
2659
|
+
source: g.shapes,
|
|
2660
|
+
filter: q("Polygon", "MultiPolygon"),
|
|
2681
2661
|
paint: e.fill
|
|
2682
2662
|
}), t({
|
|
2683
|
-
id:
|
|
2663
|
+
id: _[1],
|
|
2684
2664
|
type: "line",
|
|
2685
|
-
source:
|
|
2686
|
-
filter:
|
|
2665
|
+
source: g.shapes,
|
|
2666
|
+
filter: q("LineString", "MultiLineString", "Polygon", "MultiPolygon"),
|
|
2687
2667
|
paint: e.line
|
|
2688
2668
|
}), t({
|
|
2689
|
-
id:
|
|
2669
|
+
id: _[2],
|
|
2690
2670
|
type: "circle",
|
|
2691
|
-
source:
|
|
2692
|
-
filter:
|
|
2671
|
+
source: g.shapes,
|
|
2672
|
+
filter: q("Point", "MultiPoint"),
|
|
2693
2673
|
paint: e.point
|
|
2694
2674
|
}), t({
|
|
2695
|
-
id: `${
|
|
2675
|
+
id: `${g.draft}-fill`,
|
|
2696
2676
|
type: "fill",
|
|
2697
|
-
source:
|
|
2698
|
-
filter:
|
|
2677
|
+
source: g.draft,
|
|
2678
|
+
filter: q("Polygon"),
|
|
2699
2679
|
paint: e.draftFill
|
|
2700
2680
|
}), t({
|
|
2701
|
-
id: `${
|
|
2681
|
+
id: `${g.draft}-line`,
|
|
2702
2682
|
type: "line",
|
|
2703
|
-
source:
|
|
2704
|
-
filter:
|
|
2683
|
+
source: g.draft,
|
|
2684
|
+
filter: q("LineString"),
|
|
2705
2685
|
paint: {
|
|
2706
2686
|
...e.draftLine,
|
|
2707
2687
|
"line-width": 2.5,
|
|
2708
2688
|
"line-dasharray": [2, 2]
|
|
2709
2689
|
}
|
|
2710
2690
|
}), t({
|
|
2711
|
-
id: `${
|
|
2691
|
+
id: `${g.draft}-point`,
|
|
2712
2692
|
type: "circle",
|
|
2713
|
-
source:
|
|
2714
|
-
filter:
|
|
2693
|
+
source: g.draft,
|
|
2694
|
+
filter: q("Point"),
|
|
2715
2695
|
paint: {
|
|
2716
2696
|
...e.handle,
|
|
2717
2697
|
"circle-radius": 5,
|
|
2718
2698
|
"circle-stroke-width": 2
|
|
2719
2699
|
}
|
|
2720
2700
|
}), t({
|
|
2721
|
-
id:
|
|
2701
|
+
id: y,
|
|
2722
2702
|
type: "circle",
|
|
2723
|
-
source:
|
|
2703
|
+
source: g.handles,
|
|
2724
2704
|
filter: [
|
|
2725
2705
|
"==",
|
|
2726
2706
|
["get", "handle"],
|
|
@@ -2733,9 +2713,9 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2733
2713
|
"circle-opacity": .7
|
|
2734
2714
|
}
|
|
2735
2715
|
}), t({
|
|
2736
|
-
id:
|
|
2716
|
+
id: v,
|
|
2737
2717
|
type: "circle",
|
|
2738
|
-
source:
|
|
2718
|
+
source: g.handles,
|
|
2739
2719
|
filter: [
|
|
2740
2720
|
"==",
|
|
2741
2721
|
["get", "handle"],
|
|
@@ -2748,230 +2728,228 @@ var Qt = { class: "hidden" }, $t = /* @__PURE__ */ P({
|
|
|
2748
2728
|
}
|
|
2749
2729
|
});
|
|
2750
2730
|
}
|
|
2751
|
-
|
|
2752
|
-
if (!
|
|
2753
|
-
let e =
|
|
2754
|
-
if (
|
|
2731
|
+
Z([p, () => a.color], () => {
|
|
2732
|
+
if (!M) return;
|
|
2733
|
+
let e = Y(), t = (e, t) => {
|
|
2734
|
+
if (M.getLayer(e)) for (let [n, r] of Object.entries(t)) M.setPaintProperty(e, n, r);
|
|
2755
2735
|
};
|
|
2756
|
-
t(
|
|
2736
|
+
t(_[0], e.fill), t(_[1], e.line), t(_[2], e.point), t(`${g.draft}-fill`, e.draftFill), t(`${g.draft}-line`, e.draftLine), t(`${g.draft}-point`, e.handle), t(y, e.handle), t(v, e.handle);
|
|
2757
2737
|
});
|
|
2758
|
-
function
|
|
2759
|
-
if (e !== null && !
|
|
2760
|
-
|
|
2761
|
-
let t =
|
|
2762
|
-
|
|
2738
|
+
function se(e) {
|
|
2739
|
+
if (e !== null && !L(e) && (e = null), F.value === e) return;
|
|
2740
|
+
F.value = e, W();
|
|
2741
|
+
let t = L(e);
|
|
2742
|
+
o("select", t ? I(t) : null);
|
|
2763
2743
|
}
|
|
2764
|
-
function
|
|
2765
|
-
let t =
|
|
2766
|
-
t < 0 || (
|
|
2744
|
+
function le(e = F.value) {
|
|
2745
|
+
let t = b.findIndex((t) => t.id === e);
|
|
2746
|
+
t < 0 || (b.splice(t, 1), F.value === e && (F.value = null, o("select", null)), W(), z());
|
|
2767
2747
|
}
|
|
2768
|
-
function
|
|
2769
|
-
|
|
2748
|
+
function ue() {
|
|
2749
|
+
N.value && $(), b.length && (b = [], F.value !== null && (F.value = null, o("select", null)), W(), z());
|
|
2770
2750
|
}
|
|
2771
|
-
let
|
|
2772
|
-
function
|
|
2773
|
-
if (
|
|
2774
|
-
let { x: t, y: n } = e.point, r = [[t -
|
|
2775
|
-
if (
|
|
2776
|
-
let o =
|
|
2777
|
-
|
|
2778
|
-
}
|
|
2779
|
-
function
|
|
2780
|
-
|
|
2781
|
-
|
|
2751
|
+
let de = (e) => [e.lngLat.lng, e.lngLat.lat];
|
|
2752
|
+
function fe(e) {
|
|
2753
|
+
if (N.value || !M || !a.editable || f.value && f.value !== yn) return;
|
|
2754
|
+
let { x: t, y: n } = e.point, r = [[t - bn, n - bn], [t + bn, n + bn]], i = M.queryRenderedFeatures(r, { layers: _.filter((e) => M.getLayer(e)) })[0]?.properties?.__draw_id;
|
|
2755
|
+
if (i === void 0) return se(null);
|
|
2756
|
+
let o = b.find((e) => String(e.id) === i);
|
|
2757
|
+
se(o ? o.id : null);
|
|
2758
|
+
}
|
|
2759
|
+
function pe() {
|
|
2760
|
+
N.value || !a.editable || f.value || (f.value = yn, setTimeout(() => {
|
|
2761
|
+
f.value === yn && !N.value && !E && (f.value = null);
|
|
2782
2762
|
}, 0));
|
|
2783
2763
|
}
|
|
2784
|
-
let
|
|
2785
|
-
|
|
2786
|
-
},
|
|
2787
|
-
|
|
2764
|
+
let me = () => {
|
|
2765
|
+
M && !N.value && !E && a.editable && (M.getCanvas().style.cursor = "pointer");
|
|
2766
|
+
}, ge = () => {
|
|
2767
|
+
M && !N.value && !E && (M.getCanvas().style.cursor = "");
|
|
2788
2768
|
};
|
|
2789
|
-
function
|
|
2790
|
-
if (
|
|
2791
|
-
if (
|
|
2769
|
+
function _e(e) {
|
|
2770
|
+
if (N.value && M) {
|
|
2771
|
+
if (N.value === "point") we({
|
|
2792
2772
|
type: "Point",
|
|
2793
|
-
coordinates:
|
|
2773
|
+
coordinates: de(e)
|
|
2794
2774
|
}), $();
|
|
2795
2775
|
else {
|
|
2796
|
-
if (
|
|
2797
|
-
let t =
|
|
2776
|
+
if (N.value === "polygon" && C.length >= 3) {
|
|
2777
|
+
let t = M.project(C[0]);
|
|
2798
2778
|
if (Math.hypot(t.x - e.point.x, t.y - e.point.y) < 20) return $();
|
|
2799
2779
|
}
|
|
2800
|
-
|
|
2780
|
+
C.push(de(e)), W();
|
|
2801
2781
|
}
|
|
2802
2782
|
}
|
|
2803
2783
|
}
|
|
2804
|
-
function ve(e) {
|
|
2805
|
-
w = ue(e), G();
|
|
2806
|
-
}
|
|
2807
2784
|
function ye(e) {
|
|
2808
|
-
|
|
2809
|
-
let t = j.project(S[S.length - 1]), n = j.project(S[S.length - 2]);
|
|
2810
|
-
Math.hypot(t.x - n.x, t.y - n.y) < 10 && S.pop(), $();
|
|
2785
|
+
T = de(e), K();
|
|
2811
2786
|
}
|
|
2812
|
-
function be() {
|
|
2787
|
+
function be(e) {
|
|
2788
|
+
if (e.preventDefault(), !M || C.length < 2) return;
|
|
2789
|
+
let t = M.project(C[C.length - 1]), n = M.project(C[C.length - 2]);
|
|
2790
|
+
Math.hypot(t.x - n.x, t.y - n.y) < 10 && C.pop(), $();
|
|
2791
|
+
}
|
|
2792
|
+
function xe() {
|
|
2813
2793
|
let e = document.activeElement;
|
|
2814
|
-
return !e || e === document.body ? !0 :
|
|
2794
|
+
return !e || e === document.body ? !0 : M?.getContainer().contains(e) ? !(e instanceof HTMLElement && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName))) : !1;
|
|
2815
2795
|
}
|
|
2816
|
-
function
|
|
2817
|
-
|
|
2796
|
+
function Se(e) {
|
|
2797
|
+
xe() && (N.value ? e.key === "Enter" ? (e.preventDefault(), $()) : e.key === "Backspace" && C.length && (e.preventDefault(), C.pop(), W()) : (e.key === "Delete" || e.key === "Backspace") && F.value !== null && a.editable && (e.preventDefault(), le()));
|
|
2818
2798
|
}
|
|
2819
|
-
|
|
2820
|
-
function
|
|
2821
|
-
let e = `shape-${
|
|
2822
|
-
for (;
|
|
2799
|
+
h(() => !!N.value || F.value !== null, () => N.value ? $() : se(null));
|
|
2800
|
+
function Ce() {
|
|
2801
|
+
let e = `shape-${S++}`;
|
|
2802
|
+
for (; b.some((t) => t.id === e);) e = `shape-${S++}`;
|
|
2823
2803
|
return e;
|
|
2824
2804
|
}
|
|
2825
|
-
function
|
|
2805
|
+
function we(e) {
|
|
2826
2806
|
let t = {
|
|
2827
2807
|
type: "Feature",
|
|
2828
|
-
id:
|
|
2808
|
+
id: Ce(),
|
|
2829
2809
|
geometry: e,
|
|
2830
2810
|
properties: {}
|
|
2831
2811
|
};
|
|
2832
|
-
|
|
2812
|
+
b.push(t), F.value = a.editable ? t.id : null, z(), a.editable && o("select", I(t));
|
|
2833
2813
|
}
|
|
2834
|
-
function
|
|
2835
|
-
if (
|
|
2836
|
-
if (
|
|
2837
|
-
|
|
2814
|
+
function Te(e) {
|
|
2815
|
+
if (M) {
|
|
2816
|
+
if (N.value === e) return $();
|
|
2817
|
+
N.value && $(), F.value !== null && se(null), N.value = e, f.value = yn, C = [], T = null, M.getCanvas().style.cursor = "crosshair", M.doubleClickZoom.disable(), M.on("click", _e), M.on("mousemove", ye), M.on("dblclick", be), W(), a.mode !== e && o("update:mode", e);
|
|
2838
2818
|
}
|
|
2839
2819
|
}
|
|
2840
2820
|
function $() {
|
|
2841
|
-
if (!
|
|
2842
|
-
cancelAnimationFrame(
|
|
2843
|
-
let e =
|
|
2844
|
-
|
|
2821
|
+
if (!M || !N.value) return;
|
|
2822
|
+
cancelAnimationFrame(j), j = 0;
|
|
2823
|
+
let e = N.value, t = C;
|
|
2824
|
+
C = [], T = null, N.value = null, f.value === yn && (f.value = null), M.getCanvas().style.cursor = "", M.doubleClickZoom.enable(), M.off("click", _e), M.off("mousemove", ye), M.off("dblclick", be), e === "line" && t.length >= 2 ? we({
|
|
2845
2825
|
type: "LineString",
|
|
2846
2826
|
coordinates: t
|
|
2847
|
-
}) : e === "polygon" && t.length >= 3 &&
|
|
2827
|
+
}) : e === "polygon" && t.length >= 3 && we({
|
|
2848
2828
|
type: "Polygon",
|
|
2849
2829
|
coordinates: [[...t, [...t[0]]]]
|
|
2850
|
-
}),
|
|
2830
|
+
}), W(), a.mode !== null && o("update:mode", null);
|
|
2851
2831
|
}
|
|
2852
|
-
function
|
|
2853
|
-
let t = e.features?.[0], n =
|
|
2854
|
-
if (!t || !n ||
|
|
2832
|
+
function Ee(e) {
|
|
2833
|
+
let t = e.features?.[0], n = L(F.value);
|
|
2834
|
+
if (!t || !n || N.value || !M || !a.editable) return;
|
|
2855
2835
|
let r = ee(n);
|
|
2856
2836
|
if (!r) return;
|
|
2857
2837
|
e.preventDefault();
|
|
2858
|
-
let
|
|
2859
|
-
t.properties.handle === "midpoint" && (
|
|
2838
|
+
let i = t.properties.v;
|
|
2839
|
+
t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.splice(i, 0, de(e)), B(n, r)), E = {
|
|
2860
2840
|
id: n.id,
|
|
2861
|
-
v:
|
|
2841
|
+
v: i,
|
|
2862
2842
|
moved: t.properties.handle === "midpoint"
|
|
2863
|
-
},
|
|
2843
|
+
}, f.value = yn, M.getCanvas().style.cursor = "grabbing";
|
|
2864
2844
|
let o = e.type === "touchstart";
|
|
2865
|
-
o &&
|
|
2866
|
-
}
|
|
2867
|
-
function Te(e) {
|
|
2868
|
-
let t = T && I(T.id), n = t && ee(t);
|
|
2869
|
-
T && t && n && (n[T.v] = ue(e), z(t, n), T.moved = !0, G());
|
|
2845
|
+
o && M.dragPan.disable(), M.on(o ? "touchmove" : "mousemove", De), M.once(o ? "touchend" : "mouseup", Oe), W();
|
|
2870
2846
|
}
|
|
2871
|
-
function
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2847
|
+
function De(e) {
|
|
2848
|
+
let t = E && L(E.id), n = t && ee(t);
|
|
2849
|
+
E && t && n && (n[E.v] = de(e), B(t, n), E.moved = !0, K());
|
|
2850
|
+
}
|
|
2851
|
+
function Oe() {
|
|
2852
|
+
if (!M) return;
|
|
2853
|
+
let e = E?.moved;
|
|
2854
|
+
E = null, M.off("mousemove", De), M.off("touchmove", De), M.dragPan.enable(), M.getCanvas().style.cursor = "", W(), e && z(), setTimeout(() => {
|
|
2855
|
+
f.value === yn && !N.value && (f.value = null);
|
|
2876
2856
|
});
|
|
2877
2857
|
}
|
|
2878
|
-
function
|
|
2879
|
-
let t = e.features?.[0], n =
|
|
2880
|
-
if (!t || !n ||
|
|
2858
|
+
function ke(e) {
|
|
2859
|
+
let t = e.features?.[0], n = L(F.value);
|
|
2860
|
+
if (!t || !n || N.value || !a.editable) return;
|
|
2881
2861
|
e.preventDefault();
|
|
2882
2862
|
let r = ee(n);
|
|
2883
|
-
!r || r.length <= te(n) || (r.splice(t.properties.v, 1),
|
|
2863
|
+
!r || r.length <= te(n) || (r.splice(t.properties.v, 1), B(n, r), W(), z());
|
|
2884
2864
|
}
|
|
2885
|
-
let
|
|
2886
|
-
|
|
2887
|
-
},
|
|
2888
|
-
|
|
2865
|
+
let Ae = () => {
|
|
2866
|
+
M && !E && !N.value && (M.getCanvas().style.cursor = "grab");
|
|
2867
|
+
}, je = () => {
|
|
2868
|
+
M && !E && !N.value && (M.getCanvas().style.cursor = "");
|
|
2889
2869
|
};
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
for (let t of
|
|
2893
|
-
for (let t of [
|
|
2894
|
-
e.on("dblclick",
|
|
2895
|
-
}),
|
|
2896
|
-
|
|
2897
|
-
}),
|
|
2898
|
-
JSON.stringify(e?.features ?? []) !==
|
|
2899
|
-
}, { deep: !0 }),
|
|
2900
|
-
e && e !==
|
|
2901
|
-
}),
|
|
2902
|
-
!e &&
|
|
2870
|
+
R(a.modelValue), x = JSON.stringify(b), l((e) => {
|
|
2871
|
+
M = e, oe(), W(), e.on("click", fe);
|
|
2872
|
+
for (let t of _) e.on("mousedown", t, pe), e.on("touchstart", t, pe), e.on("mouseenter", t, me), e.on("mouseleave", t, ge);
|
|
2873
|
+
for (let t of [v, y]) e.on("mousedown", t, Ee), e.on("touchstart", t, Ee), e.on("mouseenter", t, Ae), e.on("mouseleave", t, je);
|
|
2874
|
+
e.on("dblclick", v, ke), document.addEventListener("keydown", Se), a.mode && Te(a.mode);
|
|
2875
|
+
}), Z(d, () => {
|
|
2876
|
+
oe(), W();
|
|
2877
|
+
}), Z(() => a.modelValue, (e) => {
|
|
2878
|
+
JSON.stringify(e?.features ?? []) !== x && (R(e), x = JSON.stringify(b), W());
|
|
2879
|
+
}, { deep: !0 }), Z(() => a.mode, (e) => {
|
|
2880
|
+
e && e !== N.value ? Te(e) : !e && N.value && $();
|
|
2881
|
+
}), Z(() => a.editable, (e) => {
|
|
2882
|
+
!e && F.value !== null && se(null);
|
|
2903
2883
|
}), ne(() => {
|
|
2904
|
-
if (document.removeEventListener("keydown",
|
|
2905
|
-
|
|
2906
|
-
for (let e of
|
|
2907
|
-
for (let e of [
|
|
2908
|
-
|
|
2884
|
+
if (document.removeEventListener("keydown", Se), !M) return;
|
|
2885
|
+
N.value && $(), cancelAnimationFrame(j), M.off("click", fe);
|
|
2886
|
+
for (let e of _) M.off("mousedown", e, pe), M.off("touchstart", e, pe), M.off("mouseenter", e, me), M.off("mouseleave", e, ge);
|
|
2887
|
+
for (let e of [v, y]) M.off("mousedown", e, Ee), M.off("touchstart", e, Ee), M.off("mouseenter", e, Ae), M.off("mouseleave", e, je);
|
|
2888
|
+
M.off("dblclick", v, ke);
|
|
2909
2889
|
let e = [
|
|
2910
|
-
_,
|
|
2911
2890
|
v,
|
|
2912
|
-
|
|
2913
|
-
`${
|
|
2914
|
-
`${
|
|
2915
|
-
|
|
2891
|
+
y,
|
|
2892
|
+
`${g.draft}-point`,
|
|
2893
|
+
`${g.draft}-line`,
|
|
2894
|
+
`${g.draft}-fill`,
|
|
2895
|
+
...[..._].reverse()
|
|
2916
2896
|
];
|
|
2917
|
-
for (let t of e)
|
|
2918
|
-
for (let e of Object.values(
|
|
2919
|
-
|
|
2897
|
+
for (let t of e) M.getLayer(t) && M.removeLayer(t);
|
|
2898
|
+
for (let e of Object.values(g)) M.getSource(e) && M.removeSource(e);
|
|
2899
|
+
M = void 0;
|
|
2920
2900
|
});
|
|
2921
|
-
let
|
|
2901
|
+
let Me = D(() => a.control === !0 ? "top-right" : a.control || "top-right"), Ne = {
|
|
2922
2902
|
point: "location_on",
|
|
2923
2903
|
line: "polyline",
|
|
2924
2904
|
polygon: "pentagon"
|
|
2925
|
-
},
|
|
2926
|
-
point:
|
|
2927
|
-
line:
|
|
2928
|
-
polygon:
|
|
2905
|
+
}, Pe = D(() => ({
|
|
2906
|
+
point: s.mapDrawPoint,
|
|
2907
|
+
line: s.mapDrawLine,
|
|
2908
|
+
polygon: s.mapDrawPolygon
|
|
2929
2909
|
}));
|
|
2930
|
-
return
|
|
2931
|
-
start:
|
|
2910
|
+
return r({
|
|
2911
|
+
start: Te,
|
|
2932
2912
|
finish: $,
|
|
2933
|
-
select:
|
|
2934
|
-
remove:
|
|
2935
|
-
clear:
|
|
2936
|
-
}), (
|
|
2913
|
+
select: se,
|
|
2914
|
+
remove: le,
|
|
2915
|
+
clear: ue
|
|
2916
|
+
}), (r, i) => (H(), A("div", gn, [n.control ? (H(), O(ve, {
|
|
2937
2917
|
key: 0,
|
|
2938
|
-
position:
|
|
2918
|
+
position: Me.value
|
|
2939
2919
|
}, {
|
|
2940
|
-
default:
|
|
2941
|
-
key:
|
|
2920
|
+
default: Q(() => [(H(!0), A(w, null, ie(n.modes, (n) => ce((H(), A("button", {
|
|
2921
|
+
key: n,
|
|
2942
2922
|
type: "button",
|
|
2943
2923
|
class: "grid place-items-center",
|
|
2944
|
-
|
|
2945
|
-
"aria-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
name: je[t],
|
|
2924
|
+
"aria-label": Pe.value[n],
|
|
2925
|
+
"aria-pressed": N.value === n,
|
|
2926
|
+
onClick: (e) => Te(n)
|
|
2927
|
+
}, [P(e, {
|
|
2928
|
+
name: Ne[n],
|
|
2950
2929
|
size: 20
|
|
2951
|
-
}, null, 8, ["name"])], 8,
|
|
2930
|
+
}, null, 8, ["name"])], 8, _n)), [[X(t), Pe.value[n]]])), 128)), n.editable ? ce((H(), A("button", {
|
|
2952
2931
|
key: 0,
|
|
2953
2932
|
type: "button",
|
|
2954
2933
|
class: "grid place-items-center",
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
}, [N(e, {
|
|
2934
|
+
"aria-label": X(s).mapDeleteFeature,
|
|
2935
|
+
disabled: F.value === null,
|
|
2936
|
+
onClick: i[0] ||= (e) => le()
|
|
2937
|
+
}, [P(e, {
|
|
2960
2938
|
name: "delete",
|
|
2961
2939
|
size: 20
|
|
2962
|
-
})], 8,
|
|
2940
|
+
})], 8, vn)), [[X(t), X(s).mapDeleteFeature]]) : k("", !0)]),
|
|
2963
2941
|
_: 1
|
|
2964
|
-
}, 8, ["position"])) :
|
|
2942
|
+
}, 8, ["position"])) : k("", !0)]));
|
|
2965
2943
|
}
|
|
2966
|
-
}),
|
|
2967
|
-
function
|
|
2968
|
-
let t =
|
|
2944
|
+
}), Sn = /* @__PURE__ */ new WeakMap();
|
|
2945
|
+
function Cn(e) {
|
|
2946
|
+
let t = me(e);
|
|
2969
2947
|
if (!t) throw Error("useMapFilter() must be called in a component inside <MMap>, or be given one");
|
|
2970
2948
|
function n(e, n) {
|
|
2971
2949
|
let r = t.map.value;
|
|
2972
2950
|
if (!r?.getLayer(e)) return;
|
|
2973
|
-
let i =
|
|
2974
|
-
i ||
|
|
2951
|
+
let i = Sn.get(r);
|
|
2952
|
+
i || Sn.set(r, i = /* @__PURE__ */ new Map()), i.has(e) || i.set(e, r.getFilter(e) ?? void 0);
|
|
2975
2953
|
let a = i.get(e);
|
|
2976
2954
|
r.setFilter(e, n ? a ? [
|
|
2977
2955
|
"all",
|
|
@@ -2995,7 +2973,7 @@ function xn(e) {
|
|
|
2995
2973
|
};
|
|
2996
2974
|
}
|
|
2997
2975
|
// src/components/MMapFilter.vue?vue&type=script&setup=true&lang.ts
|
|
2998
|
-
var
|
|
2976
|
+
var wn = { class: "flex flex-wrap gap-2" }, Tn = /* @__PURE__ */ F({
|
|
2999
2977
|
__name: "MMapFilter",
|
|
3000
2978
|
props: {
|
|
3001
2979
|
layer: {},
|
|
@@ -3007,7 +2985,7 @@ var Sn = { class: "flex flex-wrap gap-2" }, Cn = /* @__PURE__ */ P({
|
|
|
3007
2985
|
},
|
|
3008
2986
|
emits: ["update:modelValue"],
|
|
3009
2987
|
setup(e, { emit: t }) {
|
|
3010
|
-
let n = e, r = t, { onReady: i, styleVersion: a } =
|
|
2988
|
+
let n = e, r = t, { onReady: i, styleVersion: a } = he(() => n.map), { setFilter: o, valuesOf: s } = Cn(() => n.map), c = G([]), l = D(() => n.values ?? c.value), u = G([]), d = D(() => n.modelValue ?? u.value);
|
|
3011
2989
|
function f() {
|
|
3012
2990
|
let e = d.value;
|
|
3013
2991
|
o(n.layer, e.length ? [
|
|
@@ -3028,22 +3006,22 @@ var Sn = { class: "flex flex-wrap gap-2" }, Cn = /* @__PURE__ */ P({
|
|
|
3028
3006
|
}
|
|
3029
3007
|
return i((e) => {
|
|
3030
3008
|
m(e), f();
|
|
3031
|
-
}),
|
|
3009
|
+
}), Z(d, f, { deep: !0 }), Z(a, () => f()), Z(() => [n.layer, n.property], ([e], [t]) => {
|
|
3032
3010
|
e !== t && o(t, null), f();
|
|
3033
|
-
}), ne(() => o(n.layer, null)), (t, n) => (
|
|
3011
|
+
}), ne(() => o(n.layer, null)), (t, n) => (H(), A("div", wn, [(H(!0), A(w, null, ie(l.value, (t) => (H(), O(g, {
|
|
3034
3012
|
key: t,
|
|
3035
3013
|
type: "filter",
|
|
3036
3014
|
clickable: "",
|
|
3037
3015
|
selected: d.value.includes(t),
|
|
3038
3016
|
onClick: (e) => p(t)
|
|
3039
3017
|
}, {
|
|
3040
|
-
default:
|
|
3018
|
+
default: Q(() => [N(J(e.labels?.[String(t)] ?? t), 1)]),
|
|
3041
3019
|
_: 2
|
|
3042
3020
|
}, 1032, ["selected", "onClick"]))), 128))]));
|
|
3043
3021
|
}
|
|
3044
3022
|
});
|
|
3045
3023
|
// src/composables/mapSearch.ts
|
|
3046
|
-
function
|
|
3024
|
+
function En(e = {}) {
|
|
3047
3025
|
return async (t, n) => {
|
|
3048
3026
|
let r = new URLSearchParams({
|
|
3049
3027
|
format: "jsonv2",
|
|
@@ -3069,7 +3047,7 @@ function wn(e = {}) {
|
|
|
3069
3047
|
});
|
|
3070
3048
|
};
|
|
3071
3049
|
}
|
|
3072
|
-
var
|
|
3050
|
+
var Dn = {
|
|
3073
3051
|
city: "location_city",
|
|
3074
3052
|
town: "location_city",
|
|
3075
3053
|
village: "holiday_village",
|
|
@@ -3096,17 +3074,17 @@ var Tn = {
|
|
|
3096
3074
|
administrative: "map",
|
|
3097
3075
|
country: "public",
|
|
3098
3076
|
state: "map"
|
|
3099
|
-
},
|
|
3077
|
+
}, On = (e) => e && Dn[e] || "location_on", kn = { class: "hidden" }, An = [
|
|
3100
3078
|
"value",
|
|
3101
3079
|
"placeholder",
|
|
3102
3080
|
"aria-label"
|
|
3103
|
-
],
|
|
3081
|
+
], jn = {
|
|
3104
3082
|
key: 0,
|
|
3105
3083
|
class: "border-t border-outline-variant"
|
|
3106
|
-
},
|
|
3084
|
+
}, Mn = {
|
|
3107
3085
|
key: 1,
|
|
3108
3086
|
class: "flex flex-col items-center gap-2 py-6"
|
|
3109
|
-
},
|
|
3087
|
+
}, Nn = { class: "text-body-small text-on-surface-variant" }, Pn = /* @__PURE__ */ F({
|
|
3110
3088
|
__name: "MMapSearch",
|
|
3111
3089
|
props: {
|
|
3112
3090
|
provider: {},
|
|
@@ -3124,7 +3102,7 @@ var Tn = {
|
|
|
3124
3102
|
},
|
|
3125
3103
|
emits: ["select"],
|
|
3126
3104
|
setup(t, { emit: n }) {
|
|
3127
|
-
let r = t, i = n,
|
|
3105
|
+
let r = t, i = n, a = c(), { map: s } = he(), l = D(() => r.provider ?? En()), u = G(""), d = q([]), f = G(!1), p = G(!1), m = G(!1), h = q(null), g, _;
|
|
3128
3106
|
async function S() {
|
|
3129
3107
|
let e = u.value.trim();
|
|
3130
3108
|
if (!e) return;
|
|
@@ -3140,13 +3118,13 @@ var Tn = {
|
|
|
3140
3118
|
g === t && (f.value = !1, p.value = !0);
|
|
3141
3119
|
}
|
|
3142
3120
|
}
|
|
3143
|
-
function
|
|
3144
|
-
if (u.value = e, !e) return
|
|
3145
|
-
r.instant && (clearTimeout(
|
|
3121
|
+
function C(e) {
|
|
3122
|
+
if (u.value = e, !e) return E();
|
|
3123
|
+
r.instant && (clearTimeout(_), _ = setTimeout(S, 350));
|
|
3146
3124
|
}
|
|
3147
3125
|
function T(e) {
|
|
3148
3126
|
h.value = e, m.value = !1;
|
|
3149
|
-
let t =
|
|
3127
|
+
let t = s.value;
|
|
3150
3128
|
e.bbox && e.bbox[0] !== e.bbox[2] ? t?.fitBounds([[e.bbox[0], e.bbox[1]], [e.bbox[2], e.bbox[3]]], {
|
|
3151
3129
|
padding: 48,
|
|
3152
3130
|
maxZoom: r.zoom
|
|
@@ -3155,58 +3133,58 @@ var Tn = {
|
|
|
3155
3133
|
zoom: r.zoom
|
|
3156
3134
|
}), i("select", e);
|
|
3157
3135
|
}
|
|
3158
|
-
function
|
|
3159
|
-
g?.abort(), clearTimeout(
|
|
3136
|
+
function E() {
|
|
3137
|
+
g?.abort(), clearTimeout(_), u.value = "", d.value = [], p.value = !1, f.value = !1, m.value = !1, h.value = null;
|
|
3160
3138
|
}
|
|
3161
3139
|
return ne(() => {
|
|
3162
|
-
g?.abort(), clearTimeout(
|
|
3163
|
-
}), (n, r) => (
|
|
3140
|
+
g?.abort(), clearTimeout(_);
|
|
3141
|
+
}), (n, r) => (H(), A("div", kn, [P(ve, {
|
|
3164
3142
|
position: t.position,
|
|
3165
3143
|
group: !1
|
|
3166
3144
|
}, {
|
|
3167
|
-
default:
|
|
3145
|
+
default: Q(() => [P(y, {
|
|
3168
3146
|
variant: "elevated",
|
|
3169
3147
|
class: "w-80 max-w-[calc(100vw-5rem)] overflow-hidden"
|
|
3170
3148
|
}, {
|
|
3171
|
-
default:
|
|
3149
|
+
default: Q(() => [j("form", {
|
|
3172
3150
|
class: "flex items-center gap-2 py-1 pr-1 pl-3",
|
|
3173
3151
|
role: "search",
|
|
3174
|
-
onSubmit:
|
|
3152
|
+
onSubmit: le(S, ["prevent"])
|
|
3175
3153
|
}, [
|
|
3176
|
-
|
|
3154
|
+
P(e, {
|
|
3177
3155
|
name: "search",
|
|
3178
3156
|
size: 20,
|
|
3179
3157
|
class: "shrink-0 text-on-surface-variant"
|
|
3180
3158
|
}),
|
|
3181
|
-
|
|
3159
|
+
j("input", {
|
|
3182
3160
|
value: u.value,
|
|
3183
3161
|
type: "search",
|
|
3184
3162
|
enterkeyhint: "search",
|
|
3185
|
-
placeholder: t.placeholder ??
|
|
3186
|
-
"aria-label": t.placeholder ??
|
|
3163
|
+
placeholder: t.placeholder ?? X(a).mapSearchPlaces,
|
|
3164
|
+
"aria-label": t.placeholder ?? X(a).mapSearchPlaces,
|
|
3187
3165
|
class: "min-w-0 flex-1 bg-transparent py-2 text-body-medium text-on-surface outline-none placeholder:text-on-surface-variant [&::-webkit-search-cancel-button]:hidden",
|
|
3188
|
-
onInput: r[0] ||= (e) =>
|
|
3166
|
+
onInput: r[0] ||= (e) => C(e.target.value),
|
|
3189
3167
|
onFocus: r[1] ||= (e) => m.value = p.value && !h.value
|
|
3190
|
-
}, null, 40,
|
|
3191
|
-
f.value ? (
|
|
3168
|
+
}, null, 40, An),
|
|
3169
|
+
f.value ? (H(), O(x, {
|
|
3192
3170
|
key: 0,
|
|
3193
3171
|
size: 20,
|
|
3194
3172
|
class: "mr-2 shrink-0"
|
|
3195
|
-
})) : u.value ? (
|
|
3173
|
+
})) : u.value ? (H(), O(o, {
|
|
3196
3174
|
key: 1,
|
|
3197
3175
|
icon: "close",
|
|
3198
|
-
label:
|
|
3176
|
+
label: X(a).clearSearch,
|
|
3199
3177
|
size: "sm",
|
|
3200
|
-
onClick:
|
|
3201
|
-
}, null, 8, ["label"])) :
|
|
3202
|
-
], 32), m.value && p.value && !f.value ? (
|
|
3178
|
+
onClick: E
|
|
3179
|
+
}, null, 8, ["label"])) : k("", !0)
|
|
3180
|
+
], 32), m.value && p.value && !f.value ? (H(), A("div", jn, [d.value.length ? (H(), O(v, {
|
|
3203
3181
|
key: 0,
|
|
3204
3182
|
class: "max-h-72 overflow-y-auto"
|
|
3205
3183
|
}, {
|
|
3206
|
-
default:
|
|
3184
|
+
default: Q(() => [(H(!0), A(w, null, ie(d.value, (e, t) => (H(), O(b, {
|
|
3207
3185
|
key: t,
|
|
3208
3186
|
title: e.label,
|
|
3209
|
-
icon:
|
|
3187
|
+
icon: X(On)(e.type),
|
|
3210
3188
|
leading: "icon",
|
|
3211
3189
|
clickable: "",
|
|
3212
3190
|
onClick: (t) => T(e)
|
|
@@ -3216,39 +3194,39 @@ var Tn = {
|
|
|
3216
3194
|
"onClick"
|
|
3217
3195
|
]))), 128))]),
|
|
3218
3196
|
_: 1
|
|
3219
|
-
})) : (
|
|
3197
|
+
})) : (H(), A("div", Mn, [P(e, {
|
|
3220
3198
|
name: "search_off",
|
|
3221
3199
|
size: 28,
|
|
3222
3200
|
class: "text-on-surface-variant"
|
|
3223
|
-
}),
|
|
3201
|
+
}), j("span", Nn, J(X(a).noResults), 1)]))])) : k("", !0)]),
|
|
3224
3202
|
_: 1
|
|
3225
3203
|
})]),
|
|
3226
3204
|
_: 1
|
|
3227
|
-
}, 8, ["position"]), t.marker && h.value ? (
|
|
3205
|
+
}, 8, ["position"]), t.marker && h.value ? (H(), O(Pe, {
|
|
3228
3206
|
key: 0,
|
|
3229
3207
|
"lng-lat": h.value.lngLat
|
|
3230
|
-
}, null, 8, ["lng-lat"])) :
|
|
3208
|
+
}, null, 8, ["lng-lat"])) : k("", !0)]));
|
|
3231
3209
|
}
|
|
3232
|
-
}),
|
|
3210
|
+
}), Fn = ["aria-label"], In = {
|
|
3233
3211
|
key: 0,
|
|
3234
3212
|
class: "flex items-center gap-3 px-4 py-3 text-body-medium text-on-surface-variant",
|
|
3235
3213
|
role: "status"
|
|
3236
|
-
},
|
|
3214
|
+
}, Ln = {
|
|
3237
3215
|
key: 1,
|
|
3238
3216
|
class: "flex items-center gap-3 px-4 py-3 text-body-medium text-on-surface-variant"
|
|
3239
|
-
},
|
|
3217
|
+
}, Rn = {
|
|
3240
3218
|
key: 2,
|
|
3241
3219
|
class: "flex items-center gap-3 px-4 py-3 text-body-medium text-on-surface-variant",
|
|
3242
3220
|
role: "status"
|
|
3243
|
-
},
|
|
3221
|
+
}, zn = [
|
|
3244
3222
|
"id",
|
|
3245
3223
|
"aria-selected",
|
|
3246
3224
|
"onMousedown",
|
|
3247
3225
|
"onMousemove"
|
|
3248
|
-
],
|
|
3226
|
+
], Bn = { class: "flex min-w-0 flex-col" }, Vn = { class: "truncate text-body-large" }, Hn = {
|
|
3249
3227
|
key: 0,
|
|
3250
3228
|
class: "truncate text-body-small text-on-surface-variant"
|
|
3251
|
-
},
|
|
3229
|
+
}, Un = /* @__PURE__ */ F({
|
|
3252
3230
|
inheritAttrs: !1,
|
|
3253
3231
|
__name: "MAddressField",
|
|
3254
3232
|
props: {
|
|
@@ -3279,7 +3257,7 @@ var Tn = {
|
|
|
3279
3257
|
"blur"
|
|
3280
3258
|
],
|
|
3281
3259
|
setup(t, { expose: n, emit: r }) {
|
|
3282
|
-
let i = t,
|
|
3260
|
+
let i = t, a = r, s = c(), l = ae(), u = `${l}-list`, f = (e) => `${l}-opt-${e}`, p = D(() => i.provider ?? En()), g = G(i.modelValue?.label ?? ""), v = q([]), y = G(!1), b = G(!1), E = G(!1), M = G(!1), F = G(-1), I, L, R = G(), V = S({
|
|
3283
3261
|
value: () => i.modelValue,
|
|
3284
3262
|
rules: () => i.rules,
|
|
3285
3263
|
required: () => i.required,
|
|
@@ -3289,129 +3267,129 @@ var Tn = {
|
|
|
3289
3267
|
validateOn: () => i.validateOn,
|
|
3290
3268
|
validateDebounce: () => i.validateDebounce,
|
|
3291
3269
|
disabled: () => i.disabled,
|
|
3292
|
-
focus: () =>
|
|
3293
|
-
el: () =>
|
|
3294
|
-
setValue: (e) =>
|
|
3295
|
-
}),
|
|
3296
|
-
|
|
3297
|
-
let
|
|
3298
|
-
|
|
3299
|
-
e && e.label !==
|
|
3270
|
+
focus: () => R.value?.focus(),
|
|
3271
|
+
el: () => K.value,
|
|
3272
|
+
setValue: (e) => a("update:modelValue", e ?? null)
|
|
3273
|
+
}), re = V.disabled, W = D(() => V.message.value || V.hasError.value);
|
|
3274
|
+
U(C, null);
|
|
3275
|
+
let K = G(), Y = G(), oe = D(() => K.value?.firstElementChild?.firstElementChild ?? null), ce = G({}), ue = D(() => g.value.trim().length >= i.minLength), de = D(() => !i.instant && E.value && ue.value && !b.value && !y.value && !i.modelValue);
|
|
3276
|
+
Z(() => i.modelValue, (e) => {
|
|
3277
|
+
e && e.label !== g.value ? g.value = e.label : !e && !E.value && (g.value = "");
|
|
3300
3278
|
});
|
|
3301
|
-
async function
|
|
3302
|
-
let e =
|
|
3279
|
+
async function fe() {
|
|
3280
|
+
let e = g.value.trim();
|
|
3303
3281
|
if (e.length < i.minLength) return;
|
|
3304
3282
|
I?.abort(), clearTimeout(L), I = new AbortController();
|
|
3305
3283
|
let t = I;
|
|
3306
|
-
y.value = !0,
|
|
3284
|
+
y.value = !0, M.value = !0;
|
|
3307
3285
|
try {
|
|
3308
|
-
v.value = await
|
|
3286
|
+
v.value = await p.value(e, t.signal), F.value = v.value.length ? 0 : -1;
|
|
3309
3287
|
} catch {
|
|
3310
3288
|
if (t.signal.aborted) return;
|
|
3311
3289
|
v.value = [];
|
|
3312
3290
|
} finally {
|
|
3313
|
-
I === t && (y.value = !1,
|
|
3291
|
+
I === t && (y.value = !1, b.value = !0);
|
|
3314
3292
|
}
|
|
3315
3293
|
}
|
|
3316
|
-
function
|
|
3317
|
-
|
|
3294
|
+
function pe(e) {
|
|
3295
|
+
g.value = String(e), b.value = !1, v.value = [], F.value = -1, i.modelValue && a("update:modelValue", null), I?.abort(), y.value = !1, clearTimeout(L), ue.value ? (M.value = !i.instant, i.instant && (L = setTimeout(fe, i.debounce))) : M.value = !1;
|
|
3318
3296
|
}
|
|
3319
|
-
function
|
|
3320
|
-
|
|
3297
|
+
function me(e) {
|
|
3298
|
+
g.value = e.label, M.value = !1, v.value = [], b.value = !1, a("update:modelValue", e), a("select", e);
|
|
3321
3299
|
}
|
|
3322
|
-
function
|
|
3323
|
-
I?.abort(), clearTimeout(L),
|
|
3300
|
+
function he() {
|
|
3301
|
+
I?.abort(), clearTimeout(L), g.value = "", v.value = [], b.value = !1, y.value = !1, M.value = !1, i.modelValue && a("update:modelValue", null), R.value?.focus();
|
|
3324
3302
|
}
|
|
3325
|
-
function
|
|
3303
|
+
function ge(e) {
|
|
3326
3304
|
if (e.key === "Enter") {
|
|
3327
3305
|
e.preventDefault();
|
|
3328
3306
|
let t = v.value[F.value];
|
|
3329
|
-
|
|
3307
|
+
M.value && t && b.value ? me(t) : fe();
|
|
3330
3308
|
} else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
3331
|
-
if (!
|
|
3309
|
+
if (!M.value || !v.value.length) return;
|
|
3332
3310
|
e.preventDefault();
|
|
3333
3311
|
let t = v.value.length;
|
|
3334
|
-
F.value = (F.value + (e.key === "ArrowDown" ? 1 : -1) + t) % t, ee(() =>
|
|
3312
|
+
F.value = (F.value + (e.key === "ArrowDown" ? 1 : -1) + t) % t, ee(() => Y.value?.querySelector(`#${CSS.escape(f(F.value))}`)?.scrollIntoView({ block: "nearest" }));
|
|
3335
3313
|
}
|
|
3336
3314
|
}
|
|
3337
|
-
function
|
|
3338
|
-
|
|
3315
|
+
function _e() {
|
|
3316
|
+
E.value = !0, (b.value && v.value.length && !i.modelValue || de.value) && (M.value = !0);
|
|
3339
3317
|
}
|
|
3340
|
-
function
|
|
3318
|
+
function ve(e) {
|
|
3341
3319
|
let t = e.relatedTarget;
|
|
3342
|
-
t && (
|
|
3320
|
+
t && (K.value?.contains(t) || Y.value?.contains(t)) || (E.value = !1, M.value = !1, V.onBlur(), a("blur"));
|
|
3343
3321
|
}
|
|
3344
|
-
|
|
3345
|
-
let
|
|
3346
|
-
function
|
|
3347
|
-
let e =
|
|
3322
|
+
h(() => M.value, () => M.value = !1);
|
|
3323
|
+
let ye = D(() => M.value && (y.value || b.value || de.value));
|
|
3324
|
+
function be() {
|
|
3325
|
+
let e = oe.value?.getBoundingClientRect(), t = Y.value;
|
|
3348
3326
|
if (!e || !t) return;
|
|
3349
|
-
let n = t.offsetHeight, r =
|
|
3350
|
-
|
|
3327
|
+
let n = t.offsetHeight, r = m([e.bottom + 4, e.top - 4 - n], n, window.innerHeight, 8);
|
|
3328
|
+
ce.value = {
|
|
3351
3329
|
top: `${r}px`,
|
|
3352
3330
|
left: `${e.left}px`,
|
|
3353
3331
|
width: `${e.width}px`
|
|
3354
3332
|
};
|
|
3355
3333
|
}
|
|
3356
|
-
|
|
3357
|
-
|
|
3334
|
+
Z([
|
|
3335
|
+
ye,
|
|
3358
3336
|
v,
|
|
3359
3337
|
y
|
|
3360
|
-
], () => ee(
|
|
3361
|
-
open: () =>
|
|
3362
|
-
anchor:
|
|
3363
|
-
popup:
|
|
3364
|
-
place:
|
|
3365
|
-
close: () =>
|
|
3366
|
-
}),
|
|
3367
|
-
let e =
|
|
3368
|
-
e && (e.setAttribute("role", "combobox"), e.setAttribute("aria-autocomplete", "list"), e.setAttribute("aria-expanded", String(
|
|
3338
|
+
], () => ee(be)), _({
|
|
3339
|
+
open: () => ye.value,
|
|
3340
|
+
anchor: oe,
|
|
3341
|
+
popup: Y,
|
|
3342
|
+
place: be,
|
|
3343
|
+
close: () => M.value = !1
|
|
3344
|
+
}), se(() => {
|
|
3345
|
+
let e = R.value?.inputEl;
|
|
3346
|
+
e && (e.setAttribute("role", "combobox"), e.setAttribute("aria-autocomplete", "list"), e.setAttribute("aria-expanded", String(ye.value && v.value.length > 0)), e.setAttribute("aria-controls", u), e.setAttribute("enterkeyhint", "search"), ye.value && F.value >= 0 && v.value.length ? e.setAttribute("aria-activedescendant", f(F.value)) : e.removeAttribute("aria-activedescendant"));
|
|
3369
3347
|
}), ne(() => {
|
|
3370
3348
|
I?.abort(), clearTimeout(L);
|
|
3371
3349
|
});
|
|
3372
|
-
function
|
|
3350
|
+
function xe(e) {
|
|
3373
3351
|
let t = e.indexOf(", ");
|
|
3374
3352
|
return t < 0 ? [e, ""] : [e.slice(0, t), e.slice(t + 2)];
|
|
3375
3353
|
}
|
|
3376
3354
|
return n({
|
|
3377
|
-
search:
|
|
3378
|
-
clear:
|
|
3379
|
-
focus: () =>
|
|
3380
|
-
validate:
|
|
3381
|
-
resetValidation:
|
|
3382
|
-
}), (n, r) => (
|
|
3355
|
+
search: fe,
|
|
3356
|
+
clear: he,
|
|
3357
|
+
focus: () => R.value?.focus(),
|
|
3358
|
+
validate: V.validate,
|
|
3359
|
+
resetValidation: V.resetValidation
|
|
3360
|
+
}), (n, r) => (H(), A(w, null, [j("div", z({
|
|
3383
3361
|
ref_key: "wrapEl",
|
|
3384
|
-
ref:
|
|
3362
|
+
ref: K
|
|
3385
3363
|
}, n.$attrs, {
|
|
3386
|
-
onFocusin:
|
|
3387
|
-
onFocusout:
|
|
3388
|
-
onKeydown:
|
|
3389
|
-
}), [
|
|
3364
|
+
onFocusin: _e,
|
|
3365
|
+
onFocusout: ve,
|
|
3366
|
+
onKeydown: ge
|
|
3367
|
+
}), [P(d, {
|
|
3390
3368
|
ref_key: "field",
|
|
3391
|
-
ref:
|
|
3392
|
-
"model-value":
|
|
3393
|
-
label: t.label ??
|
|
3369
|
+
ref: R,
|
|
3370
|
+
"model-value": g.value,
|
|
3371
|
+
label: t.label ?? X(s).mapAddress,
|
|
3394
3372
|
variant: t.variant,
|
|
3395
3373
|
"leading-icon": t.leadingIcon,
|
|
3396
3374
|
hint: t.hint,
|
|
3397
|
-
error:
|
|
3375
|
+
error: W.value,
|
|
3398
3376
|
required: t.required,
|
|
3399
|
-
disabled:
|
|
3377
|
+
disabled: X(re),
|
|
3400
3378
|
autocomplete: "street-address",
|
|
3401
|
-
"onUpdate:modelValue":
|
|
3379
|
+
"onUpdate:modelValue": pe
|
|
3402
3380
|
}, {
|
|
3403
|
-
trailing:
|
|
3381
|
+
trailing: Q(() => [y.value ? (H(), O(x, {
|
|
3404
3382
|
key: 0,
|
|
3405
3383
|
size: 20,
|
|
3406
3384
|
class: "m-2"
|
|
3407
|
-
})) :
|
|
3385
|
+
})) : g.value ? (H(), O(o, {
|
|
3408
3386
|
key: 1,
|
|
3409
3387
|
icon: "close",
|
|
3410
|
-
label:
|
|
3388
|
+
label: X(s).clearSearch,
|
|
3411
3389
|
size: "sm",
|
|
3412
|
-
disabled:
|
|
3413
|
-
onClick:
|
|
3414
|
-
}, null, 8, ["label", "disabled"])) :
|
|
3390
|
+
disabled: X(re),
|
|
3391
|
+
onClick: he
|
|
3392
|
+
}, null, 8, ["label", "disabled"])) : k("", !0)]),
|
|
3415
3393
|
_: 1
|
|
3416
3394
|
}, 8, [
|
|
3417
3395
|
"model-value",
|
|
@@ -3422,36 +3400,36 @@ var Tn = {
|
|
|
3422
3400
|
"error",
|
|
3423
3401
|
"required",
|
|
3424
3402
|
"disabled"
|
|
3425
|
-
])], 16), (
|
|
3403
|
+
])], 16), (H(), O(T, { to: "body" }, [ye.value ? (H(), A("div", {
|
|
3426
3404
|
key: 0,
|
|
3427
|
-
id:
|
|
3405
|
+
id: u,
|
|
3428
3406
|
ref_key: "listEl",
|
|
3429
|
-
ref:
|
|
3407
|
+
ref: Y,
|
|
3430
3408
|
role: "listbox",
|
|
3431
|
-
"aria-label": t.label ??
|
|
3409
|
+
"aria-label": t.label ?? X(s).mapAddress,
|
|
3432
3410
|
class: "fixed z-500 max-h-72 overflow-auto rounded-xs bg-surface-container py-1 shadow-elevation-2",
|
|
3433
|
-
style: te(
|
|
3434
|
-
}, [y.value ? (
|
|
3411
|
+
style: te(ce.value)
|
|
3412
|
+
}, [y.value ? (H(), A("div", In, [P(x, { size: 20 }), N(J(X(s).mapSearching), 1)])) : de.value ? (H(), A("div", Ln, [P(e, {
|
|
3435
3413
|
name: "keyboard_return",
|
|
3436
3414
|
size: 20
|
|
3437
|
-
}),
|
|
3415
|
+
}), N(J(X(s).mapPressEnterToSearch), 1)])) : v.value.length ? (H(!0), A(w, { key: 3 }, ie(v.value, (t, n) => (H(), A("div", {
|
|
3438
3416
|
id: f(n),
|
|
3439
3417
|
key: n,
|
|
3440
3418
|
role: "option",
|
|
3441
3419
|
"aria-selected": n === F.value,
|
|
3442
|
-
class:
|
|
3443
|
-
onMousedown:
|
|
3420
|
+
class: B(["flex cursor-pointer items-center gap-3 px-4 py-2 text-on-surface hover:bg-on-surface/8", n === F.value ? "bg-on-surface/12" : ""]),
|
|
3421
|
+
onMousedown: le((e) => me(t), ["prevent"]),
|
|
3444
3422
|
onMousemove: (e) => F.value = n
|
|
3445
|
-
}, [
|
|
3446
|
-
name:
|
|
3423
|
+
}, [P(e, {
|
|
3424
|
+
name: X(On)(t.type),
|
|
3447
3425
|
size: 20,
|
|
3448
3426
|
class: "shrink-0 text-on-surface-variant"
|
|
3449
|
-
}, null, 8, ["name"]),
|
|
3427
|
+
}, null, 8, ["name"]), j("span", Bn, [j("span", Vn, J(xe(t.label)[0]), 1), xe(t.label)[1] ? (H(), A("span", Hn, J(xe(t.label)[1]), 1)) : k("", !0)])], 42, zn))), 128)) : (H(), A("div", Rn, [P(e, {
|
|
3450
3428
|
name: "search_off",
|
|
3451
3429
|
size: 20
|
|
3452
|
-
}),
|
|
3430
|
+
}), N(J(X(s).mapNoPlaces), 1)]))], 12, Fn)) : k("", !0)]))], 64));
|
|
3453
3431
|
}
|
|
3454
3432
|
});
|
|
3455
|
-
export {
|
|
3433
|
+
export { Un as MAddressField, Oe as MMap, It as MMapBaseLayers, ze as MMapCluster, ve as MMapControl, xn as MMapDraw, Gt as MMapFeatureInfo, Tn as MMapFilter, Le as MMapGeoJson, ln as MMapHover, tn as MMapIdentify, Mt as MMapLayers, Pe as MMapMarker, hn as MMapMeasure, Ie as MMapPopup, ct as MMapRoute, Pn as MMapSearch, Xt as fieldLabel, Zt as formatFieldValue, Jt as genericAdapter, $t as identifyFeatures, En as nominatimProvider, Yt as orvianAdapter, lt as osrmRouteProvider, de as setMapWorker, he as useMap, Cn as useMapFilter, Te as useMapLayers };
|
|
3456
3434
|
|
|
3457
3435
|
//# sourceMappingURL=map.js.map
|