zh-mapbox 0.1.78 → 0.1.84
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 -1
- package/dist/index.d.ts +73 -3
- package/dist/index.js +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ RegisterMapBoxModel(THREE,GLTFLoader)
|
|
|
78
78
|
| **loadSpriteGraph**(sprite)-(0.0.114) | sprite:{<br />image:string 图片地址<br />json:string\|object json数据<br />} | 加载精灵图 |
|
|
79
79
|
| **MapClusterMarker**(options)-(0.0.114) | options: marker参数 | 聚合marker |
|
|
80
80
|
| **MapSourceEvent**(name,options)-(0.0.114) | name:source<br />options:{<br />once:true 执行一次<br />sourceLayer: 图层源 vector时必传<br />filter:过滤<br />} | 获取source源信息 |
|
|
81
|
-
| **TileByGeoJson**(options)-(0.1.0) | options:{<br />maxZoom:18 最大层级<br />minZoom:0 最小层级<br />expand:0 扩展瓦片数<br />isGCJ:false 是否GCJ坐标<br />replaceUrl:Function 替换url<br />isJudgement:false 是否判断瓦片<br />judgementBox:Function 四至判断方法<br />judgementPoint:Function 坐标判断方法<br />filter:Function 设置滤镜<br/>coordTransform:Function 坐标转换<br/>judgeBound:true 是否先判断边界<br/>isPrecision:true 是否提升精度<br/>minShow:true 小于最小层级是否显示<br/>maxShow:true 大于最大层级是否显示<br/>textureType:'NEAREST'\|'LINEAR'图像混合模式<br/>gradualLoad:false 渐进加载图片<br>isThrottle:true 使用节流<br>fetchOptions:fetch
|
|
81
|
+
| **TileByGeoJson**(options)-(0.1.0) | options:{<br />maxZoom:18 最大层级<br />minZoom:0 最小层级<br />expand:0 扩展瓦片数<br />isGCJ:false 是否GCJ坐标<br />replaceUrl:Function 替换url<br />isJudgement:false 是否判断瓦片<br />judgementBox:Function 四至判断方法<br />judgementPoint:Function 坐标判断方法<br />filter:Function 设置滤镜<br/>coordTransform:Function 坐标转换<br/>judgeBound:true 是否先判断边界<br/>isPrecision:true 是否提升精度<br/>minShow:true 小于最小层级是否显示<br/>maxShow:true 大于最大层级是否显示<br/>textureType:'NEAREST'\|'LINEAR'图像混合模式<br/>gradualLoad:false 渐进加载图片<br>isThrottle:true 使用节流<br>fetchOptions:fetch配置参数<br>cacheExpire:0 缓存失效分钟(0不失效)<br>useWorker:true 使用webwork} | 裁剪区域 |
|
|
82
82
|
| **MapMenu**(options)-(0.1.0) | options:{<br />move:false 菜单是否跟随移动<br />className:string <br />} | 右键菜单 |
|
|
83
83
|
| **MapMeasure**(options)-(0.1.1) | options:{...} | 地图测量 |
|
|
84
84
|
| **MapTileClusterCustom**(options)-(0.1.6) | options:{} | 切片聚合 |
|
|
@@ -96,6 +96,8 @@ RegisterMapBoxModel(THREE,GLTFLoader)
|
|
|
96
96
|
| **MapInteraction**(options)-(0.1.76-v3) | options:{<br>reset?:Function 重置交互方法} | 地图交互 |
|
|
97
97
|
| **getInteractions**()-(0.1.76-v3) | | 获取所有地图交互 |
|
|
98
98
|
| **loadModels**(models)-(0.1.76-v3) | models:{key:string} | 添加模型 |
|
|
99
|
+
| **isPaintProperty**(id,property)-(0.1.79) | | 是否属于paint |
|
|
100
|
+
| **loadIconset**(url,options,callback)-(v3) | | 加载pbf图标 |
|
|
99
101
|
|
|
100
102
|
### Map.Style
|
|
101
103
|
|
|
@@ -448,6 +450,10 @@ layerConfig:[
|
|
|
448
450
|
| **outOfChina** | | 判断点是否在国内 |
|
|
449
451
|
| **gcj02ToWgs84** | | gcj02转wgs84 |
|
|
450
452
|
| **wgs84ToGcj02** | | wgs84转gcj02 |
|
|
453
|
+
| **gcj02ToBd09** | | gcj02转bd09 |
|
|
454
|
+
| **wgs84ToBd09** | | wgs84转bd09 |
|
|
455
|
+
| **bd09ToWgs84** | | bd09转wgs84 |
|
|
456
|
+
| **bd09ToGcj02** | | bd09转gcj02 |
|
|
451
457
|
| **getSymbolRipple** | | 动态canvas点 |
|
|
452
458
|
| **transformGeojson** | | 自定义转换geojson |
|
|
453
459
|
| **transformLngLat** | | 自定义转换position |
|
|
@@ -461,6 +467,7 @@ layerConfig:[
|
|
|
461
467
|
| **judgePointInPolygon** | | 点是否在多边形内 |
|
|
462
468
|
| **isValidLngLat** | | 是否是有效经纬度 |
|
|
463
469
|
| **isValidCoordinates** | | 是否为有效经纬度数组 |
|
|
470
|
+
| **metersToPixels** | | 计算像素宽度 |
|
|
464
471
|
|
|
465
472
|
|
|
466
473
|
|
package/dist/index.d.ts
CHANGED
|
@@ -208,6 +208,15 @@ export function generateUUID(): string;
|
|
|
208
208
|
*/
|
|
209
209
|
export function isValidLngLat(lngLat: any, options?: any): boolean;
|
|
210
210
|
|
|
211
|
+
/**
|
|
212
|
+
* 根据实际物理宽度(米)和缩放级别计算像素宽度
|
|
213
|
+
* @param {number} meters - 实际物理宽度 (米)
|
|
214
|
+
* @param {number} zoom - 当前地图缩放级别
|
|
215
|
+
* @param {number} latitude - 当前地图中心纬度 (默认为 0,即赤道)
|
|
216
|
+
* @returns {number} 对应的像素值
|
|
217
|
+
*/
|
|
218
|
+
export function metersToPixels(meters: number, zoom: number, latitude?: number): number;
|
|
219
|
+
|
|
211
220
|
/**
|
|
212
221
|
* 批量验证经纬度数组
|
|
213
222
|
* @param {Array} coordinates - 坐标数组
|
|
@@ -240,6 +249,34 @@ export function wgs84ToGcj02(inputLng: number, inputLat: number): number[];
|
|
|
240
249
|
*/
|
|
241
250
|
export function gcj02ToWgs84(lng: number, lat: number): number[];
|
|
242
251
|
|
|
252
|
+
/**
|
|
253
|
+
* GCJ02坐标系(火星坐标系)转BD09坐标系
|
|
254
|
+
* @param lng
|
|
255
|
+
* @param lat
|
|
256
|
+
*/
|
|
257
|
+
export function gcj02ToBd09(lng: number, lat: number): number[];
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* WGS84坐标系转BD09坐标系(百度坐标系)
|
|
261
|
+
* @param lng
|
|
262
|
+
* @param lat
|
|
263
|
+
*/
|
|
264
|
+
export function wgs84ToBd09(lng: number, lat: number): number[];
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* BD09坐标系(百度坐标系)转WGS84坐标系
|
|
268
|
+
* @param lng
|
|
269
|
+
* @param lat
|
|
270
|
+
*/
|
|
271
|
+
export function bd09ToWgs84(lng: number, lat: number): number[];
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* BD09坐标系(百度坐标系)转GCJ02坐标系
|
|
275
|
+
* @param lng
|
|
276
|
+
* @param lat
|
|
277
|
+
*/
|
|
278
|
+
export function bd09ToGcj02(lng: number, lat: number): number[];
|
|
279
|
+
|
|
243
280
|
/**
|
|
244
281
|
* 面转换成带宽度的边界面
|
|
245
282
|
* @param {Object} geojson - GeoJSON对象,包含多边形或线要素
|
|
@@ -371,6 +408,12 @@ export class MapLayer {
|
|
|
371
408
|
[key: string]: any;
|
|
372
409
|
}
|
|
373
410
|
|
|
411
|
+
get layer(): any | undefined;
|
|
412
|
+
|
|
413
|
+
get tooltip(): any | undefined;
|
|
414
|
+
|
|
415
|
+
get popup(): any | undefined;
|
|
416
|
+
|
|
374
417
|
/**
|
|
375
418
|
* 构造函数
|
|
376
419
|
* @param {string|null} name - 图层名称
|
|
@@ -391,13 +434,24 @@ export class MapLayer {
|
|
|
391
434
|
* 添加图层配置
|
|
392
435
|
* @param {Object} layer - 图层配置对象
|
|
393
436
|
*/
|
|
394
|
-
addLayer(layer:
|
|
437
|
+
addLayer(layer: object): void;
|
|
395
438
|
|
|
396
439
|
/**
|
|
397
440
|
* 添加属性
|
|
398
441
|
* @param {Object} prop - 属性对象
|
|
399
442
|
*/
|
|
400
|
-
addProp(prop:
|
|
443
|
+
addProp(prop: object): void;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* 移除图层
|
|
447
|
+
* @param {string|string[]} name - 图层名称或名称数组
|
|
448
|
+
*/
|
|
449
|
+
removeLayer(name: string | string[]): void;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* 销毁图层
|
|
453
|
+
*/
|
|
454
|
+
destroy(): void;
|
|
401
455
|
}
|
|
402
456
|
|
|
403
457
|
declare module 'mapbox-gl' {
|
|
@@ -590,8 +644,9 @@ declare module 'mapbox-gl' {
|
|
|
590
644
|
/**
|
|
591
645
|
* 加载精灵图
|
|
592
646
|
* @param sprite 精灵图配置
|
|
647
|
+
* @param options 配置选项
|
|
593
648
|
*/
|
|
594
|
-
loadSpriteGraph(sprite: { image: string, json: string | object }): Promise<any>;
|
|
649
|
+
loadSpriteGraph(sprite: { image: string, json: string | object }, options?: object): Promise<any>;
|
|
595
650
|
|
|
596
651
|
|
|
597
652
|
/**
|
|
@@ -890,5 +945,20 @@ declare module 'mapbox-gl' {
|
|
|
890
945
|
* @param {object} models 模型列表 {[key]:string}
|
|
891
946
|
*/
|
|
892
947
|
loadModels(models): void;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* 判断样式属性是否 paint 属性
|
|
951
|
+
* @param id 图层id
|
|
952
|
+
* @param property 属性名称
|
|
953
|
+
*/
|
|
954
|
+
isPaintProperty(id, property): boolean;
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* 加载.pbf图标集
|
|
958
|
+
* @param url
|
|
959
|
+
* @param options fetch请求配置项
|
|
960
|
+
* @param callback
|
|
961
|
+
*/
|
|
962
|
+
loadIconset(url: string, options?: object, callback?: Function): void;
|
|
893
963
|
}
|
|
894
964
|
}
|