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