zh-mapbox 0.1.64 → 0.1.73

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 CHANGED
@@ -91,6 +91,7 @@ RegisterMapBoxModel(THREE,GLTFLoader)
91
91
  | **lazyLoadAddImages**(urls)-(0.1.51) | urls:{key:any} | 懒加载图片 |
92
92
  | **MapSelectBox**(options)-(0.1.60) | options:{} | 地图框选 |
93
93
  | **isPointOnEarth**(lnglat,strict)-(0.1.60) | lnglat:{<br>lng:number,<br>lat:number}<br>strict:boolean 更严格的判断[false] | 点是否在地图上 |
94
+ | **AnimateMarker**()-(0.1.66) | | 图标动画 |
94
95
 
95
96
  ### Map.Style
96
97
 
@@ -362,6 +363,27 @@ options:{
362
363
  | **visible**(show) | show:boolean | 显示隐藏 |
363
364
  | **destroy**() | | 销毁 |
364
365
 
366
+ ##### AnimateMarker
367
+
368
+ ```js
369
+ options:{
370
+ from,//起点
371
+ to,//终点
372
+ duration,//时长
373
+ ease,//缓动函数
374
+ callback//json回调
375
+ }
376
+ ```
377
+
378
+
379
+
380
+ | 方法名 | 参数 | 描述 |
381
+ | ------------------- | ---- | -------- |
382
+ | **start**( options) | | 开启动画 |
383
+ | **update**(options) | | 更新动画 |
384
+ | **stop**() | | 停止动画 |
385
+ | **destroy**() | | 销毁 |
386
+
365
387
  #### 公共方法
366
388
 
367
389
  | 方法名 | 参数 | 描述 |
@@ -395,6 +417,8 @@ options:{
395
417
  | **polygonCenter** | | 面中心点 |
396
418
  | **invertMask** | | 反转区域 |
397
419
  | **judgePointInPolygon** | | 点是否在多边形内 |
420
+ | **isValidLngLat** | | 是否是有效经纬度 |
421
+ | **isValidCoordinates** | | 是否为有效经纬度数组 |
398
422
 
399
423
 
400
424
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { MapImageByGeoJson } from '../src/mapBox/class/MapImageByGeoJson'
2
1
 
3
2
  /**
4
3
  * 注册Mapbox扩展方法
@@ -195,7 +194,28 @@ export function deepClone(data: any): any;
195
194
  /**
196
195
  * 生成uuid
197
196
  */
198
- export function generateUUID(): string
197
+ export function generateUUID(): string;
198
+
199
+ /**
200
+ * 判断是否为有效的经纬度坐标
201
+ * @param {*} lngLat - 经纬度坐标对象或数组
202
+ * @param {Object} options - 配置选项
203
+ * @param {boolean} options.strict=false - 是否严格验证(排除南北极和 180 度经线)
204
+ * @param {number} options.minLat=-90 - 最小纬度
205
+ * @param {number} options.maxLat=90 - 最大纬度
206
+ * @param {number} options.minLng=-180 - 最小经度
207
+ * @param {number} options.maxLng=180 - 最大经度
208
+ * @return {boolean} 是否为有效的经纬度
209
+ */
210
+ export function isValidLngLat(lngLat: any, options?: any): boolean;
211
+
212
+ /**
213
+ * 批量验证经纬度数组
214
+ * @param {Array} coordinates - 坐标数组
215
+ * @param {Object} options - 配置选项(同 isValidLngLat)
216
+ * @return {boolean} 是否所有坐标都有效
217
+ */
218
+ export function isValidCoordinates(coordinates: any[], options?: any): boolean;
199
219
 
200
220
  /**
201
221
  * 判断坐标是否在中国境外,如果在中国境外则不需要进行坐标偏移
@@ -826,5 +846,15 @@ declare module 'mapbox-gl' {
826
846
  * @param {boolean} [strict] 是否严格判断 【false】
827
847
  */
828
848
  isPointOnEarth(lngLat: { lng: number, lat: number }, strict?: boolean): boolean;
849
+
850
+ /**
851
+ * 图标移动动画
852
+ * 返回 AnimateMarker 实例,提供以下方法:
853
+ * - start(options): 开启动画
854
+ * - update(options): 更新动画
855
+ * - stop(): 停止动画
856
+ * - destroy(): 销毁
857
+ */
858
+ AnimateMarker(): any;
829
859
  }
830
860
  }