gis-common 5.1.10 → 5.1.12
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/gis-common.es.js +31 -7
- package/dist/gis-common.umd.js +1 -1
- package/dist/types.d.ts +11 -11
- package/dist/utils/CommUtil.d.ts +2 -2
- package/dist/utils/GeoUtil.d.ts +23 -4
- package/package.json +40 -40
package/dist/types.d.ts
CHANGED
|
@@ -87,15 +87,15 @@ export interface CanvasStyle {
|
|
|
87
87
|
fillColor: string;
|
|
88
88
|
lineWidth: number;
|
|
89
89
|
}
|
|
90
|
-
export interface
|
|
91
|
-
desc(f: (d:
|
|
92
|
-
asc(f: (d:
|
|
93
|
-
groupBy(f: (d:
|
|
94
|
-
distinct(f: (d:
|
|
95
|
-
max(f: (d:
|
|
96
|
-
min(f: (d:
|
|
97
|
-
sum(f: (d:
|
|
98
|
-
avg(f: (d:
|
|
99
|
-
random():
|
|
100
|
-
remove(f: (d:
|
|
90
|
+
export interface SuperArray<T = any> extends Array<T> {
|
|
91
|
+
desc(f: (d: T) => any): SuperArray<T>;
|
|
92
|
+
asc(f: (d: T) => any): SuperArray<T>;
|
|
93
|
+
groupBy(f: (d: T) => any): SuperArray<T>;
|
|
94
|
+
distinct(f: (d: T) => any): SuperArray<T>;
|
|
95
|
+
max(f: (d: T) => any): T;
|
|
96
|
+
min(f: (d: T) => any): T;
|
|
97
|
+
sum(f: (d: T) => any): number;
|
|
98
|
+
avg(f: (d: T) => any): number;
|
|
99
|
+
random(): SuperArray<T>;
|
|
100
|
+
remove(f: (d: T) => any): SuperArray<T>;
|
|
101
101
|
}
|
package/dist/utils/CommUtil.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
* @returns 返回数据类型字符串
|
|
7
7
|
*/
|
|
8
8
|
getDataType(data: any): any;
|
|
9
|
-
asArray(obj:
|
|
9
|
+
asArray<T>(obj: T): T[];
|
|
10
10
|
asNumber(a: any): number;
|
|
11
11
|
/**
|
|
12
12
|
* 将值转换为字符串
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
* @param value 要转换的值
|
|
15
15
|
* @returns 转换后的字符串,如果值为空,则返回空字符串
|
|
16
16
|
*/
|
|
17
|
-
asString(value: any):
|
|
17
|
+
asString(value: any): string;
|
|
18
18
|
/**
|
|
19
19
|
* 判断传入的值是否为空
|
|
20
20
|
*
|
package/dist/utils/GeoUtil.d.ts
CHANGED
|
@@ -20,13 +20,13 @@ export default class {
|
|
|
20
20
|
*/
|
|
21
21
|
static distance(p1: Coordinate, p2: Coordinate): number;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* 计算两个点之间的距离
|
|
24
24
|
*
|
|
25
|
-
* @param A
|
|
26
|
-
* @param B
|
|
25
|
+
* @param A 点A,包含x和y两个属性
|
|
26
|
+
* @param B 点B,包含x和y两个属性
|
|
27
27
|
* @returns 返回两点之间的距离,单位为米
|
|
28
28
|
*/
|
|
29
|
-
static distanceByPoints(A:
|
|
29
|
+
static distanceByPoints(A: Coordinate, B: Coordinate): number;
|
|
30
30
|
/**
|
|
31
31
|
* 格式化经纬度为度分秒格式
|
|
32
32
|
*
|
|
@@ -145,4 +145,23 @@ export default class {
|
|
|
145
145
|
* @returns 返回质心坐标,包含x和y属性
|
|
146
146
|
*/
|
|
147
147
|
static getPolygonCentroid(coords: Coordinate[] | LngLat[]): Coordinate;
|
|
148
|
+
/**
|
|
149
|
+
* 在两点之间的线段上进行插值计算
|
|
150
|
+
*
|
|
151
|
+
* @param pA 线段起点,可以是Coordinate类型(包含x,y属性)或LngLat类型(包含lng,lat属性)
|
|
152
|
+
* @param pB 线段终点,可以是Coordinate类型(包含x,y属性)或LngLat类型(包含lng,lat属性)
|
|
153
|
+
* @param ratio 插值比例,0表示在起点pA,1表示在终点pB,0-1之间表示两点间的插值点
|
|
154
|
+
* @returns 返回插值点坐标,类型与输入参数保持一致
|
|
155
|
+
*/
|
|
156
|
+
static interpolateOnSegment(pA: Coordinate | LngLat, pB: Coordinate | LngLat, ratio: number): {
|
|
157
|
+
x: number;
|
|
158
|
+
y: number;
|
|
159
|
+
lng?: undefined;
|
|
160
|
+
lat?: undefined;
|
|
161
|
+
} | {
|
|
162
|
+
lng: number;
|
|
163
|
+
lat: number;
|
|
164
|
+
x?: undefined;
|
|
165
|
+
y?: undefined;
|
|
166
|
+
};
|
|
148
167
|
}
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
2
|
+
"name": "gis-common",
|
|
3
|
+
"version": "5.1.12",
|
|
4
|
+
"author": "Guo.Yan <luv02@vip.qq.com>",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"module": "dist/gis-common.es.js",
|
|
8
|
+
"main": "dist/gis-common.umd.js",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/gis-common.es.js",
|
|
17
|
+
"require": "./dist/gis-common.umd.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"lib": "vite build --mode lib",
|
|
23
|
+
"serve": "vite preview"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": ""
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"mqtt-browser": "^4.3.7"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/leaflet": "^1.9.12",
|
|
34
|
+
"@types/node": "^22.5.5",
|
|
35
|
+
"element-ui": "2.15.14",
|
|
36
|
+
"terser": "^5.32.0",
|
|
37
|
+
"typescript": "^5.5.4",
|
|
38
|
+
"vite": "^5.4.0",
|
|
39
|
+
"vite-plugin-dts": "^4.0.1"
|
|
40
|
+
}
|
|
41
|
+
}
|