@sword916/vae-map-plus 1.0.0 → 1.0.1
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/lib/index.js +5376 -0
- package/lib/style.css +1 -0
- package/lib/vae-amap/favicon.ico +0 -0
- package/lib/vae-amap/images/game.png +0 -0
- package/lib/vae-amap/images/grid.png +0 -0
- package/lib/vae-amap/images/marker.png +0 -0
- package/lib/vae-amap/index.js +209 -0
- package/lib/vae-amap/style.css +1 -0
- package/lib/vae-cloudmap/favicon.ico +0 -0
- package/lib/vae-cloudmap/images/game.png +0 -0
- package/lib/vae-cloudmap/images/grid.png +0 -0
- package/lib/vae-cloudmap/images/marker.png +0 -0
- package/lib/vae-cloudmap/index.html +30 -0
- package/lib/vae-cloudmap/index.js +4085 -0
- package/lib/vae-cloudmap/style.css +1 -0
- package/lib/vae-map/favicon.ico +0 -0
- package/lib/vae-map/images/game.png +0 -0
- package/lib/vae-map/images/grid.png +0 -0
- package/lib/vae-map/images/marker.png +0 -0
- package/lib/vae-map/index.html +30 -0
- package/lib/vae-map/index.js +4322 -0
- package/lib/vae-map/style.css +1 -0
- package/package.json +1 -1
- package/plugins/L.AnimatedMarker/favicon.ico +0 -0
- package/plugins/L.AnimatedMarker/images/game.png +0 -0
- package/plugins/L.AnimatedMarker/images/grid.png +0 -0
- package/plugins/L.AnimatedMarker/images/marker.png +0 -0
- package/plugins/L.AnimatedMarker/index.html +30 -0
- package/plugins/L.AnimatedMarker/index.js +83 -0
- package/plugins/L.EchartsLayer/favicon.ico +0 -0
- package/plugins/L.EchartsLayer/images/game.png +0 -0
- package/plugins/L.EchartsLayer/images/grid.png +0 -0
- package/plugins/L.EchartsLayer/images/marker.png +0 -0
- package/plugins/L.EchartsLayer/index.html +30 -0
- package/plugins/L.EchartsLayer/index.js +176 -0
- package/plugins/L.FootageCalculator.Area/favicon.ico +0 -0
- package/plugins/L.FootageCalculator.Area/images/game.png +0 -0
- package/plugins/L.FootageCalculator.Area/images/grid.png +0 -0
- package/plugins/L.FootageCalculator.Area/images/marker.png +0 -0
- package/plugins/L.FootageCalculator.Area/index.html +30 -0
- package/plugins/L.FootageCalculator.Area/index.js +418 -0
- package/plugins/L.FootageCalculator.Line/favicon.ico +0 -0
- package/plugins/L.FootageCalculator.Line/images/game.png +0 -0
- package/plugins/L.FootageCalculator.Line/images/grid.png +0 -0
- package/plugins/L.FootageCalculator.Line/images/marker.png +0 -0
- package/plugins/L.FootageCalculator.Line/index.html +30 -0
- package/plugins/L.FootageCalculator.Line/index.js +416 -0
- package/plugins/L.GeoUtil/favicon.ico +0 -0
- package/plugins/L.GeoUtil/images/game.png +0 -0
- package/plugins/L.GeoUtil/images/grid.png +0 -0
- package/plugins/L.GeoUtil/images/marker.png +0 -0
- package/plugins/L.GeoUtil/index.html +30 -0
- package/plugins/L.GeoUtil/index.js +279 -0
- package/plugins/L.Glyphicon/favicon.ico +0 -0
- package/plugins/L.Glyphicon/images/game.png +0 -0
- package/plugins/L.Glyphicon/images/grid.png +0 -0
- package/plugins/L.Glyphicon/images/marker.png +0 -0
- package/plugins/L.Glyphicon/index.html +30 -0
- package/plugins/L.Glyphicon/index.js +57 -0
- package/plugins/L.Glyphicon/style.css +1 -0
- package/plugins/L.MarkerClusterX/favicon.ico +0 -0
- package/plugins/L.MarkerClusterX/images/game.png +0 -0
- package/plugins/L.MarkerClusterX/images/grid.png +0 -0
- package/plugins/L.MarkerClusterX/images/marker.png +0 -0
- package/plugins/L.MarkerClusterX/index.html +30 -0
- package/plugins/L.MarkerClusterX/index.js +33 -0
- package/plugins/L.MarkerClusterX/style.css +1 -0
- package/plugins/L.SafeDivOverlay/favicon.ico +0 -0
- package/plugins/L.SafeDivOverlay/images/game.png +0 -0
- package/plugins/L.SafeDivOverlay/images/grid.png +0 -0
- package/plugins/L.SafeDivOverlay/images/marker.png +0 -0
- package/plugins/L.SafeDivOverlay/index.html +30 -0
- package/plugins/L.SafeDivOverlay/index.js +26 -0
- package/plugins/L.TileLayer.ChinaProvider/favicon.ico +0 -0
- package/plugins/L.TileLayer.ChinaProvider/images/game.png +0 -0
- package/plugins/L.TileLayer.ChinaProvider/images/grid.png +0 -0
- package/plugins/L.TileLayer.ChinaProvider/images/marker.png +0 -0
- package/plugins/L.TileLayer.ChinaProvider/index.html +30 -0
- package/plugins/L.TileLayer.ChinaProvider/index.js +91 -0
- package/plugins/L.VuePopup/favicon.ico +0 -0
- package/plugins/L.VuePopup/images/game.png +0 -0
- package/plugins/L.VuePopup/images/grid.png +0 -0
- package/plugins/L.VuePopup/images/marker.png +0 -0
- package/plugins/L.VuePopup/index.html +30 -0
- package/plugins/L.VuePopup/index.js +68 -0
- package/plugins/L.VueTooltip/favicon.ico +0 -0
- package/plugins/L.VueTooltip/images/game.png +0 -0
- package/plugins/L.VueTooltip/images/grid.png +0 -0
- package/plugins/L.VueTooltip/images/marker.png +0 -0
- package/plugins/L.VueTooltip/index.html +30 -0
- package/plugins/L.VueTooltip/index.js +68 -0
- package/plugins/Mixin.Map.Measure/favicon.ico +0 -0
- package/plugins/Mixin.Map.Measure/images/game.png +0 -0
- package/plugins/Mixin.Map.Measure/images/grid.png +0 -0
- package/plugins/Mixin.Map.Measure/images/marker.png +0 -0
- package/plugins/Mixin.Map.Measure/index.html +30 -0
- package/plugins/Mixin.Map.Measure/index.js +84 -0
- package/plugins/globals/favicon.ico +0 -0
- package/plugins/globals/images/game.png +0 -0
- package/plugins/globals/images/grid.png +0 -0
- package/plugins/globals/images/marker.png +0 -0
- package/plugins/globals/index.html +30 -0
- package/plugins/globals/index.js +4 -0
- package/build/index.mjs +0 -113
- package/examples/App.vue +0 -18
- package/examples/index.js +0 -13
- package/examples/router/index.js +0 -35
- package/examples/views/amap.vue +0 -29
- package/examples/views/amarker.vue +0 -58
- package/examples/views/buffer.vue +0 -66
- package/examples/views/cluster.vue +0 -74
- package/examples/views/cover.vue +0 -85
- package/examples/views/draw-line.vue +0 -49
- package/examples/views/draw.vue +0 -54
- package/examples/views/echarts.vue +0 -142
- package/examples/views/emarker.vue +0 -39
- package/examples/views/image.vue +0 -182
- package/examples/views/index.vue +0 -61
- package/examples/views/lrmap.vue +0 -108
- package/examples/views/map.vue +0 -82
- package/examples/views/measure.vue +0 -86
- package/examples/views/parts/popup.vue +0 -39
- package/examples/views/parts/tooltip.vue +0 -39
- package/examples/views/push-area.vue +0 -52
- package/examples/views/push-line.vue +0 -84
- package/examples/views/trace.vue +0 -49
- package/jsconfig.json +0 -17
- package/src/components/resize-listener/component.jsx +0 -30
- package/src/components/resize-listener/index.js +0 -3
- package/src/composables/useAutoMessage.js +0 -41
- package/src/composables/useContextMenu.js +0 -99
- package/src/composables/useMapMeasure.js +0 -191
- package/src/composables/useResizeObserver.js +0 -81
- package/src/mixins/message.js +0 -1
- package/src/packages/index.js +0 -16
- package/src/packages/vae-amap/index.js +0 -8
- package/src/packages/vae-amap/style.less +0 -9
- package/src/packages/vae-amap/vae-amap.jsx +0 -98
- package/src/packages/vae-cloudmap/ctrl-context-menu/index.vue +0 -74
- package/src/packages/vae-cloudmap/ctrl-draw/index.vue +0 -499
- package/src/packages/vae-cloudmap/ctrl-draw-line/index.vue +0 -161
- package/src/packages/vae-cloudmap/index.js +0 -57
- package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/index.js +0 -2690
- package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/style.css +0 -14
- package/src/packages/vae-cloudmap/scripts/L.Vae.CRS/index.js +0 -212
- package/src/packages/vae-cloudmap/scripts/L.Vae.Client/index.js +0 -780
- package/src/packages/vae-cloudmap/scripts/Mixin.ContextMenu/index.js +0 -101
- package/src/packages/vae-cloudmap/style.less +0 -163
- package/src/packages/vae-cloudmap/vae-cloudmap.jsx +0 -272
- package/src/packages/vae-map/ctrl-context-menu/index.vue +0 -74
- package/src/packages/vae-map/ctrl-draw/index.vue +0 -498
- package/src/packages/vae-map/ctrl-draw-line/index.vue +0 -128
- package/src/packages/vae-map/index.js +0 -59
- package/src/packages/vae-map/scripts/L.MarkerCluster/index.js +0 -2690
- package/src/packages/vae-map/scripts/L.MarkerCluster/style.css +0 -14
- package/src/packages/vae-map/scripts/L.Vae.CRS/index.js +0 -114
- package/src/packages/vae-map/scripts/L.Vae.Client/index.js +0 -548
- package/src/packages/vae-map/scripts/Mixin.ContextMenu/index.js +0 -1
- package/src/packages/vae-map/style.less +0 -161
- package/src/packages/vae-map/vae-lrmap.jsx +0 -237
- package/src/packages/vae-map/vae-map.jsx +0 -135
- package/src/plugins/L.AnimatedMarker/index.js +0 -158
- package/src/plugins/L.EchartsLayer/index.js +0 -339
- package/src/plugins/L.ElasticMarker/index.js +0 -162
- package/src/plugins/L.FootageCalculator.Area/index.js +0 -263
- package/src/plugins/L.FootageCalculator.Line/index.js +0 -273
- package/src/plugins/L.GeoUtil/buffer.js +0 -67
- package/src/plugins/L.GeoUtil/index.js +0 -284
- package/src/plugins/L.Glyphicon/index.js +0 -91
- package/src/plugins/L.Glyphicon/style.less +0 -37
- package/src/plugins/L.MarkerClusterX/index.js +0 -93
- package/src/plugins/L.MarkerClusterX/style.less +0 -162
- package/src/plugins/L.SafeDivOverlay/index.js +0 -55
- package/src/plugins/L.TileLayer.ChinaProvider/index.js +0 -108
- package/src/plugins/L.VuePopup/index.js +0 -67
- package/src/plugins/L.VueTooltip/index.js +0 -63
- package/src/plugins/Mixin.Map.Measure/index.js +0 -248
- package/src/plugins/globals/index.js +0 -7
- package/src/utils/index.js +0 -36
- package/src/utils/resize-event.js +0 -45
- /package/{public → lib}/favicon.ico +0 -0
- /package/{public → lib}/images/game.png +0 -0
- /package/{public → lib}/images/grid.png +0 -0
- /package/{public → lib}/images/marker.png +0 -0
- /package/{public → lib/vae-amap}/index.html +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
9
|
+
<style type="text/css">
|
|
10
|
+
html {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<title>...</title>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<div id="app"></div>
|
|
28
|
+
</body>
|
|
29
|
+
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createApp as u } from "vue";
|
|
2
|
+
import { v4 as c } from "uuid";
|
|
3
|
+
const h = () => _.replace(c(), /-/g, ""), n = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function a(t) {
|
|
5
|
+
return {
|
|
6
|
+
width: t.contentRect.width,
|
|
7
|
+
height: t.contentRect.height,
|
|
8
|
+
visible: !!(t.contentRect.height && t.contentRect.width),
|
|
9
|
+
entry: t
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function d(t) {
|
|
13
|
+
let e = n.get(t);
|
|
14
|
+
return e || (e = {
|
|
15
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
16
|
+
observer: new ResizeObserver((i) => {
|
|
17
|
+
for (const s of i) {
|
|
18
|
+
const o = n.get(s.target);
|
|
19
|
+
if (!o)
|
|
20
|
+
continue;
|
|
21
|
+
const r = a(s);
|
|
22
|
+
o.listeners.forEach((p) => p(r));
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}, e.observer.observe(t), n.set(t, e)), e;
|
|
26
|
+
}
|
|
27
|
+
function l(t) {
|
|
28
|
+
const e = n.get(t);
|
|
29
|
+
!e || e.listeners.size > 0 || (e.observer.disconnect(), n.delete(t));
|
|
30
|
+
}
|
|
31
|
+
function v(t, e) {
|
|
32
|
+
return !t || typeof e != "function" ? () => {
|
|
33
|
+
} : (d(t).listeners.add(e), () => {
|
|
34
|
+
const s = n.get(t);
|
|
35
|
+
s && (s.listeners.delete(e), l(t));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
L.VuePopup = L.Popup.extend({
|
|
39
|
+
app: null,
|
|
40
|
+
stopResize: null,
|
|
41
|
+
options: {
|
|
42
|
+
vueInstance: null,
|
|
43
|
+
props: null
|
|
44
|
+
},
|
|
45
|
+
initialize(t) {
|
|
46
|
+
L.setOptions(this, t), this._bindEvents(), L.Popup.prototype.initialize.call(this, _.omit(this.options, ["vueInstance", "props"]));
|
|
47
|
+
},
|
|
48
|
+
_bindEvents() {
|
|
49
|
+
this.options.vueInstance && (this.on("add", () => {
|
|
50
|
+
const t = () => {
|
|
51
|
+
this._updateVuePopup();
|
|
52
|
+
}, e = `vue-popup-${h()}`;
|
|
53
|
+
this.setContent(`<div id="${e}"></div>`), queueMicrotask(() => {
|
|
54
|
+
const i = document.getElementById(e);
|
|
55
|
+
i && (this.app = u(this.options.vueInstance, this.options.props ?? {}), this.app.mount(i), this.stopResize = v(i, t));
|
|
56
|
+
});
|
|
57
|
+
}), this.on("remove", () => {
|
|
58
|
+
var t, e;
|
|
59
|
+
(t = this.stopResize) == null || t.call(this), this.stopResize = null, (e = this.app) == null || e.unmount(), this.app = null;
|
|
60
|
+
}));
|
|
61
|
+
},
|
|
62
|
+
_updateVuePopup() {
|
|
63
|
+
!this._map || !this._latlng || !this._container || (this._container.style.visibility = "hidden", this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan());
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
L.vuePopup = function(t) {
|
|
67
|
+
return new L.VuePopup(t);
|
|
68
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
9
|
+
<style type="text/css">
|
|
10
|
+
html {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<title>...</title>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<div id="app"></div>
|
|
28
|
+
</body>
|
|
29
|
+
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createApp as u } from "vue";
|
|
2
|
+
import { v4 as c } from "uuid";
|
|
3
|
+
const h = () => _.replace(c(), /-/g, ""), n = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function l(t) {
|
|
5
|
+
return {
|
|
6
|
+
width: t.contentRect.width,
|
|
7
|
+
height: t.contentRect.height,
|
|
8
|
+
visible: !!(t.contentRect.height && t.contentRect.width),
|
|
9
|
+
entry: t
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function d(t) {
|
|
13
|
+
let e = n.get(t);
|
|
14
|
+
return e || (e = {
|
|
15
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
16
|
+
observer: new ResizeObserver((i) => {
|
|
17
|
+
for (const o of i) {
|
|
18
|
+
const s = n.get(o.target);
|
|
19
|
+
if (!s)
|
|
20
|
+
continue;
|
|
21
|
+
const r = l(o);
|
|
22
|
+
s.listeners.forEach((p) => p(r));
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}, e.observer.observe(t), n.set(t, e)), e;
|
|
26
|
+
}
|
|
27
|
+
function a(t) {
|
|
28
|
+
const e = n.get(t);
|
|
29
|
+
!e || e.listeners.size > 0 || (e.observer.disconnect(), n.delete(t));
|
|
30
|
+
}
|
|
31
|
+
function f(t, e) {
|
|
32
|
+
return !t || typeof e != "function" ? () => {
|
|
33
|
+
} : (d(t).listeners.add(e), () => {
|
|
34
|
+
const o = n.get(t);
|
|
35
|
+
o && (o.listeners.delete(e), a(t));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
L.VueTooltip = L.Tooltip.extend({
|
|
39
|
+
app: null,
|
|
40
|
+
stopResize: null,
|
|
41
|
+
options: {
|
|
42
|
+
vueInstance: null,
|
|
43
|
+
props: null
|
|
44
|
+
},
|
|
45
|
+
initialize(t) {
|
|
46
|
+
L.setOptions(this, t), this._bindEvents(), L.Tooltip.prototype.initialize.call(this, _.omit(this.options, ["vueInstance", "props"]));
|
|
47
|
+
},
|
|
48
|
+
_bindEvents() {
|
|
49
|
+
this.options.vueInstance && (this.on("add", () => {
|
|
50
|
+
const t = () => {
|
|
51
|
+
this._updateVueTooltip();
|
|
52
|
+
}, e = `vue-tooltip-${h()}`;
|
|
53
|
+
this.setContent(`<div id="${e}"></div>`), queueMicrotask(() => {
|
|
54
|
+
const i = document.getElementById(e);
|
|
55
|
+
i && (this.app = u(this.options.vueInstance, this.options.props ?? {}), this.app.mount(i), this.stopResize = f(i, t));
|
|
56
|
+
});
|
|
57
|
+
}), this.on("remove", () => {
|
|
58
|
+
var t, e;
|
|
59
|
+
(t = this.stopResize) == null || t.call(this), this.stopResize = null, (e = this.app) == null || e.unmount(), this.app = null;
|
|
60
|
+
}));
|
|
61
|
+
},
|
|
62
|
+
_updateVueTooltip() {
|
|
63
|
+
!this._map || !this._latlng || !this._container || this._updatePosition();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
L.vueTooltip = function(t) {
|
|
67
|
+
return new L.VueTooltip(t);
|
|
68
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
9
|
+
<style type="text/css">
|
|
10
|
+
html {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<title>...</title>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<div id="app"></div>
|
|
28
|
+
</body>
|
|
29
|
+
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ref as k, onBeforeUnmount as D } from "vue";
|
|
2
|
+
let e, s = L.featureGroup(), r = L.featureGroup(), l, u = [], v, i, g = [], h, c, d;
|
|
3
|
+
const f = {
|
|
4
|
+
// 管理绘制的覆盖物
|
|
5
|
+
onLayerCreate(a) {
|
|
6
|
+
if (a.layer.remove().addTo(s), a.shape == "Polygon") {
|
|
7
|
+
const t = y(L.GeoUtil.readableArea(h));
|
|
8
|
+
L.marker(l, { interactive: !1 }).setIcon(t).addTo(s);
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
// 绘制开始
|
|
12
|
+
onDrawStart(a) {
|
|
13
|
+
const t = a.workingLayer;
|
|
14
|
+
a.shape == "Line" ? (e.on("mousemove", w), t.on("pm:vertexadded", (n) => {
|
|
15
|
+
const o = L.marker(n.latlng, { interactive: !1 });
|
|
16
|
+
if (u = t._latlngs, u.length == 1)
|
|
17
|
+
o.setIcon(y("测距起点")).addTo(r);
|
|
18
|
+
else {
|
|
19
|
+
const p = L.GeometryUtil.readableDistance(v);
|
|
20
|
+
o.setIcon(y(p)).addTo(r);
|
|
21
|
+
}
|
|
22
|
+
})) : a.shape == "Polygon" && (e.on("mousemove", M), t.on("pm:vertexadded", (n) => {
|
|
23
|
+
g = t._latlngs;
|
|
24
|
+
}));
|
|
25
|
+
},
|
|
26
|
+
// 绘制结束
|
|
27
|
+
onDrawEnd(a) {
|
|
28
|
+
a.shape == "Line" ? (e.off("mousemove", w), i && (r.removeLayer(i), i = null), u = [], l = null, v = null) : a.shape == "Polygon" && (e.off("mousemove", M), c && (r.removeLayer(c), c = null), d && (r.removeLayer(d), d = null), g = [], l = null, h = null), r.eachLayer((t) => {
|
|
29
|
+
r.removeLayer(t), t.addTo(s);
|
|
30
|
+
}), r.clearLayers(), T();
|
|
31
|
+
}
|
|
32
|
+
}, I = () => {
|
|
33
|
+
e.on("pm:create", f.onLayerCreate), e.on("pm:drawstart", f.onDrawStart), e.on("pm:drawend", f.onDrawEnd);
|
|
34
|
+
}, T = () => {
|
|
35
|
+
e.off("pm:create", f.onLayerCreate), e.off("pm:drawstart", f.onDrawStart), e.off("pm:drawend", f.onDrawEnd);
|
|
36
|
+
}, w = _.throttle((a) => {
|
|
37
|
+
l = a.latlng;
|
|
38
|
+
const t = _.concat(u, l);
|
|
39
|
+
if (v = L.GeoUtil.distanceByLatLngs(t, e), u.length > 0) {
|
|
40
|
+
const n = y(L.GeometryUtil.readableDistance(v), "dark");
|
|
41
|
+
i ? i.setIcon(n).setLatLng(l) : i = L.marker(l, { interactive: !1 }).setIcon(n).addTo(r);
|
|
42
|
+
}
|
|
43
|
+
}, 20), M = _.throttle((a) => {
|
|
44
|
+
l = a.latlng;
|
|
45
|
+
const t = _.concat(g, l);
|
|
46
|
+
let n = !0;
|
|
47
|
+
if (e.vae && !e.vae.crs.code && (n = !1), h = n ? L.GeoUtil.areaByLatLngs(t) : L.GeoUtil.areaByPoints(t.map((o) => ({ x: o.lat, y: o.lng }))), g.length > 1) {
|
|
48
|
+
const o = y(L.GeoUtil.readableArea(h), "dark");
|
|
49
|
+
c ? c.setIcon(o).setLatLng(l) : c = L.marker(l, { interactive: !1 }).setIcon(o).addTo(r), d ? d.setLatLngs(t) : d = L.polygon(g, { stroke: !1, fillOpacity: 0.1 }).addTo(r);
|
|
50
|
+
}
|
|
51
|
+
}, 20), y = (a, t) => {
|
|
52
|
+
const n = a.length > 6 ? (a.length - 6) * 5 + 60 : 60;
|
|
53
|
+
return L.divIcon({
|
|
54
|
+
html: `<div>${a}</div>`,
|
|
55
|
+
className: `icon--simple-text ${t}`,
|
|
56
|
+
iconSize: [n, 18]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
function G() {
|
|
60
|
+
const a = k(!1), t = (m) => {
|
|
61
|
+
e = m, e.pm.setLang("zh"), s.clearLayers().addTo(e), r.clearLayers().addTo(e);
|
|
62
|
+
}, n = (m) => {
|
|
63
|
+
I(), e.pm.enableDraw(m), a.value = !0;
|
|
64
|
+
}, o = () => {
|
|
65
|
+
r.clearLayers(), e.pm.Draw.getShapes().forEach((m) => {
|
|
66
|
+
e.pm.disableDraw(m);
|
|
67
|
+
}), s.getLayers().length == 0 && (a.value = !1);
|
|
68
|
+
}, p = () => {
|
|
69
|
+
o(), s.clearLayers(), a.value = !1;
|
|
70
|
+
};
|
|
71
|
+
return D(() => {
|
|
72
|
+
p(), e && (e.removeLayer(s), e.removeLayer(r));
|
|
73
|
+
}), {
|
|
74
|
+
DrawStatus: a,
|
|
75
|
+
EnableMeasure: t,
|
|
76
|
+
StartMeasure: n,
|
|
77
|
+
CancelMeasure: o,
|
|
78
|
+
ClearMeasure: p
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
G as default,
|
|
83
|
+
G as useMapMeasure
|
|
84
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
9
|
+
<style type="text/css">
|
|
10
|
+
html {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<title>...</title>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
<div id="app"></div>
|
|
28
|
+
</body>
|
|
29
|
+
|
|
30
|
+
</html>
|
package/build/index.mjs
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import { promises as fs } from 'fs'
|
|
3
|
-
import { fileURLToPath } from 'url'
|
|
4
|
-
import { build } from 'vite'
|
|
5
|
-
import vue from '@vitejs/plugin-vue'
|
|
6
|
-
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
7
|
-
|
|
8
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
-
const rootDir = path.resolve(__dirname, '..')
|
|
10
|
-
|
|
11
|
-
const external = [
|
|
12
|
-
'vue',
|
|
13
|
-
'lodash',
|
|
14
|
-
'axios',
|
|
15
|
-
'leaflet',
|
|
16
|
-
'proj4',
|
|
17
|
-
'proj4leaflet',
|
|
18
|
-
'leaflet-geometryutil',
|
|
19
|
-
'jquery',
|
|
20
|
-
'uuid',
|
|
21
|
-
'@geoman-io/leaflet-geoman-free',
|
|
22
|
-
'@turf/buffer',
|
|
23
|
-
'leaflet.markercluster',
|
|
24
|
-
'echarts'
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
const packageEntries = [
|
|
28
|
-
{ entry: 'src/packages/index.js', outDir: 'lib' },
|
|
29
|
-
{ entry: 'src/packages/vae-amap/index.js', outDir: 'lib/vae-amap' },
|
|
30
|
-
{ entry: 'src/packages/vae-map/index.js', outDir: 'lib/vae-map' },
|
|
31
|
-
{ entry: 'src/packages/vae-cloudmap/index.js', outDir: 'lib/vae-cloudmap' }
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
const pluginEntries = [
|
|
35
|
-
'globals',
|
|
36
|
-
'L.AnimatedMarker',
|
|
37
|
-
'L.EchartsLayer',
|
|
38
|
-
'L.FootageCalculator.Area',
|
|
39
|
-
'L.FootageCalculator.Line',
|
|
40
|
-
'L.GeoUtil',
|
|
41
|
-
'L.Glyphicon',
|
|
42
|
-
'L.MarkerClusterX',
|
|
43
|
-
'L.SafeDivOverlay',
|
|
44
|
-
'L.TileLayer.ChinaProvider',
|
|
45
|
-
'L.VuePopup',
|
|
46
|
-
'L.VueTooltip',
|
|
47
|
-
'Mixin.Map.Measure'
|
|
48
|
-
].map((name) => ({
|
|
49
|
-
entry: `src/plugins/${name}/index.js`,
|
|
50
|
-
outDir: `plugins/${name}`
|
|
51
|
-
}))
|
|
52
|
-
|
|
53
|
-
function createViteConfig(entry, outDir) {
|
|
54
|
-
return {
|
|
55
|
-
configFile: false,
|
|
56
|
-
plugins: [vue(), vueJsx()],
|
|
57
|
-
resolve: {
|
|
58
|
-
alias: {
|
|
59
|
-
'@': path.resolve(rootDir, 'src')
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
build: {
|
|
63
|
-
outDir: path.resolve(rootDir, outDir),
|
|
64
|
-
emptyOutDir: true,
|
|
65
|
-
sourcemap: false,
|
|
66
|
-
cssCodeSplit: false,
|
|
67
|
-
lib: {
|
|
68
|
-
entry: path.resolve(rootDir, entry),
|
|
69
|
-
formats: ['es'],
|
|
70
|
-
fileName: () => 'index'
|
|
71
|
-
},
|
|
72
|
-
rollupOptions: {
|
|
73
|
-
external,
|
|
74
|
-
output: {
|
|
75
|
-
entryFileNames: 'index.js',
|
|
76
|
-
assetFileNames: ({ name }) => {
|
|
77
|
-
if (name?.endsWith('.css')) {
|
|
78
|
-
return 'style.css'
|
|
79
|
-
}
|
|
80
|
-
return 'assets/[name][extname]'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async function removeDirIfExists(target) {
|
|
89
|
-
await fs.rm(path.resolve(rootDir, target), { recursive: true, force: true })
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async function buildEntry({ entry, outDir }) {
|
|
93
|
-
await build(createViteConfig(entry, outDir))
|
|
94
|
-
console.log(`built ${entry} -> ${outDir}`)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async function run() {
|
|
98
|
-
await removeDirIfExists('lib')
|
|
99
|
-
await removeDirIfExists('plugins')
|
|
100
|
-
|
|
101
|
-
for (const item of packageEntries) {
|
|
102
|
-
await buildEntry(item)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
for (const item of pluginEntries) {
|
|
106
|
-
await buildEntry(item)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
run().catch((error) => {
|
|
111
|
-
console.error(error)
|
|
112
|
-
process.exit(1)
|
|
113
|
-
})
|
package/examples/App.vue
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<router-view />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<style lang="less">
|
|
6
|
-
html,body{
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
}
|
|
10
|
-
#app {
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
margin: 0;
|
|
14
|
-
padding: 0;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
package/examples/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import ElementPlus from 'element-plus'
|
|
3
|
-
import 'element-plus/dist/index.css'
|
|
4
|
-
import '@fortawesome/fontawesome-free/css/all.css'
|
|
5
|
-
import App from './App.vue'
|
|
6
|
-
import router from './router'
|
|
7
|
-
import VaeMap from '@/packages'
|
|
8
|
-
|
|
9
|
-
createApp(App)
|
|
10
|
-
.use(router)
|
|
11
|
-
.use(ElementPlus)
|
|
12
|
-
.use(VaeMap)
|
|
13
|
-
.mount('#app')
|
package/examples/router/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
2
|
-
|
|
3
|
-
const routes = [
|
|
4
|
-
{
|
|
5
|
-
path: '/',
|
|
6
|
-
redirect: '/views/map'
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
path: '/views',
|
|
10
|
-
component: () => import('../views/index.vue'),
|
|
11
|
-
children: [
|
|
12
|
-
{ path: 'amap', component: () => import('../views/amap.vue') },
|
|
13
|
-
{ path: 'map', component: () => import('../views/map.vue') },
|
|
14
|
-
{ path: 'lrmap', component: () => import('../views/lrmap.vue') },
|
|
15
|
-
{ path: 'push-area', component: () => import('../views/push-area.vue') },
|
|
16
|
-
{ path: 'push-line', component: () => import('../views/push-line.vue') },
|
|
17
|
-
{ path: 'echarts', component: () => import('../views/echarts.vue') },
|
|
18
|
-
{ path: 'trace', component: () => import('../views/trace.vue') },
|
|
19
|
-
{ path: 'cluster', component: () => import('../views/cluster.vue') },
|
|
20
|
-
{ path: 'cover', component: () => import('../views/cover.vue') },
|
|
21
|
-
{ path: 'draw', component: () => import('../views/draw.vue') },
|
|
22
|
-
{ path: 'draw-line', component: () => import('../views/draw-line.vue') },
|
|
23
|
-
{ path: 'measure', component: () => import('../views/measure.vue') },
|
|
24
|
-
{ path: 'amarker', component: () => import('../views/amarker.vue') },
|
|
25
|
-
{ path: 'emarker', component: () => import('../views/emarker.vue') },
|
|
26
|
-
{ path: 'buffer', component: () => import('../views/buffer.vue') },
|
|
27
|
-
{ path: 'image', component: () => import('../views/image.vue') }
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
export default createRouter({
|
|
33
|
-
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
34
|
-
routes
|
|
35
|
-
})
|
package/examples/views/amap.vue
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vae-amap :api-key="key" :options="options" @amap-ready="setOptions" @init-map="initMap" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
import { ref } from 'vue'
|
|
7
|
-
|
|
8
|
-
const amap = ref(null)
|
|
9
|
-
const key = '1a346e3ea95a3227a097cabf11a901b7'
|
|
10
|
-
const options = ref(null)
|
|
11
|
-
|
|
12
|
-
const setOptions = async () => {
|
|
13
|
-
options.value = {
|
|
14
|
-
viewMode: '3D',
|
|
15
|
-
zoom: 8,
|
|
16
|
-
layers: [new AMap.TileLayer.Satellite(), new AMap.Buildings()]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const initMap = (value) => {
|
|
21
|
-
amap.value = value
|
|
22
|
-
amap.value.setZoom(12, false, 2500)
|
|
23
|
-
amap.value.setRotation(45, false, 2500)
|
|
24
|
-
amap.value.setPitch(45, false, 2500)
|
|
25
|
-
amap.value.on('zoomend', () => {
|
|
26
|
-
amap.value.setZoom(18, false, 2500)
|
|
27
|
-
}, amap.value, true)
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="map-container">
|
|
3
|
-
<vae-map :base-layers="baseLayers" @init-map="initMap" />
|
|
4
|
-
<div class="tools">
|
|
5
|
-
<el-button size="small" @click="startMove">开始</el-button>
|
|
6
|
-
<el-button size="small" @click="pauseMove">暂停</el-button>
|
|
7
|
-
<el-button size="small" @click="continueMove">继续</el-button>
|
|
8
|
-
<el-button size="small" @click="stopMove">结束</el-button>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script setup>
|
|
14
|
-
import { ref } from 'vue'
|
|
15
|
-
|
|
16
|
-
const latLngs = [
|
|
17
|
-
{ lat: 34.26572889446933, lng: 117.14584350585939 },
|
|
18
|
-
{ lat: 34.25324367127495, lng: 117.20352172851564 },
|
|
19
|
-
{ lat: 34.27083595165, lng: 117.23888397216798 },
|
|
20
|
-
{ lat: 34.25920275895473, lng: 117.30411529541017 },
|
|
21
|
-
{ lat: 34.288991865037524, lng: 117.35321044921876 },
|
|
22
|
-
{ lat: 34.277077489205695, lng: 117.3992156982422 }
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
const map = ref(null)
|
|
26
|
-
const baseLayers = ['GaoDe.Normal.Map']
|
|
27
|
-
const aMarker = ref(null)
|
|
28
|
-
|
|
29
|
-
const initMap = (value) => {
|
|
30
|
-
map.value = value
|
|
31
|
-
aMarker.value = L.animatedMarker({ latLngs })
|
|
32
|
-
.setLatLng(latLngs[0])
|
|
33
|
-
.setIcon(L.glyphicon({
|
|
34
|
-
icon: 'fas fa-baby',
|
|
35
|
-
color: 'black'
|
|
36
|
-
}))
|
|
37
|
-
.addTo(map.value)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const startMove = () => aMarker.value?.startMove()
|
|
41
|
-
const pauseMove = () => aMarker.value?.pauseMove()
|
|
42
|
-
const continueMove = () => aMarker.value?.continueMove()
|
|
43
|
-
const stopMove = () => aMarker.value?.stopMove()
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<style lang="less" scoped>
|
|
47
|
-
.map-container {
|
|
48
|
-
height: 100%;
|
|
49
|
-
position: relative;
|
|
50
|
-
|
|
51
|
-
.tools {
|
|
52
|
-
position: absolute;
|
|
53
|
-
right: 10px;
|
|
54
|
-
top: 10px;
|
|
55
|
-
z-index: 2000;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</style>
|