gis-common 5.1.12 → 5.1.13

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.
@@ -6,7 +6,7 @@ declare const _default: {
6
6
  * @returns 返回数据类型字符串
7
7
  */
8
8
  getDataType(data: any): any;
9
- asArray<T>(obj: T): T[];
9
+ asArray(obj: any): any[];
10
10
  asNumber(a: any): number;
11
11
  /**
12
12
  * 将值转换为字符串
@@ -120,15 +120,6 @@ export default class {
120
120
  * @returns 墨卡托坐标对象,包含x和y属性
121
121
  */
122
122
  static lonlatToMercator(lng: number, lat: number): Coordinate;
123
- /**
124
- * 根据百分比获取坐标
125
- *
126
- * @param start 起点坐标
127
- * @param end 终点坐标
128
- * @param percent 百分比,取值范围0-1
129
- * @returns 返回插值后的坐标
130
- */
131
- static interpolate({ x: x1, y: y1, z: z1 }: Coordinate, { x: x2, y: y2, z: z2 }: Coordinate, percent: number): Coordinate;
132
123
  /**
133
124
  * 计算三角形面积
134
125
  *
@@ -146,22 +137,15 @@ export default class {
146
137
  */
147
138
  static getPolygonCentroid(coords: Coordinate[] | LngLat[]): Coordinate;
148
139
  /**
149
- * 在两点之间的线段上进行插值计算
140
+ * 根据百分比获取坐标
150
141
  *
151
142
  * @param pA 线段起点,可以是Coordinate类型(包含x,y属性)或LngLat类型(包含lng,lat属性)
152
143
  * @param pB 线段终点,可以是Coordinate类型(包含x,y属性)或LngLat类型(包含lng,lat属性)
153
144
  * @param ratio 插值比例,0表示在起点pA,1表示在终点pB,0-1之间表示两点间的插值点
154
145
  * @returns 返回插值点坐标,类型与输入参数保持一致
155
146
  */
156
- static interpolateOnSegment(pA: Coordinate | LngLat, pB: Coordinate | LngLat, ratio: number): {
147
+ static interpolate(pA: Coordinate | LngLat, pB: Coordinate | LngLat, ratio: number): {
157
148
  x: number;
158
149
  y: number;
159
- lng?: undefined;
160
- lat?: undefined;
161
- } | {
162
- lng: number;
163
- lat: number;
164
- x?: undefined;
165
- y?: undefined;
166
150
  };
167
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gis-common",
3
- "version": "5.1.12",
3
+ "version": "5.1.13",
4
4
  "author": "Guo.Yan <luv02@vip.qq.com>",
5
5
  "license": "MIT",
6
6
  "private": false,