zh-mapbox 0.1.51 → 0.1.60

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
@@ -89,6 +89,8 @@ RegisterMapBoxModel(THREE,GLTFLoader)
89
89
  | **setLayerOrder**(order)-(0.1.49) | order:true (排最后) | zIndex图层排序方式 |
90
90
  | **setDefaultLayerIndex**(index)-(0.1.49) | index:number | 图层添加默认zIndex |
91
91
  | **lazyLoadAddImages**(urls)-(0.1.51) | urls:{key:any} | 懒加载图片 |
92
+ | **MapSelectBox**(options)-(0.1.60) | options:{} | 地图框选 |
93
+ | **isPointOnEarth**(lnglat,strict)-(0.1.60) | lnglat:{<br>lng:number,<br>lat:number}<br>strict:boolean 更严格的判断[false] | 点是否在地图上 |
92
94
 
93
95
  ### Map.Style
94
96
 
@@ -332,7 +334,33 @@ const layer = map.MapImageByGeoJson()
332
334
  })
333
335
  ```
334
336
 
337
+ ##### **MapSelectBox**
335
338
 
339
+ ```js
340
+ options:{
341
+ cursor:string,//鼠标样式
342
+ line:{
343
+ color:string,//线颜色
344
+ width:number,//线宽度
345
+ opacity:number,//线透明度
346
+ dash:number[]//虚线样式
347
+ },
348
+ fill:{
349
+ color:string,//填充颜色
350
+ opacity:number,//填充透明度
351
+ }
352
+ }
353
+ ```
354
+
355
+
356
+
357
+ | 方法名 | 参数 | 描述 |
358
+ | ------------------- | ----------------------- | -------- |
359
+ | **draw**( callback) | callback 框选完成的回调 | 开启绘制 |
360
+ | **off**() | | 停止监听 |
361
+ | **remove**() | | 清除绘制 |
362
+ | **visible**(show) | show:boolean | 显示隐藏 |
363
+ | **destroy**() | | 销毁 |
336
364
 
337
365
  #### 公共方法
338
366
 
package/dist/index.d.ts CHANGED
@@ -795,5 +795,36 @@ declare module 'mapbox-gl' {
795
795
  * @param urls {key:any}
796
796
  */
797
797
  lazyLoadAddImages(urls: object): void;
798
+
799
+ /**
800
+ * 地图框选工具
801
+ * @param {object} [options]
802
+ * @param {string} [options.cursor] 鼠标样式
803
+ * @param {object} [options.line] 线样式
804
+ * @param {string} [options.line.color] 线颜色
805
+ * @param {number} [options.line.width] 线宽度
806
+ * @param {number[]} [options.line.dasharray] 虚线样式
807
+ * @param {number} [options.line.opacity] 透明度
808
+ * @param {object} [options.fill] 填充样式
809
+ * @param {string} [options.fill.color] 填充颜色
810
+ * @param {number} [options.fill.opacity] 透明度
811
+ * 返回 MapSelectBox 实例,提供以下方法:
812
+ * - draw(callback): 开启绘制
813
+ * - off(): 关闭监听
814
+ * - remove(): 清除选择
815
+ * - visible(visible): 设置可见性
816
+ * - destroy(): 销毁图层
817
+ * @returns MapSelectBox 实例
818
+ */
819
+ MapSelectBox(options?: { cursor?: string, line?: { color?: string, width?: number, dasharray?: [number, number], opacity?: number }, fill?: { color?: string, opacity?: number } }): any;
820
+
821
+ /**
822
+ * 点是否在地图上
823
+ * @param {object} lngLat 经纬度
824
+ * @param {number} lngLat.lng 经度
825
+ * @param {number} lngLat.lat 纬度
826
+ * @param {boolean} [strict] 是否严格判断 【false】
827
+ */
828
+ isPointOnEarth(lngLat: { lng: number, lat: number }, strict?: boolean): boolean;
798
829
  }
799
830
  }