zh-mapbox 0.1.85 → 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 +8 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +23 -1
- package/package.json +3 -12
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
|
| 方法名 | 参数 | 描述 |
|
|
@@ -478,6 +480,12 @@ layerConfig:[
|
|
|
478
480
|
| **isValidLngLat** | | 是否是有效经纬度 |
|
|
479
481
|
| **isValidCoordinates** | | 是否为有效经纬度数组 |
|
|
480
482
|
| **metersToPixels** | | 计算像素宽度 |
|
|
483
|
+
| **fetchWithAbort** | | fetch请求 |
|
|
484
|
+
| **fetchJsonWithAbort** | | fetch请求 返回json |
|
|
485
|
+
| **fetchTextWithAbort** | | fetch请求 返回text |
|
|
486
|
+
| **fetchBlobWithAbort** | | fetch请求 返回blob |
|
|
487
|
+
| **setFetchConfig** | | 设置fetch公共参数 |
|
|
488
|
+
| **getFetchConfig** | | 获取fetch公共参数 |
|
|
481
489
|
|
|
482
490
|
|
|
483
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
|
*/
|