zh-mapbox 0.1.45 → 0.1.47

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
@@ -84,6 +84,8 @@ RegisterMapBoxModel(THREE,GLTFLoader)
84
84
  | **MapTileClusterCustom**(options)-(0.1.6) | options:{} | 切片聚合 |
85
85
  | **MapLabelByGeoJson**()-(0.0.39) | | 过滤地图标签 |
86
86
  | **MapImageByGeoJson**(options)-(0.0.39) | options:{sourceConfig:{}} | 图像图层 |
87
+ | **getMapLayer**()-(0.1.47) | | 获取所有添加的图层 |
88
+ | **clearMapLayer**(names?,clear?)-(0.1.47) | names:string\|string[]<br>适用于MapLayer的名称<br>clear:boolean 清除或者保留 | 清除所有添加的图层 |
87
89
 
88
90
  ### Map.Style
89
91
 
package/dist/index.d.ts CHANGED
@@ -192,6 +192,11 @@ export function parseValue(value: any): any;
192
192
  */
193
193
  export function deepClone(data: any): any;
194
194
 
195
+ /**
196
+ * 生成uuid
197
+ */
198
+ export function generateUUID(): string
199
+
195
200
  /**
196
201
  * 判断坐标是否在中国境外,如果在中国境外则不需要进行坐标偏移
197
202
  * @param {number} inputLng - 经度
@@ -331,7 +336,7 @@ export class SymbolEffect {
331
336
  * 用于创建和管理地图图层,包括图层配置、tooltip、popup等组件
332
337
  */
333
338
  export class MapLayer {
334
- name: string
339
+ name: string | null
335
340
  layers: {
336
341
  layer: any;
337
342
  tooltip: any;
@@ -344,7 +349,7 @@ export class MapLayer {
344
349
 
345
350
  /**
346
351
  * 构造函数
347
- * @param {string} name - 图层名称
352
+ * @param {string|null} name - 图层名称
348
353
  * @param {Object} [options] - 图层配置选项
349
354
  * @param {Object} [options.layer=null] - 图层配置
350
355
  * @param {Object} [options.tooltip=null] - 提示框配置
@@ -352,7 +357,7 @@ export class MapLayer {
352
357
  * @param {Object} [prop={}] - 其他属性
353
358
  * @throws {Error} 当未使用new关键字调用时抛出错误
354
359
  */
355
- constructor(name: string, options?: {
360
+ constructor(name: string | null, options?: {
356
361
  layer?: any;
357
362
  tooltip?: any;
358
363
  popup?: any;
@@ -760,5 +765,17 @@ declare module 'mapbox-gl' {
760
765
  * @returns MapImageByGeoJson 实例
761
766
  */
762
767
  MapImageByGeoJson(options?: { sourceConfig?: any }): any;
768
+
769
+ /**
770
+ * 获取添加的所有图层
771
+ */
772
+ getMapLayer(): any[];
773
+
774
+ /**
775
+ * 清空所有图层 names 为MapLayer的名称 其他图层不适用
776
+ * @param names 图层名称
777
+ * @param clear 是否清除数据
778
+ */
779
+ clearMapLayer(names?: string | string[], clear?: boolean): void;
763
780
  }
764
781
  }