qy-vue-plugins 0.2.5 → 1.0.1-beta
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/chunks/EventKeys-B_9_2nJv.js +18 -0
- package/dist/chunks/{EventKeys-CXd5zco-.js → EventKeys-BanfFMDH.js} +3 -3
- package/dist/chunks/EventKeys-BvyQ87Zy.js +1 -0
- package/dist/chunks/MapTools.vue_vue_type_style_index_0_lang-C3__NQXN.js +1 -0
- package/dist/chunks/MapTools.vue_vue_type_style_index_0_lang-Ch4c7Qoj.js +1 -0
- package/dist/chunks/MapTools.vue_vue_type_style_index_0_lang-CyLnNIRE.js +286 -0
- package/dist/chunks/MapTools.vue_vue_type_style_index_0_lang-Uqo22w8a.js +286 -0
- package/dist/chunks/ProvideKeys-91lTuLnq.js +1 -0
- package/dist/chunks/ProvideKeys-CBXsWszp.js +10 -0
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-CGEO9pCb.js +102 -0
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-DAsI-u5q.js +1 -0
- package/dist/chunks/{aria-Lnh-oIIU.js → aria-0gp4FR49.js} +50 -44
- package/dist/chunks/aria-CT6v0_-A.js +5 -0
- package/dist/chunks/base-BmqR00dz.js +1 -0
- package/dist/chunks/base-DURufVZI.js +518 -0
- package/dist/chunks/{constant-sg1_DRTW.js → constant-BCrwD19Q.js} +3 -3
- package/dist/chunks/constant-BqK1UnfT.js +358 -0
- package/dist/chunks/constant-mXEWtcQf.js +1 -0
- package/dist/chunks/el-button-B-tQ713F.js +797 -0
- package/dist/chunks/el-button-BSavYzWl.js +3 -0
- package/dist/chunks/el-color-picker-panel-B1g-z3qR.js +1024 -0
- package/dist/chunks/el-color-picker-panel-Bj3ljc45.js +1 -0
- package/dist/chunks/el-form-item-CImWRYaB.js +1315 -0
- package/dist/chunks/el-form-item-NWLcqRzN.js +12 -0
- package/dist/chunks/el-input-CfPEOfbB.js +1 -0
- package/dist/chunks/el-input-tz6E7jFn.js +564 -0
- package/dist/chunks/el-loading-DRowB3cv.js +204 -0
- package/dist/chunks/el-loading-DY87olfi.js +1 -0
- package/dist/chunks/el-overlay-CY_IGTGt.js +1 -0
- package/dist/chunks/el-overlay-x5xtZ-_z.js +582 -0
- package/dist/chunks/el-popper-DmgxBZXK.js +1661 -0
- package/dist/chunks/el-popper-DwuuKN7V.js +1 -0
- package/dist/chunks/el-select-C9XY7xx3.js +1930 -0
- package/dist/chunks/el-select-fkI3RG0q.js +1 -0
- package/dist/chunks/geotiff-BXWVtao5.js +1839 -0
- package/dist/chunks/geotiff-OzcRsIeD.js +5 -0
- package/dist/chunks/img_c-B-7oksYM.js +6 -0
- package/dist/chunks/img_c-DUz-J5Tj.js +1 -0
- package/dist/chunks/index--HsUv0g3.js +2 -0
- package/dist/chunks/index-B0xOKkLK.js +1 -0
- package/dist/chunks/index-BvekrQO7.js +577 -0
- package/dist/chunks/index-CvAguhTB.js +304 -0
- package/dist/chunks/index-SxijbmK2.js +177 -0
- package/dist/chunks/index-zGltaNDv.js +1 -0
- package/dist/chunks/{lerc-DCCXL5wE.js → lerc-CmCGYt99.js} +1 -1
- package/dist/chunks/{lerc-BMmHSF05.js → lerc-pz_5d_yq.js} +1 -1
- package/dist/chunks/{mapStore-oFrNzlQO.js → mapStore-Eu13mnJg.js} +66 -22
- package/dist/chunks/mapStore-dFPYwvXT.js +1 -0
- package/dist/chunks/{MapTools.vue_vue_type_style_index_0_lang-CXvD_9dm.js → mapbox-gl-draw-CKTcXDzM.js} +884 -1163
- package/dist/chunks/mapbox-gl-draw-Dg_Inye3.js +1 -0
- package/dist/chunks/use-global-config-AtD9LB9U.js +1 -0
- package/dist/chunks/use-global-config-Cmftt4Lm.js +71 -0
- package/dist/chunks/{utils-Co-GE89c.js → utils-CLoHY5o3.js} +1 -1
- package/dist/chunks/utils-CZxmwfl_.js +1 -0
- package/dist/chunks/utils-n1i0zWzc.js +454 -0
- package/dist/chunks/vnode-CYGNY0Il.js +47 -0
- package/dist/chunks/vnode-aXDL2Mh-.js +1 -0
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-BRUTHTNe.js +12 -0
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-CksusXxb.js +28 -0
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-DchJeGnp.js +1 -0
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-yXKDlNvO.js +17 -0
- package/dist/manageTable/FilterItem.cjs +1 -1
- package/dist/manageTable/FilterItem.mjs +53 -57
- package/dist/manageTable/ReplaceSpeciesNameDialog.cjs +1 -1
- package/dist/manageTable/ReplaceSpeciesNameDialog.mjs +1 -1
- package/dist/manageTable/manageTable.cjs +1 -1
- package/dist/manageTable/manageTable.mjs +144 -161
- package/dist/mapbox/MapView.cjs +1 -1
- package/dist/mapbox/MapView.mjs +950 -3
- package/dist/mapbox/components/MapLegend.mjs +2 -2
- package/dist/mapbox/components/MapTools.cjs +1 -1
- package/dist/mapbox/components/MapTools.mjs +1 -1
- package/dist/mapbox/components/VideoDialog.cjs +1 -3
- package/dist/mapbox/components/VideoDialog.mjs +42 -1701
- package/dist/mapbox/components/mapCompass.cjs +1 -1
- package/dist/mapbox/components/mapCompass.mjs +1 -1
- package/dist/mapbox/components/mapLayer.cjs +1 -1
- package/dist/mapbox/components/mapLayer.mjs +37 -36
- package/dist/mapbox/components/mapLevel.cjs +1 -1
- package/dist/mapbox/components/mapLevel.mjs +1 -1
- package/dist/mapbox/components/mapPitch.cjs +1 -1
- package/dist/mapbox/components/mapPitch.mjs +1 -1
- package/dist/mapbox/components/mapTopic.cjs +1 -1
- package/dist/mapbox/components/mapTopic.mjs +26 -9
- package/dist/mapbox/utils.mjs +1 -1
- package/dist/mapbox/widgets/CustomShapeDialog.cjs +1 -1
- package/dist/mapbox/widgets/CustomShapeDialog.mjs +10 -10
- package/dist/mapbox/widgets/IconPicker.mjs +1 -1
- package/dist/mapbox/widgets/LayerAttributeDialog.cjs +1 -1
- package/dist/mapbox/widgets/LayerAttributeDialog.mjs +141 -339
- package/dist/mapbox/widgets/LayerDialog.cjs +1 -1
- package/dist/mapbox/widgets/LayerDialog.mjs +3 -3
- package/dist/mapbox/widgets/LegendDialogLine.cjs +1 -1
- package/dist/mapbox/widgets/LegendDialogLine.mjs +4 -4
- package/dist/mapbox/widgets/LegendDialogPoint.cjs +1 -1
- package/dist/mapbox/widgets/LegendDialogPoint.mjs +8 -8
- package/dist/mapbox/widgets/LegendLine.cjs +1 -1
- package/dist/mapbox/widgets/LegendLine.mjs +40 -16
- package/dist/mapbox/widgets/LegendPoint.mjs +2 -2
- package/dist/mapbox/widgets/LegendPopLine.cjs +1 -1
- package/dist/mapbox/widgets/LegendPopLine.mjs +9 -9
- package/dist/mapbox/widgets/LegendPopPoint.cjs +1 -1
- package/dist/mapbox/widgets/LegendPopPoint.mjs +19 -19
- package/dist/mapbox/widgets/LegendShape.mjs +2 -2
- package/dist/mapbox/widgets/LegendSymbol.mjs +4 -4
- package/dist/mapbox/widgets/ShapeDialog.cjs +1 -1
- package/dist/mapbox/widgets/ShapeDialog.mjs +4 -4
- package/dist/mapbox/widgets/TopicItemPop.cjs +1 -1
- package/dist/mapbox/widgets/TopicItemPop.mjs +2 -2
- package/dist/mapbox/widgets/TopicPop.cjs +1 -1
- package/dist/mapbox/widgets/TopicPop.mjs +2 -2
- package/dist/mapbox.cjs +1 -1
- package/dist/mapbox.mjs +9 -9
- package/dist/mapboxV2/EventKeys.cjs +1 -0
- package/dist/mapboxV2/EventKeys.mjs +21 -0
- package/dist/mapboxV2/MapView.cjs +1 -0
- package/dist/mapboxV2/MapView.mjs +2407 -0
- package/dist/mapboxV2/ProvideKeys.cjs +1 -0
- package/dist/mapboxV2/ProvideKeys.mjs +10 -0
- package/dist/mapboxV2/components/MapLegend.cjs +1 -0
- package/dist/mapboxV2/components/MapLegend.mjs +203 -0
- package/dist/mapboxV2/components/MapTools.cjs +1 -0
- package/dist/mapboxV2/components/MapTools.mjs +4 -0
- package/dist/mapboxV2/components/VideoDialog.cjs +1 -0
- package/dist/mapboxV2/components/VideoDialog.mjs +82 -0
- package/dist/mapboxV2/components/mapCompass.cjs +1 -0
- package/dist/mapboxV2/components/mapCompass.mjs +75 -0
- package/dist/mapboxV2/components/mapLayer.cjs +1 -0
- package/dist/mapboxV2/components/mapLayer.mjs +56 -0
- package/dist/mapboxV2/components/mapLevel.cjs +1 -0
- package/dist/mapboxV2/components/mapLevel.mjs +90 -0
- package/dist/mapboxV2/components/mapPitch.cjs +1 -0
- package/dist/mapboxV2/components/mapPitch.mjs +36 -0
- package/dist/mapboxV2/components/mapPos.cjs +1 -0
- package/dist/mapboxV2/components/mapPos.mjs +40 -0
- package/dist/mapboxV2/components/mapSetting.cjs +1 -0
- package/dist/mapboxV2/components/mapSetting.mjs +596 -0
- package/dist/mapboxV2/components/mapTopic.cjs +1 -0
- package/dist/mapboxV2/components/mapTopic.mjs +703 -0
- package/dist/mapboxV2/constant.cjs +1 -0
- package/dist/mapboxV2/constant.mjs +430 -0
- package/dist/mapboxV2/useTif.cjs +1 -0
- package/dist/mapboxV2/useTif.mjs +142 -0
- package/dist/mapboxV2/utils.cjs +1 -0
- package/dist/mapboxV2/utils.mjs +494 -0
- package/dist/mapboxV2/utilsFun.cjs +1 -0
- package/dist/mapboxV2/utilsFun.mjs +82 -0
- package/dist/mapboxV2/widgets/CustomShapeDialog.cjs +1 -0
- package/dist/mapboxV2/widgets/CustomShapeDialog.mjs +171 -0
- package/dist/mapboxV2/widgets/IconPicker.cjs +1 -0
- package/dist/mapboxV2/widgets/IconPicker.mjs +130 -0
- package/dist/mapboxV2/widgets/LayerAttributeDialog.cjs +1 -0
- package/dist/mapboxV2/widgets/LayerAttributeDialog.mjs +261 -0
- package/dist/mapboxV2/widgets/LayerDialog.cjs +1 -0
- package/dist/mapboxV2/widgets/LayerDialog.mjs +254 -0
- package/dist/mapboxV2/widgets/LegendDialogLine.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendDialogLine.mjs +228 -0
- package/dist/mapboxV2/widgets/LegendDialogPoint.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendDialogPoint.mjs +196 -0
- package/dist/mapboxV2/widgets/LegendLine.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendLine.mjs +75 -0
- package/dist/mapboxV2/widgets/LegendPoint.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendPoint.mjs +99 -0
- package/dist/mapboxV2/widgets/LegendPopInterestPoint.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendPopInterestPoint.mjs +206 -0
- package/dist/mapboxV2/widgets/LegendPopLine.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendPopLine.mjs +299 -0
- package/dist/mapboxV2/widgets/LegendPopPoint.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendPopPoint.mjs +328 -0
- package/dist/mapboxV2/widgets/LegendShape.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendShape.mjs +34 -0
- package/dist/mapboxV2/widgets/LegendSymbol.cjs +1 -0
- package/dist/mapboxV2/widgets/LegendSymbol.mjs +32 -0
- package/dist/mapboxV2/widgets/Point.cjs +1 -0
- package/dist/mapboxV2/widgets/Point.mjs +22 -0
- package/dist/mapboxV2/widgets/ShapeDialog.cjs +1 -0
- package/dist/mapboxV2/widgets/ShapeDialog.mjs +2266 -0
- package/dist/mapboxV2/widgets/TopicItemPop.cjs +1 -0
- package/dist/mapboxV2/widgets/TopicItemPop.mjs +116 -0
- package/dist/mapboxV2/widgets/TopicPop.cjs +1 -0
- package/dist/mapboxV2/widgets/TopicPop.mjs +164 -0
- package/dist/mapboxV2.cjs +1 -0
- package/dist/mapboxV2.mjs +23 -0
- package/dist/qy-vue-plugins.css +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.mjs +66 -22
- package/dist/types/manageTable/manageTable.vue.d.ts +0 -1
- package/dist/types/mapboxV2/EventKeys.d.ts +55 -0
- package/dist/types/mapboxV2/MapView.vue.d.ts +82 -0
- package/dist/types/mapboxV2/ProvideKeys.d.ts +12 -0
- package/dist/types/mapboxV2/components/MapLegend.vue.d.ts +2 -0
- package/dist/types/mapboxV2/components/MapTools.vue.d.ts +7 -0
- package/dist/types/mapboxV2/components/VideoDialog.vue.d.ts +58 -0
- package/dist/types/mapboxV2/components/index.d.ts +8 -0
- package/dist/types/mapboxV2/components/mapCompass.vue.d.ts +4 -0
- package/dist/types/mapboxV2/components/mapLayer.vue.d.ts +4 -0
- package/dist/types/mapboxV2/components/mapLevel.vue.d.ts +22 -0
- package/dist/types/mapboxV2/components/mapPitch.vue.d.ts +2 -0
- package/dist/types/mapboxV2/components/mapPos.vue.d.ts +17 -0
- package/dist/types/mapboxV2/components/mapSetting.vue.d.ts +7 -0
- package/dist/types/mapboxV2/components/mapTopic.vue.d.ts +1432 -0
- package/dist/types/mapboxV2/constant.d.ts +22 -0
- package/dist/types/mapboxV2/index.d.ts +11 -0
- package/dist/types/mapboxV2/types/map-layer.d.ts +83 -0
- package/dist/types/mapboxV2/useTif.d.ts +21 -0
- package/dist/types/mapboxV2/utils.d.ts +121 -0
- package/dist/types/mapboxV2/utilsFun.d.ts +12 -0
- package/dist/types/mapboxV2/widgets/CustomShapeDialog.vue.d.ts +191 -0
- package/dist/types/mapboxV2/widgets/IconPicker.vue.d.ts +94 -0
- package/dist/types/mapboxV2/widgets/LayerAttributeDialog.vue.d.ts +5 -0
- package/dist/types/mapboxV2/widgets/LayerDialog.vue.d.ts +185 -0
- package/dist/types/mapboxV2/widgets/LegendDialogLine.vue.d.ts +185 -0
- package/dist/types/mapboxV2/widgets/LegendDialogPoint.vue.d.ts +185 -0
- package/dist/types/mapboxV2/widgets/LegendLine.vue.d.ts +7 -0
- package/dist/types/mapboxV2/widgets/LegendPoint.vue.d.ts +7 -0
- package/dist/types/mapboxV2/widgets/LegendPopInterestPoint.vue.d.ts +5 -0
- package/dist/types/mapboxV2/widgets/LegendPopLine.vue.d.ts +5 -0
- package/dist/types/mapboxV2/widgets/LegendPopPoint.vue.d.ts +340 -0
- package/dist/types/mapboxV2/widgets/LegendShape.vue.d.ts +6 -0
- package/dist/types/mapboxV2/widgets/LegendSymbol.vue.d.ts +6 -0
- package/dist/types/mapboxV2/widgets/ShapeDialog.vue.d.ts +6 -0
- package/dist/types/mapboxV2/widgets/TopicItemPop.vue.d.ts +18 -0
- package/dist/types/mapboxV2/widgets/TopicPop.vue.d.ts +186 -0
- package/dist/types/mapboxV2/widgets/index.d.ts +13 -0
- package/dist/types/mapboxV2-EventKeys.d.ts +2 -0
- package/dist/types/mapboxV2-MapView.d.ts +4 -0
- package/dist/types/mapboxV2-ProvideKeys.d.ts +2 -0
- package/dist/types/mapboxV2-components-MapLegend.d.ts +4 -0
- package/dist/types/mapboxV2-components-MapTools.d.ts +4 -0
- package/dist/types/mapboxV2-components-VideoDialog.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapCompass.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapLayer.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapLevel.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapPitch.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapPos.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapSetting.d.ts +4 -0
- package/dist/types/mapboxV2-components-mapTopic.d.ts +4 -0
- package/dist/types/mapboxV2-constant.d.ts +2 -0
- package/dist/types/mapboxV2-useTif.d.ts +2 -0
- package/dist/types/mapboxV2-utils.d.ts +2 -0
- package/dist/types/mapboxV2-utilsFun.d.ts +2 -0
- package/dist/types/mapboxV2-widgets-CustomShapeDialog.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-IconPicker.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LayerAttributeDialog.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LayerDialog.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendDialogLine.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendDialogPoint.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendLine.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendPoint.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendPopInterestPoint.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendPopLine.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendPopPoint.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendShape.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-LegendSymbol.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-Point.d.ts +1 -0
- package/dist/types/mapboxV2-widgets-ShapeDialog.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-TopicItemPop.d.ts +4 -0
- package/dist/types/mapboxV2-widgets-TopicPop.d.ts +4 -0
- package/dist/types/mapboxV2.d.ts +2 -0
- package/dist/types/store/mapStore.d.ts +112 -0
- package/dist/types/types/map.d.ts +136 -13
- package/package/mapboxV2/EventKeys.ts +97 -0
- package/package/mapboxV2/ProvideKeys.ts +23 -0
- package/package/mapboxV2/components/index.ts +9 -0
- package/package/mapboxV2/constant.ts +456 -0
- package/package/mapboxV2/index.ts +15 -0
- package/package/mapboxV2/useTif.ts +341 -0
- package/package/mapboxV2/utils.ts +1013 -0
- package/package/mapboxV2/utilsFun.ts +155 -0
- package/package/mapboxV2/widgets/index.ts +14 -0
- package/package/types/map.ts +182 -17
- package/package.json +203 -1
- package/dist/chunks/MapTools.vue_vue_type_style_index_0_lang-cJJE47_x.js +0 -1
- package/dist/chunks/MapView-DoXcDnvD.js +0 -5
- package/dist/chunks/MapView-k58LhCWD.js +0 -2786
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-BFusb3rd.js +0 -880
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-C0OTINr4.js +0 -1
- package/dist/chunks/aria-CU11fhFG.js +0 -5
- package/dist/chunks/base-BBPoamOf.js +0 -438
- package/dist/chunks/base-Dbw4YzZq.js +0 -1
- package/dist/chunks/mapStore-D57AyFNX.js +0 -1
- package/dist/chunks/use-global-config-D_HRwVvW.js +0 -301
- package/dist/chunks/use-global-config-Wtw3ujWW.js +0 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEventBus as e } from "@vueuse/core";
|
|
2
|
+
const o = Symbol("delete-topic"), h = e(o), a = Symbol("create-topic"), K = e(a), s = Symbol("update-topic");
|
|
3
|
+
e(s);
|
|
4
|
+
const t = Symbol("topic-panel-click"), S = e(t), c = Symbol("render-geographic-data"), u = e(c), y = Symbol("toggle-geographic-layer"), b = e(y), l = Symbol("show-layer-edit"), B = e(l), n = Symbol("locate-to-layer-center"), L = e(n), r = Symbol("show-layer-dialog"), w = e(r), p = Symbol("map-loaded"), T = e(p), i = Symbol("map-style-changed"), C = e(i), g = Symbol("show-map-settings"), D = e(g), d = Symbol("search-layer"), G = e(d);
|
|
5
|
+
export {
|
|
6
|
+
T as a,
|
|
7
|
+
w as b,
|
|
8
|
+
K as c,
|
|
9
|
+
h as d,
|
|
10
|
+
b as e,
|
|
11
|
+
G as f,
|
|
12
|
+
D as g,
|
|
13
|
+
L as l,
|
|
14
|
+
C as m,
|
|
15
|
+
u as r,
|
|
16
|
+
B as s,
|
|
17
|
+
S as t
|
|
18
|
+
};
|
|
@@ -3,11 +3,11 @@ const o = Symbol("delete-topic"), g = e(o), a = Symbol("create-topic"), m = e(a)
|
|
|
3
3
|
e(t);
|
|
4
4
|
const c = Symbol("topic-panel-click"), K = e(c), s = Symbol("render-geographic-data"), h = e(s), y = Symbol("toggle-geographic-layer"), u = e(y), l = Symbol("show-layer-edit"), S = e(l), n = Symbol("locate-to-layer-center"), b = e(n), r = Symbol("show-layer-dialog"), B = e(r), p = Symbol("map-loaded"), L = e(p), i = Symbol("map-style-changed"), T = e(i);
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
L as a,
|
|
7
|
+
B as b,
|
|
8
8
|
m as c,
|
|
9
9
|
g as d,
|
|
10
|
-
|
|
10
|
+
K as e,
|
|
11
11
|
b as l,
|
|
12
12
|
T as m,
|
|
13
13
|
h as r,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@vueuse/core"),s=Symbol("delete-topic"),o=e.useEventBus(s),t=Symbol("create-topic"),a=e.useEventBus(t),c=Symbol("update-topic");e.useEventBus(c);const y=Symbol("topic-panel-click"),n=e.useEventBus(y),u=Symbol("render-geographic-data"),r=e.useEventBus(u),l=Symbol("toggle-geographic-layer"),i=e.useEventBus(l),p=Symbol("show-layer-edit"),B=e.useEventBus(p),g=Symbol("locate-to-layer-center"),d=e.useEventBus(g),h=Symbol("show-layer-dialog"),K=e.useEventBus(h),m=Symbol("map-loaded"),S=e.useEventBus(m),L=Symbol("map-style-changed"),E=e.useEventBus(L),b=Symbol("show-map-settings"),v=e.useEventBus(b),w=Symbol("search-layer"),T=e.useEventBus(w);exports.createTopicBus=a;exports.deleteTopicBus=o;exports.locateToLayerCenterKeyBus=d;exports.mapLoadedBus=S;exports.mapStyleChangedBus=E;exports.renderGeographicDataKeyBus=r;exports.searchLayerBus=T;exports.showLayerDialogKeyBus=K;exports.showLayerEditKeyBus=B;exports.showMapSettingsBus=v;exports.toggleGeographicLayerKeyBus=i;exports.topicPanelClickBus=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),h=require("./mapbox-gl-draw-Dg_Inye3.js"),P=require("./ProvideKeys-91lTuLnq.js"),N=require("./EventKeys-BvyQ87Zy.js"),q=require("./constant-mXEWtcQf.js"),B=require("@turf/turf"),I=require("@element-plus/icons-vue"),j=require("element-plus");function $(i){const m=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(m,n,r.get?r:{enumerable:!0,get:()=>i[n]})}}return m.default=i,Object.freeze(m)}const p=$(B),O={key:0,class:"measure-info-panel"},A={class:"measure-info-content"},R={class:"measure-label"},z={class:"measure-value"},K={class:"qy-flex-row hiper-map-tools-bar"},J=a.defineComponent({__name:"MapTools",props:{tools:{default:()=>["point","line","polygon","measure_distance","measure_area","clear_all"]}},setup(i){const m=a.inject("mapRootId"),n=a.ref(),r=a.ref([]),L=a.ref(null),M=a.ref(null),v=a.ref(!1),c=a.ref("distance"),y=t=>{switch(v.value&&t!=="measure_distance"&&t!=="clear_all"&&D(),n.value=t,t){case"point":s.changeMode("draw_point");break;case"line":s.changeMode("draw_line_string");break;case"polygon":s.changeMode("draw_polygon");break;case"measure_distance":s.changeMode("simple_select"),c.value="distance",x();break;case"measure_area":s.changeMode("simple_select"),c.value="area",x();break;case"clear_all":s.deleteAll(),D();break}},e=a.inject(P.mapInstanceKey),s=new h.MapboxDraw({userProperties:!0,displayControlsDefault:!1,modes:{...h.MapboxDraw.modes,draw_rectangle:h.DrawRectangle,static:h.StaticMode}});let _=null;_=N.mapLoadedBus.on(({mapRootId:t})=>{m!==t||!e?.value||(console.log("hiper-map-tools-bar mounted",e),e.value.addControl(s,"top-left"),e.value.on("draw.create",w))});function w(t){const l=s.getAll();if(!l.features.length)return;l.features=[l.features[0]];const o={point:{layerType:"symbol",config:{textColor:"rgba(0,0,0,1)",iconName:q.DefaultIcon}},line:{layerType:"line",config:{lineWidth:1,lineColor:"rgba(255, 0, 0, 1)",lineStyle:"solid"}},polygon:{layerType:"shape",config:{fillColor:"rgba(241, 131, 127, 1)",lineWidth:1}}}[n.value];o&&N.showLayerEditKeyBus.emit({mapRootId:m,e:new MouseEvent("click"),layer:{layerType:o.layerType,customLayerConfig:JSON.stringify(o.config),geoJSON:JSON.stringify(l),...n.value==="polygon"?{pid:""}:{}}}),s.deleteAll()}function x(){e?.value&&(v.value=!0,r.value=[],e.value.getCanvas().style.cursor="crosshair",e.value.on("click",b),e.value.on("dblclick",g))}function g(t){if(v.value){if(t.preventDefault(),c.value==="distance")r.value.length>=2&&C();else if(r.value.length>=3){const l=r.value[0],u=r.value[r.value.length-1];(l[0]!==u[0]||l[1]!==u[1])&&r.value.push(l),C()}e?.value?.off("click",b),e?.value?.off("dblclick",g),e?.value&&(e.value.getCanvas().style.cursor=""),v.value=!1}}function b(t){if(!v.value||!e?.value)return;t.originalEvent.stopPropagation();const l=[t.lngLat.lng,t.lngLat.lat];r.value.push(l),r.value.length===1?(c.value==="distance"?d.value=0:f.value=0,e.value.getSource("measure-point-source")?e.value.getSource("measure-point-source").setData({type:"Feature",properties:{},geometry:{type:"Point",coordinates:l}}):(e.value.addSource("measure-point-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Point",coordinates:l}}}),e.value.addLayer({id:"measure-point-layer",type:"circle",source:"measure-point-source",paint:{"circle-radius":5,"circle-color":"#16aaff"}}))):(e.value.getSource("measure-point-source")&&e.value.getSource("measure-point-source").setData({type:"FeatureCollection",features:r.value.map(u=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}}))}),C(),c.value==="area"&&r.value.length>=3&&(e.value.getCanvas().style.cursor="pointer"))}function C(){if(!e?.value||r.value.length<2)return;const t=p.lineString(r.value);if(c.value==="distance"){const l=p.length(t,{units:"kilometers"});d.value=l,l<1?`${(l*1e3).toFixed(2)}`:`${l.toFixed(3)}`;const u=Math.floor(r.value.length/2)-1;u<0?r.value[0]:r.value[u],S(t)}else if(r.value.length>=3){const l=[...r.value];l[0]!==l[l.length-1]&&l.push(l[0]);const u=p.polygon([l]),o=p.area(u)/1e6;f.value=o,o<1?`${(o*1e6).toFixed(2)}`:`${o.toFixed(3)}`;const k=p.centroid(u);S(t,k.geometry.coordinates)}else S(t,t.geometry.coordinates[0])}function S(t,l,u){if(e?.value){if(e.value.getSource("measure-line-source")?e.value.getSource("measure-line-source").setData(t):(e.value.addSource("measure-line-source",{type:"geojson",data:t}),e.value.addLayer({id:"measure-line-layer",type:"line",source:"measure-line-source",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#16aaff","line-width":2,"line-dasharray":[2,1]}}),L.value="measure-line-layer"),c.value==="area"&&r.value.length>=3){const o=[...r.value];o[0]!==o[o.length-1]&&o.push(o[0]);const k=p.polygon([o]);e.value.getSource("measure-fill-source")?e.value.getSource("measure-fill-source").setData(k):(e.value.addSource("measure-fill-source",{type:"geojson",data:k}),e.value.addLayer({id:"measure-fill-layer",type:"fill",source:"measure-fill-source",paint:{"fill-color":"#16aaff","fill-opacity":.2,"fill-outline-color":"#16aaff"}},"measure-line-layer"))}e.value.getSource("measure-label-source")&&e.value.getLayer("measure-label-layer")&&(e.value.removeLayer("measure-label-layer"),e.value.removeSource("measure-label-source"),M.value=null)}}function D(){e?.value&&(e.value?.off("click",b),e.value?.off("dblclick",g),e.value.getCanvas().style.cursor="",e.value.getLayer("measure-point-layer")&&(e.value.removeLayer("measure-point-layer"),e.value.removeSource("measure-point-source")),e.value.getLayer("measure-line-layer")&&(e.value.removeLayer("measure-line-layer"),e.value.removeSource("measure-line-source")),e.value.getLayer("measure-fill-layer")&&(e.value.removeLayer("measure-fill-layer"),e.value.removeSource("measure-fill-source")),e.value.getLayer("measure-label-layer")&&(e.value.removeLayer("measure-label-layer"),e.value.removeSource("measure-label-source")),r.value=[],L.value=null,M.value=null,v.value=!1,d.value=0,f.value=0,e.value.getLayer("measure-label-layer")&&e.value.removeLayer("measure-label-layer"),e.value.getSource("measure-label-source")&&e.value.removeSource("measure-label-source"))}a.onUnmounted(()=>{D(),_&&_(),e?.value&&(e.value?.removeControl(s),e.value?.off("draw.create",w),e.value?.off("click",b),e.value?.off("dblclick",g))});const d=a.ref(0),E=a.computed(()=>d.value<1?`${(d.value*1e3).toFixed(2)} 米`:`${d.value.toFixed(3)} 公里`),f=a.ref(0),T=a.computed(()=>f.value<1?`${(f.value*1e6).toFixed(2)} 平方米`:`${f.value.toFixed(3)} 平方公里`),V=a.computed(()=>c.value==="distance"?E.value:T.value),F=a.computed(()=>c.value==="distance"?"总长度: ":"总面积: ");return(t,l)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[v.value||r.value.length>0&&(n.value=="measure_distance"||n.value=="measure_area")?(a.openBlock(),a.createElementBlock("div",O,[a.createElementVNode("div",A,[a.createElementVNode("span",R,a.toDisplayString(F.value),1),a.createElementVNode("span",z,a.toDisplayString(V.value),1),a.createVNode(a.unref(j.ElIcon),{style:{display:"block","margin-left":"10px",cursor:"pointer"},onClick:l[0]||(l[0]=u=>y("clear_all")),size:"20px"},{default:a.withCtx(()=>[a.createVNode(a.unref(I.Close))]),_:1})])])):a.createCommentVNode("",!0),a.createElementVNode("div",K,[l[7]||(l[7]=a.createElementVNode("div",{class:"tools-label"},"测绘工具",-1)),i.tools.includes("measure_distance")?(a.openBlock(),a.createElementBlock("div",{key:0,title:"测距",class:a.normalizeClass(["hiper-map-tools-btn",n.value=="measure_distance"?"active":null]),onClick:l[1]||(l[1]=()=>y("measure_distance"))},[...l[4]||(l[4]=[a.createElementVNode("span",{class:"qyuan icon-ruler"},null,-1)])],2)):a.createCommentVNode("",!0),i.tools.includes("measure_area")?(a.openBlock(),a.createElementBlock("div",{key:1,title:"测面",class:a.normalizeClass(["hiper-map-tools-btn",n.value=="measure_area"?"active":null]),onClick:l[2]||(l[2]=()=>y("measure_area"))},[...l[5]||(l[5]=[a.createElementVNode("span",{class:"qyuan icon-multi-triangular"},null,-1)])],2)):a.createCommentVNode("",!0),i.tools.includes("clear_all")?(a.openBlock(),a.createElementBlock("div",{key:2,title:"清除所有临时绘制图形",class:"hiper-map-tools-btn",style:{border:"none"},onClick:l[3]||(l[3]=()=>y("clear_all"))},[...l[6]||(l[6]=[a.createElementVNode("span",{class:"qyuan icon-clear"},null,-1)])])):a.createCommentVNode("",!0)])],64))}});exports._sfc_main=J;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),C=require("./mapbox-gl-draw-Dg_Inye3.js"),_=require("./ProvideKeys-jy8dfV9u.js"),x=require("./EventKeys-BLmCVdTJ.js"),F=require("./constant-Bc8XErtI.js"),P=require("@turf/turf"),I=require("@element-plus/icons-vue"),j=require("element-plus");function $(s){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(d,o,t.get?t:{enumerable:!0,get:()=>s[o]})}}return d.default=s,Object.freeze(d)}const y=$(P),O={key:0,class:"measure-info-panel"},z={class:"measure-info-content"},A={class:"measure-label"},R={class:"measure-value"},K={class:"qy-flex-row hiper-map-tools-bar"},J=e.defineComponent({__name:"MapTools",props:{tools:{default:()=>["point","line","polygon","measure_distance","measure_area","clear_all"]}},setup(s){const d=e.inject("mapRootId"),o=e.ref(),t=e.ref([]),M=e.ref(null),N=e.ref(null),v=e.ref(!1),c=e.ref("distance"),m=r=>{switch(v.value&&r!=="measure_distance"&&r!=="clear_all"&&L(),o.value=r,r){case"point":i.changeMode("draw_point");break;case"line":i.changeMode("draw_line_string");break;case"polygon":i.changeMode("draw_polygon");break;case"measure_distance":i.changeMode("simple_select"),c.value="distance",E();break;case"measure_area":i.changeMode("simple_select"),c.value="area",E();break;case"clear_all":i.deleteAll(),L();break}},a=e.inject(_.mapInstanceKey),i=new C.MapboxDraw({userProperties:!0,displayControlsDefault:!1,modes:{...C.MapboxDraw.modes,draw_rectangle:C.DrawRectangle,static:C.StaticMode}});let S=null;S=x.mapLoadedBus.on(({mapRootId:r})=>{d!==r||!a?.value||(console.log("hiper-map-tools-bar mounted",a),a.value.addControl(i,"top-left"),a.value.on("draw.create",w))});function w(r){const l=i.getAll();if(!l.features.length)return;l.features=[l.features[0]];const n={point:{layerType:"symbol",config:{textColor:"rgba(0,0,0,1)",iconName:F.DefaultIcon}},line:{layerType:"line",config:{lineWidth:1,lineColor:"rgba(255, 0, 0, 1)",lineStyle:"solid"}},polygon:{layerType:"shape",config:{fillColor:"rgba(241, 131, 127, 1)",lineWidth:1}}}[o.value];n&&x.showLayerEditKeyBus.emit({mapRootId:d,e:new MouseEvent("click"),layer:{layerType:n.layerType,customLayerConfig:JSON.stringify(n.config),geoJSON:JSON.stringify(l),...o.value==="polygon"?{pid:""}:{}}}),i.deleteAll()}function E(){a?.value&&(v.value=!0,t.value=[],a.value.getCanvas().style.cursor="crosshair",a.value.on("click",b),a.value.on("dblclick",g))}function g(r){if(v.value){if(r.preventDefault(),c.value==="distance")t.value.length>=2&&h();else if(t.value.length>=3){const l=t.value[0],u=t.value[t.value.length-1];(l[0]!==u[0]||l[1]!==u[1])&&t.value.push(l),h()}a?.value?.off("click",b),a?.value?.off("dblclick",g),a?.value&&(a.value.getCanvas().style.cursor=""),v.value=!1}}function b(r){if(!v.value||!a?.value)return;r.originalEvent.stopPropagation();const l=[r.lngLat.lng,r.lngLat.lat];t.value.push(l),t.value.length===1?(c.value==="distance"?p.value=0:f.value=0,a.value.getSource("measure-point-source")?a.value.getSource("measure-point-source").setData({type:"Feature",properties:{},geometry:{type:"Point",coordinates:l}}):(a.value.addSource("measure-point-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Point",coordinates:l}}}),a.value.addLayer({id:"measure-point-layer",type:"circle",source:"measure-point-source",paint:{"circle-radius":5,"circle-color":"#16aaff"}}))):(a.value.getSource("measure-point-source")&&a.value.getSource("measure-point-source").setData({type:"FeatureCollection",features:t.value.map(u=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}}))}),h(),c.value==="area"&&t.value.length>=3&&(a.value.getCanvas().style.cursor="pointer"))}function h(){if(!a?.value||t.value.length<2)return;const r=y.lineString(t.value);if(c.value==="distance"){const l=y.length(r,{units:"kilometers"});p.value=l,l<1?`${(l*1e3).toFixed(2)}`:`${l.toFixed(3)}`;const u=Math.floor(t.value.length/2)-1;u<0?t.value[0]:t.value[u],D(r)}else if(t.value.length>=3){const l=[...t.value];l[0]!==l[l.length-1]&&l.push(l[0]);const u=y.polygon([l]),n=y.area(u)/1e6;f.value=n,n<1?`${(n*1e6).toFixed(2)}`:`${n.toFixed(3)}`;const k=y.centroid(u);D(r,k.geometry.coordinates)}else D(r,r.geometry.coordinates[0])}function D(r,l,u){if(a?.value){if(a.value.getSource("measure-line-source")?a.value.getSource("measure-line-source").setData(r):(a.value.addSource("measure-line-source",{type:"geojson",data:r}),a.value.addLayer({id:"measure-line-layer",type:"line",source:"measure-line-source",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#16aaff","line-width":2,"line-dasharray":[2,1]}}),M.value="measure-line-layer"),c.value==="area"&&t.value.length>=3){const n=[...t.value];n[0]!==n[n.length-1]&&n.push(n[0]);const k=y.polygon([n]);a.value.getSource("measure-fill-source")?a.value.getSource("measure-fill-source").setData(k):(a.value.addSource("measure-fill-source",{type:"geojson",data:k}),a.value.addLayer({id:"measure-fill-layer",type:"fill",source:"measure-fill-source",paint:{"fill-color":"#16aaff","fill-opacity":.2,"fill-outline-color":"#16aaff"}},"measure-line-layer"))}a.value.getSource("measure-label-source")&&a.value.getLayer("measure-label-layer")&&(a.value.removeLayer("measure-label-layer"),a.value.removeSource("measure-label-source"),N.value=null)}}function L(){a?.value&&(a.value?.off("click",b),a.value?.off("dblclick",g),a.value.getCanvas().style.cursor="",a.value.getLayer("measure-point-layer")&&(a.value.removeLayer("measure-point-layer"),a.value.removeSource("measure-point-source")),a.value.getLayer("measure-line-layer")&&(a.value.removeLayer("measure-line-layer"),a.value.removeSource("measure-line-source")),a.value.getLayer("measure-fill-layer")&&(a.value.removeLayer("measure-fill-layer"),a.value.removeSource("measure-fill-source")),a.value.getLayer("measure-label-layer")&&(a.value.removeLayer("measure-label-layer"),a.value.removeSource("measure-label-source")),t.value=[],M.value=null,N.value=null,v.value=!1,p.value=0,f.value=0,a.value.getLayer("measure-label-layer")&&a.value.removeLayer("measure-label-layer"),a.value.getSource("measure-label-source")&&a.value.removeSource("measure-label-source"))}e.onUnmounted(()=>{L(),S&&S(),a?.value&&(a.value?.removeControl(i),a.value?.off("draw.create",w),a.value?.off("click",b),a.value?.off("dblclick",g))});const p=e.ref(0),V=e.computed(()=>p.value<1?`${(p.value*1e3).toFixed(2)} 米`:`${p.value.toFixed(3)} 公里`),f=e.ref(0),B=e.computed(()=>f.value<1?`${(f.value*1e6).toFixed(2)} 平方米`:`${f.value.toFixed(3)} 平方公里`),q=e.computed(()=>c.value==="distance"?V.value:B.value),T=e.computed(()=>c.value==="distance"?"总长度: ":"总面积: ");return(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[v.value||t.value.length>0&&(o.value=="measure_distance"||o.value=="measure_area")?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",z,[e.createElementVNode("span",A,e.toDisplayString(T.value),1),e.createElementVNode("span",R,e.toDisplayString(q.value),1),e.createVNode(e.unref(j.ElIcon),{style:{display:"block","margin-left":"10px",cursor:"pointer"},onClick:l[0]||(l[0]=u=>m("clear_all")),size:"20px"},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Close))]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[s.tools.includes("point")?(e.openBlock(),e.createElementBlock("div",{key:0,title:"兴趣点",class:e.normalizeClass(["hiper-map-tools-btn",o.value=="point"?"active":null]),onClick:l[1]||(l[1]=()=>m("point"))},[...l[7]||(l[7]=[e.createElementVNode("span",{class:"qyuan icon-local-two"},null,-1)])],2)):e.createCommentVNode("",!0),s.tools.includes("line")?(e.openBlock(),e.createElementBlock("div",{key:1,title:"折线",class:e.normalizeClass(["hiper-map-tools-btn",o.value=="line"?"active":null]),onClick:l[2]||(l[2]=()=>m("line"))},[...l[8]||(l[8]=[e.createElementVNode("span",{class:"qyuan icon-whole-site-accelerator"},null,-1)])],2)):e.createCommentVNode("",!0),s.tools.includes("polygon")?(e.openBlock(),e.createElementBlock("div",{key:2,title:"多边形",class:e.normalizeClass(["hiper-map-tools-btn",o.value=="polygon"?"active":null]),onClick:l[3]||(l[3]=()=>m("polygon"))},[...l[9]||(l[9]=[e.createElementVNode("span",{class:"qyuan icon-anchor"},null,-1)])],2)):e.createCommentVNode("",!0),s.tools.includes("measure_distance")?(e.openBlock(),e.createElementBlock("div",{key:3,title:"测距",class:e.normalizeClass(["hiper-map-tools-btn",o.value=="measure_distance"?"active":null]),onClick:l[4]||(l[4]=()=>m("measure_distance"))},[...l[10]||(l[10]=[e.createElementVNode("span",{class:"qyuan icon-ruler"},null,-1)])],2)):e.createCommentVNode("",!0),s.tools.includes("measure_area")?(e.openBlock(),e.createElementBlock("div",{key:4,title:"测面",class:e.normalizeClass(["hiper-map-tools-btn",o.value=="measure_area"?"active":null]),onClick:l[5]||(l[5]=()=>m("measure_area"))},[...l[11]||(l[11]=[e.createElementVNode("span",{class:"qyuan icon-multi-triangular"},null,-1)])],2)):e.createCommentVNode("",!0),s.tools.includes("clear_all")?(e.openBlock(),e.createElementBlock("div",{key:5,title:"清除所有临时绘制图形",class:"hiper-map-tools-btn",style:{border:"none"},onClick:l[6]||(l[6]=()=>m("clear_all"))},[...l[12]||(l[12]=[e.createElementVNode("span",{class:"qyuan icon-clear"},null,-1)])])):e.createCommentVNode("",!0)])],64))}});exports._sfc_main=J;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as V, inject as q, ref as c, onUnmounted as z, computed as M, createElementBlock as v, openBlock as m, Fragment as K, createCommentVNode as f, createElementVNode as n, createVNode as N, toDisplayString as E, unref as j, withCtx as U, normalizeClass as C } from "vue";
|
|
2
|
+
import { M as A, S as W, D as H } from "./mapbox-gl-draw-CKTcXDzM.js";
|
|
3
|
+
import { m as G } from "./ProvideKeys-B6IuZ5VV.js";
|
|
4
|
+
import { a as Q, s as X } from "./EventKeys-BanfFMDH.js";
|
|
5
|
+
import { D as Y } from "./constant-BCrwD19Q.js";
|
|
6
|
+
import * as k from "@turf/turf";
|
|
7
|
+
import { Close as Z } from "@element-plus/icons-vue";
|
|
8
|
+
import { ElIcon as ee } from "element-plus";
|
|
9
|
+
const ae = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "measure-info-panel"
|
|
12
|
+
}, le = { class: "measure-info-content" }, re = { class: "measure-label" }, oe = { class: "measure-value" }, te = { class: "qy-flex-row hiper-map-tools-bar" }, pe = /* @__PURE__ */ V({
|
|
13
|
+
__name: "MapTools",
|
|
14
|
+
props: {
|
|
15
|
+
tools: { default: () => ["point", "line", "polygon", "measure_distance", "measure_area", "clear_all"] }
|
|
16
|
+
},
|
|
17
|
+
setup(y) {
|
|
18
|
+
const F = q("mapRootId"), u = c(), r = c([]), I = c(null), _ = c(null), p = c(!1), i = c("distance"), d = (l) => {
|
|
19
|
+
switch (p.value && l !== "measure_distance" && l !== "clear_all" && T(), u.value = l, l) {
|
|
20
|
+
case "point":
|
|
21
|
+
s.changeMode("draw_point");
|
|
22
|
+
break;
|
|
23
|
+
case "line":
|
|
24
|
+
s.changeMode("draw_line_string");
|
|
25
|
+
break;
|
|
26
|
+
case "polygon":
|
|
27
|
+
s.changeMode("draw_polygon");
|
|
28
|
+
break;
|
|
29
|
+
case "measure_distance":
|
|
30
|
+
s.changeMode("simple_select"), i.value = "distance", $();
|
|
31
|
+
break;
|
|
32
|
+
case "measure_area":
|
|
33
|
+
s.changeMode("simple_select"), i.value = "area", $();
|
|
34
|
+
break;
|
|
35
|
+
case "clear_all":
|
|
36
|
+
s.deleteAll(), T();
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}, e = q(G), s = new A({
|
|
40
|
+
userProperties: !0,
|
|
41
|
+
displayControlsDefault: !1,
|
|
42
|
+
modes: {
|
|
43
|
+
...A.modes,
|
|
44
|
+
draw_rectangle: H,
|
|
45
|
+
static: W
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
let D = null;
|
|
49
|
+
D = Q.on(({ mapRootId: l }) => {
|
|
50
|
+
F !== l || !e?.value || (console.log("hiper-map-tools-bar mounted", e), e.value.addControl(s, "top-left"), e.value.on("draw.create", P));
|
|
51
|
+
});
|
|
52
|
+
function P(l) {
|
|
53
|
+
const a = s.getAll();
|
|
54
|
+
if (!a.features.length) return;
|
|
55
|
+
a.features = [a.features[0]];
|
|
56
|
+
const o = {
|
|
57
|
+
point: {
|
|
58
|
+
layerType: "symbol",
|
|
59
|
+
config: {
|
|
60
|
+
textColor: "rgba(0,0,0,1)",
|
|
61
|
+
iconName: Y
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
line: {
|
|
65
|
+
layerType: "line",
|
|
66
|
+
config: {
|
|
67
|
+
lineWidth: 1,
|
|
68
|
+
lineColor: "rgba(255, 0, 0, 1)",
|
|
69
|
+
lineStyle: "solid"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
polygon: {
|
|
73
|
+
layerType: "shape",
|
|
74
|
+
config: {
|
|
75
|
+
fillColor: "rgba(241, 131, 127, 1)",
|
|
76
|
+
lineWidth: 1
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}[u.value];
|
|
80
|
+
o && X.emit({
|
|
81
|
+
mapRootId: F,
|
|
82
|
+
e: new MouseEvent("click"),
|
|
83
|
+
layer: {
|
|
84
|
+
layerType: o.layerType,
|
|
85
|
+
customLayerConfig: JSON.stringify(o.config),
|
|
86
|
+
geoJSON: JSON.stringify(a),
|
|
87
|
+
...u.value === "polygon" ? { pid: "" } : {}
|
|
88
|
+
}
|
|
89
|
+
}), s.deleteAll();
|
|
90
|
+
}
|
|
91
|
+
function $() {
|
|
92
|
+
e?.value && (p.value = !0, r.value = [], e.value.getCanvas().style.cursor = "crosshair", e.value.on("click", h), e.value.on("dblclick", S));
|
|
93
|
+
}
|
|
94
|
+
function S(l) {
|
|
95
|
+
if (p.value) {
|
|
96
|
+
if (l.preventDefault(), i.value === "distance")
|
|
97
|
+
r.value.length >= 2 && w();
|
|
98
|
+
else if (r.value.length >= 3) {
|
|
99
|
+
const a = r.value[0], t = r.value[r.value.length - 1];
|
|
100
|
+
(a[0] !== t[0] || a[1] !== t[1]) && r.value.push(a), w();
|
|
101
|
+
}
|
|
102
|
+
e?.value?.off("click", h), e?.value?.off("dblclick", S), e?.value && (e.value.getCanvas().style.cursor = ""), p.value = !1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function h(l) {
|
|
106
|
+
if (!p.value || !e?.value) return;
|
|
107
|
+
l.originalEvent.stopPropagation();
|
|
108
|
+
const a = [l.lngLat.lng, l.lngLat.lat];
|
|
109
|
+
r.value.push(a), r.value.length === 1 ? (i.value === "distance" ? g.value = 0 : b.value = 0, e.value.getSource("measure-point-source") ? e.value.getSource("measure-point-source").setData({
|
|
110
|
+
type: "Feature",
|
|
111
|
+
properties: {},
|
|
112
|
+
geometry: {
|
|
113
|
+
type: "Point",
|
|
114
|
+
coordinates: a
|
|
115
|
+
}
|
|
116
|
+
}) : (e.value.addSource("measure-point-source", {
|
|
117
|
+
type: "geojson",
|
|
118
|
+
data: {
|
|
119
|
+
type: "Feature",
|
|
120
|
+
properties: {},
|
|
121
|
+
geometry: {
|
|
122
|
+
type: "Point",
|
|
123
|
+
coordinates: a
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}), e.value.addLayer({
|
|
127
|
+
id: "measure-point-layer",
|
|
128
|
+
type: "circle",
|
|
129
|
+
source: "measure-point-source",
|
|
130
|
+
paint: {
|
|
131
|
+
"circle-radius": 5,
|
|
132
|
+
"circle-color": "#16aaff"
|
|
133
|
+
}
|
|
134
|
+
}))) : (e.value.getSource("measure-point-source") && e.value.getSource("measure-point-source").setData({
|
|
135
|
+
type: "FeatureCollection",
|
|
136
|
+
features: r.value.map((t) => ({
|
|
137
|
+
type: "Feature",
|
|
138
|
+
properties: {},
|
|
139
|
+
geometry: {
|
|
140
|
+
type: "Point",
|
|
141
|
+
coordinates: t
|
|
142
|
+
}
|
|
143
|
+
}))
|
|
144
|
+
}), w(), i.value === "area" && r.value.length >= 3 && (e.value.getCanvas().style.cursor = "pointer"));
|
|
145
|
+
}
|
|
146
|
+
function w() {
|
|
147
|
+
if (!e?.value || r.value.length < 2) return;
|
|
148
|
+
const l = k.lineString(r.value);
|
|
149
|
+
if (i.value === "distance") {
|
|
150
|
+
const a = k.length(l, { units: "kilometers" });
|
|
151
|
+
g.value = a, a < 1 ? `${(a * 1e3).toFixed(2)}` : `${a.toFixed(3)}`;
|
|
152
|
+
const t = Math.floor(r.value.length / 2) - 1;
|
|
153
|
+
t < 0 ? r.value[0] : r.value[t], x(l);
|
|
154
|
+
} else if (r.value.length >= 3) {
|
|
155
|
+
const a = [...r.value];
|
|
156
|
+
a[0] !== a[a.length - 1] && a.push(a[0]);
|
|
157
|
+
const t = k.polygon([a]), o = k.area(t) / 1e6;
|
|
158
|
+
b.value = o, o < 1 ? `${(o * 1e6).toFixed(2)}` : `${o.toFixed(3)}`;
|
|
159
|
+
const L = k.centroid(t);
|
|
160
|
+
x(l, L.geometry.coordinates);
|
|
161
|
+
} else
|
|
162
|
+
x(l, l.geometry.coordinates[0]);
|
|
163
|
+
}
|
|
164
|
+
function x(l, a, t) {
|
|
165
|
+
if (e?.value) {
|
|
166
|
+
if (e.value.getSource("measure-line-source") ? e.value.getSource("measure-line-source").setData(l) : (e.value.addSource("measure-line-source", {
|
|
167
|
+
type: "geojson",
|
|
168
|
+
data: l
|
|
169
|
+
}), e.value.addLayer({
|
|
170
|
+
id: "measure-line-layer",
|
|
171
|
+
type: "line",
|
|
172
|
+
source: "measure-line-source",
|
|
173
|
+
layout: {
|
|
174
|
+
"line-join": "round",
|
|
175
|
+
"line-cap": "round"
|
|
176
|
+
},
|
|
177
|
+
paint: {
|
|
178
|
+
"line-color": "#16aaff",
|
|
179
|
+
"line-width": 2,
|
|
180
|
+
"line-dasharray": [2, 1]
|
|
181
|
+
}
|
|
182
|
+
}), I.value = "measure-line-layer"), i.value === "area" && r.value.length >= 3) {
|
|
183
|
+
const o = [...r.value];
|
|
184
|
+
o[0] !== o[o.length - 1] && o.push(o[0]);
|
|
185
|
+
const L = k.polygon([o]);
|
|
186
|
+
e.value.getSource("measure-fill-source") ? e.value.getSource("measure-fill-source").setData(L) : (e.value.addSource("measure-fill-source", {
|
|
187
|
+
type: "geojson",
|
|
188
|
+
data: L
|
|
189
|
+
}), e.value.addLayer(
|
|
190
|
+
{
|
|
191
|
+
id: "measure-fill-layer",
|
|
192
|
+
type: "fill",
|
|
193
|
+
source: "measure-fill-source",
|
|
194
|
+
paint: {
|
|
195
|
+
"fill-color": "#16aaff",
|
|
196
|
+
"fill-opacity": 0.2,
|
|
197
|
+
"fill-outline-color": "#16aaff"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"measure-line-layer"
|
|
201
|
+
));
|
|
202
|
+
}
|
|
203
|
+
e.value.getSource("measure-label-source") && e.value.getLayer("measure-label-layer") && (e.value.removeLayer("measure-label-layer"), e.value.removeSource("measure-label-source"), _.value = null);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function T() {
|
|
207
|
+
e?.value && (e.value?.off("click", h), e.value?.off("dblclick", S), e.value.getCanvas().style.cursor = "", e.value.getLayer("measure-point-layer") && (e.value.removeLayer("measure-point-layer"), e.value.removeSource("measure-point-source")), e.value.getLayer("measure-line-layer") && (e.value.removeLayer("measure-line-layer"), e.value.removeSource("measure-line-source")), e.value.getLayer("measure-fill-layer") && (e.value.removeLayer("measure-fill-layer"), e.value.removeSource("measure-fill-source")), e.value.getLayer("measure-label-layer") && (e.value.removeLayer("measure-label-layer"), e.value.removeSource("measure-label-source")), r.value = [], I.value = null, _.value = null, p.value = !1, g.value = 0, b.value = 0, e.value.getLayer("measure-label-layer") && e.value.removeLayer("measure-label-layer"), e.value.getSource("measure-label-source") && e.value.removeSource("measure-label-source"));
|
|
208
|
+
}
|
|
209
|
+
z(() => {
|
|
210
|
+
T(), D && D(), e?.value && (e.value?.removeControl(s), e.value?.off("draw.create", P), e.value?.off("click", h), e.value?.off("dblclick", S));
|
|
211
|
+
});
|
|
212
|
+
const g = c(0), R = M(() => g.value < 1 ? `${(g.value * 1e3).toFixed(2)} 米` : `${g.value.toFixed(3)} 公里`), b = c(0), B = M(() => b.value < 1 ? `${(b.value * 1e6).toFixed(2)} 平方米` : `${b.value.toFixed(3)} 平方公里`), J = M(() => i.value === "distance" ? R.value : B.value), O = M(() => i.value === "distance" ? "总长度: " : "总面积: ");
|
|
213
|
+
return (l, a) => (m(), v(K, null, [
|
|
214
|
+
p.value || r.value.length > 0 && (u.value == "measure_distance" || u.value == "measure_area") ? (m(), v("div", ae, [
|
|
215
|
+
n("div", le, [
|
|
216
|
+
n("span", re, E(O.value), 1),
|
|
217
|
+
n("span", oe, E(J.value), 1),
|
|
218
|
+
N(j(ee), {
|
|
219
|
+
style: { display: "block", "margin-left": "10px", cursor: "pointer" },
|
|
220
|
+
onClick: a[0] || (a[0] = (t) => d("clear_all")),
|
|
221
|
+
size: "20px"
|
|
222
|
+
}, {
|
|
223
|
+
default: U(() => [
|
|
224
|
+
N(j(Z))
|
|
225
|
+
]),
|
|
226
|
+
_: 1
|
|
227
|
+
})
|
|
228
|
+
])
|
|
229
|
+
])) : f("", !0),
|
|
230
|
+
n("div", te, [
|
|
231
|
+
y.tools.includes("point") ? (m(), v("div", {
|
|
232
|
+
key: 0,
|
|
233
|
+
title: "兴趣点",
|
|
234
|
+
class: C(["hiper-map-tools-btn", u.value == "point" ? "active" : null]),
|
|
235
|
+
onClick: a[1] || (a[1] = () => d("point"))
|
|
236
|
+
}, [...a[7] || (a[7] = [
|
|
237
|
+
n("span", { class: "qyuan icon-local-two" }, null, -1)
|
|
238
|
+
])], 2)) : f("", !0),
|
|
239
|
+
y.tools.includes("line") ? (m(), v("div", {
|
|
240
|
+
key: 1,
|
|
241
|
+
title: "折线",
|
|
242
|
+
class: C(["hiper-map-tools-btn", u.value == "line" ? "active" : null]),
|
|
243
|
+
onClick: a[2] || (a[2] = () => d("line"))
|
|
244
|
+
}, [...a[8] || (a[8] = [
|
|
245
|
+
n("span", { class: "qyuan icon-whole-site-accelerator" }, null, -1)
|
|
246
|
+
])], 2)) : f("", !0),
|
|
247
|
+
y.tools.includes("polygon") ? (m(), v("div", {
|
|
248
|
+
key: 2,
|
|
249
|
+
title: "多边形",
|
|
250
|
+
class: C(["hiper-map-tools-btn", u.value == "polygon" ? "active" : null]),
|
|
251
|
+
onClick: a[3] || (a[3] = () => d("polygon"))
|
|
252
|
+
}, [...a[9] || (a[9] = [
|
|
253
|
+
n("span", { class: "qyuan icon-anchor" }, null, -1)
|
|
254
|
+
])], 2)) : f("", !0),
|
|
255
|
+
y.tools.includes("measure_distance") ? (m(), v("div", {
|
|
256
|
+
key: 3,
|
|
257
|
+
title: "测距",
|
|
258
|
+
class: C(["hiper-map-tools-btn", u.value == "measure_distance" ? "active" : null]),
|
|
259
|
+
onClick: a[4] || (a[4] = () => d("measure_distance"))
|
|
260
|
+
}, [...a[10] || (a[10] = [
|
|
261
|
+
n("span", { class: "qyuan icon-ruler" }, null, -1)
|
|
262
|
+
])], 2)) : f("", !0),
|
|
263
|
+
y.tools.includes("measure_area") ? (m(), v("div", {
|
|
264
|
+
key: 4,
|
|
265
|
+
title: "测面",
|
|
266
|
+
class: C(["hiper-map-tools-btn", u.value == "measure_area" ? "active" : null]),
|
|
267
|
+
onClick: a[5] || (a[5] = () => d("measure_area"))
|
|
268
|
+
}, [...a[11] || (a[11] = [
|
|
269
|
+
n("span", { class: "qyuan icon-multi-triangular" }, null, -1)
|
|
270
|
+
])], 2)) : f("", !0),
|
|
271
|
+
y.tools.includes("clear_all") ? (m(), v("div", {
|
|
272
|
+
key: 5,
|
|
273
|
+
title: "清除所有临时绘制图形",
|
|
274
|
+
class: "hiper-map-tools-btn",
|
|
275
|
+
style: { border: "none" },
|
|
276
|
+
onClick: a[6] || (a[6] = () => d("clear_all"))
|
|
277
|
+
}, [...a[12] || (a[12] = [
|
|
278
|
+
n("span", { class: "qyuan icon-clear" }, null, -1)
|
|
279
|
+
])])) : f("", !0)
|
|
280
|
+
])
|
|
281
|
+
], 64));
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
pe as _
|
|
286
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as V, inject as $, ref as n, onUnmounted as z, computed as S, createElementBlock as f, openBlock as y, Fragment as K, createCommentVNode as _, createElementVNode as i, createVNode as N, toDisplayString as E, unref as j, withCtx as U, normalizeClass as A } from "vue";
|
|
2
|
+
import { M as R, S as W, D as H } from "./mapbox-gl-draw-CKTcXDzM.js";
|
|
3
|
+
import { m as G } from "./ProvideKeys-CBXsWszp.js";
|
|
4
|
+
import { a as Q, s as X } from "./EventKeys-B_9_2nJv.js";
|
|
5
|
+
import { D as Y } from "./constant-BqK1UnfT.js";
|
|
6
|
+
import * as d from "@turf/turf";
|
|
7
|
+
import { Close as Z } from "@element-plus/icons-vue";
|
|
8
|
+
import { ElIcon as ee } from "element-plus";
|
|
9
|
+
const ae = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "measure-info-panel"
|
|
12
|
+
}, le = { class: "measure-info-content" }, re = { class: "measure-label" }, oe = { class: "measure-value" }, te = { class: "qy-flex-row hiper-map-tools-bar" }, pe = /* @__PURE__ */ V({
|
|
13
|
+
__name: "MapTools",
|
|
14
|
+
props: {
|
|
15
|
+
tools: { default: () => [
|
|
16
|
+
"point",
|
|
17
|
+
"line",
|
|
18
|
+
"polygon",
|
|
19
|
+
"measure_distance",
|
|
20
|
+
"measure_area",
|
|
21
|
+
"clear_all"
|
|
22
|
+
] }
|
|
23
|
+
},
|
|
24
|
+
setup(C) {
|
|
25
|
+
const w = $("mapRootId"), c = n(), r = n([]), T = n(null), F = n(null), v = n(!1), s = n("distance"), g = (l) => {
|
|
26
|
+
switch (v.value && l !== "measure_distance" && l !== "clear_all" && x(), c.value = l, l) {
|
|
27
|
+
case "point":
|
|
28
|
+
u.changeMode("draw_point");
|
|
29
|
+
break;
|
|
30
|
+
case "line":
|
|
31
|
+
u.changeMode("draw_line_string");
|
|
32
|
+
break;
|
|
33
|
+
case "polygon":
|
|
34
|
+
u.changeMode("draw_polygon");
|
|
35
|
+
break;
|
|
36
|
+
case "measure_distance":
|
|
37
|
+
u.changeMode("simple_select"), s.value = "distance", P();
|
|
38
|
+
break;
|
|
39
|
+
case "measure_area":
|
|
40
|
+
u.changeMode("simple_select"), s.value = "area", P();
|
|
41
|
+
break;
|
|
42
|
+
case "clear_all":
|
|
43
|
+
u.deleteAll(), x();
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}, e = $(G), u = new R({
|
|
47
|
+
userProperties: !0,
|
|
48
|
+
displayControlsDefault: !1,
|
|
49
|
+
modes: {
|
|
50
|
+
...R.modes,
|
|
51
|
+
draw_rectangle: H,
|
|
52
|
+
static: W
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
let L = null;
|
|
56
|
+
L = Q.on(({ mapRootId: l }) => {
|
|
57
|
+
w !== l || !e?.value || (console.log("hiper-map-tools-bar mounted", e), e.value.addControl(u, "top-left"), e.value.on("draw.create", I));
|
|
58
|
+
});
|
|
59
|
+
function I(l) {
|
|
60
|
+
const a = u.getAll();
|
|
61
|
+
if (!a.features.length) return;
|
|
62
|
+
a.features = [a.features[0]];
|
|
63
|
+
const o = {
|
|
64
|
+
point: {
|
|
65
|
+
layerType: "symbol",
|
|
66
|
+
config: {
|
|
67
|
+
textColor: "rgba(0,0,0,1)",
|
|
68
|
+
iconName: Y
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
line: {
|
|
72
|
+
layerType: "line",
|
|
73
|
+
config: {
|
|
74
|
+
lineWidth: 1,
|
|
75
|
+
lineColor: "rgba(255, 0, 0, 1)",
|
|
76
|
+
lineStyle: "solid"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
polygon: {
|
|
80
|
+
layerType: "shape",
|
|
81
|
+
config: {
|
|
82
|
+
fillColor: "rgba(241, 131, 127, 1)",
|
|
83
|
+
lineWidth: 1
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}[c.value];
|
|
87
|
+
o && X.emit({
|
|
88
|
+
mapRootId: w,
|
|
89
|
+
e: new MouseEvent("click"),
|
|
90
|
+
layer: {
|
|
91
|
+
layerType: o.layerType,
|
|
92
|
+
customLayerConfig: JSON.stringify(o.config),
|
|
93
|
+
geoJSON: JSON.stringify(a),
|
|
94
|
+
...c.value === "polygon" ? { pid: "" } : {}
|
|
95
|
+
}
|
|
96
|
+
}), u.deleteAll();
|
|
97
|
+
}
|
|
98
|
+
function P() {
|
|
99
|
+
e?.value && (v.value = !0, r.value = [], e.value.getCanvas().style.cursor = "crosshair", e.value.on("click", h), e.value.on("dblclick", b));
|
|
100
|
+
}
|
|
101
|
+
function b(l) {
|
|
102
|
+
if (v.value) {
|
|
103
|
+
if (l.preventDefault(), s.value === "distance")
|
|
104
|
+
r.value.length >= 2 && M();
|
|
105
|
+
else if (r.value.length >= 3) {
|
|
106
|
+
const a = r.value[0], t = r.value[r.value.length - 1];
|
|
107
|
+
(a[0] !== t[0] || a[1] !== t[1]) && r.value.push(a), M();
|
|
108
|
+
}
|
|
109
|
+
e?.value?.off("click", h), e?.value?.off("dblclick", b), e?.value && (e.value.getCanvas().style.cursor = ""), v.value = !1;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function h(l) {
|
|
113
|
+
if (!v.value || !e?.value) return;
|
|
114
|
+
l.originalEvent.stopPropagation();
|
|
115
|
+
const a = [l.lngLat.lng, l.lngLat.lat];
|
|
116
|
+
r.value.push(a), r.value.length === 1 ? (s.value === "distance" ? m.value = 0 : p.value = 0, e.value.getSource("measure-point-source") ? e.value.getSource("measure-point-source").setData({
|
|
117
|
+
type: "Feature",
|
|
118
|
+
properties: {},
|
|
119
|
+
geometry: {
|
|
120
|
+
type: "Point",
|
|
121
|
+
coordinates: a
|
|
122
|
+
}
|
|
123
|
+
}) : (e.value.addSource("measure-point-source", {
|
|
124
|
+
type: "geojson",
|
|
125
|
+
data: {
|
|
126
|
+
type: "Feature",
|
|
127
|
+
properties: {},
|
|
128
|
+
geometry: {
|
|
129
|
+
type: "Point",
|
|
130
|
+
coordinates: a
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}), e.value.addLayer({
|
|
134
|
+
id: "measure-point-layer",
|
|
135
|
+
type: "circle",
|
|
136
|
+
source: "measure-point-source",
|
|
137
|
+
paint: {
|
|
138
|
+
"circle-radius": 5,
|
|
139
|
+
"circle-color": "#16aaff"
|
|
140
|
+
}
|
|
141
|
+
}))) : (e.value.getSource("measure-point-source") && e.value.getSource("measure-point-source").setData({
|
|
142
|
+
type: "FeatureCollection",
|
|
143
|
+
features: r.value.map((t) => ({
|
|
144
|
+
type: "Feature",
|
|
145
|
+
properties: {},
|
|
146
|
+
geometry: {
|
|
147
|
+
type: "Point",
|
|
148
|
+
coordinates: t
|
|
149
|
+
}
|
|
150
|
+
}))
|
|
151
|
+
}), M(), s.value === "area" && r.value.length >= 3 && (e.value.getCanvas().style.cursor = "pointer"));
|
|
152
|
+
}
|
|
153
|
+
function M() {
|
|
154
|
+
if (!e?.value || r.value.length < 2) return;
|
|
155
|
+
const l = d.lineString(r.value);
|
|
156
|
+
if (s.value === "distance") {
|
|
157
|
+
const a = d.length(l, { units: "kilometers" });
|
|
158
|
+
m.value = a, a < 1 ? `${(a * 1e3).toFixed(2)}` : `${a.toFixed(3)}`;
|
|
159
|
+
const t = Math.floor(r.value.length / 2) - 1;
|
|
160
|
+
t < 0 ? r.value[0] : r.value[t], D(l);
|
|
161
|
+
} else if (r.value.length >= 3) {
|
|
162
|
+
const a = [...r.value];
|
|
163
|
+
a[0] !== a[a.length - 1] && a.push(a[0]);
|
|
164
|
+
const t = d.polygon([a]), o = d.area(t) / 1e6;
|
|
165
|
+
p.value = o, o < 1 ? `${(o * 1e6).toFixed(2)}` : `${o.toFixed(3)}`;
|
|
166
|
+
const k = d.centroid(t);
|
|
167
|
+
D(
|
|
168
|
+
l,
|
|
169
|
+
k.geometry.coordinates
|
|
170
|
+
);
|
|
171
|
+
} else
|
|
172
|
+
D(
|
|
173
|
+
l,
|
|
174
|
+
l.geometry.coordinates[0]
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
function D(l, a, t) {
|
|
178
|
+
if (e?.value) {
|
|
179
|
+
if (e.value.getSource("measure-line-source") ? e.value.getSource("measure-line-source").setData(
|
|
180
|
+
l
|
|
181
|
+
) : (e.value.addSource("measure-line-source", {
|
|
182
|
+
type: "geojson",
|
|
183
|
+
data: l
|
|
184
|
+
}), e.value.addLayer({
|
|
185
|
+
id: "measure-line-layer",
|
|
186
|
+
type: "line",
|
|
187
|
+
source: "measure-line-source",
|
|
188
|
+
layout: {
|
|
189
|
+
"line-join": "round",
|
|
190
|
+
"line-cap": "round"
|
|
191
|
+
},
|
|
192
|
+
paint: {
|
|
193
|
+
"line-color": "#16aaff",
|
|
194
|
+
"line-width": 2,
|
|
195
|
+
"line-dasharray": [2, 1]
|
|
196
|
+
}
|
|
197
|
+
}), T.value = "measure-line-layer"), s.value === "area" && r.value.length >= 3) {
|
|
198
|
+
const o = [...r.value];
|
|
199
|
+
o[0] !== o[o.length - 1] && o.push(o[0]);
|
|
200
|
+
const k = d.polygon([o]);
|
|
201
|
+
e.value.getSource("measure-fill-source") ? e.value.getSource("measure-fill-source").setData(
|
|
202
|
+
k
|
|
203
|
+
) : (e.value.addSource("measure-fill-source", {
|
|
204
|
+
type: "geojson",
|
|
205
|
+
data: k
|
|
206
|
+
}), e.value.addLayer(
|
|
207
|
+
{
|
|
208
|
+
id: "measure-fill-layer",
|
|
209
|
+
type: "fill",
|
|
210
|
+
source: "measure-fill-source",
|
|
211
|
+
paint: {
|
|
212
|
+
"fill-color": "#16aaff",
|
|
213
|
+
"fill-opacity": 0.2,
|
|
214
|
+
"fill-outline-color": "#16aaff"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"measure-line-layer"
|
|
218
|
+
));
|
|
219
|
+
}
|
|
220
|
+
e.value.getSource("measure-label-source") && e.value.getLayer("measure-label-layer") && (e.value.removeLayer("measure-label-layer"), e.value.removeSource("measure-label-source"), F.value = null);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function x() {
|
|
224
|
+
e?.value && (e.value?.off("click", h), e.value?.off("dblclick", b), e.value.getCanvas().style.cursor = "", e.value.getLayer("measure-point-layer") && (e.value.removeLayer("measure-point-layer"), e.value.removeSource("measure-point-source")), e.value.getLayer("measure-line-layer") && (e.value.removeLayer("measure-line-layer"), e.value.removeSource("measure-line-source")), e.value.getLayer("measure-fill-layer") && (e.value.removeLayer("measure-fill-layer"), e.value.removeSource("measure-fill-source")), e.value.getLayer("measure-label-layer") && (e.value.removeLayer("measure-label-layer"), e.value.removeSource("measure-label-source")), r.value = [], T.value = null, F.value = null, v.value = !1, m.value = 0, p.value = 0, e.value.getLayer("measure-label-layer") && e.value.removeLayer("measure-label-layer"), e.value.getSource("measure-label-source") && e.value.removeSource("measure-label-source"));
|
|
225
|
+
}
|
|
226
|
+
z(() => {
|
|
227
|
+
x(), L && L(), e?.value && (e.value?.removeControl(u), e.value?.off("draw.create", I), e.value?.off("click", h), e.value?.off("dblclick", b));
|
|
228
|
+
});
|
|
229
|
+
const m = n(0), q = S(() => m.value < 1 ? `${(m.value * 1e3).toFixed(2)} 米` : `${m.value.toFixed(3)} 公里`), p = n(0), B = S(() => p.value < 1 ? `${(p.value * 1e6).toFixed(2)} 平方米` : `${p.value.toFixed(3)} 平方公里`), J = S(() => s.value === "distance" ? q.value : B.value), O = S(() => s.value === "distance" ? "总长度: " : "总面积: ");
|
|
230
|
+
return (l, a) => (y(), f(K, null, [
|
|
231
|
+
v.value || r.value.length > 0 && (c.value == "measure_distance" || c.value == "measure_area") ? (y(), f("div", ae, [
|
|
232
|
+
i("div", le, [
|
|
233
|
+
i("span", re, E(O.value), 1),
|
|
234
|
+
i("span", oe, E(J.value), 1),
|
|
235
|
+
N(j(ee), {
|
|
236
|
+
style: { display: "block", "margin-left": "10px", cursor: "pointer" },
|
|
237
|
+
onClick: a[0] || (a[0] = (t) => g("clear_all")),
|
|
238
|
+
size: "20px"
|
|
239
|
+
}, {
|
|
240
|
+
default: U(() => [
|
|
241
|
+
N(j(Z))
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
})
|
|
245
|
+
])
|
|
246
|
+
])) : _("", !0),
|
|
247
|
+
i("div", te, [
|
|
248
|
+
a[7] || (a[7] = i("div", { class: "tools-label" }, "测绘工具", -1)),
|
|
249
|
+
C.tools.includes("measure_distance") ? (y(), f("div", {
|
|
250
|
+
key: 0,
|
|
251
|
+
title: "测距",
|
|
252
|
+
class: A([
|
|
253
|
+
"hiper-map-tools-btn",
|
|
254
|
+
c.value == "measure_distance" ? "active" : null
|
|
255
|
+
]),
|
|
256
|
+
onClick: a[1] || (a[1] = () => g("measure_distance"))
|
|
257
|
+
}, [...a[4] || (a[4] = [
|
|
258
|
+
i("span", { class: "qyuan icon-ruler" }, null, -1)
|
|
259
|
+
])], 2)) : _("", !0),
|
|
260
|
+
C.tools.includes("measure_area") ? (y(), f("div", {
|
|
261
|
+
key: 1,
|
|
262
|
+
title: "测面",
|
|
263
|
+
class: A([
|
|
264
|
+
"hiper-map-tools-btn",
|
|
265
|
+
c.value == "measure_area" ? "active" : null
|
|
266
|
+
]),
|
|
267
|
+
onClick: a[2] || (a[2] = () => g("measure_area"))
|
|
268
|
+
}, [...a[5] || (a[5] = [
|
|
269
|
+
i("span", { class: "qyuan icon-multi-triangular" }, null, -1)
|
|
270
|
+
])], 2)) : _("", !0),
|
|
271
|
+
C.tools.includes("clear_all") ? (y(), f("div", {
|
|
272
|
+
key: 2,
|
|
273
|
+
title: "清除所有临时绘制图形",
|
|
274
|
+
class: "hiper-map-tools-btn",
|
|
275
|
+
style: { border: "none" },
|
|
276
|
+
onClick: a[3] || (a[3] = () => g("clear_all"))
|
|
277
|
+
}, [...a[6] || (a[6] = [
|
|
278
|
+
i("span", { class: "qyuan icon-clear" }, null, -1)
|
|
279
|
+
])])) : _("", !0)
|
|
280
|
+
])
|
|
281
|
+
], 64));
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
pe as _
|
|
286
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=Symbol("selectTopics"),s=Symbol("dbfDataRequest"),t=Symbol("researchDataRequest"),a=Symbol("geographicLayerList"),y=Symbol("mapInstance"),c=Symbol("thirdPartyLayers"),r=Symbol("permissionCheck");exports.dbfDataRequestKey=s;exports.geographicLayerListKey=a;exports.mapInstanceKey=y;exports.permissionCheckKey=r;exports.researchDataRequestKey=t;exports.selectTopicsKey=e;exports.thirdPartyLayersKey=c;
|