@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
package/examples/views/index.vue
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="examples">
|
|
3
|
-
<el-button @click="navi = true" type="primary" class="toggle">菜单</el-button>
|
|
4
|
-
<el-drawer v-model="navi" :show-close="false">
|
|
5
|
-
<el-row :gutter="10">
|
|
6
|
-
<el-col v-for="item in navis" :key="item" :span="8">
|
|
7
|
-
<el-button size="small" style="width: 100%" @click="routeTo(item)">{{ item }}</el-button>
|
|
8
|
-
</el-col>
|
|
9
|
-
</el-row>
|
|
10
|
-
</el-drawer>
|
|
11
|
-
<router-view />
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script setup>
|
|
16
|
-
import { ref } from 'vue'
|
|
17
|
-
import { useRouter } from 'vue-router'
|
|
18
|
-
|
|
19
|
-
const router = useRouter()
|
|
20
|
-
const navi = ref(false)
|
|
21
|
-
const navis = ['amap', 'map', 'lrmap', 'push-area', 'push-line', 'echarts', 'trace', 'cluster', 'cover', 'draw', 'draw-line', 'measure', 'amarker', 'emarker', 'buffer', 'image']
|
|
22
|
-
|
|
23
|
-
const routeTo = (path) => {
|
|
24
|
-
router.push(`/views/${path}`).finally(() => {
|
|
25
|
-
navi.value = false
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<style lang="less">
|
|
31
|
-
.examples {
|
|
32
|
-
position: relative;
|
|
33
|
-
height: 100%;
|
|
34
|
-
|
|
35
|
-
.el-drawer__header {
|
|
36
|
-
padding: 0;
|
|
37
|
-
margin: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.el-drawer__body {
|
|
41
|
-
padding: 10px;
|
|
42
|
-
|
|
43
|
-
.el-col {
|
|
44
|
-
text-align: center;
|
|
45
|
-
margin-top: 20px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.el-button {
|
|
49
|
-
width: 88px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.toggle {
|
|
54
|
-
position: absolute;
|
|
55
|
-
top: calc(50% - 20px);
|
|
56
|
-
right: 0;
|
|
57
|
-
z-index: 1500;
|
|
58
|
-
box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.5);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
</style>
|
package/examples/views/lrmap.vue
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="container">
|
|
3
|
-
<div class="actions">
|
|
4
|
-
<el-button type="success" size="small" @click="setLayerSet">切换图组</el-button>
|
|
5
|
-
<el-button type="primary" size="small" @click="getImage">缩略图</el-button>
|
|
6
|
-
<div style="background: #ccc">
|
|
7
|
-
<el-image :src="imageSrc" />
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
10
|
-
<div class="layers">
|
|
11
|
-
<el-tree ref="treeRef" :data="treeLayers" node-key="id" :default-checked-keys="visibleKeys" show-checkbox />
|
|
12
|
-
<div>
|
|
13
|
-
<el-button type="primary" size="small" @click="confirmLayers">确认</el-button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
<vae-lrmap :before-create="beforeCreate" :options="options" @init-map="initMap" @reload-map="initMap" />
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script setup>
|
|
21
|
-
import { computed, ref } from 'vue'
|
|
22
|
-
|
|
23
|
-
const treeRef = ref(null)
|
|
24
|
-
const map = ref(null)
|
|
25
|
-
const treeLayers = ref([])
|
|
26
|
-
const visibleKeys = ref([])
|
|
27
|
-
const imageSrc = ref(null)
|
|
28
|
-
|
|
29
|
-
const options = computed(() => ({
|
|
30
|
-
url: 'http://123.56.162.219:8702/gis-xzk/',
|
|
31
|
-
dsname: 'XZMKGIS',
|
|
32
|
-
rotate: true,
|
|
33
|
-
crs: 'bj54'
|
|
34
|
-
}))
|
|
35
|
-
|
|
36
|
-
const initMap = async (value) => {
|
|
37
|
-
map.value = value
|
|
38
|
-
treeLayers.value = map.value.vae.treeLayers
|
|
39
|
-
visibleKeys.value = map.value.vae.visibleKeys
|
|
40
|
-
|
|
41
|
-
const arr = [
|
|
42
|
-
[32.76422859210167, 116.46418594831812],
|
|
43
|
-
[32.759949154841145, 116.48346373812541],
|
|
44
|
-
[32.757756957291484, 116.4829576836318],
|
|
45
|
-
[32.7620293706736, 116.46364205232726]
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
L.polygon(arr, { fillColor: 'green', fillOpacity: 0.1 }).addTo(map.value).bindTooltip('测试', {
|
|
49
|
-
permanent: true,
|
|
50
|
-
direction: 'right',
|
|
51
|
-
className: 'nice-tooltip dark',
|
|
52
|
-
offset: [6, 28]
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const beforeCreate = (context) => new Promise((resolve) => {
|
|
57
|
-
_.delay(() => {
|
|
58
|
-
console.log(context)
|
|
59
|
-
resolve()
|
|
60
|
-
}, 500)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
const confirmLayers = () => {
|
|
64
|
-
map.value.vae.showLayers(treeRef.value.getCheckedKeys()).then((layers) => {
|
|
65
|
-
console.log(layers)
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const setLayerSet = async () => {
|
|
70
|
-
const keys = await map.value.vae.showLayerSets('安全监测监控系统图')
|
|
71
|
-
treeRef.value.setCheckedKeys(keys)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const getImage = () => {
|
|
75
|
-
map.value.vae.getThumbnail().then((imageData) => {
|
|
76
|
-
imageSrc.value = imageData
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<style lang="less" scoped>
|
|
82
|
-
.container {
|
|
83
|
-
height: 100%;
|
|
84
|
-
position: relative;
|
|
85
|
-
|
|
86
|
-
.actions {
|
|
87
|
-
position: absolute;
|
|
88
|
-
top: 10px;
|
|
89
|
-
left: 10px;
|
|
90
|
-
z-index: 1000;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.layers {
|
|
94
|
-
overflow: auto;
|
|
95
|
-
position: absolute;
|
|
96
|
-
top: 10px;
|
|
97
|
-
right: 10px;
|
|
98
|
-
z-index: 1000;
|
|
99
|
-
height: 600px;
|
|
100
|
-
width: 400px;
|
|
101
|
-
background: #f5f7fa;
|
|
102
|
-
|
|
103
|
-
:deep(.el-tree) {
|
|
104
|
-
background: #f5f7fa;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
</style>
|
package/examples/views/map.vue
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vae-map :base-layers="baseLayers" :options="options" :context-menu="menus" @init-map="initMap" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
import { ref } from 'vue'
|
|
7
|
-
import vpopup from './parts/popup.vue'
|
|
8
|
-
import vtooltip from './parts/tooltip.vue'
|
|
9
|
-
|
|
10
|
-
const map = ref(null)
|
|
11
|
-
const baseLayers = ref([])
|
|
12
|
-
const menus = ref([])
|
|
13
|
-
const options = ref({})
|
|
14
|
-
const latLngs = ref([])
|
|
15
|
-
const points = ref([])
|
|
16
|
-
|
|
17
|
-
const initMap = (value) => {
|
|
18
|
-
const icon = L.glyphicon({
|
|
19
|
-
icon: 'fab fa-alipay',
|
|
20
|
-
effect: {
|
|
21
|
-
type: 'halo'
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const marker = L.marker(value.getCenter()).setIcon(icon).addTo(value)
|
|
26
|
-
marker.bindPopup(L.vuePopup({ vueInstance: vpopup, props: { name: 'vae' } }))
|
|
27
|
-
marker.bindTooltip(L.vueTooltip({ vueInstance: vtooltip, props: { name: 'vae' } }), {
|
|
28
|
-
permanent: true,
|
|
29
|
-
direction: 'right',
|
|
30
|
-
offset: [10, 0]
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
baseLayers.value = ['GaoDe.Normal.Map']
|
|
34
|
-
_.delay(() => {
|
|
35
|
-
baseLayers.value = ['TianDiTu.Satellite.Map@1a346e3ea95a3227a097cabf11a901b7']
|
|
36
|
-
}, 3000)
|
|
37
|
-
|
|
38
|
-
map.value = value
|
|
39
|
-
|
|
40
|
-
const polygonLatlngs = [
|
|
41
|
-
[37, -109.05],
|
|
42
|
-
[41, -109.03],
|
|
43
|
-
[41, -102.05],
|
|
44
|
-
[37, -102.04]
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
const polygon = L.polygon(polygonLatlngs, { color: 'red' }).addTo(map.value)
|
|
48
|
-
polygon.bindTooltip(L.vueTooltip({ vueInstance: vtooltip, props: { name: 'vae' } }), {
|
|
49
|
-
permanent: true,
|
|
50
|
-
direction: 'right',
|
|
51
|
-
offset: [10, 0]
|
|
52
|
-
})
|
|
53
|
-
map.value.fitBounds(polygon.getBounds())
|
|
54
|
-
|
|
55
|
-
menus.value = [
|
|
56
|
-
{
|
|
57
|
-
text: 'hello world',
|
|
58
|
-
callback: (event) => {
|
|
59
|
-
L.marker(event.latlng).addTo(map.value)
|
|
60
|
-
if (points.value.length !== 4) {
|
|
61
|
-
latLngs.value.push(event.latlng)
|
|
62
|
-
if (latLngs.value.length === 4) {
|
|
63
|
-
L.polygon(latLngs.value).addTo(map.value)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
text: 'zoom in',
|
|
70
|
-
divided: true
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
text: 'zoom out'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
text: 'fly to',
|
|
77
|
-
divided: true,
|
|
78
|
-
disabled: true
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="map-container">
|
|
3
|
-
<vae-lrmap :options="options" @init-map="initMap" />
|
|
4
|
-
<span class="actions">
|
|
5
|
-
<div style="text-align: right">
|
|
6
|
-
<el-button size="small" type="danger" @click="ClearMeasure">清理</el-button>
|
|
7
|
-
<el-button size="small" type="warning" @click="CancelMeasure">取消当前</el-button>
|
|
8
|
-
<el-button size="small" type="primary" @click="StartMeasure('Line')">测距</el-button>
|
|
9
|
-
<el-button size="small" type="primary" @click="StartMeasure('Polygon')">测面积</el-button>
|
|
10
|
-
</div>
|
|
11
|
-
<div style="margin-top: 10px; text-align: right">
|
|
12
|
-
<el-button size="small">绘制状态 # {{ DrawStatus }}</el-button>
|
|
13
|
-
<el-button size="small" type="danger" @click="clearDrawSegement">清理线段</el-button>
|
|
14
|
-
<el-button size="small" type="info" @click="drawSegement">画线段 # 非测距</el-button>
|
|
15
|
-
</div>
|
|
16
|
-
</span>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script setup>
|
|
21
|
-
import { ref } from 'vue'
|
|
22
|
-
import { useMapMeasure } from '@/composables/useMapMeasure'
|
|
23
|
-
|
|
24
|
-
const { DrawStatus, EnableMeasure, StartMeasure, CancelMeasure, ClearMeasure } = useMapMeasure()
|
|
25
|
-
|
|
26
|
-
const map = ref(null)
|
|
27
|
-
const drawItems = L.layerGroup()
|
|
28
|
-
const options = {
|
|
29
|
-
url: 'http://58.218.64.10:38500/',
|
|
30
|
-
dsname: 'XS_MLGIS',
|
|
31
|
-
crs: 'bj54',
|
|
32
|
-
defaultLayerSets: ['采掘工程平面图>8煤']
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const initMap = (value) => {
|
|
36
|
-
map.value = value
|
|
37
|
-
EnableMeasure(value)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const drawSegement = () => {
|
|
41
|
-
drawItems.addTo(map.value)
|
|
42
|
-
|
|
43
|
-
const onLayerCreate = (event) => {
|
|
44
|
-
event.layer.remove().addTo(drawItems)
|
|
45
|
-
}
|
|
46
|
-
const onDrawStart = (event) => {
|
|
47
|
-
const workingLayer = event.workingLayer
|
|
48
|
-
if (event.shape === 'Line') {
|
|
49
|
-
workingLayer.on('pm:vertexadded', (vertex) => {
|
|
50
|
-
if (workingLayer._latlngs.length === 2) {
|
|
51
|
-
vertex.marker.fire('click')
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const onDrawEnd = () => {
|
|
57
|
-
map.value.off('pm:create', onLayerCreate)
|
|
58
|
-
map.value.off('pm:drawstart', onDrawStart)
|
|
59
|
-
map.value.off('pm:drawend', onDrawEnd)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
map.value.on('pm:create', onLayerCreate)
|
|
63
|
-
map.value.on('pm:drawstart', onDrawStart)
|
|
64
|
-
map.value.on('pm:drawend', onDrawEnd)
|
|
65
|
-
map.value.pm.enableDraw('Line')
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const clearDrawSegement = () => {
|
|
69
|
-
map.value.pm.disableDraw('Line')
|
|
70
|
-
drawItems.clearLayers()
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style lang="less" scoped>
|
|
75
|
-
.map-container {
|
|
76
|
-
height: 100%;
|
|
77
|
-
position: relative;
|
|
78
|
-
|
|
79
|
-
.actions {
|
|
80
|
-
position: absolute;
|
|
81
|
-
right: 10px;
|
|
82
|
-
top: 10px;
|
|
83
|
-
z-index: 1000;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="style">
|
|
3
|
-
<div v-for="item in count" :key="item">{{ name }}: {{ item }}</div>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup>
|
|
8
|
-
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
9
|
-
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
name: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: ''
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const count = ref(1)
|
|
18
|
-
let timer = null
|
|
19
|
-
|
|
20
|
-
const style = computed(() => ({
|
|
21
|
-
width: `${100 + count.value * 10}px`
|
|
22
|
-
}))
|
|
23
|
-
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
timer = window.setInterval(() => {
|
|
26
|
-
count.value += 1
|
|
27
|
-
if (count.value === 10) {
|
|
28
|
-
clearInterval(timer)
|
|
29
|
-
timer = null
|
|
30
|
-
}
|
|
31
|
-
}, 1000)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
onBeforeUnmount(() => {
|
|
35
|
-
if (timer) {
|
|
36
|
-
clearInterval(timer)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="style">
|
|
3
|
-
<div v-for="item in count" :key="item">{{ name }}: {{ item }}</div>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup>
|
|
8
|
-
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
9
|
-
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
name: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: ''
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
const count = ref(1)
|
|
18
|
-
let timer = null
|
|
19
|
-
|
|
20
|
-
const style = computed(() => ({
|
|
21
|
-
width: `${50 + count.value * 10}px`
|
|
22
|
-
}))
|
|
23
|
-
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
timer = window.setInterval(() => {
|
|
26
|
-
count.value += 1
|
|
27
|
-
if (count.value === 5) {
|
|
28
|
-
clearInterval(timer)
|
|
29
|
-
timer = null
|
|
30
|
-
}
|
|
31
|
-
}, 1000)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
onBeforeUnmount(() => {
|
|
35
|
-
if (timer) {
|
|
36
|
-
clearInterval(timer)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vae-map :base-layers="['GaoDe.Normal.Map']" @init-map="initMap" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
const poly = [
|
|
7
|
-
{ lat: 34.26572889446933, lng: 117.18566894531251 },
|
|
8
|
-
{ lat: 34.24274329938616, lng: 117.1956253051758 },
|
|
9
|
-
{ lat: 34.27395677834786, lng: 117.4043655395508 },
|
|
10
|
-
{ lat: 34.29579932143427, lng: 117.39475250244142 }
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
const baseLayers = L.layerGroup()
|
|
14
|
-
let calculator = null
|
|
15
|
-
|
|
16
|
-
const drawPoly = (map) => {
|
|
17
|
-
L.polygon(poly).addTo(baseLayers)
|
|
18
|
-
_.delay(() => {
|
|
19
|
-
map.fitBounds(L.latLngBounds(poly))
|
|
20
|
-
}, 250)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const doCalculate = () => {
|
|
24
|
-
calculator = L.footageCalculator.area({
|
|
25
|
-
latlngs: poly,
|
|
26
|
-
headStart: { lat: 34.26572889446933, lng: 117.18566894531251 },
|
|
27
|
-
headEnd: { lat: 34.29579932143427, lng: 117.39475250244142 },
|
|
28
|
-
tailStart: { lat: 34.24274329938616, lng: 117.1956253051758 },
|
|
29
|
-
tailEnd: { lat: 34.27395677834786, lng: 117.4043655395508 }
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const result = calculator.doCalculate({
|
|
33
|
-
headStart: { lat: 34.26572889446933, lng: 117.18566894531251 },
|
|
34
|
-
tailStart: { lat: 34.24274329938616, lng: 117.1956253051758 },
|
|
35
|
-
headDistance: 100,
|
|
36
|
-
tailDistance: 100
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
L.polygon(result.latlngs, { color: 'red' }).addTo(baseLayers)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const initMap = (map) => {
|
|
43
|
-
map.addLayer(baseLayers)
|
|
44
|
-
map.on('click', (event) => {
|
|
45
|
-
console.log(event.latlng)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
baseLayers.clearLayers()
|
|
49
|
-
drawPoly(map)
|
|
50
|
-
doCalculate()
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<vae-map @init-map="initMap" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
const lines = [
|
|
7
|
-
[
|
|
8
|
-
{ lat: 34.31614748988616, lng: 117.32368469238283 },
|
|
9
|
-
{ lat: 34.293104769231974, lng: 117.31870651245119 },
|
|
10
|
-
{ lat: 34.28629709450699, lng: 117.33801841735841 }
|
|
11
|
-
],
|
|
12
|
-
[
|
|
13
|
-
{ lat: 34.29955736832844, lng: 117.33630180358887 },
|
|
14
|
-
{ lat: 34.299202842785114, lng: 117.35329627990724 }
|
|
15
|
-
],
|
|
16
|
-
[
|
|
17
|
-
{ lat: 34.29565750505196, lng: 117.33501434326173 },
|
|
18
|
-
{ lat: 34.29374296045891, lng: 117.35097885131837 }
|
|
19
|
-
]
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
const footages = [3100, 200, 200, 2000, 100, 300, 300, 300, 2000, 100, 100]
|
|
23
|
-
const colors = ['#964B00', '#FFC0CB', '#00FF00', '#87CEFA', '#e01f54', '#f5e8c8', '#0a915d']
|
|
24
|
-
const baseLayers = L.layerGroup()
|
|
25
|
-
const polylines = []
|
|
26
|
-
|
|
27
|
-
const drawLines = (map) => {
|
|
28
|
-
let latlngs = []
|
|
29
|
-
lines.forEach((line) => {
|
|
30
|
-
polylines.push(L.polyline(line).addTo(baseLayers))
|
|
31
|
-
latlngs = _.concat(latlngs, line)
|
|
32
|
-
})
|
|
33
|
-
_.delay(() => {
|
|
34
|
-
map.fitBounds(L.latLngBounds(latlngs))
|
|
35
|
-
}, 250)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const doCalculate = () => {
|
|
39
|
-
let footageIndex = 0
|
|
40
|
-
|
|
41
|
-
for (const line of lines) {
|
|
42
|
-
const remainingFootages = _.takeRight(footages, footages.length - footageIndex)
|
|
43
|
-
if (remainingFootages.length === 0) {
|
|
44
|
-
continue
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const calculator = new L.FootageCalculator.Line({
|
|
48
|
-
latlngs: line,
|
|
49
|
-
width: 200
|
|
50
|
-
})
|
|
51
|
-
let start = line[0]
|
|
52
|
-
|
|
53
|
-
for (const footage of remainingFootages) {
|
|
54
|
-
const { path, remainingPath, area } = calculator.doCalculate({
|
|
55
|
-
start,
|
|
56
|
-
distance: footage
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
L.polygon(area, {
|
|
60
|
-
color: colors[footageIndex % colors.length],
|
|
61
|
-
fillOpacity: 0.8
|
|
62
|
-
}).addTo(baseLayers)
|
|
63
|
-
|
|
64
|
-
footageIndex += 1
|
|
65
|
-
start = _.last(path)
|
|
66
|
-
|
|
67
|
-
if (remainingPath.length === 0) {
|
|
68
|
-
break
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const initMap = (map) => {
|
|
75
|
-
map.addLayer(baseLayers)
|
|
76
|
-
map.on('click', (event) => {
|
|
77
|
-
console.log(event.latlng)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
baseLayers.clearLayers()
|
|
81
|
-
drawLines(map)
|
|
82
|
-
doCalculate()
|
|
83
|
-
}
|
|
84
|
-
</script>
|
package/examples/views/trace.vue
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="map-container">
|
|
3
|
-
<vae-map :base-layers="['GaoDe.Normal.Map']" @init-map="initMap" />
|
|
4
|
-
<div class="actions">
|
|
5
|
-
<el-button @click="start">START</el-button>
|
|
6
|
-
</div>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script setup>
|
|
11
|
-
import { ref } from 'vue'
|
|
12
|
-
|
|
13
|
-
const latLngs = [
|
|
14
|
-
{ lat: 34.3380, lng: 117.311 },
|
|
15
|
-
{ lat: 34.2794, lng: 117.314 },
|
|
16
|
-
{ lat: 34.2867, lng: 117.365 },
|
|
17
|
-
{ lat: 34.2470, lng: 117.341 },
|
|
18
|
-
{ lat: 34.2132, lng: 117.403 }
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
const map = ref(null)
|
|
22
|
-
const aMarker = ref(null)
|
|
23
|
-
|
|
24
|
-
const initMap = (value) => {
|
|
25
|
-
map.value = value
|
|
26
|
-
aMarker.value = L.animatedMarker({ latLngs }).addTo(map.value)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const start = () => {
|
|
30
|
-
aMarker.value.on('chunkmove', ({ index, duration }) => {
|
|
31
|
-
map.value.panTo(latLngs[index], { duration: duration / 1000 })
|
|
32
|
-
})
|
|
33
|
-
aMarker.value.startMove()
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style lang="less" scoped>
|
|
38
|
-
.map-container {
|
|
39
|
-
height: 100%;
|
|
40
|
-
position: relative;
|
|
41
|
-
|
|
42
|
-
.actions {
|
|
43
|
-
position: absolute;
|
|
44
|
-
top: 20px;
|
|
45
|
-
right: 20px;
|
|
46
|
-
z-index: 2000;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
</style>
|
package/jsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref } from 'vue'
|
|
2
|
-
import { debounce as lodashDebounce } from 'lodash'
|
|
3
|
-
import { useElementResize } from '@/composables/useResizeObserver'
|
|
4
|
-
|
|
5
|
-
export default defineComponent({
|
|
6
|
-
name: 'ResizeListener',
|
|
7
|
-
props: {
|
|
8
|
-
debounce: {
|
|
9
|
-
type: Number,
|
|
10
|
-
default: 100
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
emits: ['resize'],
|
|
14
|
-
setup(props, { emit, slots }) {
|
|
15
|
-
const rootRef = ref(null)
|
|
16
|
-
const emitResize = lodashDebounce(() => {
|
|
17
|
-
if (rootRef.value) {
|
|
18
|
-
emit('resize', rootRef.value)
|
|
19
|
-
}
|
|
20
|
-
}, props.debounce)
|
|
21
|
-
|
|
22
|
-
useElementResize(rootRef, ({ visible }) => {
|
|
23
|
-
if (visible) {
|
|
24
|
-
emitResize()
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
return () => <div ref={rootRef}>{slots.default?.()}</div>
|
|
29
|
-
}
|
|
30
|
-
})
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ElMessage, ElNotification } from 'element-plus'
|
|
2
|
-
|
|
3
|
-
export function useAutoMessage() {
|
|
4
|
-
return (options) => {
|
|
5
|
-
let message
|
|
6
|
-
let type
|
|
7
|
-
let duration
|
|
8
|
-
|
|
9
|
-
if (_.isString(options)) {
|
|
10
|
-
message = options
|
|
11
|
-
type = 'error'
|
|
12
|
-
duration = 3000
|
|
13
|
-
} else {
|
|
14
|
-
message = options.message
|
|
15
|
-
type = options.type || 'error'
|
|
16
|
-
duration = _.isNil(options.duration) ? 3000 : options.duration
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (['success', 'warning', 'info', 'error'].includes(type)) {
|
|
20
|
-
ElMessage({
|
|
21
|
-
message,
|
|
22
|
-
type,
|
|
23
|
-
duration
|
|
24
|
-
})
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let notifyType = type
|
|
29
|
-
if (notifyType === 'info') {
|
|
30
|
-
notifyType = 'primary'
|
|
31
|
-
} else if (notifyType === 'error') {
|
|
32
|
-
notifyType = 'danger'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ElNotification({
|
|
36
|
-
message,
|
|
37
|
-
type: notifyType,
|
|
38
|
-
duration
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
}
|