zh-mapbox 0.1.84 → 0.1.87

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
@@ -31,6 +31,8 @@ RegisterMapBoxModel(THREE,GLTFLoader)
31
31
 
32
32
  注册常用方法后 map.on('layerdata') 可监听图层的添加与删除
33
33
 
34
+ 增加对pmtile文件的加载 source默认'pmtile' symbol图层不能使用 如果使用请修改mapbox源码
35
+
34
36
  ### Map
35
37
 
36
38
  | 方法名 | 参数 | 描述 |
@@ -118,7 +120,17 @@ RegisterMapBoxModel(THREE,GLTFLoader)
118
120
 
119
121
  ##### MapTooltip
120
122
 
121
-
123
+ ```
124
+ options:{
125
+ ...,
126
+ customName=false,//是否自定义名称 true时会取消默认类名
127
+ className=‘’,//类名样式
128
+ allMove=false,//使用鼠标移动显示
129
+ events={}//元素事件
130
+ }
131
+ ```
132
+
133
+
122
134
 
123
135
  | 方法名 | 参数 | 描述 |
124
136
  | -------------------------------------------------- | ------------------------------------------------------------ | ------------ |
@@ -468,6 +480,12 @@ layerConfig:[
468
480
  | **isValidLngLat** | | 是否是有效经纬度 |
469
481
  | **isValidCoordinates** | | 是否为有效经纬度数组 |
470
482
  | **metersToPixels** | | 计算像素宽度 |
483
+ | **fetchWithAbort** | | fetch请求 |
484
+ | **fetchJsonWithAbort** | | fetch请求 返回json |
485
+ | **fetchTextWithAbort** | | fetch请求 返回text |
486
+ | **fetchBlobWithAbort** | | fetch请求 返回blob |
487
+ | **setFetchConfig** | | 设置fetch公共参数 |
488
+ | **getFetchConfig** | | 获取fetch公共参数 |
471
489
 
472
490
 
473
491
 
package/dist/index.d.ts CHANGED
@@ -319,6 +319,69 @@ export function invertMask(geojson: any, maskArray: any[]): any | null;
319
319
  */
320
320
  export function judgePointInPolygon(point: [number, number] | { lng: number, lat: number }, geojson: any): boolean;
321
321
 
322
+ /**
323
+ * Fetch请求配置选项
324
+ */
325
+ export interface FetchOptions extends RequestInit {
326
+ /** 超时时间(毫秒),0表示不设置超时 */
327
+ timeout?: number;
328
+ }
329
+
330
+ /**
331
+ * AbortablePromise对象 - 基础版本
332
+ */
333
+ export interface AbortablePromise<T = any> {
334
+ /** Promise对象 */
335
+ promise: Promise<T>;
336
+ /** 取消请求的函数 */
337
+ abort: () => void;
338
+ }
339
+
340
+ /**
341
+ * 设置全局fetch配置
342
+ * @param config - 全局配置对象
343
+ */
344
+ export function setFetchConfig(config: FetchOptions): void;
345
+
346
+ /**
347
+ * 获取全局fetch配置
348
+ * @returns 全局配置对象
349
+ */
350
+ export function getFetchConfig(): FetchOptions;
351
+
352
+ /**
353
+ * 封装带取消功能的fetch请求
354
+ * @param url - 请求URL
355
+ * @param options - fetch配置项,会与全局配置合并
356
+ * @returns 包含promise和abort方法的对象
357
+ */
358
+ export function fetchWithAbort(url: string, options?: FetchOptions): AbortablePromise<Response>;
359
+
360
+ /**
361
+ * 封装带取消功能的fetch请求,返回JSON数据
362
+ * @param url - 请求URL
363
+ * @param options - fetch配置项,会与全局配置合并
364
+ * @returns 包含promise和abort方法的对象,promise解析为JSON数据
365
+ */
366
+ export function fetchJsonWithAbort(url: string, options?: FetchOptions): AbortablePromise<any>;
367
+
368
+ /**
369
+ * 封装带取消功能的fetch请求,返回文本数据
370
+ * @param url - 请求URL
371
+ * @param options - fetch配置项,会与全局配置合并
372
+ * @returns 包含promise和abort方法的对象,promise解析为文本数据
373
+ */
374
+ export function fetchTextWithAbort(url: string, options?: FetchOptions): AbortablePromise<string>;
375
+
376
+ /**
377
+ * 封装带取消功能的fetch请求,返回Blob数据
378
+ * @param url - 请求URL
379
+ * @param options - fetch配置项,会与全局配置合并
380
+ * @returns 包含promise和abort方法的对象,promise解析为Blob数据
381
+ */
382
+ export function fetchBlobWithAbort(url: string, options?: FetchOptions): AbortablePromise<Blob>;
383
+
384
+
322
385
  /**
323
386
  * 地图类类型枚举
324
387
  */