@m3ui-vue/m3ui-vue 1.2.0 → 1.2.2
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 +152 -11
- package/dist/{MMenuItem-DI351kIf.js → MMenuItem-D4Gx_l3F.js} +2 -2
- package/dist/{MMenuItem-DI351kIf.js.map → MMenuItem-D4Gx_l3F.js.map} +1 -1
- package/dist/{MSlider-BnEy5ieZ.js → MSlider-Dx_S3vJ9.js} +227 -221
- package/dist/{MSlider-BnEy5ieZ.js.map → MSlider-Dx_S3vJ9.js.map} +1 -1
- package/dist/{MTextField-BBmkaIbO.js → MTextField-Bz8JIsnl.js} +4 -4
- package/dist/{MTextField-BBmkaIbO.js.map → MTextField-Bz8JIsnl.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/components/MMap.vue.d.ts +1 -1
- package/dist/components/MSlider.vue.d.ts +2 -2
- package/dist/composables/_effectCanvas.d.ts +23 -0
- package/dist/composables/_storageKeys.d.ts +9 -0
- package/dist/composables/themeInitScript.d.ts +2 -0
- package/dist/composables/useConfetti.d.ts +19 -8
- package/dist/composables/useFireworks.d.ts +37 -0
- package/dist/composables/useReactions.d.ts +32 -0
- package/dist/composables/viewportHints.d.ts +2 -0
- package/dist/directives/vSparkle.d.ts +27 -0
- package/dist/index.d.ts +7 -1
- package/dist/m3ui.js +5404 -5023
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +572 -572
- package/dist/map.js.map +1 -1
- package/dist/plugin.d.ts +10 -0
- package/dist/rich-text-editor.js +2 -2
- package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-y0HZpyhL.js} +23 -8
- package/dist/useThemeTokens-y0HZpyhL.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MSegmentedButton.test.ts +10 -0
- package/src/__tests__/MSlider.test.ts +36 -0
- package/src/__tests__/plugin.test.ts +56 -1
- package/src/__tests__/ssr.test.ts +1 -1
- package/src/__tests__/themeInitScript.test.ts +10 -0
- package/src/__tests__/useConfetti.test.ts +33 -2
- package/src/__tests__/useFireworks.test.ts +104 -0
- package/src/__tests__/useReactions.test.ts +51 -0
- package/src/__tests__/vSparkle.test.ts +83 -0
- package/src/components/MEmojiSelector.vue +3 -2
- package/src/components/MMap.vue +3 -2
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSlider.vue +22 -4
- package/src/components/MTextField.vue +8 -4
- package/src/composables/_colorUtils.ts +4 -2
- package/src/composables/_effectCanvas.ts +109 -0
- package/src/composables/_ssrState.ts +2 -2
- package/src/composables/_storageKeys.ts +28 -0
- package/src/composables/themeInitScript.ts +5 -2
- package/src/composables/useColorPalette.ts +36 -8
- package/src/composables/useConfetti.ts +84 -107
- package/src/composables/useFireworks.ts +360 -0
- package/src/composables/useReactions.ts +131 -0
- package/src/composables/useTheme.ts +21 -4
- package/src/composables/viewportHints.ts +6 -5
- package/src/directives/vSparkle.ts +180 -0
- package/src/index.ts +7 -1
- package/src/plugin.ts +21 -5
- package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
package/dist/map.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { i as
|
|
5
|
-
import { t as
|
|
6
|
-
import { c as
|
|
7
|
-
import { Fragment as
|
|
1
|
+
import { s as e, t } from "./useThemeTokens-y0HZpyhL.js";
|
|
2
|
+
import { i as n } from "./useLocale-JYxDDeXC.js";
|
|
3
|
+
import { _ as r, g as i, h as a, n as o, p as s, r as c, t as l, v as u } from "./MTextField-Bz8JIsnl.js";
|
|
4
|
+
import { i as d } from "./motion-DZiXG09o.js";
|
|
5
|
+
import { t as f } from "./MIcon-Bxh9j135.js";
|
|
6
|
+
import { c as p, i as m, n as h, o as g, t as _ } from "./MSlider-Dx_S3vJ9.js";
|
|
7
|
+
import { Fragment as v, Transition as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createSlots as T, createTextVNode as E, createVNode as D, defineComponent as O, getCurrentInstance as k, inject as A, markRaw as j, mergeProps as M, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as F, onMounted as ee, onUnmounted as I, openBlock as L, provide as te, reactive as R, ref as z, renderList as B, renderSlot as V, shallowRef as H, toDisplayString as U, toValue as ne, unref as W, useId as re, useSlots as G, watch as K, withCtx as q, withModifiers as J } from "vue";
|
|
8
8
|
//#region src/composables/useMap.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let t =
|
|
9
|
+
var ie = Symbol("m3-map");
|
|
10
|
+
function ae(e) {
|
|
11
|
+
let t = A(ie, null);
|
|
12
12
|
if (t || e === void 0) return t;
|
|
13
|
-
let n =
|
|
14
|
-
let t =
|
|
13
|
+
let n = b(() => {
|
|
14
|
+
let t = ne(e);
|
|
15
15
|
return t ? "context" in t ? t.context : t : void 0;
|
|
16
16
|
}), r = {
|
|
17
|
-
map:
|
|
18
|
-
maplibre:
|
|
19
|
-
styleVersion:
|
|
20
|
-
model:
|
|
17
|
+
map: b(() => n.value?.map.value),
|
|
18
|
+
maplibre: b(() => n.value?.maplibre.value),
|
|
19
|
+
styleVersion: b(() => n.value?.styleVersion.value ?? 0),
|
|
20
|
+
model: b(() => n.value?.model.value),
|
|
21
21
|
layerState: new Proxy({
|
|
22
22
|
visible: {},
|
|
23
23
|
opacity: {}
|
|
24
24
|
}, { get: (e, t) => Reflect.get(n.value?.layerState ?? e, t) }),
|
|
25
|
-
activeTool:
|
|
25
|
+
activeTool: b({
|
|
26
26
|
get: () => n.value?.activeTool.value ?? null,
|
|
27
27
|
set: (e) => {
|
|
28
28
|
n.value && (n.value.activeTool.value = e);
|
|
29
29
|
}
|
|
30
30
|
})
|
|
31
31
|
};
|
|
32
|
-
return
|
|
32
|
+
return te(ie, r), r;
|
|
33
33
|
}
|
|
34
34
|
function Y(e) {
|
|
35
|
-
let t =
|
|
35
|
+
let t = ae(e);
|
|
36
36
|
if (!t) throw Error("useMap() must be called in a component inside <MMap>, or be given one");
|
|
37
37
|
let n = [];
|
|
38
|
-
|
|
38
|
+
k() && F(() => n.splice(0).forEach((e) => e()));
|
|
39
39
|
function r(e) {
|
|
40
40
|
let r = () => {
|
|
41
41
|
if (t.map.value && t.maplibre.value) return e(t.map.value, t.maplibre.value);
|
|
@@ -43,8 +43,8 @@ function Y(e) {
|
|
|
43
43
|
n && t.maplibre.value && (r(), e(n, t.maplibre.value));
|
|
44
44
|
});
|
|
45
45
|
n.push(r);
|
|
46
|
-
}, i =
|
|
47
|
-
i && !i.isMounted ?
|
|
46
|
+
}, i = k();
|
|
47
|
+
i && !i.isMounted ? ee(r) : r();
|
|
48
48
|
}
|
|
49
49
|
function i(e, t) {
|
|
50
50
|
r((r) => {
|
|
@@ -57,9 +57,9 @@ function Y(e) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
|
-
map:
|
|
61
|
-
maplibre:
|
|
62
|
-
styleVersion:
|
|
60
|
+
map: b(() => t.map.value),
|
|
61
|
+
maplibre: b(() => t.maplibre.value),
|
|
62
|
+
styleVersion: b(() => t.styleVersion.value),
|
|
63
63
|
activeTool: t.activeTool,
|
|
64
64
|
onReady: r,
|
|
65
65
|
on: i,
|
|
@@ -68,10 +68,10 @@ function Y(e) {
|
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/components/MMapControl.vue?vue&type=script&setup=true&lang.ts
|
|
71
|
-
var
|
|
71
|
+
var oe = { class: "hidden" }, X = {
|
|
72
72
|
key: 0,
|
|
73
73
|
class: "m3-map-control-panel-in"
|
|
74
|
-
},
|
|
74
|
+
}, se = /* @__PURE__ */ O({
|
|
75
75
|
inheritAttrs: !1,
|
|
76
76
|
__name: "MMapControl",
|
|
77
77
|
props: {
|
|
@@ -91,11 +91,11 @@ var ae = { class: "hidden" }, X = {
|
|
|
91
91
|
},
|
|
92
92
|
emits: ["update:expanded"],
|
|
93
93
|
setup(e, { emit: t }) {
|
|
94
|
-
let
|
|
95
|
-
K(() =>
|
|
94
|
+
let n = e, o = t, s = G(), c = z(), { onReady: l } = Y(), f = z(n.expanded);
|
|
95
|
+
K(() => n.expanded, (e) => {
|
|
96
96
|
f.value = e;
|
|
97
97
|
});
|
|
98
|
-
let p =
|
|
98
|
+
let p = b(() => f.value && !!s.panel);
|
|
99
99
|
function m(e) {
|
|
100
100
|
e !== f.value && (f.value = e, o("update:expanded", e));
|
|
101
101
|
}
|
|
@@ -106,7 +106,7 @@ var ae = { class: "hidden" }, X = {
|
|
|
106
106
|
function v(e) {
|
|
107
107
|
e.key === "Escape" && p.value && (g(), e.stopPropagation());
|
|
108
108
|
}
|
|
109
|
-
let
|
|
109
|
+
let y = null, x = null, S = [], T = {
|
|
110
110
|
w: 0,
|
|
111
111
|
h: 0
|
|
112
112
|
}, E = {
|
|
@@ -123,59 +123,59 @@ var ae = { class: "hidden" }, X = {
|
|
|
123
123
|
let e = c.value;
|
|
124
124
|
if (!e || x) return;
|
|
125
125
|
let t = O();
|
|
126
|
-
|
|
126
|
+
y && (t.w !== y.w || t.h !== y.h) && n.animate && !i() && A(e, y, t), y = t;
|
|
127
127
|
}
|
|
128
128
|
function A(e, t, n) {
|
|
129
|
-
if (T = t, E = n,
|
|
129
|
+
if (T = t, E = n, S = u(0, 1, 0, d.standard.defaultSpatial, .002), e.style.overflow = "hidden", x = a(e, S, (e) => ({
|
|
130
130
|
width: `${t.w + (n.w - t.w) * e}px`,
|
|
131
131
|
height: `${t.h + (n.h - t.h) * e}px`
|
|
132
|
-
})), !x) return
|
|
133
|
-
x.onfinish = () =>
|
|
132
|
+
})), !x) return j(e);
|
|
133
|
+
x.onfinish = () => j(e);
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function j(e) {
|
|
136
136
|
x?.cancel(), x = null, e.style.overflow = "";
|
|
137
137
|
let t = O();
|
|
138
|
-
t.w !== E.w || t.h !== E.h ? (
|
|
138
|
+
t.w !== E.w || t.h !== E.h ? (y = E, k()) : y = t;
|
|
139
139
|
}
|
|
140
140
|
function N() {
|
|
141
141
|
if (!c.value || !x) return;
|
|
142
|
-
let e =
|
|
142
|
+
let e = r(S, x.currentTime), t = {
|
|
143
143
|
w: T.w + (E.w - T.w) * e,
|
|
144
144
|
h: T.h + (E.h - T.h) * e
|
|
145
145
|
};
|
|
146
|
-
x.onfinish = null, x.cancel(), x = null,
|
|
146
|
+
x.onfinish = null, x.cancel(), x = null, y = t, k();
|
|
147
147
|
}
|
|
148
148
|
K(p, N, { flush: "post" });
|
|
149
|
-
let
|
|
149
|
+
let P, I = {
|
|
150
150
|
onAdd: () => c.value,
|
|
151
151
|
onRemove: () => c.value?.remove()
|
|
152
152
|
};
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
}), K(() =>
|
|
156
|
-
|
|
157
|
-
}),
|
|
153
|
+
return l((e) => {
|
|
154
|
+
P = e, c.value && e.addControl(I, n.position);
|
|
155
|
+
}), K(() => n.position, (e) => {
|
|
156
|
+
P && c.value && (P.removeControl(I), P.addControl(I, e));
|
|
157
|
+
}), ee(() => {
|
|
158
158
|
document.addEventListener("pointerdown", _, !0), !(typeof ResizeObserver > "u" || !c.value) && (D = new ResizeObserver(k), D.observe(c.value));
|
|
159
|
-
}),
|
|
160
|
-
document.removeEventListener("pointerdown", _, !0), D?.disconnect(), x?.cancel(),
|
|
161
|
-
}), (t, n) => (L(),
|
|
159
|
+
}), F(() => {
|
|
160
|
+
document.removeEventListener("pointerdown", _, !0), D?.disconnect(), x?.cancel(), P?.hasControl(I) && P.removeControl(I);
|
|
161
|
+
}), (t, n) => (L(), C("div", oe, [w("div", M({
|
|
162
162
|
ref_key: "el",
|
|
163
163
|
ref: c,
|
|
164
164
|
class: ["maplibregl-ctrl m3-map-control", p.value ? "m3-map-control-panel" : e.group ? "maplibregl-ctrl-group" : ""]
|
|
165
|
-
}, t.$attrs, { onKeydown: v }), [p.value ? (L(),
|
|
165
|
+
}, t.$attrs, { onKeydown: v }), [p.value ? (L(), C("div", X, [V(t.$slots, "panel", { close: g })])) : V(t.$slots, "default", {
|
|
166
166
|
expanded: f.value,
|
|
167
167
|
toggle: h
|
|
168
168
|
}, void 0, void 0, 1)], 16)]));
|
|
169
169
|
}
|
|
170
|
-
}),
|
|
170
|
+
}), ce = [
|
|
171
171
|
"title",
|
|
172
172
|
"aria-label",
|
|
173
173
|
"aria-expanded"
|
|
174
|
-
],
|
|
174
|
+
], le = ["innerHTML"], ue = /* @__PURE__ */ O({
|
|
175
175
|
__name: "_MMapAttribution",
|
|
176
176
|
props: { position: {} },
|
|
177
177
|
setup(e) {
|
|
178
|
-
let
|
|
178
|
+
let t = e, r = n(), { on: i, onReady: a } = Y(), o = z([]), s = z(!0), c = z(0), l;
|
|
179
179
|
function u() {
|
|
180
180
|
if (!l) return;
|
|
181
181
|
let e = l.getStyle?.();
|
|
@@ -194,35 +194,35 @@ var ae = { class: "hidden" }, X = {
|
|
|
194
194
|
}), i("styledata", u), i("sourcedata", u), i("resize", u), i("dragstart", () => {
|
|
195
195
|
s.value = !1;
|
|
196
196
|
});
|
|
197
|
-
let
|
|
198
|
-
return (t, n) =>
|
|
197
|
+
let d = b(() => o.value.join(" ")), p = b(() => t.position.endsWith("right"));
|
|
198
|
+
return (t, n) => d.value ? (L(), x(se, {
|
|
199
199
|
key: 0,
|
|
200
200
|
position: e.position,
|
|
201
201
|
group: !1,
|
|
202
|
-
class:
|
|
202
|
+
class: N(["m3-map-attrib", s.value ? "m3-map-attrib-open" : ""])
|
|
203
203
|
}, {
|
|
204
|
-
default: q(() => [
|
|
205
|
-
class:
|
|
206
|
-
style:
|
|
207
|
-
}, [
|
|
204
|
+
default: q(() => [w("div", {
|
|
205
|
+
class: N(["m3-map-attrib-row", p.value ? "flex-row-reverse" : ""]),
|
|
206
|
+
style: P(c.value ? { maxWidth: `${c.value}px` } : void 0)
|
|
207
|
+
}, [w("button", {
|
|
208
208
|
type: "button",
|
|
209
209
|
class: "m3-map-attrib-button",
|
|
210
|
-
title:
|
|
211
|
-
"aria-label":
|
|
210
|
+
title: W(r).mapToggleAttribution,
|
|
211
|
+
"aria-label": W(r).mapToggleAttribution,
|
|
212
212
|
"aria-expanded": s.value,
|
|
213
213
|
onClick: n[0] ||= (e) => s.value = !s.value
|
|
214
|
-
}, [
|
|
214
|
+
}, [D(f, {
|
|
215
215
|
name: "info",
|
|
216
216
|
size: 20
|
|
217
|
-
})], 8,
|
|
217
|
+
})], 8, ce), s.value ? (L(), C("div", {
|
|
218
218
|
key: 0,
|
|
219
|
-
class:
|
|
220
|
-
innerHTML:
|
|
221
|
-
}, null, 10,
|
|
219
|
+
class: N(["m3-map-attrib-text", p.value ? "pl-3.5" : "pr-3.5"]),
|
|
220
|
+
innerHTML: d.value
|
|
221
|
+
}, null, 10, le)) : S("", !0)], 6)]),
|
|
222
222
|
_: 1
|
|
223
|
-
}, 8, ["position", "class"])) :
|
|
223
|
+
}, 8, ["position", "class"])) : S("", !0);
|
|
224
224
|
}
|
|
225
|
-
}),
|
|
225
|
+
}), de = {
|
|
226
226
|
fill: ["fill-opacity"],
|
|
227
227
|
line: ["line-opacity"],
|
|
228
228
|
circle: ["circle-opacity", "circle-stroke-opacity"],
|
|
@@ -231,27 +231,27 @@ var ae = { class: "hidden" }, X = {
|
|
|
231
231
|
heatmap: ["heatmap-opacity"],
|
|
232
232
|
"fill-extrusion": ["fill-extrusion-opacity"]
|
|
233
233
|
};
|
|
234
|
-
function
|
|
235
|
-
return
|
|
234
|
+
function fe() {
|
|
235
|
+
return R({
|
|
236
236
|
visible: {},
|
|
237
237
|
opacity: {}
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function pe(e, t, n) {
|
|
241
241
|
let r = {}, i = {};
|
|
242
242
|
for (let e of n?.layers ?? []) {
|
|
243
243
|
let n = t.getLayer(e.id);
|
|
244
244
|
if (!n) continue;
|
|
245
245
|
r[e.id] = t.getLayoutProperty(e.id, "visibility") !== "none";
|
|
246
|
-
let a =
|
|
246
|
+
let a = de[n.type]?.[0], o = a ? t.getPaintProperty(e.id, a) : void 0;
|
|
247
247
|
i[e.id] = typeof o == "number" ? o : 1;
|
|
248
248
|
}
|
|
249
249
|
e.visible = r, e.opacity = i;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
let t =
|
|
251
|
+
function Z(e) {
|
|
252
|
+
let t = ae(e);
|
|
253
253
|
if (!t) throw Error("useMapLayers() must be called in a component inside <MMap>, or be given one");
|
|
254
|
-
let { map: n, model: r, layerState: i } = t, a =
|
|
254
|
+
let { map: n, model: r, layerState: i } = t, a = b(() => r.value?.layers ?? []), o = b(() => new Map(a.value.map((e) => [e.id, e])));
|
|
255
255
|
function s(e) {
|
|
256
256
|
return i.visible[e] ?? !0;
|
|
257
257
|
}
|
|
@@ -268,7 +268,7 @@ function fe(e) {
|
|
|
268
268
|
}
|
|
269
269
|
function d(e, t) {
|
|
270
270
|
let r = n.value, a = r?.getLayer(e);
|
|
271
|
-
if (a) for (let n of
|
|
271
|
+
if (a) for (let n of de[a.type] ?? []) r.setPaintProperty(e, n, t);
|
|
272
272
|
i.opacity[e] = t;
|
|
273
273
|
for (let n of o.value.get(e)?.children ?? []) d(n, t);
|
|
274
274
|
}
|
|
@@ -282,12 +282,12 @@ function fe(e) {
|
|
|
282
282
|
function m(e, t) {
|
|
283
283
|
for (let n of f(e)) c(n.id, t);
|
|
284
284
|
}
|
|
285
|
-
let h =
|
|
285
|
+
let h = b(() => a.value.filter((e) => e.base)), g = b(() => h.value.find((e) => s(e.id))?.id ?? null);
|
|
286
286
|
function _(e) {
|
|
287
287
|
for (let t of h.value) c(t.id, t.id === e);
|
|
288
288
|
}
|
|
289
289
|
return {
|
|
290
|
-
model:
|
|
290
|
+
model: b(() => r.value),
|
|
291
291
|
layers: a,
|
|
292
292
|
isVisible: s,
|
|
293
293
|
setVisible: c,
|
|
@@ -304,13 +304,13 @@ function fe(e) {
|
|
|
304
304
|
}
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/composables/_mapStyle.ts
|
|
307
|
-
function
|
|
307
|
+
function me(e) {
|
|
308
308
|
return {
|
|
309
309
|
sources: new Set(Object.keys(e?.sources ?? {})),
|
|
310
310
|
layers: new Set((e?.layers ?? []).map((e) => e.id))
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function he(e, t, n, r = () => !0) {
|
|
314
314
|
if (!e) return t;
|
|
315
315
|
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 };
|
|
316
316
|
for (let [t, r] of Object.entries(e.sources)) !n.sources.has(t) && !(t in o) && (o[t] = r);
|
|
@@ -322,7 +322,7 @@ function me(e, t, n, r = () => !0) {
|
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/components/MMap.vue?vue&type=script&setup=true&lang.ts
|
|
325
|
-
var
|
|
325
|
+
var ge = 600, _e = /* @__PURE__ */ O({
|
|
326
326
|
__name: "MMap",
|
|
327
327
|
props: {
|
|
328
328
|
mapStyle: {},
|
|
@@ -370,22 +370,22 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
370
370
|
"update:bearing",
|
|
371
371
|
"update:pitch"
|
|
372
372
|
],
|
|
373
|
-
setup(
|
|
374
|
-
let
|
|
375
|
-
map:
|
|
376
|
-
maplibre:
|
|
377
|
-
styleVersion:
|
|
378
|
-
model:
|
|
379
|
-
layerState:
|
|
373
|
+
setup(t, { expose: r, emit: i }) {
|
|
374
|
+
let a = t, o = i, s = z(), c = z(), l = H(), u = H(), d = z(0), f, p = H(), m = fe(), h = {
|
|
375
|
+
map: l,
|
|
376
|
+
maplibre: u,
|
|
377
|
+
styleVersion: d,
|
|
378
|
+
model: p,
|
|
379
|
+
layerState: m,
|
|
380
380
|
activeTool: z(null)
|
|
381
381
|
};
|
|
382
|
-
|
|
383
|
-
function
|
|
384
|
-
|
|
382
|
+
te(ie, h);
|
|
383
|
+
function g(e) {
|
|
384
|
+
p.value = a.adapter ? a.adapter(e.getStyle(), { styleUrl: typeof a.mapStyle == "string" ? a.mapStyle : void 0 }) : void 0, pe(m, e, p.value);
|
|
385
385
|
}
|
|
386
|
-
let
|
|
387
|
-
function
|
|
388
|
-
let e =
|
|
386
|
+
let _ = n(), v = () => typeof a.persist == "string" ? a.persist : a.persist ? e("m3-map-view") : null;
|
|
387
|
+
function b() {
|
|
388
|
+
let e = v();
|
|
389
389
|
if (!e) return {};
|
|
390
390
|
try {
|
|
391
391
|
let t = JSON.parse(localStorage.getItem(e) ?? "null");
|
|
@@ -394,7 +394,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
394
394
|
return {};
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function T(e) {
|
|
398
398
|
let t = e.getCenter();
|
|
399
399
|
return {
|
|
400
400
|
center: [t.lng, t.lat],
|
|
@@ -403,7 +403,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
403
403
|
pitch: e.getPitch()
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
let
|
|
406
|
+
let E = {
|
|
407
407
|
navigation: {
|
|
408
408
|
corner: "top-right",
|
|
409
409
|
create: (e) => new e.NavigationControl()
|
|
@@ -417,7 +417,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
417
417
|
},
|
|
418
418
|
fullscreen: {
|
|
419
419
|
corner: "top-right",
|
|
420
|
-
create: (e) => new e.FullscreenControl({ container:
|
|
420
|
+
create: (e) => new e.FullscreenControl({ container: s.value })
|
|
421
421
|
},
|
|
422
422
|
scale: {
|
|
423
423
|
corner: "bottom-left",
|
|
@@ -426,74 +426,74 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
426
426
|
unit: "metric"
|
|
427
427
|
})
|
|
428
428
|
}
|
|
429
|
-
},
|
|
430
|
-
function
|
|
431
|
-
let t =
|
|
429
|
+
}, O = /* @__PURE__ */ new Map();
|
|
430
|
+
function k(e) {
|
|
431
|
+
let t = l.value, n = u.value;
|
|
432
432
|
if (!t || !n) return;
|
|
433
|
-
let r =
|
|
434
|
-
r && (t.removeControl(r),
|
|
435
|
-
let
|
|
436
|
-
if (!
|
|
437
|
-
let o =
|
|
438
|
-
t.addControl(o,
|
|
439
|
-
}
|
|
440
|
-
for (let e of Object.keys(
|
|
441
|
-
function
|
|
433
|
+
let r = O.get(e);
|
|
434
|
+
r && (t.removeControl(r), O.delete(e));
|
|
435
|
+
let i = a[e];
|
|
436
|
+
if (!i) return;
|
|
437
|
+
let o = E[e].create(n);
|
|
438
|
+
t.addControl(o, i === !0 ? E[e].corner : i), O.set(e, o);
|
|
439
|
+
}
|
|
440
|
+
for (let e of Object.keys(E)) K(() => a[e], () => k(e));
|
|
441
|
+
function A() {
|
|
442
442
|
return {
|
|
443
|
-
"AttributionControl.ToggleAttribution":
|
|
444
|
-
"AttributionControl.MapFeedback":
|
|
445
|
-
"FullscreenControl.Enter":
|
|
446
|
-
"FullscreenControl.Exit":
|
|
447
|
-
"GeolocateControl.FindMyLocation":
|
|
448
|
-
"GeolocateControl.LocationNotAvailable":
|
|
449
|
-
"Map.Title":
|
|
450
|
-
"Marker.Title":
|
|
451
|
-
"NavigationControl.ResetBearing":
|
|
452
|
-
"NavigationControl.ZoomIn":
|
|
453
|
-
"NavigationControl.ZoomOut":
|
|
454
|
-
"Popup.Close":
|
|
455
|
-
"CooperativeGesturesHandler.WindowsHelpText":
|
|
456
|
-
"CooperativeGesturesHandler.MacHelpText":
|
|
457
|
-
"CooperativeGesturesHandler.MobileHelpText":
|
|
443
|
+
"AttributionControl.ToggleAttribution": _.mapToggleAttribution,
|
|
444
|
+
"AttributionControl.MapFeedback": _.mapFeedback,
|
|
445
|
+
"FullscreenControl.Enter": _.mapEnterFullscreen,
|
|
446
|
+
"FullscreenControl.Exit": _.mapExitFullscreen,
|
|
447
|
+
"GeolocateControl.FindMyLocation": _.mapFindMyLocation,
|
|
448
|
+
"GeolocateControl.LocationNotAvailable": _.mapLocationNotAvailable,
|
|
449
|
+
"Map.Title": _.mapTitle,
|
|
450
|
+
"Marker.Title": _.mapMarker,
|
|
451
|
+
"NavigationControl.ResetBearing": _.mapResetBearing,
|
|
452
|
+
"NavigationControl.ZoomIn": _.mapZoomIn,
|
|
453
|
+
"NavigationControl.ZoomOut": _.mapZoomOut,
|
|
454
|
+
"Popup.Close": _.close,
|
|
455
|
+
"CooperativeGesturesHandler.WindowsHelpText": _.mapCtrlScroll,
|
|
456
|
+
"CooperativeGesturesHandler.MacHelpText": _.mapCmdScroll,
|
|
457
|
+
"CooperativeGesturesHandler.MobileHelpText": _.mapTwoFingers
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
|
-
let
|
|
461
|
-
function
|
|
460
|
+
let M = z(null), R, B;
|
|
461
|
+
function ne(e) {
|
|
462
462
|
let t = e.getAttribute("title");
|
|
463
463
|
t && e.closest(".maplibregl-ctrl") && (e.setAttribute("data-m3-tip", t), e.hasAttribute("aria-label") || e.setAttribute("aria-label", t), e.removeAttribute("title"));
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
let t = e.getAttribute("data-m3-tip"), n =
|
|
465
|
+
function W(e) {
|
|
466
|
+
let t = e.getAttribute("data-m3-tip"), n = s.value?.getBoundingClientRect();
|
|
467
467
|
if (!t || !n) return;
|
|
468
468
|
let r = e.getBoundingClientRect(), i = r.left + r.width / 2 > n.left + n.width / 2;
|
|
469
|
-
|
|
469
|
+
M.value = {
|
|
470
470
|
text: t,
|
|
471
471
|
left: i,
|
|
472
472
|
x: (i ? r.left - 8 : r.right + 8) - n.left,
|
|
473
473
|
y: r.top + r.height / 2 - n.top
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
clearTimeout(
|
|
476
|
+
function re() {
|
|
477
|
+
clearTimeout(R), M.value = null;
|
|
478
478
|
}
|
|
479
|
-
let
|
|
479
|
+
let G = (e) => e.target?.closest?.(".maplibregl-ctrl [data-m3-tip]") ?? null;
|
|
480
480
|
function J(e) {
|
|
481
|
-
let t =
|
|
482
|
-
t && e.pointerType !== "touch" && (clearTimeout(
|
|
481
|
+
let t = G(e);
|
|
482
|
+
t && e.pointerType !== "touch" && (clearTimeout(R), R = setTimeout(() => W(t), ge));
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
let t =
|
|
486
|
-
t && !t.contains(e.relatedTarget) &&
|
|
484
|
+
function ae(e) {
|
|
485
|
+
let t = G(e);
|
|
486
|
+
t && !t.contains(e.relatedTarget) && re();
|
|
487
487
|
}
|
|
488
488
|
function Y(e) {
|
|
489
|
-
let t =
|
|
490
|
-
t?.matches(":focus-visible") &&
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
let e =
|
|
494
|
-
e && (e.querySelectorAll("[title]").forEach(
|
|
495
|
-
for (let t of e) t.type === "attributes" ?
|
|
496
|
-
e instanceof Element && (
|
|
489
|
+
let t = G(e);
|
|
490
|
+
t?.matches(":focus-visible") && W(t);
|
|
491
|
+
}
|
|
492
|
+
ee(() => {
|
|
493
|
+
let e = s.value;
|
|
494
|
+
e && (e.querySelectorAll("[title]").forEach(ne), B = new MutationObserver((e) => {
|
|
495
|
+
for (let t of e) t.type === "attributes" ? ne(t.target) : t.addedNodes.forEach((e) => {
|
|
496
|
+
e instanceof Element && (ne(e), e.querySelectorAll("[title]").forEach(ne));
|
|
497
497
|
});
|
|
498
498
|
}), B.observe(e, {
|
|
499
499
|
subtree: !0,
|
|
@@ -501,118 +501,118 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
501
501
|
attributes: !0,
|
|
502
502
|
attributeFilter: ["title"]
|
|
503
503
|
}));
|
|
504
|
-
}),
|
|
505
|
-
B?.disconnect(), clearTimeout(
|
|
504
|
+
}), F(() => {
|
|
505
|
+
B?.disconnect(), clearTimeout(R);
|
|
506
506
|
});
|
|
507
|
-
let
|
|
508
|
-
|
|
507
|
+
let oe = !1;
|
|
508
|
+
ee(async () => {
|
|
509
509
|
let e = await import("maplibre-gl"), t = "Map" in e ? e : e.default;
|
|
510
|
-
if (
|
|
511
|
-
let n =
|
|
512
|
-
center: n.center ??
|
|
513
|
-
zoom: n.zoom ??
|
|
514
|
-
bearing: n.bearing ??
|
|
515
|
-
pitch: n.pitch ??
|
|
516
|
-
},
|
|
517
|
-
container:
|
|
518
|
-
style:
|
|
510
|
+
if (oe || !c.value) return;
|
|
511
|
+
let n = b(), r = {
|
|
512
|
+
center: n.center ?? a.center,
|
|
513
|
+
zoom: n.zoom ?? a.zoom,
|
|
514
|
+
bearing: n.bearing ?? a.bearing,
|
|
515
|
+
pitch: n.pitch ?? a.pitch
|
|
516
|
+
}, i = j(new t.Map({
|
|
517
|
+
container: c.value,
|
|
518
|
+
style: a.mapStyle,
|
|
519
519
|
attributionControl: !1,
|
|
520
|
-
locale:
|
|
520
|
+
locale: A(),
|
|
521
521
|
...Object.fromEntries(Object.entries(r).filter(([, e]) => e !== void 0)),
|
|
522
|
-
...
|
|
522
|
+
...a.options
|
|
523
523
|
}));
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}),
|
|
527
|
-
let e =
|
|
528
|
-
|
|
529
|
-
let t =
|
|
524
|
+
u.value = t, i.on("style.load", () => {
|
|
525
|
+
f ||= me(i.getStyle()), g(i), d.value++;
|
|
526
|
+
}), i.on("click", (e) => o("click", e)), i.on("moveend", () => {
|
|
527
|
+
let e = T(i);
|
|
528
|
+
o("update:center", e.center), o("update:zoom", e.zoom), o("update:bearing", e.bearing), o("update:pitch", e.pitch);
|
|
529
|
+
let t = v();
|
|
530
530
|
if (t) try {
|
|
531
531
|
localStorage.setItem(t, JSON.stringify(e));
|
|
532
532
|
} catch {}
|
|
533
|
-
}),
|
|
534
|
-
|
|
535
|
-
for (let e of Object.keys(
|
|
536
|
-
|
|
533
|
+
}), i.once("load", () => {
|
|
534
|
+
l.value = i;
|
|
535
|
+
for (let e of Object.keys(E)) k(e);
|
|
536
|
+
o("ready", i);
|
|
537
537
|
});
|
|
538
538
|
}), I(() => {
|
|
539
|
-
|
|
539
|
+
oe = !0, l.value?.remove(), l.value = void 0;
|
|
540
540
|
});
|
|
541
541
|
let X = (e, t) => Math.abs(e - t) < 1e-9;
|
|
542
|
-
return K(() =>
|
|
543
|
-
let e =
|
|
544
|
-
if (!e || !
|
|
542
|
+
return K(() => a.center?.join(","), () => {
|
|
543
|
+
let e = l.value;
|
|
544
|
+
if (!e || !a.center) return;
|
|
545
545
|
let t = e.getCenter();
|
|
546
|
-
(!X(t.lng,
|
|
547
|
-
}), K(() =>
|
|
548
|
-
|
|
549
|
-
}), K(() =>
|
|
550
|
-
|
|
551
|
-
}), K(() =>
|
|
552
|
-
|
|
553
|
-
}), K(() =>
|
|
554
|
-
|
|
555
|
-
}), K(() =>
|
|
546
|
+
(!X(t.lng, a.center[0]) || !X(t.lat, a.center[1])) && e.jumpTo({ center: a.center });
|
|
547
|
+
}), K(() => a.zoom, (e) => {
|
|
548
|
+
l.value && e !== void 0 && !X(l.value.getZoom(), e) && l.value.jumpTo({ zoom: e });
|
|
549
|
+
}), K(() => a.bearing, (e) => {
|
|
550
|
+
l.value && e !== void 0 && !X(l.value.getBearing(), e) && l.value.jumpTo({ bearing: e });
|
|
551
|
+
}), K(() => a.pitch, (e) => {
|
|
552
|
+
l.value && e !== void 0 && !X(l.value.getPitch(), e) && l.value.jumpTo({ pitch: e });
|
|
553
|
+
}), K(() => a.adapter, () => {
|
|
554
|
+
l.value && g(l.value);
|
|
555
|
+
}), K(() => a.mapStyle, (e) => l.value?.setStyle(e, {
|
|
556
556
|
diff: !1,
|
|
557
557
|
transformStyle: (e, t) => {
|
|
558
|
-
let n =
|
|
559
|
-
|
|
560
|
-
let r =
|
|
561
|
-
return
|
|
558
|
+
let n = f ?? me(void 0);
|
|
559
|
+
f = me(t);
|
|
560
|
+
let r = a.keepLayers, i = r === !1 ? t : he(e, t, n, typeof r == "function" ? r : void 0);
|
|
561
|
+
return a.transformStyle && (i = a.transformStyle(e, i)), i;
|
|
562
562
|
}
|
|
563
|
-
})),
|
|
564
|
-
map:
|
|
565
|
-
context:
|
|
566
|
-
}), (
|
|
563
|
+
})), r({
|
|
564
|
+
map: l,
|
|
565
|
+
context: h
|
|
566
|
+
}), (e, n) => (L(), C("div", {
|
|
567
567
|
ref_key: "root",
|
|
568
|
-
ref:
|
|
568
|
+
ref: s,
|
|
569
569
|
class: "m3-map relative overflow-hidden",
|
|
570
570
|
onPointerover: J,
|
|
571
|
-
onPointerout:
|
|
572
|
-
onPointerdown:
|
|
571
|
+
onPointerout: ae,
|
|
572
|
+
onPointerdown: re,
|
|
573
573
|
onFocusin: Y,
|
|
574
|
-
onFocusout:
|
|
574
|
+
onFocusout: re
|
|
575
575
|
}, [
|
|
576
|
-
|
|
576
|
+
w("div", {
|
|
577
577
|
ref_key: "container",
|
|
578
|
-
ref:
|
|
578
|
+
ref: c,
|
|
579
579
|
class: "h-full w-full"
|
|
580
580
|
}, null, 512),
|
|
581
|
-
|
|
581
|
+
l.value && t.attribution ? (L(), x(ue, {
|
|
582
582
|
key: 0,
|
|
583
|
-
position:
|
|
584
|
-
}, null, 8, ["position"])) :
|
|
585
|
-
|
|
586
|
-
|
|
583
|
+
position: t.attribution === !0 ? "bottom-right" : t.attribution
|
|
584
|
+
}, null, 8, ["position"])) : S("", !0),
|
|
585
|
+
l.value ? V(e.$slots, "default", {}, void 0, void 0, 1) : S("", !0),
|
|
586
|
+
D(y, {
|
|
587
587
|
"enter-active-class": "transition-opacity duration-150",
|
|
588
588
|
"enter-from-class": "opacity-0",
|
|
589
589
|
"leave-active-class": "transition-opacity duration-100",
|
|
590
590
|
"leave-to-class": "opacity-0"
|
|
591
591
|
}, {
|
|
592
|
-
default: q(() => [
|
|
592
|
+
default: q(() => [M.value ? (L(), C("div", {
|
|
593
593
|
key: 0,
|
|
594
594
|
role: "tooltip",
|
|
595
|
-
class:
|
|
596
|
-
style:
|
|
597
|
-
left: `${
|
|
598
|
-
top: `${
|
|
595
|
+
class: N(["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", M.value.left ? "-translate-x-full" : ""]),
|
|
596
|
+
style: P({
|
|
597
|
+
left: `${M.value.x}px`,
|
|
598
|
+
top: `${M.value.y}px`
|
|
599
599
|
})
|
|
600
|
-
}, U(
|
|
600
|
+
}, U(M.value.text), 7)) : S("", !0)]),
|
|
601
601
|
_: 1
|
|
602
602
|
})
|
|
603
603
|
], 544));
|
|
604
604
|
}
|
|
605
|
-
}),
|
|
605
|
+
}), ve = 13.5, ye = ve / Math.SQRT2, be = [0, -14], xe = {
|
|
606
606
|
center: [0, 0],
|
|
607
607
|
top: [0, 0],
|
|
608
608
|
"top-left": [0, 0],
|
|
609
609
|
"top-right": [0, 0],
|
|
610
610
|
bottom: [0, -38.1],
|
|
611
|
-
"bottom-left": [
|
|
612
|
-
"bottom-right": [-
|
|
613
|
-
left: [
|
|
611
|
+
"bottom-left": [ye, (24.6 + ye) * -1],
|
|
612
|
+
"bottom-right": [-ye, (24.6 + ye) * -1],
|
|
613
|
+
left: [ve, -24.6],
|
|
614
614
|
right: [-13.5, -24.6]
|
|
615
|
-
},
|
|
615
|
+
}, Q = { class: "hidden" }, Se = /* @__PURE__ */ O({
|
|
616
616
|
inheritAttrs: !1,
|
|
617
617
|
__name: "MMapMarker",
|
|
618
618
|
props: {
|
|
@@ -628,7 +628,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
628
628
|
},
|
|
629
629
|
emits: ["update:lngLat", "click"],
|
|
630
630
|
setup(e, { expose: t, emit: n }) {
|
|
631
|
-
let r = e, i = n, a =
|
|
631
|
+
let r = e, i = n, a = G(), o = z(), s = z(), { onReady: c } = Y(), l, u = !1;
|
|
632
632
|
c((e, t) => {
|
|
633
633
|
u = !!a.default && !!o.value, l = new t.Marker({
|
|
634
634
|
...u ? { element: o.value } : { color: r.color ?? "currentColor" },
|
|
@@ -647,20 +647,20 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
647
647
|
function d(e) {
|
|
648
648
|
i("click", e);
|
|
649
649
|
}
|
|
650
|
-
return K(() => r.lngLat.join(","), () => l?.setLngLat(r.lngLat)), K(() => r.draggable, (e) => l?.setDraggable(e)), K(() => r.rotation, (e) => l?.setRotation(e)), K(() => r.offset?.join(","), () => l?.setOffset(r.offset ?? (u ? [0, 0] :
|
|
650
|
+
return K(() => r.lngLat.join(","), () => l?.setLngLat(r.lngLat)), K(() => r.draggable, (e) => l?.setDraggable(e)), K(() => r.rotation, (e) => l?.setRotation(e)), K(() => r.offset?.join(","), () => l?.setOffset(r.offset ?? (u ? [0, 0] : be))), F(() => {
|
|
651
651
|
l?.getElement().removeEventListener("click", d), l?.getPopup()?.remove(), l?.remove();
|
|
652
|
-
}), t({ marker: () => l }), (e, t) => (L(),
|
|
652
|
+
}), t({ marker: () => l }), (e, t) => (L(), C("div", Q, [e.$slots.default ? (L(), C("div", M({
|
|
653
653
|
key: 0,
|
|
654
654
|
ref_key: "content",
|
|
655
655
|
ref: o,
|
|
656
656
|
class: "m3-map-marker"
|
|
657
|
-
}, e.$attrs), [V(e.$slots, "default")], 16)) :
|
|
657
|
+
}, e.$attrs), [V(e.$slots, "default")], 16)) : S("", !0), e.$slots.popup ? (L(), C("div", {
|
|
658
658
|
key: 1,
|
|
659
659
|
ref_key: "popupContent",
|
|
660
660
|
ref: s
|
|
661
|
-
}, [V(e.$slots, "popup")], 512)) :
|
|
661
|
+
}, [V(e.$slots, "popup")], 512)) : S("", !0)]));
|
|
662
662
|
}
|
|
663
|
-
}),
|
|
663
|
+
}), Ce = { class: "hidden" }, we = /* @__PURE__ */ O({
|
|
664
664
|
inheritAttrs: !1,
|
|
665
665
|
__name: "MMapPopup",
|
|
666
666
|
props: {
|
|
@@ -701,14 +701,14 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
701
701
|
}), r.open && u();
|
|
702
702
|
}), K(() => r.open, (e) => {
|
|
703
703
|
e ? u() : s?.isOpen() && (l = !0, s.remove(), l = !1);
|
|
704
|
-
}), K(() => r.lngLat.join(","), () => s?.setLngLat(r.lngLat)), K(() => r.maxWidth, (e) => s?.setMaxWidth(e)), K(() => r.offset, (e) => s?.setOffset(e ?? 0)),
|
|
704
|
+
}), K(() => r.lngLat.join(","), () => s?.setLngLat(r.lngLat)), K(() => r.maxWidth, (e) => s?.setMaxWidth(e)), K(() => r.offset, (e) => s?.setOffset(e ?? 0)), F(() => {
|
|
705
705
|
l = !0, s?.remove();
|
|
706
|
-
}), t({ popup: () => s }), (e, t) => (L(),
|
|
706
|
+
}), t({ popup: () => s }), (e, t) => (L(), C("div", Ce, [w("div", M({
|
|
707
707
|
ref_key: "content",
|
|
708
708
|
ref: a
|
|
709
709
|
}, e.$attrs), [V(e.$slots, "default")], 16)]));
|
|
710
710
|
}
|
|
711
|
-
}),
|
|
711
|
+
}), Te = /* @__PURE__ */ O({
|
|
712
712
|
inheritAttrs: !1,
|
|
713
713
|
__name: "MMapGeoJson",
|
|
714
714
|
props: {
|
|
@@ -723,14 +723,14 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
723
723
|
sourceOptions: {}
|
|
724
724
|
},
|
|
725
725
|
emits: ["click"],
|
|
726
|
-
setup(
|
|
727
|
-
let i =
|
|
726
|
+
setup(e, { expose: n, emit: r }) {
|
|
727
|
+
let i = e, a = r, o = i.id ?? `m3-geojson-${re()}`, { onReady: s, styleVersion: c } = Y(), l = t(["primary", "surface"]), u = (...e) => [
|
|
728
728
|
"match",
|
|
729
729
|
["geometry-type"],
|
|
730
730
|
e,
|
|
731
731
|
!0,
|
|
732
732
|
!1
|
|
733
|
-
], d =
|
|
733
|
+
], d = b(() => {
|
|
734
734
|
let { primary: e, surface: t } = l.value;
|
|
735
735
|
return [
|
|
736
736
|
{
|
|
@@ -763,7 +763,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
];
|
|
766
|
-
}), f =
|
|
766
|
+
}), f = b(() => (i.layers ?? d.value).map((e, t) => ({
|
|
767
767
|
...e,
|
|
768
768
|
id: e.id ?? `${o}-${t}`,
|
|
769
769
|
source: o
|
|
@@ -778,7 +778,7 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
778
778
|
m = [];
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function y() {
|
|
782
782
|
if (p) {
|
|
783
783
|
v();
|
|
784
784
|
for (let e of f.value) p.addLayer(e, i.before && p.getLayer(i.before) ? i.before : void 0), p.on("click", e.id, h), p.on("mouseenter", e.id, g), p.on("mouseleave", e.id, _), m.push(e.id);
|
|
@@ -789,111 +789,111 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
789
789
|
type: "geojson",
|
|
790
790
|
data: i.data,
|
|
791
791
|
...i.sourceOptions
|
|
792
|
-
}), m = []), (!m.length || !p.getLayer(m[0])) &&
|
|
792
|
+
}), m = []), (!m.length || !p.getLayer(m[0])) && y());
|
|
793
793
|
}
|
|
794
794
|
return s((e) => {
|
|
795
795
|
p = e, x();
|
|
796
|
-
}), K(c, () => x()), K(() => i.data, (e) => (p?.getSource(o))?.setData(e)), K(() => JSON.stringify(f.value), () =>
|
|
796
|
+
}), K(c, () => x()), K(() => i.data, (e) => (p?.getSource(o))?.setData(e)), K(() => JSON.stringify(f.value), () => y()), K(() => i.before, () => y()), F(() => {
|
|
797
797
|
p &&= (v(), p.getSource(o) && p.removeSource(o), void 0);
|
|
798
798
|
}), n({
|
|
799
799
|
sourceId: o,
|
|
800
800
|
layerIds: () => [...m]
|
|
801
801
|
}), (e, t) => null;
|
|
802
802
|
}
|
|
803
|
-
}),
|
|
803
|
+
}), Ee = { class: "flex min-w-0 flex-1 flex-col" }, De = ["aria-label", "aria-pressed"], Oe = { class: "flex min-w-0 flex-1 flex-col" }, ke = {
|
|
804
804
|
key: 0,
|
|
805
805
|
class: "truncate text-label-small text-on-surface-variant"
|
|
806
|
-
},
|
|
806
|
+
}, Ae = {
|
|
807
807
|
key: 0,
|
|
808
808
|
class: "rounded-full bg-primary/8 px-2 py-0.5 text-label-small tabular-nums text-primary"
|
|
809
|
-
},
|
|
809
|
+
}, je = { class: "min-h-0 overflow-hidden" }, Me = { class: "flex flex-col gap-3 px-3 pb-3" }, Ne = {
|
|
810
810
|
key: 0,
|
|
811
811
|
class: "text-body-small text-on-surface-variant"
|
|
812
|
-
},
|
|
812
|
+
}, Pe = { class: "flex items-center gap-2 rounded-2xl bg-surface-container-highest/60 px-3 py-1" }, Fe = ["src"], Ie = {
|
|
813
813
|
key: 2,
|
|
814
814
|
class: "flex flex-wrap items-center gap-2"
|
|
815
|
-
},
|
|
815
|
+
}, Le = ["href"], Re = /* @__PURE__ */ O({
|
|
816
816
|
__name: "_MMapLayerItem",
|
|
817
817
|
props: {
|
|
818
818
|
layer: {},
|
|
819
819
|
expanded: { type: Boolean }
|
|
820
820
|
},
|
|
821
821
|
emits: ["toggle-expanded"],
|
|
822
|
-
setup(e, { emit:
|
|
823
|
-
let r =
|
|
824
|
-
return (t, n) => (L(),
|
|
822
|
+
setup(e, { emit: t }) {
|
|
823
|
+
let r = t, i = n(), { isVisible: a, toggle: o, opacityOf: s, setOpacity: c } = Z();
|
|
824
|
+
return (t, n) => (L(), C("div", { class: N(["flex overflow-hidden rounded-2xl bg-surface-container", W(a)(e.layer.id) ? "" : "opacity-75"]) }, [w("div", { class: N(["w-1 shrink-0 transition-colors duration-200", W(a)(e.layer.id) ? "bg-primary" : "bg-outline-variant"]) }, null, 2), w("div", Ee, [w("div", {
|
|
825
825
|
class: "flex cursor-pointer items-center gap-2 px-3 py-2",
|
|
826
826
|
onClick: n[1] ||= (e) => r("toggle-expanded")
|
|
827
827
|
}, [
|
|
828
|
-
|
|
828
|
+
w("button", {
|
|
829
829
|
type: "button",
|
|
830
|
-
class:
|
|
831
|
-
"aria-label":
|
|
832
|
-
"aria-pressed":
|
|
833
|
-
onClick: n[0] ||= J((t) =>
|
|
834
|
-
}, [
|
|
835
|
-
name:
|
|
830
|
+
class: N(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", W(a)(e.layer.id) ? "bg-primary/12 text-primary" : "bg-on-surface/5 text-on-surface-variant"]),
|
|
831
|
+
"aria-label": W(a)(e.layer.id) ? W(i).mapHideLayer : W(i).mapShowLayer,
|
|
832
|
+
"aria-pressed": W(a)(e.layer.id),
|
|
833
|
+
onClick: n[0] ||= J((t) => W(o)(e.layer.id), ["stop"])
|
|
834
|
+
}, [D(f, {
|
|
835
|
+
name: W(a)(e.layer.id) ? "visibility" : "visibility_off",
|
|
836
836
|
size: 18
|
|
837
|
-
}, null, 8, ["name"])], 10,
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
837
|
+
}, null, 8, ["name"])], 10, De),
|
|
838
|
+
w("div", Oe, [w("span", { class: N(["truncate text-body-medium", W(a)(e.layer.id) ? "text-on-surface" : "text-on-surface-variant"]) }, U(e.layer.title), 3), e.layer.description && !e.expanded ? (L(), C("span", ke, U(e.layer.description), 1)) : S("", !0)]),
|
|
839
|
+
W(a)(e.layer.id) && W(s)(e.layer.id) < 1 ? (L(), C("span", Ae, U(Math.round(W(s)(e.layer.id) * 100)) + "% ", 1)) : S("", !0),
|
|
840
|
+
D(f, {
|
|
841
841
|
name: "expand_more",
|
|
842
842
|
size: 18,
|
|
843
|
-
class:
|
|
843
|
+
class: N(["shrink-0 text-on-surface-variant transition-transform duration-300", e.expanded ? "rotate-180" : ""])
|
|
844
844
|
}, null, 8, ["class"])
|
|
845
|
-
]),
|
|
845
|
+
]), w("div", {
|
|
846
846
|
class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
847
|
-
style:
|
|
848
|
-
}, [
|
|
849
|
-
e.layer.description ? (L(),
|
|
850
|
-
|
|
847
|
+
style: P({ gridTemplateRows: e.expanded ? "1fr" : "0fr" })
|
|
848
|
+
}, [w("div", je, [w("div", Me, [
|
|
849
|
+
e.layer.description ? (L(), C("p", Ne, U(e.layer.description), 1)) : S("", !0),
|
|
850
|
+
w("div", Pe, [D(f, {
|
|
851
851
|
name: "opacity",
|
|
852
852
|
size: 16,
|
|
853
853
|
class: "shrink-0 text-on-surface-variant"
|
|
854
|
-
}),
|
|
855
|
-
"model-value":
|
|
854
|
+
}), D(_, {
|
|
855
|
+
"model-value": W(s)(e.layer.id),
|
|
856
856
|
min: 0,
|
|
857
857
|
max: 1,
|
|
858
858
|
step: .01,
|
|
859
|
-
label:
|
|
859
|
+
label: W(i).mapOpacity,
|
|
860
860
|
class: "flex-1",
|
|
861
|
-
"onUpdate:modelValue": n[2] ||= (t) =>
|
|
861
|
+
"onUpdate:modelValue": n[2] ||= (t) => W(c)(e.layer.id, Number(t))
|
|
862
862
|
}, null, 8, ["model-value", "label"])]),
|
|
863
|
-
e.layer.legend ? (L(),
|
|
863
|
+
e.layer.legend ? (L(), C("img", {
|
|
864
864
|
key: 1,
|
|
865
865
|
src: e.layer.legend,
|
|
866
866
|
alt: "",
|
|
867
867
|
class: "max-w-full self-start",
|
|
868
868
|
loading: "lazy"
|
|
869
|
-
}, null, 8,
|
|
870
|
-
e.layer.download || t.$slots.actions ? (L(),
|
|
869
|
+
}, null, 8, Fe)) : S("", !0),
|
|
870
|
+
e.layer.download || t.$slots.actions ? (L(), C("div", Ie, [e.layer.download ? (L(), C("a", {
|
|
871
871
|
key: 0,
|
|
872
872
|
href: e.layer.download,
|
|
873
873
|
target: "_blank",
|
|
874
874
|
rel: "noopener",
|
|
875
875
|
download: "",
|
|
876
876
|
class: "inline-flex items-center gap-1 rounded-full px-3 py-1.5 text-label-large text-primary hover:bg-primary/8"
|
|
877
|
-
}, [
|
|
877
|
+
}, [D(f, {
|
|
878
878
|
name: "download",
|
|
879
879
|
size: 18
|
|
880
|
-
}),
|
|
880
|
+
}), E(" " + U(W(i).mapDownload), 1)], 8, Le)) : S("", !0), V(t.$slots, "actions", {
|
|
881
881
|
layer: e.layer,
|
|
882
|
-
visible:
|
|
883
|
-
})])) :
|
|
882
|
+
visible: W(a)(e.layer.id)
|
|
883
|
+
})])) : S("", !0)
|
|
884
884
|
])])], 4)])], 2));
|
|
885
885
|
}
|
|
886
|
-
}),
|
|
886
|
+
}), ze = { class: "flex flex-col gap-3" }, Be = ["onClick"], Ve = [
|
|
887
887
|
"aria-label",
|
|
888
888
|
"aria-pressed",
|
|
889
889
|
"onClick"
|
|
890
|
-
],
|
|
890
|
+
], He = { class: "flex-1 select-none truncate text-label-large text-on-surface" }, Ue = { class: "rounded-full bg-surface-container-highest px-2 py-0.5 text-label-small tabular-nums text-on-surface-variant" }, We = {
|
|
891
891
|
key: 1,
|
|
892
892
|
class: "flex flex-col gap-1.5"
|
|
893
|
-
},
|
|
893
|
+
}, Ge = {
|
|
894
894
|
key: 2,
|
|
895
895
|
class: "flex flex-col items-center gap-3 py-8"
|
|
896
|
-
},
|
|
896
|
+
}, Ke = { class: "grid size-14 place-items-center rounded-full bg-surface-container-highest" }, qe = { class: "text-body-medium text-on-surface-variant" }, Je = /* @__PURE__ */ O({
|
|
897
897
|
__name: "MMapLayers",
|
|
898
898
|
props: {
|
|
899
899
|
search: {
|
|
@@ -907,103 +907,103 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
907
907
|
map: {}
|
|
908
908
|
},
|
|
909
909
|
setup(e) {
|
|
910
|
-
let
|
|
910
|
+
let t = e, r = n(), { model: i, layersOf: a, isVisible: o, groupState: s, setGroupVisible: c } = Z(() => t.map), u = z(""), d = (e) => !u.value || e.title.toLowerCase().includes(u.value.toLowerCase()), p = b(() => (i.value?.groups ?? []).map((e) => ({
|
|
911
911
|
...e,
|
|
912
912
|
all: a(e.name),
|
|
913
|
-
layers: a(e.name).filter(
|
|
914
|
-
})).filter((e) => e.layers.length)), m =
|
|
915
|
-
function
|
|
913
|
+
layers: a(e.name).filter(d)
|
|
914
|
+
})).filter((e) => e.layers.length)), m = b(() => a(null).filter(d)), h = z(/* @__PURE__ */ new Set()), g = (e) => h.value.has(e) === t.collapsed;
|
|
915
|
+
function _(e) {
|
|
916
916
|
let t = new Set(h.value);
|
|
917
917
|
t.delete(e) || t.add(e), h.value = t;
|
|
918
918
|
}
|
|
919
|
-
let
|
|
920
|
-
function
|
|
921
|
-
let t = new Set(
|
|
922
|
-
t.delete(e) || t.add(e),
|
|
919
|
+
let y = z(/* @__PURE__ */ new Set());
|
|
920
|
+
function E(e) {
|
|
921
|
+
let t = new Set(y.value);
|
|
922
|
+
t.delete(e) || t.add(e), y.value = t;
|
|
923
923
|
}
|
|
924
924
|
let O = (e) => e.filter((e) => o(e.id)).length;
|
|
925
|
-
return (t, n) => (L(),
|
|
926
|
-
e.search ? (L(),
|
|
925
|
+
return (t, n) => (L(), C("div", ze, [
|
|
926
|
+
e.search ? (L(), x(l, {
|
|
927
927
|
key: 0,
|
|
928
928
|
modelValue: u.value,
|
|
929
929
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
930
|
-
label:
|
|
930
|
+
label: W(r).mapSearchLayers,
|
|
931
931
|
"leading-icon": "search",
|
|
932
932
|
variant: "outlined",
|
|
933
933
|
clearable: ""
|
|
934
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
935
|
-
(L(!0),
|
|
934
|
+
}, null, 8, ["modelValue", "label"])) : S("", !0),
|
|
935
|
+
(L(!0), C(v, null, B(p.value, (e) => (L(), C("section", {
|
|
936
936
|
key: e.name,
|
|
937
937
|
class: "flex flex-col"
|
|
938
|
-
}, [
|
|
938
|
+
}, [w("div", {
|
|
939
939
|
class: "m3-map-layers-row flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5",
|
|
940
|
-
onClick: (t) =>
|
|
940
|
+
onClick: (t) => _(e.name)
|
|
941
941
|
}, [
|
|
942
|
-
|
|
942
|
+
w("button", {
|
|
943
943
|
type: "button",
|
|
944
|
-
class:
|
|
945
|
-
"aria-label":
|
|
946
|
-
"aria-pressed":
|
|
947
|
-
onClick: J((t) =>
|
|
948
|
-
}, [
|
|
949
|
-
name:
|
|
944
|
+
class: N(["grid size-8 shrink-0 cursor-pointer place-items-center rounded-full transition-colors duration-200", W(s)(e.name) === "visible" ? "bg-primary-container text-on-primary-container" : W(s)(e.name) === "partial" ? "bg-secondary-container text-on-secondary-container" : "bg-on-surface/8 text-on-surface-variant"]),
|
|
945
|
+
"aria-label": W(s)(e.name) === "hidden" ? W(r).mapShowLayer : W(r).mapHideLayer,
|
|
946
|
+
"aria-pressed": W(s)(e.name) !== "hidden",
|
|
947
|
+
onClick: J((t) => W(c)(e.name, W(s)(e.name) !== "visible"), ["stop"])
|
|
948
|
+
}, [D(f, {
|
|
949
|
+
name: W(s)(e.name) === "hidden" ? "visibility_off" : "visibility",
|
|
950
950
|
size: 18
|
|
951
|
-
}, null, 8, ["name"])], 10,
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
951
|
+
}, null, 8, ["name"])], 10, Ve),
|
|
952
|
+
w("span", He, U(e.title), 1),
|
|
953
|
+
w("span", Ue, U(O(e.all)) + "/" + U(e.all.length), 1),
|
|
954
|
+
D(f, {
|
|
955
955
|
name: "expand_more",
|
|
956
956
|
size: 18,
|
|
957
|
-
class:
|
|
957
|
+
class: N(["text-on-surface-variant transition-transform duration-300", g(e.name) ? "rotate-180" : ""])
|
|
958
958
|
}, null, 8, ["class"])
|
|
959
|
-
], 8,
|
|
959
|
+
], 8, Be), w("div", {
|
|
960
960
|
class: "grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
961
|
-
style:
|
|
962
|
-
}, [
|
|
961
|
+
style: P({ gridTemplateRows: g(e.name) ? "1fr" : "0fr" })
|
|
962
|
+
}, [w("div", { class: N(["flex min-h-0 flex-col gap-1.5 overflow-hidden", g(e.name) ? "pt-1.5" : ""]) }, [(L(!0), C(v, null, B(e.layers, (e) => (L(), x(Re, {
|
|
963
963
|
key: e.id,
|
|
964
964
|
layer: e,
|
|
965
|
-
expanded:
|
|
966
|
-
onToggleExpanded: (t) =>
|
|
967
|
-
},
|
|
965
|
+
expanded: y.value.has(e.id),
|
|
966
|
+
onToggleExpanded: (t) => E(e.id)
|
|
967
|
+
}, T({ _: 2 }, [t.$slots.actions ? {
|
|
968
968
|
name: "actions",
|
|
969
|
-
fn: q((e) => [V(t.$slots, "actions",
|
|
969
|
+
fn: q((e) => [V(t.$slots, "actions", M({ ref_for: !0 }, e))]),
|
|
970
970
|
key: "0"
|
|
971
971
|
} : void 0]), 1032, [
|
|
972
972
|
"layer",
|
|
973
973
|
"expanded",
|
|
974
974
|
"onToggleExpanded"
|
|
975
975
|
]))), 128))], 2)], 4)]))), 128)),
|
|
976
|
-
m.value.length ? (L(),
|
|
976
|
+
m.value.length ? (L(), C("div", We, [(L(!0), C(v, null, B(m.value, (e) => (L(), x(Re, {
|
|
977
977
|
key: e.id,
|
|
978
978
|
layer: e,
|
|
979
|
-
expanded:
|
|
980
|
-
onToggleExpanded: (t) =>
|
|
981
|
-
},
|
|
979
|
+
expanded: y.value.has(e.id),
|
|
980
|
+
onToggleExpanded: (t) => E(e.id)
|
|
981
|
+
}, T({ _: 2 }, [t.$slots.actions ? {
|
|
982
982
|
name: "actions",
|
|
983
|
-
fn: q((e) => [V(t.$slots, "actions",
|
|
983
|
+
fn: q((e) => [V(t.$slots, "actions", M({ ref_for: !0 }, e))]),
|
|
984
984
|
key: "0"
|
|
985
985
|
} : void 0]), 1032, [
|
|
986
986
|
"layer",
|
|
987
987
|
"expanded",
|
|
988
988
|
"onToggleExpanded"
|
|
989
|
-
]))), 128))])) :
|
|
990
|
-
!p.value.length && !m.value.length ? (L(),
|
|
989
|
+
]))), 128))])) : S("", !0),
|
|
990
|
+
!p.value.length && !m.value.length ? (L(), C("div", Ge, [w("div", Ke, [D(f, {
|
|
991
991
|
name: "layers_clear",
|
|
992
992
|
size: 28,
|
|
993
993
|
class: "text-on-surface-variant"
|
|
994
|
-
})]),
|
|
994
|
+
})]), w("p", qe, U(W(r).mapNoLayers), 1)])) : S("", !0)
|
|
995
995
|
]));
|
|
996
996
|
}
|
|
997
|
-
}),
|
|
997
|
+
}), Ye = [
|
|
998
998
|
"title",
|
|
999
999
|
"aria-label",
|
|
1000
1000
|
"aria-checked",
|
|
1001
1001
|
"onClick"
|
|
1002
|
-
],
|
|
1002
|
+
], Xe = ["src"], Ze = [
|
|
1003
1003
|
"title",
|
|
1004
1004
|
"aria-label",
|
|
1005
1005
|
"aria-checked"
|
|
1006
|
-
],
|
|
1006
|
+
], Qe = /* @__PURE__ */ O({
|
|
1007
1007
|
__name: "MMapBaseLayers",
|
|
1008
1008
|
props: {
|
|
1009
1009
|
imageBase: { default: "" },
|
|
@@ -1018,95 +1018,95 @@ var he = 600, ge = /* @__PURE__ */ D({
|
|
|
1018
1018
|
map: {}
|
|
1019
1019
|
},
|
|
1020
1020
|
setup(e) {
|
|
1021
|
-
let
|
|
1022
|
-
return (t, n) => (L(),
|
|
1023
|
-
class:
|
|
1021
|
+
let t = e, r = n(), { baseLayers: i, baseLayer: a, setBaseLayer: o } = Z(() => t.map), s = (e, t) => /^(https?:|data:|\/\/)/.test(e) ? e : `${t}${e}`;
|
|
1022
|
+
return (t, n) => (L(), C("div", {
|
|
1023
|
+
class: N(["flex gap-2", e.vertical ? "flex-col" : "flex-row flex-wrap"]),
|
|
1024
1024
|
role: "radiogroup"
|
|
1025
|
-
}, [(L(!0),
|
|
1025
|
+
}, [(L(!0), C(v, null, B(W(i), (t) => (L(), C("button", {
|
|
1026
1026
|
key: t.id,
|
|
1027
1027
|
type: "button",
|
|
1028
1028
|
role: "radio",
|
|
1029
|
-
class:
|
|
1029
|
+
class: N(["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", W(a) === t.id ? "m3-map-base--active border-primary" : "border-transparent"]),
|
|
1030
1030
|
title: t.title,
|
|
1031
1031
|
"aria-label": t.title,
|
|
1032
|
-
"aria-checked":
|
|
1033
|
-
onClick: (e) =>
|
|
1034
|
-
}, [t.base?.image ? (L(),
|
|
1032
|
+
"aria-checked": W(a) === t.id,
|
|
1033
|
+
onClick: (e) => W(o)(t.id)
|
|
1034
|
+
}, [t.base?.image ? (L(), C("img", {
|
|
1035
1035
|
key: 0,
|
|
1036
1036
|
src: s(t.base.image, e.imageBase),
|
|
1037
1037
|
alt: "",
|
|
1038
1038
|
class: "size-full object-cover"
|
|
1039
|
-
}, null, 8,
|
|
1039
|
+
}, null, 8, Xe)) : (L(), x(f, {
|
|
1040
1040
|
key: 1,
|
|
1041
1041
|
name: "map",
|
|
1042
1042
|
size: 22,
|
|
1043
1043
|
class: "text-on-surface-variant"
|
|
1044
|
-
}))], 10,
|
|
1044
|
+
}))], 10, Ye))), 128)), e.none ? (L(), C("button", {
|
|
1045
1045
|
key: 0,
|
|
1046
1046
|
type: "button",
|
|
1047
1047
|
role: "radio",
|
|
1048
|
-
class:
|
|
1049
|
-
title:
|
|
1050
|
-
"aria-label":
|
|
1051
|
-
"aria-checked":
|
|
1052
|
-
onClick: n[0] ||= (e) =>
|
|
1053
|
-
}, [
|
|
1048
|
+
class: N(["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", W(a) === null ? "m3-map-base--active border-primary" : "border-transparent"]),
|
|
1049
|
+
title: W(r).mapNoBaseLayer,
|
|
1050
|
+
"aria-label": W(r).mapNoBaseLayer,
|
|
1051
|
+
"aria-checked": W(a) === null,
|
|
1052
|
+
onClick: n[0] ||= (e) => W(o)(null)
|
|
1053
|
+
}, [D(f, {
|
|
1054
1054
|
name: "layers_clear",
|
|
1055
1055
|
size: 22,
|
|
1056
1056
|
class: "text-on-surface-variant"
|
|
1057
|
-
})], 10,
|
|
1057
|
+
})], 10, Ze)) : S("", !0)], 2));
|
|
1058
1058
|
}
|
|
1059
|
-
}),
|
|
1059
|
+
}), $e = { class: "flex flex-col gap-2" }, et = { class: "flex items-center gap-2 bg-primary-container/40 px-4 py-2" }, tt = { class: "text-label-large text-on-primary-container" }, nt = { class: "flex flex-col px-4 py-1" }, rt = { class: "text-label-small text-on-surface-variant" }, it = { class: "text-body-medium text-on-surface" }, at = {
|
|
1060
1060
|
key: 0,
|
|
1061
1061
|
class: "break-words"
|
|
1062
|
-
},
|
|
1062
|
+
}, ot = {
|
|
1063
1063
|
key: 1,
|
|
1064
1064
|
class: "text-body-small italic text-on-surface-variant"
|
|
1065
|
-
},
|
|
1065
|
+
}, st = /* @__PURE__ */ O({
|
|
1066
1066
|
__name: "MMapFeatureInfo",
|
|
1067
1067
|
props: { results: {} },
|
|
1068
1068
|
setup(e) {
|
|
1069
|
-
let
|
|
1070
|
-
return (
|
|
1069
|
+
let t = n();
|
|
1070
|
+
return (n, r) => (L(), C("div", $e, [(L(!0), C(v, null, B(e.results, (e, r) => (L(), C("div", {
|
|
1071
1071
|
key: r,
|
|
1072
1072
|
class: "overflow-hidden rounded-2xl bg-surface-container"
|
|
1073
|
-
}, [
|
|
1073
|
+
}, [w("div", et, [D(f, {
|
|
1074
1074
|
name: "layers",
|
|
1075
1075
|
size: 16,
|
|
1076
1076
|
class: "text-on-primary-container"
|
|
1077
|
-
}),
|
|
1077
|
+
}), w("span", tt, U(e.layer.title), 1)]), w("dl", nt, [(L(!0), C(v, null, B(e.fields, (r) => (L(), C("div", {
|
|
1078
1078
|
key: r.key,
|
|
1079
1079
|
class: "flex flex-col gap-0.5 border-b border-outline-variant py-1.5 last:border-b-0"
|
|
1080
|
-
}, [
|
|
1080
|
+
}, [w("dt", rt, U(r.label), 1), w("dd", it, [V(n.$slots, "value", {
|
|
1081
1081
|
field: r,
|
|
1082
1082
|
result: e
|
|
1083
|
-
}, () => [r.value ? (L(),
|
|
1083
|
+
}, () => [r.value ? (L(), C("span", at, U(r.value), 1)) : (L(), C("span", ot, U(W(t).mapNoValue), 1))])])]))), 128))])]))), 128))]));
|
|
1084
1084
|
}
|
|
1085
|
-
}),
|
|
1085
|
+
}), ct = (e) => e.metadata, lt = /* @__PURE__ */ new Set([
|
|
1086
1086
|
"fill",
|
|
1087
1087
|
"line",
|
|
1088
1088
|
"circle",
|
|
1089
1089
|
"symbol",
|
|
1090
1090
|
"fill-extrusion",
|
|
1091
1091
|
"heatmap"
|
|
1092
|
-
]),
|
|
1092
|
+
]), ut = (e) => ({
|
|
1093
1093
|
title: e.name,
|
|
1094
1094
|
groups: [],
|
|
1095
1095
|
layers: e.layers.filter((e) => e.type !== "background").map((e) => ({
|
|
1096
1096
|
id: e.id,
|
|
1097
|
-
title:
|
|
1097
|
+
title: ct(e)?.title ?? e.id,
|
|
1098
1098
|
listed: !0,
|
|
1099
1099
|
children: [],
|
|
1100
|
-
identify:
|
|
1100
|
+
identify: lt.has(e.type) ? {
|
|
1101
1101
|
format: {},
|
|
1102
1102
|
exclude: []
|
|
1103
1103
|
} : !1,
|
|
1104
1104
|
hover: !1
|
|
1105
1105
|
}))
|
|
1106
1106
|
});
|
|
1107
|
-
function
|
|
1107
|
+
function dt(e = {}) {
|
|
1108
1108
|
let t = e.legend ?? ((e, t) => {
|
|
1109
|
-
let n =
|
|
1109
|
+
let n = ct(e)?.legend;
|
|
1110
1110
|
if (n?.show === !1) return;
|
|
1111
1111
|
if (n?.wmslegend) return n.wmslegend;
|
|
1112
1112
|
if (!t?.includes("/services/styles/")) return;
|
|
@@ -1122,7 +1122,7 @@ function ut(e = {}) {
|
|
|
1122
1122
|
title: e.alias ?? e.name
|
|
1123
1123
|
})),
|
|
1124
1124
|
layers: e.layers.filter((e) => e.type !== "background").map((e) => {
|
|
1125
|
-
let r =
|
|
1125
|
+
let r = ct(e) ?? {}, i = { ...r.fields }, a = i.exclude ?? [];
|
|
1126
1126
|
delete i.exclude;
|
|
1127
1127
|
let o = {};
|
|
1128
1128
|
for (let [e, t] of Object.entries(i)) o[e] = {
|
|
@@ -1159,10 +1159,10 @@ function ut(e = {}) {
|
|
|
1159
1159
|
};
|
|
1160
1160
|
};
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function ft(e, t) {
|
|
1163
1163
|
return t?.label ?? e.charAt(0).toUpperCase() + e.slice(1);
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1165
|
+
function pt(e, t) {
|
|
1166
1166
|
if (e == null || String(e).trim() === "") return "";
|
|
1167
1167
|
let n = String(e), r = typeof e == "number" ? e : Number(e);
|
|
1168
1168
|
if (t?.mask && !Number.isNaN(r)) {
|
|
@@ -1175,23 +1175,23 @@ function ft(e, t) {
|
|
|
1175
1175
|
}
|
|
1176
1176
|
return t?.prefix && (n = `${t.prefix} ${n}`), t?.suffix && (n = `${n} ${t.suffix}`), n;
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1178
|
+
var mt = /* @__PURE__ */ new Set([
|
|
1179
1179
|
"coordinates",
|
|
1180
1180
|
"mapCoordinates",
|
|
1181
1181
|
"layerId",
|
|
1182
1182
|
"__layerMetadata"
|
|
1183
1183
|
]);
|
|
1184
|
-
function
|
|
1184
|
+
function ht(e, t, n) {
|
|
1185
1185
|
let r = new Map((n?.layers ?? []).filter((t) => t.identify && e.getLayer(t.id)).map((e) => [e.id, e]));
|
|
1186
1186
|
if (!r.size) return [];
|
|
1187
1187
|
let i = [];
|
|
1188
1188
|
for (let n of e.queryRenderedFeatures(t, { layers: [...r.keys()] })) {
|
|
1189
1189
|
let e = r.get(n.layer.id);
|
|
1190
1190
|
if (!e || !e.identify) continue;
|
|
1191
|
-
let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !
|
|
1191
|
+
let { format: t, exclude: a } = e.identify, o = Object.entries(n.properties ?? {}).filter(([e]) => !mt.has(e) && !a.includes(e) && !t[e]?.hidden).map(([e, n]) => ({
|
|
1192
1192
|
key: e,
|
|
1193
|
-
label:
|
|
1194
|
-
value:
|
|
1193
|
+
label: ft(e, t[e]),
|
|
1194
|
+
value: pt(n, t[e])
|
|
1195
1195
|
}));
|
|
1196
1196
|
o.length && i.push({
|
|
1197
1197
|
layer: e,
|
|
@@ -1203,7 +1203,7 @@ function mt(e, t, n) {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
//#endregion
|
|
1205
1205
|
//#region src/components/MMapIdentify.vue?vue&type=script&setup=true&lang.ts
|
|
1206
|
-
var
|
|
1206
|
+
var gt = { class: "hidden" }, _t = /* @__PURE__ */ O({
|
|
1207
1207
|
inheritAttrs: !1,
|
|
1208
1208
|
__name: "MMapIdentify",
|
|
1209
1209
|
props: {
|
|
@@ -1222,11 +1222,11 @@ var ht = { class: "hidden" }, gt = /* @__PURE__ */ D({
|
|
|
1222
1222
|
},
|
|
1223
1223
|
emits: ["identify"],
|
|
1224
1224
|
setup(e, { expose: t, emit: n }) {
|
|
1225
|
-
let r = e, i = n, { on: a, onReady: o, activeTool: s } = Y(), { model: c } =
|
|
1225
|
+
let r = e, i = n, { on: a, onReady: o, activeTool: s } = Y(), { model: c } = Z(), l = H([]), u = z([0, 0]), d = z(!1);
|
|
1226
1226
|
a("click", (e) => {
|
|
1227
1227
|
if (!r.enabled || s.value) return;
|
|
1228
1228
|
let t = e.target;
|
|
1229
|
-
l.value =
|
|
1229
|
+
l.value = ht(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);
|
|
1230
1230
|
});
|
|
1231
1231
|
function f() {
|
|
1232
1232
|
d.value = !1;
|
|
@@ -1248,38 +1248,38 @@ var ht = { class: "hidden" }, gt = /* @__PURE__ */ D({
|
|
|
1248
1248
|
}
|
|
1249
1249
|
return o((e) => {
|
|
1250
1250
|
p = e, _();
|
|
1251
|
-
}), K(c, _),
|
|
1251
|
+
}), K(c, _), F(() => {
|
|
1252
1252
|
m.forEach((e) => {
|
|
1253
1253
|
p?.off("mouseenter", e, h), p?.off("mouseleave", e, g);
|
|
1254
1254
|
});
|
|
1255
|
-
}), t({ close: f }), (t, n) => (L(),
|
|
1255
|
+
}), t({ close: f }), (t, n) => (L(), C("div", gt, [e.marker && d.value ? (L(), x(Se, {
|
|
1256
1256
|
key: 0,
|
|
1257
1257
|
"lng-lat": u.value
|
|
1258
|
-
}, null, 8, ["lng-lat"])) :
|
|
1258
|
+
}, null, 8, ["lng-lat"])) : S("", !0), e.popup && l.value.length ? (L(), x(we, {
|
|
1259
1259
|
key: 1,
|
|
1260
1260
|
open: d.value,
|
|
1261
1261
|
"onUpdate:open": n[0] ||= (e) => d.value = e,
|
|
1262
1262
|
"lng-lat": u.value,
|
|
1263
1263
|
"max-width": "360px",
|
|
1264
|
-
offset: e.marker ?
|
|
1264
|
+
offset: e.marker ? W(xe) : void 0
|
|
1265
1265
|
}, {
|
|
1266
|
-
default: q(() => [
|
|
1266
|
+
default: q(() => [w("div", M({ class: "max-h-80 overflow-y-auto" }, t.$attrs), [V(t.$slots, "default", {
|
|
1267
1267
|
results: l.value,
|
|
1268
1268
|
lngLat: u.value,
|
|
1269
1269
|
close: f
|
|
1270
|
-
}, () => [
|
|
1270
|
+
}, () => [D(st, { results: l.value }, null, 8, ["results"])])], 16)]),
|
|
1271
1271
|
_: 3
|
|
1272
1272
|
}, 8, [
|
|
1273
1273
|
"open",
|
|
1274
1274
|
"lng-lat",
|
|
1275
1275
|
"offset"
|
|
1276
|
-
])) :
|
|
1276
|
+
])) : S("", !0)]));
|
|
1277
1277
|
}
|
|
1278
|
-
}),
|
|
1278
|
+
}), vt = { class: "hidden" }, yt = [
|
|
1279
1279
|
"title",
|
|
1280
1280
|
"aria-label",
|
|
1281
1281
|
"aria-pressed"
|
|
1282
|
-
],
|
|
1282
|
+
], bt = { class: "-mx-4 -mt-3 mb-1 bg-primary-container px-3 py-1.5 text-label-medium text-on-primary-container" }, xt = { class: "flex flex-col" }, St = { class: "text-label-small text-on-surface-variant" }, Ct = { class: "text-body-small text-on-surface" }, wt = /* @__PURE__ */ O({
|
|
1283
1283
|
__name: "MMapHover",
|
|
1284
1284
|
props: {
|
|
1285
1285
|
modelValue: {
|
|
@@ -1292,8 +1292,8 @@ var ht = { class: "hidden" }, gt = /* @__PURE__ */ D({
|
|
|
1292
1292
|
}
|
|
1293
1293
|
},
|
|
1294
1294
|
emits: ["update:modelValue"],
|
|
1295
|
-
setup(e, { emit:
|
|
1296
|
-
let r = e, i =
|
|
1295
|
+
setup(e, { emit: t }) {
|
|
1296
|
+
let r = e, i = t, a = n(), { onReady: o } = Y(), { model: s } = Z(), c = b(() => (s.value?.layers ?? []).filter((e) => e.hover && e.hover.fields.length)), l = H(null), u = z([0, 0]), d = z(!1), p, m = [];
|
|
1297
1297
|
function h(e) {
|
|
1298
1298
|
let t = e.features?.[0], n = c.value.find((e) => e.id === t?.layer.id);
|
|
1299
1299
|
if (!t || !n || !n.hover) return;
|
|
@@ -1302,48 +1302,48 @@ var ht = { class: "hidden" }, gt = /* @__PURE__ */ D({
|
|
|
1302
1302
|
layer: n,
|
|
1303
1303
|
fields: n.hover.fields.map((e) => ({
|
|
1304
1304
|
key: e.key,
|
|
1305
|
-
label:
|
|
1306
|
-
value:
|
|
1305
|
+
label: ft(e.key, e),
|
|
1306
|
+
value: pt(r[e.key], e)
|
|
1307
1307
|
})).filter((e) => e.value)
|
|
1308
|
-
}, u.value = [e.lngLat.lng, e.lngLat.lat],
|
|
1308
|
+
}, u.value = [e.lngLat.lng, e.lngLat.lat], d.value = !0;
|
|
1309
1309
|
}
|
|
1310
1310
|
function g() {
|
|
1311
|
-
|
|
1311
|
+
d.value = !1;
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1313
|
+
function _() {
|
|
1314
1314
|
if (p) {
|
|
1315
1315
|
for (let e of m) p.off("mousemove", e, h), p.off("mouseleave", e, g);
|
|
1316
1316
|
m = r.modelValue ? c.value.map((e) => e.id) : [];
|
|
1317
1317
|
for (let e of m) p.on("mousemove", e, h), p.on("mouseleave", e, g);
|
|
1318
|
-
r.modelValue || (
|
|
1318
|
+
r.modelValue || (d.value = !1);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
o((e) => {
|
|
1322
|
-
p = e,
|
|
1323
|
-
}), K([() => r.modelValue, c],
|
|
1322
|
+
p = e, _();
|
|
1323
|
+
}), K([() => r.modelValue, c], _), F(() => {
|
|
1324
1324
|
for (let e of m) p?.off("mousemove", e, h), p?.off("mouseleave", e, g);
|
|
1325
1325
|
});
|
|
1326
|
-
let
|
|
1327
|
-
return (t, n) => (L(),
|
|
1326
|
+
let y = b(() => r.control === !0 ? "top-right" : r.control || "top-right");
|
|
1327
|
+
return (t, n) => (L(), C("div", vt, [e.control && c.value.length ? (L(), x(se, {
|
|
1328
1328
|
key: 0,
|
|
1329
|
-
position:
|
|
1329
|
+
position: y.value
|
|
1330
1330
|
}, {
|
|
1331
|
-
default: q(() => [
|
|
1331
|
+
default: q(() => [w("button", {
|
|
1332
1332
|
type: "button",
|
|
1333
1333
|
class: "grid place-items-center",
|
|
1334
|
-
title:
|
|
1335
|
-
"aria-label":
|
|
1334
|
+
title: W(a).mapHoverInfo,
|
|
1335
|
+
"aria-label": W(a).mapHoverInfo,
|
|
1336
1336
|
"aria-pressed": e.modelValue,
|
|
1337
1337
|
onClick: n[0] ||= (t) => i("update:modelValue", !e.modelValue)
|
|
1338
|
-
}, [
|
|
1338
|
+
}, [D(f, {
|
|
1339
1339
|
name: "ads_click",
|
|
1340
1340
|
size: 20
|
|
1341
|
-
})], 8,
|
|
1341
|
+
})], 8, yt)]),
|
|
1342
1342
|
_: 1
|
|
1343
|
-
}, 8, ["position"])) :
|
|
1343
|
+
}, 8, ["position"])) : S("", !0), l.value ? (L(), x(we, {
|
|
1344
1344
|
key: 1,
|
|
1345
|
-
open:
|
|
1346
|
-
"onUpdate:open": n[1] ||= (e) =>
|
|
1345
|
+
open: d.value,
|
|
1346
|
+
"onUpdate:open": n[1] ||= (e) => d.value = e,
|
|
1347
1347
|
"lng-lat": u.value,
|
|
1348
1348
|
"close-button": !1,
|
|
1349
1349
|
"close-on-click": !1,
|
|
@@ -1351,24 +1351,24 @@ var ht = { class: "hidden" }, gt = /* @__PURE__ */ D({
|
|
|
1351
1351
|
"max-width": "280px",
|
|
1352
1352
|
class: "m3-map-hover"
|
|
1353
1353
|
}, {
|
|
1354
|
-
default: q(() => [
|
|
1354
|
+
default: q(() => [w("p", bt, U(l.value.layer.title), 1), w("dl", xt, [(L(!0), C(v, null, B(l.value.fields, (e) => (L(), C("div", {
|
|
1355
1355
|
key: e.key,
|
|
1356
1356
|
class: "border-b border-outline-variant py-1 last:border-b-0"
|
|
1357
|
-
}, [
|
|
1357
|
+
}, [w("dt", St, U(e.label), 1), w("dd", Ct, U(e.value), 1)]))), 128))])]),
|
|
1358
1358
|
_: 1
|
|
1359
|
-
}, 8, ["open", "lng-lat"])) :
|
|
1359
|
+
}, 8, ["open", "lng-lat"])) : S("", !0)]));
|
|
1360
1360
|
}
|
|
1361
|
-
}),
|
|
1362
|
-
function
|
|
1361
|
+
}), Tt = 6371008.8, $ = Math.PI / 180;
|
|
1362
|
+
function Et(e, t) {
|
|
1363
1363
|
let n = (t[1] - e[1]) * $, r = (t[0] - e[0]) * $, i = Math.sin(n / 2) ** 2 + Math.cos(e[1] * $) * Math.cos(t[1] * $) * Math.sin(r / 2) ** 2;
|
|
1364
|
-
return 2 *
|
|
1364
|
+
return 2 * Tt * Math.asin(Math.min(1, Math.sqrt(i)));
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function Dt(e) {
|
|
1367
1367
|
let t = 0;
|
|
1368
|
-
for (let n = 1; n < e.length; n++) t +=
|
|
1368
|
+
for (let n = 1; n < e.length; n++) t += Et(e[n - 1], e[n]);
|
|
1369
1369
|
return t;
|
|
1370
1370
|
}
|
|
1371
|
-
function
|
|
1371
|
+
function Ot(e, t) {
|
|
1372
1372
|
let [n, r, i, a] = [
|
|
1373
1373
|
e[0] * $,
|
|
1374
1374
|
e[1] * $,
|
|
@@ -1377,22 +1377,22 @@ function Dt(e, t) {
|
|
|
1377
1377
|
], 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));
|
|
1378
1378
|
return [(n + Math.atan2(s, Math.cos(r) + o)) / $, c / $];
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1381
|
-
let t =
|
|
1380
|
+
function kt(e) {
|
|
1381
|
+
let t = At(e), n = t.length - 1;
|
|
1382
1382
|
if (n <= 2) return 0;
|
|
1383
1383
|
let r = 0;
|
|
1384
1384
|
for (let e = 0; e < n; e++) {
|
|
1385
1385
|
let i = t[e], a = t[e + 1 === n ? 0 : e + 1], o = t[e + 2 >= n ? (e + 2) % n : e + 2];
|
|
1386
1386
|
r += (o[0] - i[0]) * $ * Math.sin(a[1] * $);
|
|
1387
1387
|
}
|
|
1388
|
-
return Math.abs(r *
|
|
1388
|
+
return Math.abs(r * Tt * Tt / 2);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function At(e) {
|
|
1391
1391
|
let t = e[0], n = e[e.length - 1];
|
|
1392
1392
|
return t && n && (t[0] !== n[0] || t[1] !== n[1]) ? [...e, t] : e;
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1395
|
-
let t =
|
|
1394
|
+
function jt(e) {
|
|
1395
|
+
let t = At(e), n = 0, r = 0, i = 0;
|
|
1396
1396
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1397
1397
|
let [a, o] = t[e], [s, c] = t[e + 1], l = a * c - s * o;
|
|
1398
1398
|
n += l, r += (a + s) * l, i += (o + c) * l;
|
|
@@ -1405,11 +1405,11 @@ function At(e) {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
//#endregion
|
|
1407
1407
|
//#region src/components/MMapMeasure.vue?vue&type=script&setup=true&lang.ts
|
|
1408
|
-
var
|
|
1408
|
+
var Mt = { class: "hidden" }, Nt = ["title", "aria-pressed"], Pt = ["title", "aria-pressed"], Ft = ["title", "disabled"], It = [
|
|
1409
1409
|
"aria-label",
|
|
1410
1410
|
"title",
|
|
1411
1411
|
"onClick"
|
|
1412
|
-
],
|
|
1412
|
+
], Lt = /* @__PURE__ */ O({
|
|
1413
1413
|
__name: "MMapMeasure",
|
|
1414
1414
|
props: {
|
|
1415
1415
|
modelValue: { default: null },
|
|
@@ -1419,15 +1419,15 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1419
1419
|
}
|
|
1420
1420
|
},
|
|
1421
1421
|
emits: ["update:modelValue", "change"],
|
|
1422
|
-
setup(
|
|
1423
|
-
let
|
|
1422
|
+
setup(e, { expose: r, emit: i }) {
|
|
1423
|
+
let a = e, s = i, c = n(), { onReady: l, styleVersion: u, activeTool: d } = Y(), p = t(["primary", "surface"]), m = `m3-measure-${re()}`, h = {
|
|
1424
1424
|
done: `${m}-done`,
|
|
1425
1425
|
draft: `${m}-draft`,
|
|
1426
1426
|
handles: `${m}-handles`
|
|
1427
|
-
}, g = `${h.handles}-vertex`,
|
|
1427
|
+
}, g = `${h.handles}-vertex`, _ = `${h.handles}-midpoint`, y = [], T = [], O = null, k = !1, A = null, j = 0, M, P = z(null), ee = z(0), I = H([]), te = () => typeof document < "u" && document.documentElement.lang || void 0, R = (e, t) => new Intl.NumberFormat(te(), {
|
|
1428
1428
|
minimumFractionDigits: t,
|
|
1429
1429
|
maximumFractionDigits: t
|
|
1430
|
-
}).format(e),
|
|
1430
|
+
}).format(e), V = (e) => e === 0 ? "" : e < 1e3 ? `${R(Math.round(e), 0)} m` : `${R(e / 1e3, 2)} km`, ne = (e) => e >= 1e6 ? `${R(e / 1e6, 2)} km²` : e >= 1e4 ? `${R(e / 1e4, 2)} ha` : `${R(Math.round(e), 0)} m²`, G = (e, t = {}) => ({
|
|
1431
1431
|
type: "Feature",
|
|
1432
1432
|
geometry: {
|
|
1433
1433
|
type: "Point",
|
|
@@ -1436,7 +1436,7 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1436
1436
|
properties: t
|
|
1437
1437
|
});
|
|
1438
1438
|
function ie(e, t, n, r) {
|
|
1439
|
-
let i = e.map((e) =>
|
|
1439
|
+
let i = e.map((e) => G(e)), a = [];
|
|
1440
1440
|
if (e.length < 2) return {
|
|
1441
1441
|
features: i,
|
|
1442
1442
|
labels: a
|
|
@@ -1451,10 +1451,10 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1451
1451
|
});
|
|
1452
1452
|
let o = (e) => {
|
|
1453
1453
|
for (let t = 0; t < e.length - 1; t++) {
|
|
1454
|
-
let r =
|
|
1454
|
+
let r = V(Et(e[t], e[t + 1]));
|
|
1455
1455
|
r && a.push({
|
|
1456
1456
|
key: `${n}-s${t}`,
|
|
1457
|
-
at:
|
|
1457
|
+
at: Ot(e[t], e[t + 1]),
|
|
1458
1458
|
text: r,
|
|
1459
1459
|
kind: "segment"
|
|
1460
1460
|
});
|
|
@@ -1463,12 +1463,12 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1463
1463
|
if (t === "distance") o(e), a.push({
|
|
1464
1464
|
key: `${n}-t`,
|
|
1465
1465
|
at: e[e.length - 1],
|
|
1466
|
-
text: `${c.mapTotal}: ${
|
|
1466
|
+
text: `${c.mapTotal}: ${V(Dt(e))}`,
|
|
1467
1467
|
kind: "total",
|
|
1468
1468
|
m: r
|
|
1469
1469
|
});
|
|
1470
1470
|
else if (e.length >= 3) {
|
|
1471
|
-
let t =
|
|
1471
|
+
let t = At(e);
|
|
1472
1472
|
i.push({
|
|
1473
1473
|
type: "Feature",
|
|
1474
1474
|
geometry: {
|
|
@@ -1478,15 +1478,15 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1478
1478
|
properties: {}
|
|
1479
1479
|
}), o(t), a.push({
|
|
1480
1480
|
key: `${n}-a`,
|
|
1481
|
-
at:
|
|
1482
|
-
text: ne(
|
|
1481
|
+
at: jt(t),
|
|
1482
|
+
text: ne(kt(t)),
|
|
1483
1483
|
kind: "area",
|
|
1484
1484
|
m: r
|
|
1485
1485
|
});
|
|
1486
1486
|
} else a.push({
|
|
1487
1487
|
key: `${n}-t`,
|
|
1488
1488
|
at: e[e.length - 1],
|
|
1489
|
-
text:
|
|
1489
|
+
text: V(Dt(e)),
|
|
1490
1490
|
kind: "total",
|
|
1491
1491
|
m: r
|
|
1492
1492
|
});
|
|
@@ -1498,43 +1498,43 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1498
1498
|
let ae = (e) => ({
|
|
1499
1499
|
type: "FeatureCollection",
|
|
1500
1500
|
features: e
|
|
1501
|
-
}),
|
|
1502
|
-
function
|
|
1503
|
-
if (!
|
|
1504
|
-
let e =
|
|
1501
|
+
}), oe = (e, t) => (M?.getSource(e))?.setData(ae(t));
|
|
1502
|
+
function X() {
|
|
1503
|
+
if (!M) return;
|
|
1504
|
+
let e = y.map((e, t) => ie(e.points, e.mode, `m${t}`, t)), t = P.value && T.length ? ie(O ? [...T, O] : T, P.value, "draft") : {
|
|
1505
1505
|
features: [],
|
|
1506
1506
|
labels: []
|
|
1507
1507
|
};
|
|
1508
|
-
|
|
1508
|
+
oe(h.done, e.flatMap((e) => e.features)), oe(h.draft, t.features);
|
|
1509
1509
|
let n = [];
|
|
1510
|
-
|
|
1511
|
-
(e.closed ? e.points.slice(0, -1) : e.points).forEach((e, r) => n.push(
|
|
1510
|
+
P.value || y.forEach((e, t) => {
|
|
1511
|
+
(e.closed ? e.points.slice(0, -1) : e.points).forEach((e, r) => n.push(G(e, {
|
|
1512
1512
|
handle: "vertex",
|
|
1513
1513
|
m: t,
|
|
1514
1514
|
v: r
|
|
1515
1515
|
})));
|
|
1516
|
-
for (let r = 0; r < e.points.length - 1; r++) n.push(
|
|
1516
|
+
for (let r = 0; r < e.points.length - 1; r++) n.push(G(Ot(e.points[r], e.points[r + 1]), {
|
|
1517
1517
|
handle: "midpoint",
|
|
1518
1518
|
m: t,
|
|
1519
1519
|
after: r
|
|
1520
1520
|
}));
|
|
1521
|
-
}),
|
|
1521
|
+
}), oe(h.handles, n), I.value = [...e.flatMap((e) => e.labels), ...t.labels];
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1524
|
-
|
|
1523
|
+
function ce() {
|
|
1524
|
+
ee.value = y.length, s("change", y.map((e) => ({
|
|
1525
1525
|
mode: e.mode,
|
|
1526
1526
|
points: e.points.map((e) => [...e]),
|
|
1527
1527
|
closed: e.closed,
|
|
1528
|
-
length:
|
|
1529
|
-
...e.mode === "area" || e.closed ? { area:
|
|
1528
|
+
length: Dt(e.points),
|
|
1529
|
+
...e.mode === "area" || e.closed ? { area: kt(e.points) } : {}
|
|
1530
1530
|
})));
|
|
1531
1531
|
}
|
|
1532
|
-
let
|
|
1532
|
+
let le = (e) => [
|
|
1533
1533
|
"==",
|
|
1534
1534
|
["geometry-type"],
|
|
1535
1535
|
e
|
|
1536
1536
|
];
|
|
1537
|
-
function
|
|
1537
|
+
function ue() {
|
|
1538
1538
|
let { primary: e, surface: t } = p.value;
|
|
1539
1539
|
return {
|
|
1540
1540
|
fill: { "fill-color": e },
|
|
@@ -1545,20 +1545,20 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1545
1545
|
}
|
|
1546
1546
|
};
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1549
|
-
if (!
|
|
1550
|
-
for (let e of Object.values(h))
|
|
1548
|
+
function de() {
|
|
1549
|
+
if (!M) return;
|
|
1550
|
+
for (let e of Object.values(h)) M.getSource(e) || M.addSource(e, {
|
|
1551
1551
|
type: "geojson",
|
|
1552
1552
|
data: ae([])
|
|
1553
1553
|
});
|
|
1554
|
-
let e =
|
|
1555
|
-
|
|
1554
|
+
let e = ue(), t = (e) => {
|
|
1555
|
+
M.getLayer(e.id) || M.addLayer(e);
|
|
1556
1556
|
};
|
|
1557
1557
|
for (let [n, r] of [[h.done, !1], [h.draft, !0]]) t({
|
|
1558
1558
|
id: `${n}-fill`,
|
|
1559
1559
|
type: "fill",
|
|
1560
1560
|
source: n,
|
|
1561
|
-
filter:
|
|
1561
|
+
filter: le("Polygon"),
|
|
1562
1562
|
paint: {
|
|
1563
1563
|
...e.fill,
|
|
1564
1564
|
"fill-opacity": r ? .15 : .2
|
|
@@ -1581,7 +1581,7 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1581
1581
|
id: `${n}-points`,
|
|
1582
1582
|
type: "circle",
|
|
1583
1583
|
source: n,
|
|
1584
|
-
filter:
|
|
1584
|
+
filter: le("Point"),
|
|
1585
1585
|
paint: {
|
|
1586
1586
|
...e.vertices,
|
|
1587
1587
|
"circle-radius": 5,
|
|
@@ -1589,7 +1589,7 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1589
1589
|
}
|
|
1590
1590
|
});
|
|
1591
1591
|
t({
|
|
1592
|
-
id:
|
|
1592
|
+
id: _,
|
|
1593
1593
|
type: "circle",
|
|
1594
1594
|
source: h.handles,
|
|
1595
1595
|
filter: [
|
|
@@ -1620,46 +1620,46 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1620
1620
|
});
|
|
1621
1621
|
}
|
|
1622
1622
|
K(p, () => {
|
|
1623
|
-
if (!
|
|
1624
|
-
let e =
|
|
1625
|
-
if (
|
|
1623
|
+
if (!M) return;
|
|
1624
|
+
let e = ue(), t = (e, t) => {
|
|
1625
|
+
if (M.getLayer(e)) for (let [n, r] of Object.entries(t)) M.setPaintProperty(e, n, r);
|
|
1626
1626
|
};
|
|
1627
1627
|
for (let n of [h.done, h.draft]) t(`${n}-fill`, e.fill), t(`${n}-line`, e.line), t(`${n}-points`, e.vertices);
|
|
1628
|
-
t(
|
|
1628
|
+
t(_, e.vertices), t(g, e.vertices);
|
|
1629
1629
|
});
|
|
1630
|
-
let
|
|
1631
|
-
function
|
|
1632
|
-
if (
|
|
1633
|
-
let t =
|
|
1630
|
+
let fe = (e) => [e.lngLat.lng, e.lngLat.lat];
|
|
1631
|
+
function pe(e) {
|
|
1632
|
+
if (T.length >= 2) {
|
|
1633
|
+
let t = M.project(T[0]);
|
|
1634
1634
|
if (Math.hypot(t.x - e.point.x, t.y - e.point.y) < 20) {
|
|
1635
1635
|
k = !0, Q();
|
|
1636
1636
|
return;
|
|
1637
1637
|
}
|
|
1638
1638
|
}
|
|
1639
|
-
|
|
1639
|
+
T.push(fe(e)), X();
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
O =
|
|
1643
|
-
j = 0,
|
|
1641
|
+
function Z(e) {
|
|
1642
|
+
O = fe(e), !j && (j = requestAnimationFrame(() => {
|
|
1643
|
+
j = 0, X();
|
|
1644
1644
|
}));
|
|
1645
1645
|
}
|
|
1646
1646
|
function me(e) {
|
|
1647
|
-
if (e.preventDefault(),
|
|
1648
|
-
let t =
|
|
1649
|
-
Math.hypot(t.x - n.x, t.y - n.y) < 10 &&
|
|
1647
|
+
if (e.preventDefault(), T.length < 2) return;
|
|
1648
|
+
let t = M.project(T[T.length - 1]), n = M.project(T[T.length - 2]);
|
|
1649
|
+
Math.hypot(t.x - n.x, t.y - n.y) < 10 && T.pop(), Q();
|
|
1650
1650
|
}
|
|
1651
1651
|
function he(e) {
|
|
1652
1652
|
e.key === "Enter" && Q();
|
|
1653
1653
|
}
|
|
1654
|
-
|
|
1654
|
+
o(() => !!P.value, () => Q(!0));
|
|
1655
1655
|
let ge = () => typeof navigator < "u" ? navigator.keyboard : void 0, _e = !1;
|
|
1656
1656
|
function ve() {
|
|
1657
|
-
|
|
1657
|
+
P.value && document.fullscreenElement && ge()?.lock && ge().lock(["Escape"]).then(() => {
|
|
1658
1658
|
_e = !0;
|
|
1659
1659
|
}, () => {});
|
|
1660
1660
|
}
|
|
1661
1661
|
function ye() {
|
|
1662
|
-
|
|
1662
|
+
P.value || (_e && ge()?.unlock?.(), _e = !1);
|
|
1663
1663
|
}
|
|
1664
1664
|
function be() {
|
|
1665
1665
|
let e, t = () => {
|
|
@@ -1670,147 +1670,147 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1670
1670
|
document.addEventListener("keyup", n, !0), e = setTimeout(t, 1500);
|
|
1671
1671
|
}
|
|
1672
1672
|
function xe(e) {
|
|
1673
|
-
if (
|
|
1674
|
-
if (
|
|
1675
|
-
|
|
1673
|
+
if (M) {
|
|
1674
|
+
if (P.value === e) return Q();
|
|
1675
|
+
P.value && Q(), P.value = e, d.value = "measure", T = [], O = null, M.getCanvas().style.cursor = "crosshair", M.doubleClickZoom.disable(), M.on("click", pe), M.on("mousemove", Z), M.on("dblclick", me), document.addEventListener("keydown", he), document.addEventListener("fullscreenchange", ve), ve(), X(), a.modelValue !== e && s("update:modelValue", e);
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
function Q(e = !1) {
|
|
1679
|
-
if (!
|
|
1679
|
+
if (!M || !P.value) return;
|
|
1680
1680
|
cancelAnimationFrame(j), j = 0;
|
|
1681
|
-
let t =
|
|
1682
|
-
|
|
1683
|
-
mode:
|
|
1684
|
-
points: t ? [...
|
|
1681
|
+
let t = T.length >= 3 && (k || P.value === "area");
|
|
1682
|
+
T.length >= 2 && y.push({
|
|
1683
|
+
mode: P.value,
|
|
1684
|
+
points: t ? [...T, [...T[0]]] : T,
|
|
1685
1685
|
closed: t
|
|
1686
|
-
}),
|
|
1686
|
+
}), T = [], O = null, k = !1, P.value = null, d.value === "measure" && (d.value = null), M.getCanvas().style.cursor = "", M.doubleClickZoom.enable(), M.off("click", pe), M.off("mousemove", Z), M.off("dblclick", me), document.removeEventListener("keydown", he), document.removeEventListener("fullscreenchange", ve), e && _e ? be() : ye(), X(), ce(), a.modelValue !== null && s("update:modelValue", null);
|
|
1687
1687
|
}
|
|
1688
1688
|
function Ce(e) {
|
|
1689
|
-
|
|
1689
|
+
y[e] && (y.splice(e, 1), X(), ce());
|
|
1690
1690
|
}
|
|
1691
1691
|
function we() {
|
|
1692
|
-
|
|
1692
|
+
P.value && Q(), y.length = 0, X(), ce();
|
|
1693
1693
|
}
|
|
1694
1694
|
function Te(e) {
|
|
1695
1695
|
let t = e.features?.[0];
|
|
1696
|
-
if (!t ||
|
|
1696
|
+
if (!t || P.value || !M) return;
|
|
1697
1697
|
e.preventDefault();
|
|
1698
|
-
let n = t.properties.m, r =
|
|
1698
|
+
let n = t.properties.m, r = y[n];
|
|
1699
1699
|
if (!r) return;
|
|
1700
1700
|
let i = t.properties.v;
|
|
1701
|
-
t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0,
|
|
1701
|
+
t.properties.handle === "midpoint" && (i = t.properties.after + 1, r.points.splice(i, 0, fe(e))), A = {
|
|
1702
1702
|
m: n,
|
|
1703
1703
|
v: i
|
|
1704
|
-
},
|
|
1704
|
+
}, d.value = "measure", M.getCanvas().style.cursor = "grabbing";
|
|
1705
1705
|
let a = e.type === "touchstart";
|
|
1706
|
-
a &&
|
|
1706
|
+
a && M.dragPan.disable(), M.on(a ? "touchmove" : "mousemove", Ee), M.once(a ? "touchend" : "mouseup", De), X();
|
|
1707
1707
|
}
|
|
1708
1708
|
function Ee(e) {
|
|
1709
1709
|
if (!A) return;
|
|
1710
|
-
let t =
|
|
1710
|
+
let t = y[A.m];
|
|
1711
1711
|
if (!t) return;
|
|
1712
|
-
let n =
|
|
1713
|
-
t.points[A.v] = n, t.closed && A.v === 0 && (t.points[t.points.length - 1] = n),
|
|
1712
|
+
let n = fe(e);
|
|
1713
|
+
t.points[A.v] = n, t.closed && A.v === 0 && (t.points[t.points.length - 1] = n), X();
|
|
1714
1714
|
}
|
|
1715
1715
|
function De() {
|
|
1716
|
-
|
|
1717
|
-
|
|
1716
|
+
M && (A = null, M.off("mousemove", Ee), M.off("touchmove", Ee), M.dragPan.enable(), M.getCanvas().style.cursor = "", ce(), setTimeout(() => {
|
|
1717
|
+
d.value === "measure" && !P.value && (d.value = null);
|
|
1718
1718
|
}));
|
|
1719
1719
|
}
|
|
1720
1720
|
let Oe = () => {
|
|
1721
|
-
|
|
1721
|
+
M && !A && !P.value && (M.getCanvas().style.cursor = "grab");
|
|
1722
1722
|
}, ke = () => {
|
|
1723
|
-
|
|
1723
|
+
M && !A && !P.value && (M.getCanvas().style.cursor = "");
|
|
1724
1724
|
};
|
|
1725
1725
|
l((e) => {
|
|
1726
|
-
|
|
1727
|
-
for (let t of [g,
|
|
1728
|
-
|
|
1726
|
+
M = e, de();
|
|
1727
|
+
for (let t of [g, _]) e.on("mousedown", t, Te), e.on("touchstart", t, Te), e.on("mouseenter", t, Oe), e.on("mouseleave", t, ke);
|
|
1728
|
+
a.modelValue && xe(a.modelValue);
|
|
1729
1729
|
}), K(u, () => {
|
|
1730
|
-
|
|
1731
|
-
}), K(() =>
|
|
1732
|
-
e && e !==
|
|
1733
|
-
}),
|
|
1734
|
-
if (!
|
|
1735
|
-
|
|
1736
|
-
for (let e of [g,
|
|
1730
|
+
de(), X();
|
|
1731
|
+
}), K(() => a.modelValue, (e) => {
|
|
1732
|
+
e && e !== P.value ? xe(e) : !e && P.value && Q();
|
|
1733
|
+
}), F(() => {
|
|
1734
|
+
if (!M) return;
|
|
1735
|
+
P.value && Q();
|
|
1736
|
+
for (let e of [g, _]) M.off("mousedown", e, Te), M.off("touchstart", e, Te), M.off("mouseenter", e, Oe), M.off("mouseleave", e, ke);
|
|
1737
1737
|
let e = [
|
|
1738
1738
|
g,
|
|
1739
|
-
|
|
1739
|
+
_,
|
|
1740
1740
|
...[h.done, h.draft].flatMap((e) => [
|
|
1741
1741
|
`${e}-points`,
|
|
1742
1742
|
`${e}-line`,
|
|
1743
1743
|
`${e}-fill`
|
|
1744
1744
|
])
|
|
1745
1745
|
];
|
|
1746
|
-
for (let t of e)
|
|
1747
|
-
for (let e of Object.values(h))
|
|
1746
|
+
for (let t of e) M.getLayer(t) && M.removeLayer(t);
|
|
1747
|
+
for (let e of Object.values(h)) M.getSource(e) && M.removeSource(e);
|
|
1748
1748
|
});
|
|
1749
|
-
let Ae =
|
|
1749
|
+
let Ae = b(() => a.control === !0 ? "top-right" : a.control || "top-right");
|
|
1750
1750
|
return r({
|
|
1751
1751
|
start: xe,
|
|
1752
1752
|
finish: Q,
|
|
1753
1753
|
clear: we,
|
|
1754
1754
|
remove: Ce
|
|
1755
|
-
}), (
|
|
1755
|
+
}), (t, n) => (L(), C("div", Mt, [e.control ? (L(), x(se, {
|
|
1756
1756
|
key: 0,
|
|
1757
1757
|
position: Ae.value
|
|
1758
1758
|
}, {
|
|
1759
1759
|
default: q(() => [
|
|
1760
|
-
|
|
1760
|
+
w("button", {
|
|
1761
1761
|
type: "button",
|
|
1762
1762
|
class: "grid place-items-center",
|
|
1763
|
-
title:
|
|
1764
|
-
"aria-pressed":
|
|
1765
|
-
onClick:
|
|
1766
|
-
}, [
|
|
1763
|
+
title: W(c).mapMeasureDistance,
|
|
1764
|
+
"aria-pressed": P.value === "distance",
|
|
1765
|
+
onClick: n[0] ||= (e) => xe("distance")
|
|
1766
|
+
}, [D(f, {
|
|
1767
1767
|
name: "straighten",
|
|
1768
1768
|
size: 20
|
|
1769
|
-
})], 8,
|
|
1770
|
-
|
|
1769
|
+
})], 8, Nt),
|
|
1770
|
+
w("button", {
|
|
1771
1771
|
type: "button",
|
|
1772
1772
|
class: "grid place-items-center",
|
|
1773
|
-
title:
|
|
1774
|
-
"aria-pressed":
|
|
1775
|
-
onClick:
|
|
1776
|
-
}, [
|
|
1773
|
+
title: W(c).mapMeasureArea,
|
|
1774
|
+
"aria-pressed": P.value === "area",
|
|
1775
|
+
onClick: n[1] ||= (e) => xe("area")
|
|
1776
|
+
}, [D(f, {
|
|
1777
1777
|
name: "pentagon",
|
|
1778
1778
|
size: 20
|
|
1779
|
-
})], 8,
|
|
1780
|
-
|
|
1779
|
+
})], 8, Pt),
|
|
1780
|
+
w("button", {
|
|
1781
1781
|
type: "button",
|
|
1782
1782
|
class: "grid place-items-center",
|
|
1783
|
-
title:
|
|
1784
|
-
disabled: !
|
|
1783
|
+
title: W(c).mapClearMeasurements,
|
|
1784
|
+
disabled: !ee.value && !P.value,
|
|
1785
1785
|
onClick: we
|
|
1786
|
-
}, [
|
|
1786
|
+
}, [D(f, {
|
|
1787
1787
|
name: "delete",
|
|
1788
1788
|
size: 20
|
|
1789
|
-
})], 8,
|
|
1789
|
+
})], 8, Ft)
|
|
1790
1790
|
]),
|
|
1791
1791
|
_: 1
|
|
1792
|
-
}, 8, ["position"])) :
|
|
1792
|
+
}, 8, ["position"])) : S("", !0), (L(!0), C(v, null, B(I.value, (e) => (L(), x(Se, {
|
|
1793
1793
|
key: e.key,
|
|
1794
1794
|
"lng-lat": e.at,
|
|
1795
1795
|
anchor: e.kind === "area" ? "center" : "top",
|
|
1796
1796
|
offset: e.kind === "area" ? [0, 0] : [0, 8],
|
|
1797
1797
|
class: "pointer-events-none"
|
|
1798
1798
|
}, {
|
|
1799
|
-
default: q(() => [
|
|
1799
|
+
default: q(() => [w("span", { class: N(["flex items-center gap-1 whitespace-nowrap rounded-full py-0.5 shadow-elevation-1", [e.kind === "segment" ? "bg-surface-container-highest text-label-small text-on-surface" : "bg-primary text-label-medium text-on-primary", e.m === void 0 ? "px-2" : "pr-0.5 pl-2"]]) }, [E(U(e.text) + " ", 1), e.m === void 0 ? S("", !0) : (L(), C("button", {
|
|
1800
1800
|
key: 0,
|
|
1801
1801
|
type: "button",
|
|
1802
1802
|
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",
|
|
1803
|
-
"aria-label":
|
|
1804
|
-
title:
|
|
1803
|
+
"aria-label": W(c).mapDeleteMeasurement,
|
|
1804
|
+
title: W(c).mapDeleteMeasurement,
|
|
1805
1805
|
onClick: J((t) => Ce(e.m), ["stop"]),
|
|
1806
|
-
onPointerdown:
|
|
1807
|
-
onMousedown:
|
|
1808
|
-
onTouchstart:
|
|
1809
|
-
onDblclick:
|
|
1810
|
-
}, [
|
|
1806
|
+
onPointerdown: n[2] ||= J(() => {}, ["stop"]),
|
|
1807
|
+
onMousedown: n[3] ||= J(() => {}, ["stop"]),
|
|
1808
|
+
onTouchstart: n[4] ||= J(() => {}, ["stop"]),
|
|
1809
|
+
onDblclick: n[5] ||= J(() => {}, ["stop"])
|
|
1810
|
+
}, [D(f, {
|
|
1811
1811
|
name: "close",
|
|
1812
1812
|
size: 14
|
|
1813
|
-
})], 40,
|
|
1813
|
+
})], 40, It))], 2)]),
|
|
1814
1814
|
_: 2
|
|
1815
1815
|
}, 1032, [
|
|
1816
1816
|
"lng-lat",
|
|
@@ -1818,15 +1818,15 @@ var jt = { class: "hidden" }, Mt = ["title", "aria-pressed"], Nt = ["title", "ar
|
|
|
1818
1818
|
"offset"
|
|
1819
1819
|
]))), 128))]));
|
|
1820
1820
|
}
|
|
1821
|
-
}),
|
|
1822
|
-
function
|
|
1823
|
-
let t =
|
|
1821
|
+
}), Rt = /* @__PURE__ */ new WeakMap();
|
|
1822
|
+
function zt(e) {
|
|
1823
|
+
let t = ae(e);
|
|
1824
1824
|
if (!t) throw Error("useMapFilter() must be called in a component inside <MMap>, or be given one");
|
|
1825
1825
|
function n(e, n) {
|
|
1826
1826
|
let r = t.map.value;
|
|
1827
1827
|
if (!r?.getLayer(e)) return;
|
|
1828
|
-
let i =
|
|
1829
|
-
i ||
|
|
1828
|
+
let i = Rt.get(r);
|
|
1829
|
+
i || Rt.set(r, i = /* @__PURE__ */ new Map()), i.has(e) || i.set(e, r.getFilter(e) ?? void 0);
|
|
1830
1830
|
let a = i.get(e);
|
|
1831
1831
|
r.setFilter(e, n ? a ? [
|
|
1832
1832
|
"all",
|
|
@@ -1851,7 +1851,7 @@ function Rt(e) {
|
|
|
1851
1851
|
}
|
|
1852
1852
|
//#endregion
|
|
1853
1853
|
//#region src/components/MMapFilter.vue?vue&type=script&setup=true&lang.ts
|
|
1854
|
-
var
|
|
1854
|
+
var Bt = { class: "flex flex-wrap gap-2" }, Vt = /* @__PURE__ */ O({
|
|
1855
1855
|
__name: "MMapFilter",
|
|
1856
1856
|
props: {
|
|
1857
1857
|
layer: {},
|
|
@@ -1863,7 +1863,7 @@ var zt = { class: "flex flex-wrap gap-2" }, Bt = /* @__PURE__ */ D({
|
|
|
1863
1863
|
},
|
|
1864
1864
|
emits: ["update:modelValue"],
|
|
1865
1865
|
setup(e, { emit: t }) {
|
|
1866
|
-
let n = e, r = t, { onReady: i, styleVersion: a } = Y(() => n.map), { setFilter: o, valuesOf: s } =
|
|
1866
|
+
let n = e, r = t, { onReady: i, styleVersion: a } = Y(() => n.map), { setFilter: o, valuesOf: s } = zt(() => n.map), c = z([]), l = b(() => n.values ?? c.value), u = z([]), d = b(() => n.modelValue ?? u.value);
|
|
1867
1867
|
function f() {
|
|
1868
1868
|
let e = d.value;
|
|
1869
1869
|
o(n.layer, e.length ? [
|
|
@@ -1886,21 +1886,21 @@ var zt = { class: "flex flex-wrap gap-2" }, Bt = /* @__PURE__ */ D({
|
|
|
1886
1886
|
m(e), f();
|
|
1887
1887
|
}), K(d, f, { deep: !0 }), K(a, () => f()), K(() => [n.layer, n.property], ([e], [t]) => {
|
|
1888
1888
|
e !== t && o(t, null), f();
|
|
1889
|
-
}),
|
|
1889
|
+
}), F(() => o(n.layer, null)), (t, n) => (L(), C("div", Bt, [(L(!0), C(v, null, B(l.value, (t) => (L(), x(g, {
|
|
1890
1890
|
key: t,
|
|
1891
1891
|
type: "filter",
|
|
1892
1892
|
clickable: "",
|
|
1893
1893
|
selected: d.value.includes(t),
|
|
1894
1894
|
onClick: (e) => p(t)
|
|
1895
1895
|
}, {
|
|
1896
|
-
default: q(() => [
|
|
1896
|
+
default: q(() => [E(U(e.labels?.[String(t)] ?? t), 1)]),
|
|
1897
1897
|
_: 2
|
|
1898
1898
|
}, 1032, ["selected", "onClick"]))), 128))]));
|
|
1899
1899
|
}
|
|
1900
1900
|
});
|
|
1901
1901
|
//#endregion
|
|
1902
1902
|
//#region src/composables/mapSearch.ts
|
|
1903
|
-
function
|
|
1903
|
+
function Ht(e = {}) {
|
|
1904
1904
|
return async (t, n) => {
|
|
1905
1905
|
let r = new URLSearchParams({
|
|
1906
1906
|
format: "jsonv2",
|
|
@@ -1928,17 +1928,17 @@ function Vt(e = {}) {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
//#endregion
|
|
1930
1930
|
//#region src/components/MMapSearch.vue?vue&type=script&setup=true&lang.ts
|
|
1931
|
-
var
|
|
1931
|
+
var Ut = { class: "hidden" }, Wt = [
|
|
1932
1932
|
"value",
|
|
1933
1933
|
"placeholder",
|
|
1934
1934
|
"aria-label"
|
|
1935
|
-
],
|
|
1935
|
+
], Gt = {
|
|
1936
1936
|
key: 0,
|
|
1937
1937
|
class: "border-t border-outline-variant"
|
|
1938
|
-
},
|
|
1938
|
+
}, Kt = {
|
|
1939
1939
|
key: 1,
|
|
1940
1940
|
class: "flex flex-col items-center gap-2 py-6"
|
|
1941
|
-
},
|
|
1941
|
+
}, qt = { class: "text-body-small text-on-surface-variant" }, Jt = /* @__PURE__ */ O({
|
|
1942
1942
|
__name: "MMapSearch",
|
|
1943
1943
|
props: {
|
|
1944
1944
|
provider: {},
|
|
@@ -1955,21 +1955,21 @@ var Ht = { class: "hidden" }, Ut = [
|
|
|
1955
1955
|
}
|
|
1956
1956
|
},
|
|
1957
1957
|
emits: ["select"],
|
|
1958
|
-
setup(e, { emit:
|
|
1959
|
-
let r = e, i =
|
|
1958
|
+
setup(e, { emit: t }) {
|
|
1959
|
+
let r = e, i = t, a = n(), { map: o } = Y(), l = b(() => r.provider ?? Ht()), u = z(""), d = H([]), g = z(!1), _ = z(!1), y = z(!1), T = H(null), E, O;
|
|
1960
1960
|
async function k() {
|
|
1961
1961
|
let e = u.value.trim();
|
|
1962
1962
|
if (!e) return;
|
|
1963
|
-
|
|
1964
|
-
let t =
|
|
1965
|
-
g.value = !0,
|
|
1963
|
+
E?.abort(), E = new AbortController();
|
|
1964
|
+
let t = E;
|
|
1965
|
+
g.value = !0, y.value = !0;
|
|
1966
1966
|
try {
|
|
1967
|
-
|
|
1967
|
+
d.value = await l.value(e, t.signal);
|
|
1968
1968
|
} catch {
|
|
1969
1969
|
if (t.signal.aborted) return;
|
|
1970
|
-
|
|
1970
|
+
d.value = [];
|
|
1971
1971
|
} finally {
|
|
1972
|
-
|
|
1972
|
+
E === t && (g.value = !1, _.value = !0);
|
|
1973
1973
|
}
|
|
1974
1974
|
}
|
|
1975
1975
|
function A(e) {
|
|
@@ -1977,8 +1977,8 @@ var Ht = { class: "hidden" }, Ut = [
|
|
|
1977
1977
|
r.instant && (clearTimeout(O), O = setTimeout(k, 350));
|
|
1978
1978
|
}
|
|
1979
1979
|
function j(e) {
|
|
1980
|
-
T.value = e,
|
|
1981
|
-
let t =
|
|
1980
|
+
T.value = e, y.value = !1;
|
|
1981
|
+
let t = o.value;
|
|
1982
1982
|
e.bbox && e.bbox[0] !== e.bbox[2] ? t?.fitBounds([[e.bbox[0], e.bbox[1]], [e.bbox[2], e.bbox[3]]], {
|
|
1983
1983
|
padding: 48,
|
|
1984
1984
|
maxZoom: r.zoom
|
|
@@ -1988,10 +1988,10 @@ var Ht = { class: "hidden" }, Ut = [
|
|
|
1988
1988
|
}), i("select", e);
|
|
1989
1989
|
}
|
|
1990
1990
|
function M() {
|
|
1991
|
-
|
|
1991
|
+
E?.abort(), clearTimeout(O), u.value = "", d.value = [], _.value = !1, g.value = !1, y.value = !1, T.value = null;
|
|
1992
1992
|
}
|
|
1993
|
-
|
|
1994
|
-
|
|
1993
|
+
F(() => {
|
|
1994
|
+
E?.abort(), clearTimeout(O);
|
|
1995
1995
|
});
|
|
1996
1996
|
let N = {
|
|
1997
1997
|
city: "location_city",
|
|
@@ -2020,54 +2020,54 @@ var Ht = { class: "hidden" }, Ut = [
|
|
|
2020
2020
|
administrative: "map",
|
|
2021
2021
|
country: "public",
|
|
2022
2022
|
state: "map"
|
|
2023
|
-
},
|
|
2024
|
-
return (t, n) => (L(),
|
|
2023
|
+
}, P = (e) => e && N[e] || "location_on";
|
|
2024
|
+
return (t, n) => (L(), C("div", Ut, [D(se, {
|
|
2025
2025
|
position: e.position,
|
|
2026
2026
|
group: !1
|
|
2027
2027
|
}, {
|
|
2028
|
-
default: q(() => [
|
|
2028
|
+
default: q(() => [D(p, {
|
|
2029
2029
|
variant: "elevated",
|
|
2030
2030
|
class: "w-80 max-w-[calc(100vw-5rem)] overflow-hidden"
|
|
2031
2031
|
}, {
|
|
2032
|
-
default: q(() => [
|
|
2032
|
+
default: q(() => [w("form", {
|
|
2033
2033
|
class: "flex items-center gap-2 py-1 pr-1 pl-3",
|
|
2034
2034
|
role: "search",
|
|
2035
2035
|
onSubmit: J(k, ["prevent"])
|
|
2036
2036
|
}, [
|
|
2037
|
-
|
|
2037
|
+
D(f, {
|
|
2038
2038
|
name: "search",
|
|
2039
2039
|
size: 20,
|
|
2040
2040
|
class: "shrink-0 text-on-surface-variant"
|
|
2041
2041
|
}),
|
|
2042
|
-
|
|
2042
|
+
w("input", {
|
|
2043
2043
|
value: u.value,
|
|
2044
2044
|
type: "search",
|
|
2045
2045
|
enterkeyhint: "search",
|
|
2046
|
-
placeholder: e.placeholder ??
|
|
2047
|
-
"aria-label": e.placeholder ??
|
|
2046
|
+
placeholder: e.placeholder ?? W(a).mapSearchPlaces,
|
|
2047
|
+
"aria-label": e.placeholder ?? W(a).mapSearchPlaces,
|
|
2048
2048
|
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",
|
|
2049
2049
|
onInput: n[0] ||= (e) => A(e.target.value),
|
|
2050
|
-
onFocus: n[1] ||= (e) =>
|
|
2051
|
-
}, null, 40,
|
|
2052
|
-
g.value ? (L(),
|
|
2050
|
+
onFocus: n[1] ||= (e) => y.value = _.value && !T.value
|
|
2051
|
+
}, null, 40, Wt),
|
|
2052
|
+
g.value ? (L(), x(s, {
|
|
2053
2053
|
key: 0,
|
|
2054
2054
|
size: 20,
|
|
2055
2055
|
class: "mr-2 shrink-0"
|
|
2056
|
-
})) : u.value ? (L(),
|
|
2056
|
+
})) : u.value ? (L(), x(c, {
|
|
2057
2057
|
key: 1,
|
|
2058
2058
|
icon: "close",
|
|
2059
|
-
label:
|
|
2059
|
+
label: W(a).clearSearch,
|
|
2060
2060
|
size: "sm",
|
|
2061
2061
|
onClick: M
|
|
2062
|
-
}, null, 8, ["label"])) :
|
|
2063
|
-
], 32),
|
|
2062
|
+
}, null, 8, ["label"])) : S("", !0)
|
|
2063
|
+
], 32), y.value && _.value && !g.value ? (L(), C("div", Gt, [d.value.length ? (L(), x(m, {
|
|
2064
2064
|
key: 0,
|
|
2065
2065
|
class: "max-h-72 overflow-y-auto"
|
|
2066
2066
|
}, {
|
|
2067
|
-
default: q(() => [(L(!0),
|
|
2067
|
+
default: q(() => [(L(!0), C(v, null, B(d.value, (e, t) => (L(), x(h, {
|
|
2068
2068
|
key: t,
|
|
2069
2069
|
title: e.label,
|
|
2070
|
-
icon:
|
|
2070
|
+
icon: P(e.type),
|
|
2071
2071
|
leading: "icon",
|
|
2072
2072
|
clickable: "",
|
|
2073
2073
|
onClick: (t) => j(e)
|
|
@@ -2077,21 +2077,21 @@ var Ht = { class: "hidden" }, Ut = [
|
|
|
2077
2077
|
"onClick"
|
|
2078
2078
|
]))), 128))]),
|
|
2079
2079
|
_: 1
|
|
2080
|
-
})) : (L(),
|
|
2080
|
+
})) : (L(), C("div", Kt, [D(f, {
|
|
2081
2081
|
name: "search_off",
|
|
2082
2082
|
size: 28,
|
|
2083
2083
|
class: "text-on-surface-variant"
|
|
2084
|
-
}),
|
|
2084
|
+
}), w("span", qt, U(W(a).noResults), 1)]))])) : S("", !0)]),
|
|
2085
2085
|
_: 1
|
|
2086
2086
|
})]),
|
|
2087
2087
|
_: 1
|
|
2088
|
-
}, 8, ["position"]), e.marker && T.value ? (L(),
|
|
2088
|
+
}, 8, ["position"]), e.marker && T.value ? (L(), x(Se, {
|
|
2089
2089
|
key: 0,
|
|
2090
2090
|
"lng-lat": T.value.lngLat
|
|
2091
|
-
}, null, 8, ["lng-lat"])) :
|
|
2091
|
+
}, null, 8, ["lng-lat"])) : S("", !0)]));
|
|
2092
2092
|
}
|
|
2093
2093
|
});
|
|
2094
2094
|
//#endregion
|
|
2095
|
-
export {
|
|
2095
|
+
export { _e as MMap, Qe as MMapBaseLayers, se as MMapControl, st as MMapFeatureInfo, Vt as MMapFilter, Te as MMapGeoJson, wt as MMapHover, _t as MMapIdentify, Je as MMapLayers, Se as MMapMarker, Lt as MMapMeasure, we as MMapPopup, Jt as MMapSearch, ft as fieldLabel, pt as formatFieldValue, ut as genericAdapter, ht as identifyFeatures, Ht as nominatimProvider, dt as orvianAdapter, Y as useMap, zt as useMapFilter, Z as useMapLayers };
|
|
2096
2096
|
|
|
2097
2097
|
//# sourceMappingURL=map.js.map
|