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