@sword916/vae-map-plus 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/build/index.mjs +113 -0
- package/examples/App.vue +18 -0
- package/examples/index.js +13 -0
- package/examples/router/index.js +35 -0
- package/examples/views/amap.vue +29 -0
- package/examples/views/amarker.vue +58 -0
- package/examples/views/buffer.vue +66 -0
- package/examples/views/cluster.vue +74 -0
- package/examples/views/cover.vue +85 -0
- package/examples/views/draw-line.vue +49 -0
- package/examples/views/draw.vue +54 -0
- package/examples/views/echarts.vue +142 -0
- package/examples/views/emarker.vue +39 -0
- package/examples/views/image.vue +182 -0
- package/examples/views/index.vue +61 -0
- package/examples/views/lrmap.vue +108 -0
- package/examples/views/map.vue +82 -0
- package/examples/views/measure.vue +86 -0
- package/examples/views/parts/popup.vue +39 -0
- package/examples/views/parts/tooltip.vue +39 -0
- package/examples/views/push-area.vue +52 -0
- package/examples/views/push-line.vue +84 -0
- package/examples/views/trace.vue +49 -0
- package/index.html +13 -0
- package/jsconfig.json +17 -0
- package/package.json +47 -0
- package/public/favicon.ico +0 -0
- package/public/images/game.png +0 -0
- package/public/images/grid.png +0 -0
- package/public/images/marker.png +0 -0
- package/public/index.html +30 -0
- package/src/components/resize-listener/component.jsx +30 -0
- package/src/components/resize-listener/index.js +3 -0
- package/src/composables/useAutoMessage.js +41 -0
- package/src/composables/useContextMenu.js +99 -0
- package/src/composables/useMapMeasure.js +191 -0
- package/src/composables/useResizeObserver.js +81 -0
- package/src/mixins/message.js +1 -0
- package/src/packages/index.js +16 -0
- package/src/packages/vae-amap/index.js +8 -0
- package/src/packages/vae-amap/style.less +9 -0
- package/src/packages/vae-amap/vae-amap.jsx +98 -0
- package/src/packages/vae-cloudmap/ctrl-context-menu/index.vue +74 -0
- package/src/packages/vae-cloudmap/ctrl-draw/index.vue +499 -0
- package/src/packages/vae-cloudmap/ctrl-draw-line/index.vue +161 -0
- package/src/packages/vae-cloudmap/index.js +57 -0
- package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/index.js +2690 -0
- package/src/packages/vae-cloudmap/scripts/L.MarkerCluster/style.css +14 -0
- package/src/packages/vae-cloudmap/scripts/L.Vae.CRS/index.js +212 -0
- package/src/packages/vae-cloudmap/scripts/L.Vae.Client/index.js +780 -0
- package/src/packages/vae-cloudmap/scripts/Mixin.ContextMenu/index.js +101 -0
- package/src/packages/vae-cloudmap/style.less +163 -0
- package/src/packages/vae-cloudmap/vae-cloudmap.jsx +272 -0
- package/src/packages/vae-map/ctrl-context-menu/index.vue +74 -0
- package/src/packages/vae-map/ctrl-draw/index.vue +498 -0
- package/src/packages/vae-map/ctrl-draw-line/index.vue +128 -0
- package/src/packages/vae-map/index.js +59 -0
- package/src/packages/vae-map/scripts/L.MarkerCluster/index.js +2690 -0
- package/src/packages/vae-map/scripts/L.MarkerCluster/style.css +14 -0
- package/src/packages/vae-map/scripts/L.Vae.CRS/index.js +114 -0
- package/src/packages/vae-map/scripts/L.Vae.Client/index.js +548 -0
- package/src/packages/vae-map/scripts/Mixin.ContextMenu/index.js +1 -0
- package/src/packages/vae-map/style.less +161 -0
- package/src/packages/vae-map/vae-lrmap.jsx +237 -0
- package/src/packages/vae-map/vae-map.jsx +135 -0
- package/src/plugins/L.AnimatedMarker/index.js +158 -0
- package/src/plugins/L.EchartsLayer/index.js +339 -0
- package/src/plugins/L.ElasticMarker/index.js +162 -0
- package/src/plugins/L.FootageCalculator.Area/index.js +263 -0
- package/src/plugins/L.FootageCalculator.Line/index.js +273 -0
- package/src/plugins/L.GeoUtil/buffer.js +67 -0
- package/src/plugins/L.GeoUtil/index.js +284 -0
- package/src/plugins/L.Glyphicon/index.js +91 -0
- package/src/plugins/L.Glyphicon/style.less +37 -0
- package/src/plugins/L.MarkerClusterX/index.js +93 -0
- package/src/plugins/L.MarkerClusterX/style.less +162 -0
- package/src/plugins/L.SafeDivOverlay/index.js +55 -0
- package/src/plugins/L.TileLayer.ChinaProvider/index.js +108 -0
- package/src/plugins/L.VuePopup/index.js +67 -0
- package/src/plugins/L.VueTooltip/index.js +63 -0
- package/src/plugins/Mixin.Map.Measure/index.js +248 -0
- package/src/plugins/globals/index.js +7 -0
- package/src/utils/index.js +36 -0
- package/src/utils/resize-event.js +45 -0
- package/vite.config.mjs +25 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
|
|
2
|
+
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
|
|
3
|
+
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
|
|
4
|
+
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
|
|
5
|
+
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.leaflet-cluster-spider-leg {
|
|
9
|
+
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
|
|
10
|
+
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
|
|
11
|
+
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
|
|
12
|
+
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
|
|
13
|
+
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
|
|
14
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// 偏移墨卡托投影
|
|
2
|
+
const OffsetSphericalMercator = (offset = L.point(0, 0)) => {
|
|
3
|
+
|
|
4
|
+
const Mercator = L.Projection.SphericalMercator
|
|
5
|
+
const R = Mercator.R
|
|
6
|
+
const D = Math.PI / 180
|
|
7
|
+
|
|
8
|
+
return L.extend({}, Mercator, {
|
|
9
|
+
project(latlng) {
|
|
10
|
+
const max = Mercator.MAX_LATITUDE
|
|
11
|
+
const lat = Math.max(Math.min(max, latlng.lat), -max)
|
|
12
|
+
const sin = Math.sin(lat * D)
|
|
13
|
+
const point = L.point(R * latlng.lng * D, R * Math.log((1 + sin) / (1 - sin)) / 2)
|
|
14
|
+
|
|
15
|
+
return point.add(offset)
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
unproject(point) {
|
|
19
|
+
const [x, y] = point.subtract(offset)
|
|
20
|
+
|
|
21
|
+
return L.latLng((2 * Math.atan(Math.exp(y / R)) - (Math.PI / 2)) * D, x * D / R)
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// LRMAP常用CRS
|
|
27
|
+
const fns = {
|
|
28
|
+
|
|
29
|
+
SIMPLE(count = 2) {
|
|
30
|
+
const ratio = Math.pow(0.1, count)
|
|
31
|
+
|
|
32
|
+
return L.extend({}, L.CRS.Simple, {
|
|
33
|
+
scale: zoom => ratio * Math.pow(2, zoom),
|
|
34
|
+
zoom: scale => Math.log(scale / ratio) / Math.log(2)
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
OFFSET_EPSG3857(offset = L.point(0, 0)) {
|
|
39
|
+
|
|
40
|
+
return L.extend({}, L.CRS.EPSG3857, {
|
|
41
|
+
projection: OffsetSphericalMercator(offset)
|
|
42
|
+
})
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
BJ54(x, options = {}) {
|
|
46
|
+
// console.log(options);
|
|
47
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
48
|
+
//为了解决矿政的1:500000的图纸新增了一个分辨率的参数,如果另外的项目需要改动,联系史新国
|
|
49
|
+
if (options.resolutions) {
|
|
50
|
+
resolutions = options.resolutions
|
|
51
|
+
}
|
|
52
|
+
;
|
|
53
|
+
// 确定投影带和带号
|
|
54
|
+
let pType, pCode
|
|
55
|
+
if (x > 25000000 && x < 40000000) {
|
|
56
|
+
pType = 3
|
|
57
|
+
pCode = parseInt(x / 1000000)
|
|
58
|
+
} else if (x > 12000000 && x < 22000000) {
|
|
59
|
+
pType = 6
|
|
60
|
+
pCode = parseInt(x / 1000000)
|
|
61
|
+
}
|
|
62
|
+
// 确定proj4的各项参数:ESPG代码,中央经线,东伪偏移
|
|
63
|
+
let EPSGCode, lon_0, x_0
|
|
64
|
+
if (pCode >= 0) {
|
|
65
|
+
if (pType == 3) {
|
|
66
|
+
EPSGCode = 2376 + pCode
|
|
67
|
+
lon_0 = pCode * 3
|
|
68
|
+
x_0 = 1000000 * pCode + 500000
|
|
69
|
+
} else if (pType == 6) {
|
|
70
|
+
EPSGCode = 2325 + pCode
|
|
71
|
+
lon_0 = pCode * 6 - 3
|
|
72
|
+
x_0 = 1000000 * pCode + 500000
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// console.log(EPSGCode, "EPSGCode");
|
|
76
|
+
// 返回3度带/6度带坐标系
|
|
77
|
+
if (EPSGCode) {
|
|
78
|
+
let proj = '+proj=tmerc +lat_0=0 +lon_0=' + lon_0 + ' +k=1 +x_0=' + x_0 + ' +y_0=0 +ellps=krass +units=m +no_defs no_defs'
|
|
79
|
+
return new L.Proj.CRS('EPSG:' + EPSGCode, proj, {resolutions: resolutions})
|
|
80
|
+
} else {
|
|
81
|
+
return this.SIMPLE()
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
XA80(x) {
|
|
86
|
+
let EPSGCode = 900099,
|
|
87
|
+
x_0 = 0,
|
|
88
|
+
lon_0 = 0,
|
|
89
|
+
pcode = parseInt(x / 1000000)
|
|
90
|
+
if (pcode > 0) {
|
|
91
|
+
lon_0 = pcode * 3
|
|
92
|
+
x_0 = 1000000 * pcode + 500000
|
|
93
|
+
EPSGCode = 2376 + pcode
|
|
94
|
+
}
|
|
95
|
+
let proj = '+proj=tmerc +lat_0=0 +lon_0=' + lon_0 + ' +k=1 +x_0=' + x_0 + ' +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs no_defs'
|
|
96
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
97
|
+
return new L.Proj.CRS('EPSG:' + EPSGCode, proj, {resolutions, origin: [0, 0]})
|
|
98
|
+
},
|
|
99
|
+
CGCS2000(x, options = {}) {
|
|
100
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
101
|
+
if (options.resolutions) {
|
|
102
|
+
resolutions = options.resolutions
|
|
103
|
+
}
|
|
104
|
+
;
|
|
105
|
+
let origin = [0, 0]
|
|
106
|
+
if (options.origin) {
|
|
107
|
+
origin = options.origin
|
|
108
|
+
}
|
|
109
|
+
;
|
|
110
|
+
// 确定投影带和带号
|
|
111
|
+
let pType, pCode
|
|
112
|
+
if (x > 25000000 && x < 45000000) {
|
|
113
|
+
pType = 3
|
|
114
|
+
pCode = parseInt(x / 1000000)
|
|
115
|
+
} else if (x > 12000000 && x < 22000000) {
|
|
116
|
+
pType = 6
|
|
117
|
+
pCode = parseInt(x / 1000000)
|
|
118
|
+
}
|
|
119
|
+
// 确定proj4的各项参数:ESPG代码,中央经线,东伪偏移
|
|
120
|
+
let EPSGCode, lon_0, x_0
|
|
121
|
+
if (pCode >= 0) {
|
|
122
|
+
if (pType == 3) {
|
|
123
|
+
if (pCode >= 25 && pCode <= 45)
|
|
124
|
+
EPSGCode = 45 + '' + (pCode - 12)
|
|
125
|
+
lon_0 = pCode * 3
|
|
126
|
+
x_0 = 1000000 * pCode + 500000
|
|
127
|
+
} else if (pType == 6) {
|
|
128
|
+
if (pCode >= 13 && pCode <= 21)
|
|
129
|
+
EPSGCode = 44 + '' + (pCode + 78)
|
|
130
|
+
if (pCode >= 22 && pCode <= 23)
|
|
131
|
+
EPSGCode = 44 + '' + (pCode - 22)
|
|
132
|
+
lon_0 = pCode * 6 - 3
|
|
133
|
+
x_0 = 1000000 * pCode + 500000
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// console.log(EPSGCode, "EPSGCode");
|
|
137
|
+
return new L.Proj.CRS("EPSG:" + EPSGCode, "+proj=tmerc +lat_0=0 +lon_0=" + lon_0 + " +k=1 +x_0=" + x_0 + " +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs", {
|
|
138
|
+
resolutions: resolutions,
|
|
139
|
+
origin: origin
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/* CGCS2000_4523(options = {}) {
|
|
144
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
145
|
+
if (options.resolutions) {
|
|
146
|
+
resolutions = options.resolutions
|
|
147
|
+
}
|
|
148
|
+
;
|
|
149
|
+
let origin = [0, 0]
|
|
150
|
+
if (options.origin) {
|
|
151
|
+
origin = options.origin
|
|
152
|
+
}
|
|
153
|
+
;
|
|
154
|
+
|
|
155
|
+
return new L.Proj.CRS("EPSG:4523", "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs", {
|
|
156
|
+
resolutions: resolutions,
|
|
157
|
+
origin: origin
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
CGCS2000_4524(options = {}) {
|
|
161
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
162
|
+
if (options.resolutions) {
|
|
163
|
+
resolutions = options.resolutions
|
|
164
|
+
}
|
|
165
|
+
;
|
|
166
|
+
let origin = [0, 0]
|
|
167
|
+
if (options.origin) {
|
|
168
|
+
origin = options.origin
|
|
169
|
+
}
|
|
170
|
+
;
|
|
171
|
+
|
|
172
|
+
return new L.Proj.CRS("EPSG:4524", "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs", {
|
|
173
|
+
resolutions: resolutions,
|
|
174
|
+
origin: origin
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
CGCS2000_4525(options = {}) {
|
|
178
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
179
|
+
if (options.resolutions) {
|
|
180
|
+
resolutions = options.resolutions
|
|
181
|
+
}
|
|
182
|
+
;
|
|
183
|
+
let origin = [0, 0]
|
|
184
|
+
if (options.origin) {
|
|
185
|
+
origin = options.origin
|
|
186
|
+
}
|
|
187
|
+
;
|
|
188
|
+
return new L.Proj.CRS("EPSG:4525", "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs", {
|
|
189
|
+
resolutions: resolutions,
|
|
190
|
+
origin: origin
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
CGCS2000_4526(options = {}) {
|
|
194
|
+
let resolutions = [307.2, 153.6, 76.8, 38.4, 19.2, 9.6, 4.8, 2.4, 1.2, 0.6, 0.3, 0.15, 0.075, 0.0375, 0.01875]
|
|
195
|
+
if (options.resolutions) {
|
|
196
|
+
resolutions = options.resolutions
|
|
197
|
+
}
|
|
198
|
+
;
|
|
199
|
+
let origin = [0, 0]
|
|
200
|
+
if (options.origin) {
|
|
201
|
+
origin = options.origin
|
|
202
|
+
}
|
|
203
|
+
;
|
|
204
|
+
return new L.Proj.CRS("EPSG:4526", "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs", {
|
|
205
|
+
resolutions: resolutions,
|
|
206
|
+
origin: origin
|
|
207
|
+
});
|
|
208
|
+
}*/
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
L.Vae = L.Vae || {}
|
|
212
|
+
L.Vae.CRS = L.extend(L.Vae.CRS || {}, fns)
|