@mapcatch/util 2.0.2 → 2.0.3
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/CHANGELOG.md +68 -0
- package/dist/catchUtil.min.esm.js +21 -13
- package/dist/catchUtil.min.js +2 -2
- package/package.json +1 -1
- package/src/constants/crs.js +19 -12
- package/src/measure/index.js +7 -2
package/package.json
CHANGED
package/src/constants/crs.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
export default [
|
|
2
2
|
{
|
|
3
|
-
'type': '
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
'type': 'COMMON',
|
|
4
|
+
'alias': 'Common',
|
|
5
|
+
'title': '常用坐标系',
|
|
6
|
+
'children': [
|
|
7
|
+
{
|
|
8
|
+
'type': 'GEOGCS',
|
|
9
|
+
'title': 'WGS 84',
|
|
10
|
+
'authName': 'EPSG',
|
|
11
|
+
'authCode': 4326,
|
|
12
|
+
'wkt': 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
'type': 'GEOGCS',
|
|
16
|
+
'title': 'China Geodetic Coordinate System 2000',
|
|
17
|
+
'authName': 'EPSG',
|
|
18
|
+
'authCode': 4490,
|
|
19
|
+
'wkt': 'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]'
|
|
20
|
+
}
|
|
21
|
+
]
|
|
15
22
|
},
|
|
16
23
|
{
|
|
17
24
|
'type': 'PROJCS',
|
package/src/measure/index.js
CHANGED
|
@@ -163,11 +163,16 @@ class Measurement {
|
|
|
163
163
|
flatCoordinates.pop() // 去掉最后一个重复的点
|
|
164
164
|
let edges = []
|
|
165
165
|
flatCoordinates.forEach((coord, index) => {
|
|
166
|
+
let edge = null
|
|
166
167
|
if (index === flatCoordinates.length - 1) {
|
|
167
|
-
|
|
168
|
+
edge = [index, 0]
|
|
168
169
|
} else {
|
|
169
|
-
|
|
170
|
+
edge = [index, index + 1]
|
|
170
171
|
}
|
|
172
|
+
if (_.isEqual(flatCoordinates[edge[0]], flatCoordinates[edge[1]])) {
|
|
173
|
+
return
|
|
174
|
+
}
|
|
175
|
+
edges.push(edge)
|
|
171
176
|
})
|
|
172
177
|
triangles = cdt2d(flatCoordinates, edges, { exterior: false })
|
|
173
178
|
}
|