zh-mapbox 0.0.101 → 0.0.113
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 +11 -5
- package/dist/index.d.ts +83 -0
- package/dist/index.js +2 -1
- package/dist/index.js.LICENSE +1 -0
- package/dist/index.js.LICENSE.txt +1 -6
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -69,6 +69,12 @@ RegisterMapBoxModel(THREE,GLTFLoader)
|
|
|
69
69
|
| **getAllLayer**()-(0.0.71) | - | 获取所有图层 |
|
|
70
70
|
| **getLineLayer**()-(0.0.71) | - | 获取线图层 |
|
|
71
71
|
| **AnimateLine**(name,options)-(0.0.73) | name:图层id<br />options?:{<br />dash?:变化的数组<br />step?:段数<br />} | 线动画 |
|
|
72
|
+
| **setPaint**(id,options)-(0.0.108) | id:图层id<br/>options:{<br/>key:属性名<br/>value:属性值<br/>} | 修改paint |
|
|
73
|
+
| **setLayout**(id,options)-(0.0.108) | id:图层id<br/>options:{<br/>key:属性名<br/>value:属性值<br/>} | 修改layout |
|
|
74
|
+
| **customStyle**(options)-(0.0.108) | options:{<br/>key:string,<br/>value:[color,opacity]} | 修改地图style |
|
|
75
|
+
| **clearData**()-(0.0.108) | - | 清除数据(初始化时调用) |
|
|
76
|
+
| **getTileByPosition**(position,zoom?)-(0.0.108) | position:[lng,lat]<br/>zoom?:number | 根据经纬度获取瓦片 |
|
|
77
|
+
| **getPositionByTile**(range)-(0.0.108) | range:[x,y,z] | 根据瓦片获取经纬度四至 |
|
|
72
78
|
|
|
73
79
|
### Map.Style
|
|
74
80
|
|
|
@@ -126,7 +132,7 @@ options:{
|
|
|
126
132
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | -------- |
|
|
127
133
|
| **draw**<br />(geojson:GeoJson,<br />name:string,options):<br />array(图层名称数组) | geojson<br />name:图层id<br />options:{<br />beforeId:在那个图层之下<br />layerConfig:图层配置<br /><br />lineConfig?:额外高亮线配置<br />sourceConfig?:源配置(0.0.23)} | 绘制线 |
|
|
128
134
|
| **destroy**() | - | 销毁 |
|
|
129
|
-
| **visible**()-(0.0.71)
|
|
135
|
+
| **visible**(show)-(0.0.71) | show:boolean | 显示隐藏 |
|
|
130
136
|
|
|
131
137
|
##### MapCustom
|
|
132
138
|
|
|
@@ -134,7 +140,7 @@ options:{
|
|
|
134
140
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | -------- |
|
|
135
141
|
| **draw** <br />(geojson:GeoJson,<br />name:string,options):<br />array(图层名称数组) | geojson <br />name:图层id <br />options:{ <br />beforeId:在那个图层之下<br /> layerConfig:图层配置 <br />type:图层类型 ’symbol‘<br />sliceNum?:数据分割加载数<br />sourceConfig?:源配置(0.0.23) } | 绘制图层 |
|
|
136
142
|
| **destroy**() | - | 销毁 |
|
|
137
|
-
| **visible**()-(0.0.71)
|
|
143
|
+
| **visible**(show)-(0.0.71) | show:boolean | 显示隐藏 |
|
|
138
144
|
|
|
139
145
|
##### MapCircle
|
|
140
146
|
|
|
@@ -142,7 +148,7 @@ options:{
|
|
|
142
148
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | ----------- |
|
|
143
149
|
| **draw** <br />(geojson:GeoJson, <br />name:string,options):<br /> array(图层名称数组) | geojson <br />name:图层id <br />options:{ <br />beforeId:在那个图层之下<br /> layerConfig:图层配置 <br />radius:范围(km)<br />steps:圆边数(64)<br />endRadius?:结束范围(km)<br />lingConfig?:边框线配置<br />sourceConfig?:源配置(0.0.23) } | 绘制圆/圆环 |
|
|
144
150
|
| **destroy**() | - | 销毁 |
|
|
145
|
-
| **visible**()-(0.0.71)
|
|
151
|
+
| **visible**(show)-(0.0.71) | show:boolean | 显示隐藏 |
|
|
146
152
|
|
|
147
153
|
##### MapEvent
|
|
148
154
|
|
|
@@ -170,7 +176,7 @@ layerConfig:{
|
|
|
170
176
|
| ------------------------------------------------------ | ------------------------------------------------------------ | ---------- |
|
|
171
177
|
| **draw**(<br />geojson:GeoJson,<br />options:):array | geojson<br />options:{<br />sourceConfig:<br />{id,type?,...}<br />layerConfig:[]\|{}<br />} | 添加多图层 |
|
|
172
178
|
| **destroy**() | - | 销毁 |
|
|
173
|
-
| **visible**()-(0.0.71)
|
|
179
|
+
| **visible**(show)-(0.0.71) | show:boolean | 显示隐藏 |
|
|
174
180
|
|
|
175
181
|
##### MapMarker
|
|
176
182
|
|
|
@@ -179,7 +185,7 @@ layerConfig:{
|
|
|
179
185
|
| **draw**(<br />geojson:GeoJson,<br />htmlCallback:function<br />) | geojson<br />htmlCallback<br />({lngLat,properties}) | 绘制marker |
|
|
180
186
|
| **addEvent**<br />(events:{[key]:function}) | events:{<br />dragstart?:function,<br />drag?:function,<br />dragend?function<br />} | 添加事件 |
|
|
181
187
|
| **destroy**() | - | 销毁 |
|
|
182
|
-
| **visible**()-(0.0.71)
|
|
188
|
+
| **visible**(show)-(0.0.71) | show:boolean | 显示隐藏 |
|
|
183
189
|
|
|
184
190
|
**AnimateLine**
|
|
185
191
|
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,12 @@ export declare function hexToRgba(color: string, pure?: boolean): number[] | str
|
|
|
71
71
|
*/
|
|
72
72
|
export declare function isNumber(value: any): boolean;
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* 判断一个数字是否为有效数字
|
|
76
|
+
* @param value
|
|
77
|
+
*/
|
|
78
|
+
export declare function isValidNumber(value: number): boolean;
|
|
79
|
+
|
|
74
80
|
/**
|
|
75
81
|
* 创建一组地图图层
|
|
76
82
|
*/
|
|
@@ -136,6 +142,28 @@ export declare function mergeGeoJson(...args: any): any;
|
|
|
136
142
|
*/
|
|
137
143
|
export declare function RegisterMapClass(map: any, options?: { tooltipClass?: string, popupClass?: string }): void;
|
|
138
144
|
|
|
145
|
+
/**
|
|
146
|
+
* 判断坐标是否在国内
|
|
147
|
+
* @param lng
|
|
148
|
+
* @param lat
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
export declare function outOfChina(lng, lat): boolean;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 将GCJ-02坐标转换为WGS-84坐标
|
|
155
|
+
* @param lng
|
|
156
|
+
* @param lat
|
|
157
|
+
*/
|
|
158
|
+
export declare function gcj02ToWgs84(lng, lat): [number, number];
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 将WGS84坐标转换为GCJ02坐标
|
|
162
|
+
* @param lng
|
|
163
|
+
* @param lat
|
|
164
|
+
*/
|
|
165
|
+
export declare function wgs84ToGcj02(lng, lat): [number, number];
|
|
166
|
+
|
|
139
167
|
declare module 'mapbox-gl' {
|
|
140
168
|
interface Map {
|
|
141
169
|
/**
|
|
@@ -330,6 +358,61 @@ declare module 'mapbox-gl' {
|
|
|
330
358
|
* @constructor
|
|
331
359
|
*/
|
|
332
360
|
AnimateLine(id: string, options?: any): any;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* 更改地图图层颜色和透明度
|
|
364
|
+
* 可以使用表达式
|
|
365
|
+
* @param options
|
|
366
|
+
* @example
|
|
367
|
+
customStyle({
|
|
368
|
+
'water-line':'#f00',
|
|
369
|
+
'water-line-fill':['#f00',0.5],
|
|
370
|
+
'water-line-fill-outline':[['case',['==','name','1'],'#f00','#ff0'],['case',['==','name','1'],0.5,1]],
|
|
371
|
+
}
|
|
372
|
+
*/
|
|
373
|
+
customStyle(options: object): void;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* 设置图层paint样式
|
|
377
|
+
* @param id
|
|
378
|
+
* @param options
|
|
379
|
+
*/
|
|
380
|
+
setPaint(id: string, options: any): void;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* 设置图层layout样式
|
|
384
|
+
* @param id
|
|
385
|
+
* @param options
|
|
386
|
+
*/
|
|
387
|
+
setLayout(id: string, options: any): void;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* 清除图层数据
|
|
391
|
+
*/
|
|
392
|
+
clearData(): void;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* 根据坐标获取瓦片
|
|
396
|
+
* @param position
|
|
397
|
+
* @param zoom
|
|
398
|
+
*/
|
|
399
|
+
getTileByPosition(position: [number, number], zoom?: number): [number, number, number];
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* 根据瓦片获取经纬度四至
|
|
403
|
+
* @param tile
|
|
404
|
+
* @return [minLng, minLat, maxLng, maxLat]
|
|
405
|
+
*/
|
|
406
|
+
getPositionByTile(tile: [number, number, number]): [number, number, number, number];
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* 获取指定zoom下瓦片集合
|
|
410
|
+
* @param zoom
|
|
411
|
+
* @param options
|
|
412
|
+
* @param options.expand 瓦片扩展范围
|
|
413
|
+
* @param options.reversal 是否反转
|
|
414
|
+
*/
|
|
415
|
+
getTilesByBounds(zoom?: number, options?: { expand?: number, reversal?: boolean }): [number, number, number][];
|
|
333
416
|
}
|
|
334
417
|
}
|
|
335
418
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("zMapUtil",[],t):"object"==typeof exports?exports.zMapUtil=t():e.zMapUtil=t()}(this,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){if(null==e)return{};for(var r,o={},n=Object.keys(e),i=0;i<n.length;i++)r=n[i],0<=t.indexOf(r)||(o[r]=e[r]);return o}function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,o=arguments[t];for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}e.r(t),e.d(t,{MapLayer:()=>F,RegisterMapBoxMethod:()=>function(e,t){if(e&&e.Map){q=e,-1===(window.mapboxgl=q).Map.prototype._setupPainter.toString().indexOf("webgl2")&&(a=q.Map.prototype._setupPainter,q.Map.prototype._setupPainter=function(){var e=this._canvas.getContext;this._canvas.getContext=function(t,r){return e.apply(this,["webgl2",r])||e.apply(this,["webgl",r])||e.apply(this,["experimental-webgl",r])},a.apply(this),this._canvas.getContext=e});var a,s,l=e.Map,u=function(e,t){var a=[];t&&Array.isArray(t)&&0<t.length&&t.every((function(e){return"string"==typeof e}))&&(a=t);var s=e.prototype.setStyle,l={layers:[],sources:[]},u=[],c={},p=[];return{getAllLayerAndSource:function(e,t){void 0===e&&(e=a),void 0===t&&(t=!0);for(var r,o=this.getStyle(),i=o.layers,s=o.sources,l={layers:[],sources:[]},u=0;u<i.length;)"background"===i[u].type||e.includes(i[u].source)||(r=i[u].id,this.getLayer(r)&&(l.layers.push(n(i[u])),t||this.removeLayer(r))),u++;var c,p=[];for(c in s)p.push(c);for(var h=0;h<p.length;){var f=p[h];e.includes(f)||this.isSourceLoaded(f)&&(l.sources.push({name:f,source:n(s[f])}),t||this.removeSource(f)),h++}return l},removeAllCustomLayer:function(){var e=this;u.forEach((function(t){e.getLayer(t.layer.id)&&e.removeLayer(t.layer.id)}))},removeAllLayerAndSource:function(e){return void 0===e&&(e=a),this.removeAllCustomLayer(),this.getAllLayerAndSource(e,!1)},removeEvents:function(e){var t=this;void 0===e&&(e=["click","mousemove","mouseout"]),Array.isArray(e)&&e.forEach((function(e){e in t._listeners&&(t._listeners[e]=[])}))},removePopup:function(e){e&&"string"==typeof e?["tooltip","popup"].includes(e)&&this._popups.forEach((function(t){t.options.type===e&&t.remove()})):this._popups.forEach((function(e){e.remove()}))},findCustomLayer:function(e,t){void 0===t&&(t=a);for(var r=this.getStyle().layers,o=[],n=0;n<r.length;)"background"===r[n].type||t.includes(r[n].source)||o.push(r[n]),n++;if(e){if("string"==typeof e)return o.filter((function(t){return t.type===e}));if(Array.isArray(e)&&0<e.length)return o.filter((function(t){return e.includes(t.type)}))}return o},MapTooltip:function(e,t){return new f(this,e,t)},MapPopup:function(e,t){return new d(this,e,t)},addLayer:function(e,t){var r;return this._lazyInitEmptyStyle(),"custom"===e.type&&u.push({layer:e,beforeId:t}),t?-1!==(r=p.findIndex((function(e){return e.id===t})))&&p.splice(r,0,{type:e.type,id:e.id}):p.push({type:e.type,id:e.id}),this.style.addLayer(e,t),this.fire("layerdata",o({},e,{add:!0})),this._update(!0)},removeLayer:function(e){var t=this.style.getLayer(e),r=u.findIndex((function(t){return t.layer.id===e}));return-1!==r&&u.splice(r,1),r=p.findIndex((function(t){return t.id===e})),-1!==r&&p.splice(r,1),this.style.removeLayer(e),this.fire("layerdata",o({},t,{add:!1})),this._update(!0)},moveLayer:function(e,t){var r=p.findIndex((function(t){return t.id===e})),o=p.findIndex((function(e){return e.id===t}));return-1!==r&&-1!==o&&(r=p.splice(r,1)[0],o<0?o=0:p.length<o&&(o=p.length),p.splice(o,0,r)),this.style.moveLayer(e,t),this._update(!0)},MapLine:function(){return new v(this)},MapCustom:function(){return new g(this)},fitBoundsGeoJson:function(e,t){e&&(e=[[(e=x(e)).bbox[0],e.bbox[1]],[e.bbox[2],e.bbox[3]]],this.fitBoundsPosition(e,t))},fitBoundsPosition:function(e,t){var n,i,a,s;Array.isArray(e)&&0!==(null==e?void 0:e.length)&&(n=void 0===(n=(t=null!=t?t:{}).padding)?40:n,i=void 0===(i=t.animate)||i,a=void 0===(a=t.maxZoom)?15:a,s=void 0===(s=t.essential)||s,t=r(t,z),this.fitBounds(e,o({linear:!1,padding:n,animate:i,essential:s,maxZoom:a},t)))},getInvertMask:function(e,t){var r;if(i(e)&&0!==(e=null!=(e=e.features[0].geometry.coordinates)?e:[]).length)return r=[],e.forEach((function(e){r.push(e[0])})),t=(e=null!=t?t:{}).id,e=void 0===(e=e.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:e,o({id:void 0===t?"mask":t,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(r)}}}},e)},loadImages:function(e){var t=this;return new Promise((function(o){var n={};if(e&&0!==Object.keys(e).length)for(var i in e){var a,s,l=e[i];"string"==typeof l?t.loadImage(l,u(i)):"object"==typeof l&&(l.url?(a=l.url,s=r(l,J),t.loadImage(a,u(i,s))):l.layer&&l.layer.render&&"function"==typeof l.layer.render&&u(i,l.config||{})(null,l.layer))}else o(n);function u(t,r){return function(i,a){n[t]={data:r,url:i?null:a},Object.keys(n).length===Object.keys(e).length&&o(n)}}}))},loadAddImages:function(e){var t=this;return new Promise((function(r){t.loadImages(e).then((function(e){for(var n in e){var i=e[n],a=o({},null==i?void 0:i.data,{type:"custom"});t.hasImage(n)||t.addImage(n,i.url,a)}r()}))}))},MapCircle:function(){return new T(this)},MapEvent:function(e){return new j(this,e)},MapMoreCustom:function(){return new B(this)},removeLayerSource:function(e){function t(e){r.getSource(e)&&(r.removeLayer(e),r.removeSource(e))}var r=this,o=e.name,n=null!=(n=e.sources)?n:[];e=null!=(e=e.layers)?e:[],Array.isArray(o)&&0<o.length?o.forEach((function(e){t(e)})):"string"==typeof o&&t(o),0<(null==n?void 0:n.length)&&0<(null==e?void 0:e.length)&&(e.forEach((function(e){r.getLayer(e)&&r.removeLayer(e)})),n.forEach((function(e){r.getSource(e)&&r.removeSource(e)})))},removeLayerEvent:function(e,t){if(void 0===t&&(t=!0),"object"==typeof e&&null!=e)if(Object.keys(e).includes("destroy")&&"function"==typeof e.destroy)e.destroy();else for(var r in e)e[r]&&e[r].destroy&&"function"==typeof e[r].destroy&&(e[r].destroy(),t)&&(e[r]=null)},MapMarker:function(e){return new G(this,e)},findCustomIcon:function(){var e,t=this.style.imageManager.images,r={};for(e in t)"custom"===t[e].type&&(r[e]=t[e]);return r},getCustomLayer:function(){var e=this,t=[];return u.map((function(r){e.getLayer(r.layer.id)&&t.push(r.layer)})),t},setStyle:function(e,t,r){var o,n,i,a=this;return null!=t&&t.save&&(i=(n=null!=t?t:{}).source,n=void 0!==(n=n.custom)&&n,i=null!=(o=i=void 0===i?[]:i)?o:[],c=this.findCustomIcon(),Array.isArray(i)&&0!==i.length?n||(i=Array.from(new Set([].concat(i,["composite","mapbox://mapbox.satellite"])))):i=["composite","mapbox://mapbox.satellite"],l=this.getAllLayerAndSource(i),this.once("style.load",(function(o){var n,i=[];for(n in c)i.push(n),a.style.imageManager.images[n]=c[n];var s=[];l.sources.map((function(e){var t=l.layers.filter((function(t){return t.source===e.name}));s.push({name:e.name,source:e.source,layer:t})})),null!=t&&t.log&&console.log(s),s.map((function(e){a.getSource(e.name)||a.addSource(e.name,e.source),e.layer.map((function(e){a.getLayer(e.id)||a.addLayer(e)}))})),u.forEach((function(e){a.getLayer(e.layer.id)||a.addLayer(e.layer,e.beforeId)})),r&&"function"==typeof r&&r({style:e,images:i,layerSource:l})}))),s.call(this,e,t)},getLayerIndex:function(e){if(e){var t=p.findIndex((function(t){return t.id===e}));if(-1!==t)return t}return 0===p.length?0:p.length-1},getLayerId:function(e,t){return e+=t=void 0===t?0:t,t=Number(e),isNaN(t)||e<0&&p.length<=e?"":p[e].id},getMinLayerId:function(){var e;return null!=(e=p[0].id)?e:""},getMaxLayerId:function(){var e;return null!=(e=p[p.length-1].id)?e:""},getAllLayerId:function(){return p.map((function(e){return e.id}))},getAllLayer:function(){return p},getLineLayer:function(){return p.map((function(e,t){return"line"!==e.type?null:{index:t,id:e.id}})).filter(Boolean)},AnimateLine:function(e,t){return new D(this,e,t)}}}(l,t);for(s in new Event("layerdata"),u)l.prototype[s]=u[s];var c,p=q.Style,h=function(e){var t=e.prototype.addImage,r=e.prototype.updateImage,o=e.prototype._loadSprite,n=e.prototype.queryRenderedFeatures,i=e.prototype.addLayer,a=e.prototype.removeLayer,s={};return{addImage:function(e,r){return r.type="custom",t.call(this,e,r),this},updateImage:function(e,t){t.type="custom",r.call(this,e,t)},_loadSprite:function(e,t){var r,n=this;void 0===t&&(t=!1),o.call(this,e),t&&(r=this._availableImages.length,this.map.on("data",(function e(t){var o=n._availableImages.length;if("style"===t.dataType&&o!==r&&r<o){for(var i=n._availableImages.slice(r),a=0;a<i.length;a++)n.imageManager.images[i[a]].type="custom";n.map.off("data",e)}})))},loadSprite:function(e){this._loadSprite(e,!0)},addLayer:function(e,t){var r=e.interactive;s[e.id]=void 0===r||r,i.call(this,e,t)},removeLayer:function(e){s[e]&&delete s[e],a.call(this,e)},queryRenderedFeatures:function(e,t,r){var o=n.call(this,e,t,r);if(0<o.length)for(var i=0;i<o.length;i++){var a=s[o[i].layer.id];o[i].layer.interactive=null==a||a}return o.filter((function(e){return e.layer.interactive}))}}}(p);for(c in h)p.prototype[c]=h[c];var y=(e=q.Popup).prototype.setDOMContent;e.prototype._closeClick=function(){},e.prototype.setDOMContent=function(e){return e=y.call(this,e),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),e}}},RegisterMapBoxModel:()=>function(e,t){if(q&&e&&t){(U=e).GLTFLoader=t,window.THREE=U;var r,o=q.Map,n={initGLTF:function(e,t,r){return new m(e,t,r)}};for(r in n)o.prototype[r]=n[r]}},RegisterMapClass:()=>function(e,t){var r;e&&(r=(t=null!=t?t:{}).tooltipClass,t=t.popupClass,e.tooltipClass=null!=r?r:"commonTooltip",e.popupClass=null!=t?t:"commonPopup")},getSymbolRipple:()=>function(e){var t,r=void 0===(t=(e=null!=e?e:{}).size)?30:t,o=void 0===(t=e.duration)?1e3:t,n=void 0===(t=e.color)?"#f00":t,i=e.custom,a=c(n,!0),s=!1;return i&&"function"==typeof i&&(s=!0),{width:r,height:r,data:new Uint8Array(r*r*4),onAdd:function(e){this.map=e,(e=document.createElement("canvas")).width=this.width,e.height=this.height,this.context=e.getContext("2d")},render:function(){var e,t,l,u=this.context;return s?u=i({width:this.width,height:this.height,duration:o,color:n,context:u}):(e=performance.now()%o/o,t=r/2*.2,l=r/2*e,u.clearRect(0,0,this.width,this.height),u.beginPath(),u.arc(this.width/2,this.height/2,l,0,2*Math.PI),u.strokeStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e+.1)+")",u.lineWidth=2,u.stroke(),u.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",u.fill(),u.beginPath(),u.arc(this.width/2,this.height/2,t,0,2*Math.PI),u.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",u.lineWidth=2+4*(1-e),u.fill()),this.data=u.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>c,isGeoJSON:()=>i,isNumber:()=>p,judgeSizeLngLat:()=>s,mergeGeoJson:()=>function(){for(var e={type:"FeatureCollection",features:[]},t=[],r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];for(var a=0;a<o.length;a++)Array.isArray(o[a])?t.push.apply(t,o[a]):o[a]&&"object"==typeof o[a]&&t.push(o[a]);for(var s,l=0;l<t.length;l++){var u=t[l];i(u)&&(u=u.features,(s=e.features).push.apply(s,u))}return e},object2Geojson:()=>function(e,t,r){var o=n(e);if(!Array.isArray(o))return null;e={type:"FeatureCollection"};for(var i=[],a=function(e){var n=o[e],a=function(e,t){if(t){var r;if("string"==typeof t)return 1===(r=t.split(".").filter(Boolean)).length?[l(e[r[0]])]:u(e,r);if(Array.isArray(t)){if(2===t.length)return[[e[t[0]],e[t[1]]].filter(Boolean)];if(3===t.length&&t[2])return u(e,r=t[2].split(".").filter(Boolean),[t[0],t[1]])}}return[]}(n,t);0<a.length&&a.map((function(t){var a=function(e){if(Array.isArray(e)){var t=function e(t){return Array.isArray(t)?Array.isArray(t[0])?1+e(t[0]):1:0}(e=e.filter(Boolean));if(0!==t)switch(t){case 1:return"Point";case 2:return"LineString";case 3:var r=(o=e[0])[0],o=o[o.length-1];return r[0]===o[0]&&r[1]===o[1]?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(e&&"object"==typeof e){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(e.type))return"type";if("Feature"===e.type)return"Feature"}return null}(t),s=!1;(s=!(!a||!("type"===a||0<t.length||"Feature"===a))||s)&&(s={type:"Feature"},"Feature"!==a?(s.properties=n,s.geometry="type"===a?t:{type:a,coordinates:t}):s=t,r&&r.key&&"string"==typeof r.key&&(r.alias&&"string"==typeof r.alias?s[r.alias]=o[e][r.key]:s[r.key]=o[e][r.key]),i.push(s))}))},s=0;s<o.length;s++)a(s);return e.features=i,e},resversalGeojson:()=>function(e,t){if(void 0===t&&(t=!0),i(e)){for(var r={type:"FeatureCollection",features:[]},n=e.features,l=0;l<n.length;l++){var u,c=n[l],p={};for(u in c)"geometry"!==u&&"properties"!==u&&"type"!==u&&(p[u]=c[u]);var h=c.geometry.coordinates,f=c.geometry.type,y={type:f,coordinates:null};y.coordinates=("Point"===f?s:a)(h,t),r.features.push(o({type:"Feature",geometry:y,properties:c.properties},p))}return r}return null},reversalLngLat:()=>a});var n=function e(t){var r,o,n="object"!=(n=typeof(r=t))?n:Object.prototype.toString.call(r).replace(/^\[object (\S+)\]$/,"$1");if("Array"===n)o=[];else{if("Object"!==n)return t;o={}}if("Array"===n)for(var i=0,a=t.length;i<a;i++)o.push(e(t[i]));else if("Object"===n)for(var s in t)o[s]=e(t[s]);return o};function i(e){return"object"==typeof e&&null!==e&&!("FeatureCollection"===e.type&&!Array.isArray(e.features))}function a(e,t){return void 0===t&&(t=!0),e&&("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))?p(e[0])?s(e,t):function e(t){for(var r=[],o=0;o<t.length;o++){var n=t[o];p(n[0])?r.push(s(n)):r.push(e(n))}return r}(e):[]}function s(e,t){void 0===t&&(t=!0);var r=Number(e[0]);return e=Number(e[1]),t&&r<e?[e,r]:[r,e]}function l(e){return"string"==typeof e?JSON.parse(e):e}function u(e,t,r){var o=[],i=2===(r=void 0===r?[]:r).length;return function e(t,a){var s;t&&a.length&&(s=a.shift(),t.hasOwnProperty(s))&&(t=t[s],Array.isArray(t)?0!==a.length||i?t.forEach((function(t){i?o.push([t[r[0]],t[r[1]]]):e(t,n(a))})):(s=l(t),o.push(s)):"object"==typeof t?0===a.length?o.push(i?[t[r[0]],t[r[1]]]:t):e(t,a):0===a.length&&(s=l(t),o.push(s)))}(e,t),o}function c(e,t){void 0===t&&(t=!1);var r,o,n=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,r,o){return t+t+r+r+o+o}));return(n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n))?(r=parseInt(n[1],16),o=parseInt(n[2],16),n=parseInt(n[3],16),t?[r,o,n,1]:"rgba("+r+","+o+","+n+",1)"):e}function p(e){return"number"==typeof e||!("string"!=typeof e||!e||e.includes(" ")||isNaN(Number(e)))}var h=["customName"],f=function(){function e(e,t,n){var i=this,a=(this._mouseEnter=function(e){var t,r,o;"Map"===e.originalEvent.target.ariaLabel&&(r=e.point,e=e.lngLat,t=(r=null!=(r=i.map.queryRenderedFeatures(r)[0])?r:{}).properties,o=r.geometry,r.source,r=r.layer,i.layerName.includes(r.id)?(r=o.coordinates,o=[e.lng,e.lat],0<(null==(e=o="mouseenter"===i.mouseType?0<r.length&&Array.isArray(r[0])?r[0]:r:o)?void 0:e.length)&&i.popup.setLngLat(o).setHTML(i.htmlCallBack(t,o)).addTo(i.map)):null!=(r=i.popup)&&r.remove())},this._mouseLeave=function(){i.popup.remove()},this.map=e,"string"==typeof t?this.layerName=[t]:Array.isArray(t)&&(this.layerName=t),e=null!=(t=e.tooltipClass)?t:"commonTooltip",void 0!==(a=(t=null!=n?n:{}).customName)&&a);t=r(t,h),a=a?"":e+" ",this.className=a,null!=n&&n.className&&(a+=n.className),this.fullName=a,this.popup=new mapboxgl.Popup(o({},t,{className:a,closeButton:null!=(e=null==n?void 0:n.closeButton)&&e,closeOnClick:null!=(t=null==n?void 0:n.closeOnClick)&&t,anchor:null!=(a=null==n?void 0:n.anchor)?a:"left",type:"tooltip"}))}var t=e.prototype;return t.show=function(e,t){var r=this;"function"==typeof(this.htmlCallBack=e)&&(this.mouseType="mouseenter","move"===t&&(this.mouseType="mousemove"),0<(null==(e=this.layerName)?void 0:e.length))&&this.layerName.forEach((function(e){r.map.on(r.mouseType,e,r._mouseEnter).on("mouseleave",e,r._mouseLeave)}))},t.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){r.popup.removeClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){r.popup.addClassName(e)})),this.oldClassName=e)},t.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off(t.mouseType,e,t._mouseEnter).off("mouseleave",e,t._mouseLeave)}))},e}(),y=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],d=function(){function e(e,t,n){var i=this,a=(this._closeOtherPopup=function(){var e;i.closeOther&&null!=(e=i.map)&&null!=(e=e._popups)&&e.forEach((function(e){var t;"popup"===e.options.type&&(Array.isArray(i.noCloseLayerName)&&0<i.noCloseLayerName.length?(t=e.options.sourceName.join("|"),new RegExp(t).test(i.noCloseLayerName)&&null!=e&&null!=(t=e._onClose)&&t.call(e)):null!=e&&null!=(t=e._onClose)&&t.call(e))}))},this._click=function(e){var t,r,o,n,a,s,l;"Map"===e.originalEvent.target.ariaLabel&&(i._closeOtherPopup(),t=e.point,e=e.lngLat,r=(n=null!=(n=(s=i.map.queryRenderedFeatures(t))[0])?n:{}).properties,o=n.geometry,n.source,n=n.layer,i.layerName.includes(n.id))&&(i.customClick||(n=o.coordinates,l=o.type,a=(s=null!=(a=null==(a=i.componentCallBack)?void 0:a.call(i,{properties:r,lngLat:e,coordinates:n,feature:s[0]}))?a:{}).component,s=s.instance,l="Point"===l?n:e,i.vueInstance=s,a&&(i.popup.setOffset(i.offset),i.popup.setLngLat(l).setDOMContent(a).addTo(i.map))),"function"==typeof i.callBack)&&i.callBack({lngLat:e,properties:r,geometry:o,point:t})},this.map=e,this.popup=null,"string"==typeof t?this.layerName=[t]:Array.isArray(t)&&(this.layerName=t),void 0!==(s=(t=n||{}).destroyComponent)&&s),s=void 0!==(s=t.customClick)&&s,l=void 0!==(l=t.popupClose)&&l,u=void 0===(u=t.closeOther)||u,c=void 0===(c=t.noCloseLayerName)?[]:c,p=void 0!==(p=t.customName)&&p,h=void 0===(h=t.offset)?[0,0]:h,f=t.closeClick;t=r(t,y),e=null!=(e=e.popupClass)?e:"commonPopup",p=p?"":e+" ",this.className=p,null!=n&&n.className&&(p+=n.className),this.fullName=p,this.noCloseLayerName=c,this.noCloseLayerName=[],this.customClick=s,this.popupCloseSign=l,this.closeOther=u,this.offset=h="number"==typeof h?[h,h]:h,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(o({},t,{offset:h,className:p,closeButton:null!=(e=null==t?void 0:t.closeButton)&&e,closeOnClick:null!=(n=null==t?void 0:t.closeOnClick)&&n,anchor:null!=(c=null==t?void 0:t.anchor)?c:"bottom",focusAfterOpen:null!=(s=null==t?void 0:t.focusAfterOpen)&&s,type:"popup",sourceName:this.layerName})),f&&"function"==typeof f&&(this.popup._closeClick=f),null!=(l=this.popup)&&l.on("close",(function(e){"function"==typeof i.closeCallback&&i.closeCallback(e),i.popupCloseSign&&null!=(e=i.vueInstance)&&e.popupClose&&"function"==typeof i.vueInstance.popupClose&&i.vueInstance.popupClose(),i.vueInstance&&a&&null!=(e=i.vueInstance)&&e.$destroy()})))}var t=e.prototype;return t.show=function(e,t){var r=this;this.componentCallBack=e,this.callBack=t,0<(null==(e=this.layerName)?void 0:e.length)&&this.layerName.forEach((function(e){r.map.on("click",e,r._click)}))},t.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){r.popup.removeClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){r.popup.addClassName(e)})),this.oldClassName=e)},t.showPosition=function(e,t,r,o){e&&(this._closeOtherPopup(),(r=(null!=r?r:{}).offset)&&this.popup.setOffset(r),this.popup.setLngLat(e).setDOMContent(t).addTo(this.map),o)&&"function"==typeof o&&o()},t.close=function(){var e;null!=(e=this.popup)&&e._onClose()},t.closeBack=function(e){this.closeCallback=e},t.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off("click",e,t._click)}))},e}(),m=function(){function e(e,t,r){var o=this,n=(this.clickEvent=function(e){var t=new THREE.Vector2,r=o.map.getCanvas();t.x=(e.clientX-r.getBoundingClientRect().left)/r.offsetWidth*2-1,t.y=-(e.clientY-r.getBoundingClientRect().top)/r.offsetHeight*2+1,e=(new THREE.Matrix4).getInverse(o.camera.projectionMatrix),r=(new THREE.Vector3).applyMatrix4(e),t=new THREE.Vector3(t.x,t.y,1).applyMatrix4(e).clone().sub(r).normalize(),(e=new THREE.Raycaster).set(r,t),r=e.intersectObjects(o.scene.children,!0),o.callback&&0<r.length&&(t=r[0],e=o.findProperties(t.object),o.callback(e))},this.findProperties=function(e){var t={},r=null;return"Scene"!==e.type&&(r=(e.lngLat?(t=e.properties,e):(t=(e=o.findProperties(e.parent)).properties,e)).lngLat),{properties:t,lngLat:r}},this.id="3d-"+e,this.type="custom",this.renderingMode="3d","function"==typeof r&&(this.callback=r),e=t.lngLat,r=t.url,void 0===(n=t.scale)?1:n),i=void 0===(i=t.height)?0:i,a=void 0===(a=t.rotate)?[Math.PI/2,0,0]:a,s=void 0===(s=t.properties)?{}:s,l=void 0===(l=t.AmbientLight)?{show:!0,color:16777215,intensity:.5}:l,u=void 0===(u=t.DirectionalLight)?[]:u,c=void 0===(c=t.PointLight)?[]:c;t=void 0!==(t=t.click)&&t,this.lngLat=e,this.url=r,this.scale=n,this.height=i,this.rotate=a,this.properties=s,this.AmbientLight=l,this.DirectionalLight=u,this.PointLight=c,this.click=t,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(e,i),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:a[0],rotateY:a[1],rotateZ:a[2],scale:n*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var t=e.prototype;return t.onAdd=function(e,t){var r,o,n=this;this.map=e,e=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,e.innerWidth/e.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(o=this.AmbientLight.color||16777215,r=this.AmbientLight.intensity||.5,o=new THREE.AmbientLight(o,r),this.scene.add(o)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1;e=e.position||[0,0,0],(t=new THREE.DirectionalLight(t,r)).position.set(e[0],e[1],e[2]).normalize(),n.scene.add(t)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1,o=e.distance||0,i=e.decay||2;e=e.position||[0,0,0],(t=new THREE.PointLight(t,r,o,i)).position.set(e[0],e[1],e[2]).normalize(),n.scene.add(t)})),(new THREE.GLTFLoader).load(this.url,(function(e){for(var t=0;t<e.scene.children.length;t++)e.scene.children[t].properties=n.properties,e.scene.children[t].lngLat=n.lngLat;n.scene.add(e.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:e,context:t,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},t.render=function(e,t){var r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),o=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),i=(new THREE.Matrix4).fromArray(t);r=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(r).multiply(o).multiply(n),this.camera.projectionMatrix.elements=t,this.camera.projectionMatrix=i.multiply(r),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},t.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},e}(),v=function(){function e(e){this.map=e,this.sourceName=[],this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map)return"vector"===e.type?(this.sourceName=[t],this.sourceType="vector",this._addSourceLayer(t,e,r),this.sourceName):"FeatureCollection"===e.type||Array.isArray(e.features)?(this.sourceName=[t],this._addSourceLayer(t,e,r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._addSourceLayer=function(e,t,r){"vector"===this.sourceType?this.map.addSource(e,o({},t,r.sourceConfig)):this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig)),t=r.beforeId||null,this.map.addLayer(o({id:e,type:"line",source:e},r.layerConfig),t),r.lineConfig&&(this.lineName=e+"-highlight",this.map.addLayer(o({id:this.lineName,type:"line",source:e},r.lineConfig)))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.lineName&&t.map.removeLayer(e+"-highlight"),t.map.removeSource(e))}))},e}(),g=function(){function e(e){this.map=e,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map){if("vector"===e.type)return this.sourceType="vector",this._addSourceLayer(t,e,r),this.sourceName=[t],this.sourceName;var o;if("FeatureCollection"===e.type||Array.isArray(e.features)){this.type=null!=(o=r.type)?o:"symbol";var n=r.sliceNum;if(!n||n<1e3)this.sourceName=[t],this._clearSource(),this._addSourceLayer(t,e,r);else{this._clearSource();for(var i=0,a=0;a<e.features.length;a+=n){var s={type:"FeatureCollection",features:[]},l=e.features.slice(a,n);s.features=[].concat(l),l=t+"-"+i,this.sourceName.push(l),this._addSourceLayer(l,s,r),i++}}return this.sourceName}}},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.map.removeSource(e))}))},t._addSourceLayer=function(e,t,r){"vector"===this.sourceType?this.map.addSource(e,o({},t,r.sourceConfig)):this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig)),t=r.beforeId||null,this.map.addLayer(o({id:e,type:this.type,source:e},r.layerConfig),t)},e}(),b=6371008.8,L={centimeters:100*b,centimetres:100*b,degrees:b/111325,feet:3.28084*b,inches:39.37*b,kilometers:b/1e3,kilometres:b/1e3,meters:b,metres:b,miles:b/1609.344,millimeters:1e3*b,millimetres:1e3*b,nauticalmiles:b/1852,radians:1,yards:1.0936*b};function A(e,t,r){var o={type:"Feature"};return 0!==(r=void 0===r?{}:r).id&&!r.id||(o.id=r.id),r.bbox&&(o.bbox=r.bbox),o.properties=t||{},o.geometry=e,o}function C(e,t,r){void 0===r&&(r={});for(var o=0,n=e;o<n.length;o++){var i=n[o];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}return A({type:"Polygon",coordinates:e},t,r)}function E(e,t){var r=L[t=void 0===t?"kilometers":t];if(r)return e/r;throw new Error(t+" units is invalid")}function N(e){return e%(2*Math.PI)*180/Math.PI}function w(e){return e%360*Math.PI/180}function S(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function M(e,t,r){if(null!==e)for(var o,n,i,a=0,s=e.type,l="FeatureCollection"===s,u="Feature"===s,c=l?e.features.length:1,p=0;p<c;p++)for(var h,f,y=(f=!!(h=l?e.features[p].geometry:u?e.geometry:e)&&"GeometryCollection"===h.type)?h.geometries.length:1,d=0;d<y;d++){var m=0,v=0,g=f?h.geometries[d]:h;if(null!==g){var b=g.coordinates,L=g.type,A=!r||"Polygon"!==L&&"MultiPolygon"!==L?0:1;switch(L){case null:break;case"Point":if(!1===t(b,a,p,m,v))return!1;a++,m++;break;case"LineString":case"MultiPoint":for(o=0;o<b.length;o++){if(!1===t(b[o],a,p,m,v))return!1;a++,"MultiPoint"===L&&m++}"LineString"===L&&m++;break;case"Polygon":case"MultiLineString":for(o=0;o<b.length;o++){for(n=0;n<b[o].length-A;n++){if(!1===t(b[o][n],a,p,m,v))return!1;a++}"MultiLineString"===L&&m++,"Polygon"===L&&v++}"Polygon"===L&&m++;break;case"MultiPolygon":for(o=0;o<b.length;o++){for(n=v=0;n<b[o].length;n++){for(i=0;i<b[o][n].length-A;i++){if(!1===t(b[o][n][i],a,p,m,v))return!1;a++}v++}m++}break;case"GeometryCollection":for(o=0;o<g.geometries.length;o++)if(!1===M(g.geometries[o],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function k(e){var t=[1/0,1/0,-1/0,-1/0];return M(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}const P=k.default=k,x=function(e){e=P(e);var t=void 0,r=(void 0===t&&(t={}),Number(e[0])),o=Number(e[1]),n=Number(e[2]),i=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,o];return C([[a,[n,o],[n,i],[r,i],a]],t.properties,{bbox:e,id:t.id})};function _(e,t,r,o){void 0===o&&(o={});var n=w((e=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&2<=e.length&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e))[0]),i=(e=w(e[1]),r=w(r),t=E(t,o.units),Math.asin(Math.sin(e)*Math.cos(t)+Math.cos(e)*Math.sin(t)*Math.cos(r)));return function(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(S(e[0])&&S(e[1]))return A({type:"Point",coordinates:e},t,r);throw new Error("coordinates must contain numbers")}([N(n+Math.atan2(Math.sin(r)*Math.sin(t)*Math.cos(e),Math.cos(t)-Math.sin(e)*Math.sin(i))),N(i)],o.properties)}const I=function(e,t,r){for(var o=(r=void 0===r?{}:r).steps||64,n=r.properties||(!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{}),i=[],a=0;a<o;a++)i.push(_(e,t,-360*a/o,r).geometry.coordinates);return i.push(i[0]),C([i],n)};var T=function(){function e(e){this.map=e,this.sourceName=[],this.lineName=""}var t=e.prototype;return t.draw=function(e,t,r){if(e){this.sourceName=[t];var o,n=null!=r?r:{},i=void 0===(o=n.radius)?0:o,a=void 0===(o=n.steps)?64:o,s=n.endRadius,l=[];if("object"==typeof e){if("FeatureCollection"!==e.type&&!Array.isArray(e.features))return;for(var u=e.features,c=0;c<u.length;c++){var p,h,f,y,d,m=u[c].geometry.coordinates;"number"==typeof m[0]&&"number"==typeof m[1]&&(m[0]<m[1]&&(p=[m[1],m[0]],m[0]=p[0],m[1]=p[1]),p=!1,h=0<(h=(p="string"==typeof i||p)?u[c].properties[i]:i)?h:0,f={steps:a,units:"kilometers",properties:u[c].properties},y=I(m,h,f),s?(d=!1,d=0<(d=(d="string"==typeof s||d)?u[c].properties[s]:s)?d:0,m=I(m,s,f),l.push(h===d?y:h<d?this._getRingJson(m.geometry.coordinates[0],y.geometry.coordinates[0],y.properties):this._getRingJson(y.geometry.coordinates[0],m.geometry.coordinates[0],y.properties))):l.push(y))}}return this._addSourceLayer(t,{type:"FeatureCollection",features:l},r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},t._getRingJson=function(e,t,r){return{type:"Feature",geometry:{coordinates:[e,t],type:"Polygon"},properties:r}},t._addSourceLayer=function(e,t,r){this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig)),t=(null!=r?r:{}).beforeId,this.map.addLayer(o({id:e,type:"fill",source:e},r.layerConfig),t),r.lineConfig&&(this.lineName=e+"-line",this.map.addLayer(o({id:this.lineName,type:"line",source:e},r.lineConfig),t))},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.lineName&&t.map.removeLayer(e+"-line"),t.map.removeSource(e))}))},e}(),j=function(){function e(e,t){this.map=e,this.name=[],"string"==typeof t?this.name=[t]:Array.isArray(t)&&t.every((function(e){return"string"==typeof e}))&&(this.name=t),this.event=[]}var t=e.prototype;return t.add=function(e){var t,r=this;if(0===(null==(t=this.event)?void 0:t.length)&&e&&"object"==typeof e){var o,n=function(t){var o,n;r.event.push(t),0<(null==(n=r.name)?void 0:n.length)?null!=(n=r.name)&&n.forEach((function(o){function n(r){var o;"Map"===(null==r||null==(o=r.originalEvent)||null==(o=o.target)?void 0:o.ariaLabel)&&e[t](r)}var i;r[t]=n,null!=(i=r.map)&&i.on(t,o,n)})):(r[t]=n=function(r){var o;"Map"===(null==r||null==(o=r.originalEvent)||null==(o=o.target)?void 0:o.ariaLabel)&&e[t](r)},null!=(o=r.map)&&o.on(t,n))};for(o in e)n(o)}},t.destroy=function(e){var t,r=this;e&&Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))?null!=(t=this.name)&&t.forEach((function(t){e.forEach((function(e){var o,n;r.event.includes(e)&&(n=r[e],null!=(o=r.map))&&o.off(e,t,n)}))})):0<(null==(t=this.name)?void 0:t.length)?null!=(t=this.name)&&t.forEach((function(e){r.event.forEach((function(t){var o,n=r[t];null!=(o=r.map)&&o.off(t,e,n)}))})):this.event.forEach((function(e){var t,o=r[e];null!=(t=r.map)&&t.off(e,o)}))},e}(),R=["id","type"],O=["id","type","beforeId"],B=function(){function e(e){this.map=e,this.sourceName=[]}var t=e.prototype;return t.draw=function(e,t){var n,a,s,l,u=this;return i(e)||"vector"===e.type?(n=(a=null!=(a=t.sourceConfig)?a:{}).id,l=void 0===(l=a.type)?"geojson":l,a=r(a,R),s=n,"vector"===e.type?this.map.addSource(n,o({},a,e)):this.map.addSource(n,o({type:l,data:e},a)),l=null!=(n=t.layerConfig)?n:{},e=[],Array.isArray(l)?e=l:"object"==typeof l&&e.push(l),e.forEach((function(e){var t=e.id,n=e.type,i=e.beforeId;e=r(e,O),u.map.addLayer(o({id:t,type:n,source:s},e),i)})),this.sourceName=[s].concat(e.map((function(e){return e.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},t.destroy=function(){var e,t,r=this;0<(null==(t=this.sourceName)?void 0:t.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(e=(t=this.sourceName)[0],t=t.slice(1),this.map.getSource(e)&&(t.forEach((function(e){r.map.removeLayer(e)})),this.map.removeSource(e))))},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},e}(),F=function(){function e(t,r,n){if((this instanceof e?this.constructor:void 0)!==e)throw new Error("MapLayer is a constructor and should be called with the new keyword");var i={layer:null,tooltip:null,popup:null};return r&&"object"==typeof r&&(i=o({},i,r)),this.name=t,this.layers=i,this.prop=null!=n?n:{},new Proxy(this,{deleteProperty:function(e,t){return(e!==this||"layers"!==t&&"name"!==t)&&(delete e[t],!0)},set:function(e,t,r){return(e!==this||"layers"!==t&&"name"!==t)&&(e[t]=r,!0)}})}var t=e.prototype;return t.addLayer=function(e){if(e&&"object"==typeof e)for(var t in e)this.layers[t]=e[t]},t.addProp=function(e){if(e&&"object"==typeof e)for(var t in e)this.prop[t]=e[t]},e}();function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var G=function(){function e(e,t){this.map=e,this.markers=[],this.options=t,this.properties=[]}var t=e.prototype;return t.draw=function(e,t){if(i(e))for(var r,n=null!=(r=this.options)?r:{},a=0,s=function(e,t){var r,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=function(e,t){var r;if(e)return"string"==typeof e?H(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(e,t):void 0}(e)))return o&&(e=o),r=0,function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.features);!(c=s()).done;){var l,u,c=c.value;"Point"===c.geometry.type&&(l=n,t&&"function"==typeof t&&1===(null==(u=t({lngLat:c.geometry.coordinates,properties:c.properties,index:a}))?void 0:u.nodeType)&&(l=o({},l,{element:u})),u=new mapboxgl.Marker(l).setLngLat(c.geometry.coordinates).addTo(this.map),this.markers.push(u),this.properties.push(c.properties),a++)}},t.addEvent=function(e){var t=this;if(e&&"object"==typeof e)for(var r=0;r<this.markers.length;r++)!function(r){["dragstart","drag","dragend"].forEach((function(n){e[n]&&"function"==typeof e[n]&&t.markers[r].on(n,(function(i){e[n](o({},i,{properties:t.properties[r]}))}))}))}(r)},t.destroy=function(){for(var e=0;e<this.markers.length;e++)this.markers[e].remove();this.markers=[]},t.visible=function(e){var t;"boolean"==typeof e&&null!=(t=this.markers)&&t.forEach((function(t){t.getElement().style.display=e?"block":"none"}))},e}(),D=function(){function e(e,t,r){var o;r=null!=(o=r)?o:{},this.map=e,this.name=t,this.dash=Array.isArray(r.dash)?r.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(o=r.step)?o:50,this.animateId=null}var t=e.prototype;return t.animate=function(){var e,t=this;this.name&&this.map.getLayer(this.name)&&function r(o){(o=parseInt(o/t.step%t.dash.length))!==e&&(t.map.setPaintProperty(t.name,"line-dasharray",t.dash[e]),e=o),t.animateId=requestAnimationFrame(r)}(e=0)},t.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},e}(),z=["padding","animate","maxZoom","essential"],J=["url"],q=null,U=null;return t})()));
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("zMapUtil",[],t):"object"==typeof exports?exports.zMapUtil=t():e.zMapUtil=t()}(this,(()=>{return t={61:(e,t,r)=>{var n=r(698).default;e.exports=function(){"use strict";e.exports=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s=(w="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",u=w.asyncIterator||"@@asyncIterator",l=w.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(t){c=function(e,t,r){return e[t]=r}}function p(e,r,n,o){var i,s,u,l;return r=r&&r.prototype instanceof g?r:g,r=Object.create(r.prototype),o=new k(o||[]),a(r,"_invoke",{value:(i=e,s=n,u=o,l=h,function(e,r){if(l===d)throw new Error("Generator is already running");if(l===m){if("throw"===e)throw r;return{value:t,done:!0}}for(u.method=e,u.arg=r;;){var n=u.delegate;if(n&&(n=function e(r,n){var o=n.method,i=r.iterator[o];return i===t?(n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v):"throw"===(o=f(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=o.arg,n.delegate=null,v):(i=o.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,u),n)){if(n===v)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(l===h)throw l=m,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(l=d,"normal"===(n=f(i,s,u)).type){if(l=u.done?m:y,n.arg===v)continue;return{value:n.arg,done:u.done}}"throw"===n.type&&(l=m,u.method="throw",u.arg=n.arg)}})}),r}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var h="suspendedStart",y="suspendedYield",d="executing",m="completed",v={};function g(){}function b(){}function L(){}var w,A,E=(c(w={},s,(function(){return this})),(A=(A=Object.getPrototypeOf)&&A(A(P([]))))&&A!==o&&i.call(A,s)&&(w=A),L.prototype=g.prototype=Object.create(w));function M(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){var r;a(this,"_invoke",{value:function(o,a){function s(){return new t((function(r,s){!function r(o,a,s,u){var l;if("throw"!==(o=f(e[o],e,a)).type)return(a=(l=o.arg).value)&&"object"==n(a)&&i.call(a,"__await")?t.resolve(a.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(a).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}));u(o.arg)}(o,a,r,s)}))}return r=r?r.then(s,s):s()}})}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function P(e){if(e||""===e){var r,o=e[s];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(o=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n}).next=o}throw new TypeError(n(e)+" is not iterable")}return a(E,"constructor",{value:b.prototype=L,configurable:!0}),a(L,"constructor",{value:b,configurable:!0}),b.displayName=c(L,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,L):(e.__proto__=L,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},M(x.prototype),c(x.prototype,u,(function(){return this})),r.AsyncIterator=x,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new x(p(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},M(E),c(E,l,"Generator"),c(E,s,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},r.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;0<=o;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var a=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,C(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r},e.exports.__esModule=!0,e.exports.default=e.exports},698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:(e,t,r)=>{r=r(61)(),e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={},e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n={},(()=>{"use strict";function t(e,t){if(null==e)return{};for(var r,n={},o=Object.keys(e),i=0;i<o.length;i++)r=o[i],0<=t.indexOf(r)||(n[r]=e[r]);return n}function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e.r(n),e.d(n,{MapLayer:()=>K,RegisterMapBoxMethod:()=>function(e,n){if(e&&e.Map){oe=e,-1===(window.mapboxgl=oe).Map.prototype._setupPainter.toString().indexOf("webgl2")&&(a=oe.Map.prototype._setupPainter,oe.Map.prototype._setupPainter=function(){var e=this._canvas.getContext;this._canvas.getContext=function(t,r){return e.apply(this,["webgl2",r])||e.apply(this,["webgl",r])||e.apply(this,["experimental-webgl",r])},a.apply(this),this._canvas.getContext=e});var a,s,u=e.Map,l=function(e,n){var a=[],s=[];n&&Array.isArray(n)&&0<n.length&&n.every((function(e){return"string"==typeof e}))&&(s=n),a=s;var u=e.prototype.setStyle,l={layers:[],sources:[]},c=[],p={},f=[],h=!1,v=null,g={};return{clearData:function(){a=s,l={layers:[],sources:[]},c=[],p={},h=!(f=[]),v=null,g={}},setPaint:function(e,t){fe(this,e,t,"setPaintProperty")},setLayout:function(e,t){fe(this,e,t,"setLayoutProperty")},customStyle:function(e){if(e&&"object"==typeof e)for(var t in e){var r,n=e[t];"string"==typeof n?pe(this,t,n):Array.isArray(n)&&(ae(n[0])||Array.isArray(n[0]))&&(r=null,"number"!=typeof n[1]&&!Array.isArray(n[1])||(r=n[1]),pe(this,t,n[0],r))}},getAllLayerAndSource:function(e,t){void 0===e&&(e=a),void 0===t&&(t=!0);for(var r,n=this.getStyle(),i=n.layers,s=n.sources,u={layers:[],sources:[]},l=0;l<i.length;)"background"===i[l].type||e.includes(i[l].source)||(r=i[l].id,this.getLayer(r)&&(u.layers.push(o(i[l])),t||this.removeLayer(r))),l++;var c,p=[];for(c in s)p.push(c);for(var f=0;f<p.length;){var h=p[f];e.includes(h)||this.isSourceLoaded(h)&&(u.sources.push({name:h,source:o(s[h])}),t||this.removeSource(h)),f++}return u},removeAllCustomLayer:function(){var e=this;c.forEach((function(t){e.getLayer(t.layer.id)&&e.removeLayer(t.layer.id)}))},removeAllLayerAndSource:function(e){return void 0===e&&(e=a),this.removeAllCustomLayer(),this.getAllLayerAndSource(e,!1)},removeEvents:function(e){var t=this;void 0===e&&(e=["click","mousemove","mouseout"]),Array.isArray(e)&&e.forEach((function(e){e in t._listeners&&(t._listeners[e]=[])}))},removePopup:function(e){e&&"string"==typeof e?["tooltip","popup"].includes(e)&&this._popups.forEach((function(t){t.options.type===e&&t.remove()})):this._popups.forEach((function(e){e.remove()}))},findCustomLayer:function(e,t){void 0===t&&(t=a);for(var r=this.getStyle().layers,n=[],o=0;o<r.length;)"background"===r[o].type||t.includes(r[o].source)||n.push(r[o]),o++;if(e){if("string"==typeof e)return n.filter((function(t){return t.type===e}));if(Array.isArray(e)&&0<e.length)return n.filter((function(t){return e.includes(t.type)}))}return n},MapTooltip:function(e,t){return new k(this,e,t)},MapPopup:function(e,t){return new S(this,e,t)},addLayer:function(e,t){var n;return this._lazyInitEmptyStyle(),"custom"===e.type&&c.push({layer:e,beforeId:t}),t?-1!==(n=f.findIndex((function(e){return e.id===t})))&&f.splice(n,0,{type:e.type,id:e.id}):f.push({type:e.type,id:e.id}),this.style.addLayer(e,t),this.fire("layerdata",r({},e,{add:!0})),this._update(!0)},removeLayer:function(e){var t=this.style.getLayer(e),n=c.findIndex((function(t){return t.layer.id===e}));return-1!==n&&c.splice(n,1),n=f.findIndex((function(t){return t.id===e})),-1!==n&&f.splice(n,1),this.style.removeLayer(e),this.fire("layerdata",r({},t,{add:!1})),this._update(!0)},moveLayer:function(e,t){var r,n=f.findIndex((function(t){return t.id===e})),o=f.findIndex((function(e){return e.id===t}));return-1!==n&&-1!==o&&(r=f.splice(n,1)[0],o<0?o=0:o>f.length&&(o=f.length),f.splice(o,0,r)),this.style.moveLayer(e,t),this._update(!0)},MapLine:function(){return new T(this)},MapCustom:function(){return new j(this)},fitBoundsGeoJson:function(e,t,r){e&&(e=[[(e=J(e)).bbox[0],e.bbox[1]],[e.bbox[2],e.bbox[3]]],this.fitBoundsPosition(e,t,r))},fitBoundsPosition:function(e,n,o){var i,a,s,u;Array.isArray(e)&&0!==(null==e?void 0:e.length)&&(i=void 0===(i=(n=null!=n?n:{}).padding)?40:i,a=void 0===(a=n.animate)||a,s=void 0===(s=n.maxZoom)?15:s,u=void 0===(u=n.essential)||u,n=t(n,re),this.fitBounds(e,r({linear:!1,padding:i,animate:a,essential:u,maxZoom:s},n),o))},getInvertMask:function(e,t){var n;if(i(e)&&0!==(e=null!=(e=e.features[0].geometry.coordinates)?e:[]).length)return n=[],e.forEach((function(e){n.push(e[0])})),t=(e=null!=t?t:{}).id,e=void 0===(e=e.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:e,r({id:void 0===t?"mask":t,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(n)}}}},e)},fitMap:function(){for(var e={},t=!1,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];var s=void 0===(s=o[0])?null:s,u=void 0===(u=o[1])?null:u;s?i(s)?(t=!1,v=s,u&&!i(u)&&"object"==typeof u&&(g=u)):"object"==typeof s&&(t=!0,e=s):v&&(t=!0),t&&v&&this.fitBoundsGeoJson(v,r({},g,e))},loadImages:function(e){var r=this;return new Promise((function(n){var o={};if(e&&0!==Object.keys(e).length)for(var i in e){var a,s,u=e[i];"string"==typeof u?r.loadImage(u,l(i)):"object"==typeof u&&(u.url?(a=u.url,s=t(u,ne),r.loadImage(a,l(i,s))):u.layer&&u.layer.render&&"function"==typeof u.layer.render&&l(i,u.config||{})(null,u.layer))}else n(o);function l(t,r){return function(i,a){o[t]={data:r,url:i?null:a},Object.keys(o).length===Object.keys(e).length&&n(o)}}}))},loadAddImages:function(e){var t=this;return new Promise((function(n){t.loadImages(e).then((function(e){for(var o in e){var i=e[o],a=r({},null==i?void 0:i.data,{type:"custom"});t.hasImage(o)||t.addImage(o,i.url,a)}n()}))}))},MapCircle:function(){return new Y(this)},MapEvent:function(e){return new U(this,e)},MapMoreCustom:function(){return new X(this)},removeLayerSource:function(e){function t(e){r.getSource(e)&&(r.removeLayer(e),r.removeSource(e))}var r=this,n=e.name,o=null!=(o=e.sources)?o:[];e=null!=(e=e.layers)?e:[],Array.isArray(n)&&0<n.length?n.forEach((function(e){t(e)})):"string"==typeof n&&t(n),0<(null==o?void 0:o.length)&&0<(null==e?void 0:e.length)&&(e.forEach((function(e){r.getLayer(e)&&r.removeLayer(e)})),o.forEach((function(e){r.getSource(e)&&r.removeSource(e)})))},removeLayerEvent:function(e,t){if(void 0===t&&(t=!0),"object"==typeof e&&null!=e)if(Object.keys(e).includes("destroy")&&"function"==typeof e.destroy)e.destroy();else for(var r in e)e[r]&&e[r].destroy&&"function"==typeof e[r].destroy&&(e[r].destroy(),t)&&(e[r]=null)},MapMarker:function(e){return new ee(this,e)},findCustomIcon:function(){var e,t=this.style.imageManager.images,r={};for(e in t)"custom"===t[e].type&&(r[e]=t[e]);return r},getCustomLayer:function(){var e=this,t=[];return c.map((function(r){e.getLayer(r.layer.id)&&t.push(r.layer)})),t},setStyle:function(e,t,r){var n,o,i,a=this;return null!=t&&t.save&&(i=(o=null!=t?t:{}).source,o=void 0!==(o=o.custom)&&o,i=null!=(n=i=void 0===i?[]:i)?n:[],p=this.findCustomIcon(),Array.isArray(i)&&0!==i.length?o||(i=Array.from(new Set([].concat(i,["composite","mapbox://mapbox.satellite"])))):i=["composite","mapbox://mapbox.satellite"],l=this.getAllLayerAndSource(i),this.once("style.load",(function(n){var o,i=[];for(o in p)i.push(o),a.style.imageManager.images[o]=p[o];var s=[];l.sources.map((function(e){var t=l.layers.filter((function(t){return t.source===e.name}));s.push({name:e.name,source:e.source,layer:t})})),null!=t&&t.log&&console.log(s),s.map((function(e){a.getSource(e.name)||a.addSource(e.name,e.source),e.layer.map((function(e){a.getLayer(e.id)||a.addLayer(e)}))})),c.forEach((function(e){a.getLayer(e.layer.id)||a.addLayer(e.layer,e.beforeId)})),r&&"function"==typeof r&&r({style:e,images:i,layerSource:l})}))),u.call(this,e,t)},getLayerIndex:function(e){if(e){var t=f.findIndex((function(t){return t.id===e}));if(-1!==t)return t}return 0===f.length?0:f.length-1},getLayerId:function(e,t){return e+=t=void 0===t?0:t,t=Number(e),isNaN(t)||e<0&&e>=f.length?"":null!=(e=null==(t=f)||null==(t=t[e])?void 0:t.id)?e:void 0},getMinLayerId:function(){var e;return null!=(e=null==(e=f)||null==(e=e[0])?void 0:e.id)?e:void 0},getMaxLayerId:function(){var e;return null!=(e=null==(e=f)||null==(e=e[f.length-1])?void 0:e.id)?e:void 0},getAllLayerId:function(){return f.map((function(e){return e.id}))},getAllLayer:function(){return f},getLineLayer:function(){return f.map((function(e,t){return"line"!==e.type?null:{index:t,id:e.id}})).filter(Boolean)},AnimateLine:function(e,t){return new te(this,e,t)},addHeader:function(e,t){var n;t&&"function"==typeof t&&!h&&(n=this._requestManager.transformRequest,this._requestManager.transformRequest=function(o,i){return i=n.call(this,o,i),(o=t(o))&&"boolean"==typeof o?(h=!0,r({headers:e},i)):i})},getTileByPosition:function(e,t){var r,n;return e&&Array.isArray(e)&&2<=e.length&&e.every((function(e){return"number"==typeof e}))?(r=(e=oe.MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]})).x,e=e.y,t=null!=(n=t)?n:this.getZoom(),n=Math.floor(t),t=Math.pow(2,n),[Math.floor(r*t),Math.floor(e*t),n]):[]},getPositionByTile:function(e){var t,r,n,o;return!(e&&Array.isArray(e)&&3===e.length&&e.every((function(e){return"number"==typeof e})))||(o=e[0],t=e[1],e=Math.floor(e[2]),e=Math.pow(2,e),o<0)||t<0||e<=o||e<=t?[]:(r=m(t/e),n=d(o/e),o=d((o+1)/e),[n,m((t+1)/e),o,r])},getTilesByBounds:function(e,t){var r=void 0===(r=(t=null!=(t=t=void 0===t?{}:t)?t:{}).expand)?0:r,n=(t=void 0!==(t=t.reversal)&&t,e=null!=(o=e)?o:this.getZoom(),Math.floor(e)),o=this.getBounds().toArray(),i=(e=this.getTileByPosition(o[0],n))[0],a=e[1],s=(e=this.getTileByPosition(o[1],n))[0],u=e[1];if(u-=r="number"!=typeof r||r<0||2<r?0:r,s+=r,a+=r,!(y(i-=r)&&y(s)&&y(u)&&y(a)))return[];var l=[];if(t)for(var c=u;c<=a;c++)for(var p=i;p<=s;p++)l.push([p,c,n]);else for(var f=i;f<=s;f++)for(var h=u;h<=a;h++)l.push([f,h,n]);var d=Math.pow(2,n);return l.forEach((function(e){e[0]<0&&(e[0]=e[0]+d)})),l.filter((function(e){return 0<=e[1]}))}}}(u,n);for(s in new Event("layerdata"),l)u.prototype[s]=l[s];var c,p=oe.Style,f=function(e){var t=e.prototype.addImage,r=e.prototype.updateImage,n=e.prototype._loadSprite,o=e.prototype.queryRenderedFeatures,i=e.prototype.addLayer,a=e.prototype.removeLayer,s={};return{addImage:function(e,r){return r.type="custom",t.call(this,e,r),this},updateImage:function(e,t){t.type="custom",r.call(this,e,t)},_loadSprite:function(e,t){var r,o=this;void 0===t&&(t=!1),n.call(this,e),t&&(r=this._availableImages.length,this.map.on("data",(function e(t){var n=o._availableImages.length;if("style"===t.dataType&&n!==r&&r<n){for(var i=o._availableImages.slice(r),a=0;a<i.length;a++)o.imageManager.images[i[a]].type="custom";o.map.off("data",e)}})))},loadSprite:function(e){this._loadSprite(e,!0)},addLayer:function(e,t){var r=e.interactive;s[e.id]=void 0===r||r,i.call(this,e,t)},removeLayer:function(e){s[e]&&delete s[e],a.call(this,e)},queryRenderedFeatures:function(e,t,r){var n=o.call(this,e,t,r);if(0<n.length)for(var i=0;i<n.length;i++){var a=s[n[i].layer.id];n[i].layer.interactive=null==a||a}return n.filter((function(e){return e.layer.interactive}))}}}(p);for(c in f)p.prototype[c]=f[c];var h=(e=oe.Popup).prototype.setDOMContent;e.prototype._closeClick=function(){},e.prototype.setDOMContent=function(e){return e=h.call(this,e),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),e}}},RegisterMapBoxModel:()=>function(e,t){if(oe&&e&&t){(ie=e).GLTFLoader=t,window.THREE=ie;var r,n=oe.Map,o={initGLTF:function(e,t,r){return new _(e,t,r)}};for(r in o)n.prototype[r]=o[r]}},RegisterMapClass:()=>function(e,t){var r;e&&(r=(t=null!=t?t:{}).tooltipClass,t=t.popupClass,e.tooltipClass=null!=r?r:"commonTooltip",e.popupClass=null!=t?t:"commonPopup")},deepClone:()=>o,gcj02ToWgs84:()=>function(e,t){var r,n,o,i,a;return A(e,t)?[e,t]:(r=L(e-105,t-35),n=w(e-105,t-35),o=t/180*v,i=Math.sin(o),i=1-b*i*i,a=Math.sqrt(i),r=180*r/(g*(1-b)/(i*a)*v),[2*e-(e+(n=180*n/(g/a*Math.cos(o)*v))),2*t-(t+r)])},getArrayDepth:()=>p,getPositionType:()=>c,getSymbolRipple:()=>function(e){var t,r=void 0===(t=(e=null!=e?e:{}).size)?30:t,n=void 0===(t=e.duration)?1e3:t,o=void 0===(t=e.color)?"#f00":t,i=e.custom,a=f(o,!0),s=!1;return i&&"function"==typeof i&&(s=!0),{width:r,height:r,data:new Uint8Array(r*r*4),onAdd:function(e){this.map=e,(e=document.createElement("canvas")).width=this.width,e.height=this.height,this.context=e.getContext("2d")},render:function(){var e,t,u,l=this.context;return s?l=i({width:this.width,height:this.height,duration:n,color:o,context:l}):(e=performance.now()%n/n,t=r/2*.2,u=r/2*e,l.clearRect(0,0,this.width,this.height),l.beginPath(),l.arc(this.width/2,this.height/2,u,0,2*Math.PI),l.strokeStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e+.1)+")",l.lineWidth=2,l.stroke(),l.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",l.fill(),l.beginPath(),l.arc(this.width/2,this.height/2,t,0,2*Math.PI),l.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",l.lineWidth=2+4*(1-e),l.fill()),this.data=l.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>f,isGeoJSON:()=>i,isNumber:()=>h,isValidNumber:()=>y,judgeSizeLngLat:()=>s,latFromMercatorY:()=>m,lngFromMercatorX:()=>d,mergeGeoJson:()=>function(){for(var e={type:"FeatureCollection",features:[]},t=[],r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];for(var a=0;a<n.length;a++)Array.isArray(n[a])?t.push.apply(t,n[a]):n[a]&&"object"==typeof n[a]&&t.push(n[a]);for(var s,u=0;u<t.length;u++){var l=t[u];i(l)&&(l=l.features,(s=e.features).push.apply(s,l))}return e},object2Geojson:()=>function(e,t,r){var n=o(e);if(!Array.isArray(n))return null;e={type:"FeatureCollection"};for(var i=[],a=function(e){var o=n[e],a=function(e,t){if(t)if("string"==typeof t){var r=t.split(".").filter(Boolean);if(1!==r.length)return l(e,r);if(r=e[r[0]])return[u(r)]}else if(Array.isArray(t)){if(2===t.length)return[[e[t[0]],e[t[1]]].filter(Boolean)];if(3===t.length&&t[2])return l(e,r=t[2].split(".").filter(Boolean),[t[0],t[1]])}return[]}(o,t);0<a.length&&a.map((function(t){var a=c(t),s=!1;(s=!(!a||!("type"===a||0<t.length||"Feature"===a))||s)&&(s={type:"Feature"},"Feature"!==a?(s.properties=o,s.geometry="type"===a?t:{type:a,coordinates:t}):s=t,r&&r.key&&"string"==typeof r.key&&(r.alias&&"string"==typeof r.alias?s[r.alias]=n[e][r.key]:s[r.key]=n[e][r.key]),i.push(s))}))},s=0;s<n.length;s++)a(s);return e.features=i,e},outOfChina:()=>A,resversalGeojson:()=>function(e,t){if(void 0===t&&(t=!0),i(e)){for(var n={type:"FeatureCollection",features:[]},o=e.features,u=0;u<o.length;u++){var l,c=o[u],p={};for(l in c)"geometry"!==l&&"properties"!==l&&"type"!==l&&(p[l]=c[l]);var f=c.geometry.coordinates,h=c.geometry.type,y={type:h,coordinates:null};y.coordinates=("Point"===h?s:a)(f,t),n.features.push(r({type:"Feature",geometry:y,properties:c.properties},p))}return n}return null},reversalLngLat:()=>a,wgs84ToGcj02:()=>function(e,t){var r,n,o,i,a;return A(e=+e,t=+t)?[e,t]:(r=L(e-105,t-35),n=w(e-105,t-35),o=t/180*v,i=Math.sin(o),i=1-b*i*i,a=Math.sqrt(i),r=180*r/(g*(1-b)/(i*a)*v),[e+(n=180*n/(g/a*Math.cos(o)*v)),t+r])}});var o=function e(t){var r,n,o="object"!=(o=typeof(r=t))?o:Object.prototype.toString.call(r).replace(/^\[object (\S+)\]$/,"$1");if("Array"===o)n=[];else{if("Object"!==o)return t;n={}}if("Array"===o)for(var i=0,a=t.length;i<a;i++)n.push(e(t[i]));else if("Object"===o)for(var s in t)n[s]=e(t[s]);return n};function i(e){return"object"==typeof e&&null!==e&&"FeatureCollection"===e.type&&Array.isArray(e.features)}function a(e,t){return void 0===t&&(t=!0),e&&("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))?h(e[0])?s(e,t):function e(t){for(var r=[],n=0;n<t.length;n++){var o=t[n];h(o[0])?r.push(s(o)):r.push(e(o))}return r}(e):[]}function s(e,t){void 0===t&&(t=!0);var r=Number(e[0]);return e=Number(e[1]),t&&r<e?[e,r]:[r,e]}function u(e){return"string"==typeof e?JSON.parse(e):e}function l(e,t,r){var n=[],i=2===(r=void 0===r?[]:r).length;return function e(t,a){var s;t&&a.length&&(s=a.shift(),t.hasOwnProperty(s))&&(t=t[s],Array.isArray(t)?0!==a.length||i?t.forEach((function(t){i?n.push([t[r[0]],t[r[1]]]):e(t,o(a))})):t&&(s=u(t),n.push(s)):"object"==typeof t?0===a.length?n.push(i?[t[r[0]],t[r[1]]]:t):e(t,a):0===a.length&&t&&(s=u(t),n.push(s)))}(e,t),n}function c(e){if(Array.isArray(e)){var t=p(e=e.filter(Boolean));if(0!==t)switch(t){case 1:return"Point";case 2:return"LineString";case 3:var r=(n=e[0])[0],n=n[n.length-1];return r[0]===n[0]&&r[1]===n[1]?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(e&&"object"==typeof e){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(e.type))return"type";if("Feature"===e.type)return"Feature"}return null}function p(e){return Array.isArray(e)?Array.isArray(e[0])?1+p(e[0]):1:0}function f(e,t){void 0===t&&(t=!1);var r,n,o=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,r,n){return t+t+r+r+n+n}));return(o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o))?(r=parseInt(o[1],16),n=parseInt(o[2],16),o=parseInt(o[3],16),t?[r,n,o,1]:"rgba("+r+","+n+","+o+",1)"):e}function h(e){return"number"==typeof e||!("string"!=typeof e||!e||e.includes(" ")||isNaN(Number(e)))}function y(e){return isFinite(e)&&!isNaN(e)}function d(e){return 360*e-180}function m(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var v=Math.PI,g=6378245,b=.006693421622965943;function L(e,t){var r=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return(r+=2*(20*Math.sin(6*e*v)+20*Math.sin(2*e*v))/3)+2*(20*Math.sin(t*v)+40*Math.sin(t/3*v))/3+2*(160*Math.sin(t/12*v)+320*Math.sin(t*v/30))/3}function w(e,t){return t=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e)),(t+=2*(20*Math.sin(6*e*v)+20*Math.sin(2*e*v))/3)+2*(20*Math.sin(e*v)+40*Math.sin(e/3*v))/3+2*(150*Math.sin(e/12*v)+300*Math.sin(e/30*v))/3}function A(e,t){return t=+t,!(73.66<(e=+e)&&e<135.05&&3.86<t&&t<53.55)}function E(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function M(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){E(i,n,o,a,s,"next",e)}function s(e){E(i,n,o,a,s,"throw",e)}a(void 0)}))}}var x=e(687),N=e.n(x),C=["customName"],k=function(){function e(e,n,o){var i=this,a=(this._mouseEnter=function(){var e=M(N().mark((function e(t){var r,n,o,a,s,u,l,c;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Map"!==t.originalEvent.target.ariaLabel)return e.abrupt("return");e.next=2;break;case 2:if(r=t.point,n=t.lngLat,o=i.map.queryRenderedFeatures(r),u=null!=(u=o[0])?u:{},a=u.properties,s=u.geometry,u.source,u=u.layer,i.layerName.includes(u.id)){e.next=8;break}return null!=(u=i.popup)&&u.remove(),e.abrupt("return");case 8:if(u=s.coordinates,l=[n.lng,n.lat],"mouseenter"===i.mouseType&&(l=i._getPosition(u)),0<(null==(c=l)?void 0:c.length))return e.next=14,i.htmlCallBack(a,l,{lngLat:n,geometry:s,point:r,features:o,feature:o[0]});e.next=16;break;case 14:c=e.sent,i.popup.setLngLat(l).setHTML(c).addTo(i.map);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._mouseLeave=function(){i.popup.remove()},this.map=e,"string"==typeof n?this.layerName=[n]:Array.isArray(n)&&(this.layerName=n),e=null!=(n=e.tooltipClass)?n:"commonTooltip",void 0!==(a=(n=null!=o?o:{}).customName)&&a);n=t(n,C),a=a?"":e+" ",this.className=a,null!=o&&o.className&&(a+=o.className),this.fullName=a,this.popup=new mapboxgl.Popup(r({},n,{className:a,closeButton:null!=(e=null==o?void 0:o.closeButton)&&e,closeOnClick:null!=(n=null==o?void 0:o.closeOnClick)&&n,anchor:null!=(a=null==o?void 0:o.anchor)?a:"left",type:"tooltip"}))}var n=e.prototype;return n.show=function(e,t){var r=this;"function"==typeof(this.htmlCallBack=e)&&(this.mouseType="mouseenter","move"===t&&(this.mouseType="mousemove"),0<(null==(e=this.layerName)?void 0:e.length))&&this.layerName.forEach((function(e){r.map.on(r.mouseType,e,r._mouseEnter).on("mouseleave",e,r._mouseLeave)}))},n.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){r.popup.removeClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){r.popup.addClassName(e)})),this.oldClassName=e)},n.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off(t.mouseType,e,t._mouseEnter).off("mouseleave",e,t._mouseLeave)}))},n._getPosition=function(e){return function e(t){return Array.isArray(t[0])?e(t[0]):t}(e)},e}(),P=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],S=function(){function e(e,n,o){var i=this,a=(this._closeOtherPopup=function(){var e;i.closeOther&&null!=(e=i.map)&&null!=(e=e._popups)&&e.forEach((function(e){var t;"popup"===e.options.type&&(Array.isArray(i.noCloseLayerName)&&0<i.noCloseLayerName.length?(t=e.options.sourceName.join("|"),new RegExp(t).test(i.noCloseLayerName)&&null!=e&&null!=(t=e._onClose)&&t.call(e)):null!=e&&null!=(t=e._onClose)&&t.call(e))}))},this._click=function(){var e=M(N().mark((function e(t){var r,n,o,a,s,u,l,c,p,f,h,y;return N().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Map"!==t.originalEvent.target.ariaLabel)return e.abrupt("return");e.next=2;break;case 2:if(i._closeOtherPopup(),r=t.point,n=t.lngLat,o=i.map.queryRenderedFeatures(r),l=null!=(l=o[0])?l:{},a=l.properties,s=l.geometry,l.source,l=l.layer,i.layerName.includes(l.id)){e.next=8;break}return e.abrupt("return");case 8:if(i.customClick){e.next=28;break}return c=s.coordinates,p=s.type,e.next=12,null==(l=i.componentCallBack)?void 0:l.call(i,{properties:a,lngLat:n,coordinates:c,point:r,features:o,feature:o[0]});case 12:if(e.t1=u=e.sent,e.t0=null!==e.t1,!e.t0){e.next=16;break}e.t0=void 0!==u;case 16:e.t0?(e.t2=u,e.next=21):e.next=20;break;case 20:e.t2={};case 21:h=e.t2,f=h.component,h=h.instance,y=n,"Point"===p&&(y=c),i.vueInstance=h,f&&(i.popup.setOffset(i.offset),i.popup.setLngLat(y).setDOMContent(f).addTo(i.map));case 28:"function"==typeof i.callBack&&i.callBack({lngLat:n,properties:a,geometry:s,point:r});case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.map=e,this.popup=null,"string"==typeof n?this.layerName=[n]:Array.isArray(n)&&(this.layerName=n),void 0!==(s=(n=o||{}).destroyComponent)&&s),s=void 0!==(s=n.customClick)&&s,u=void 0!==(u=n.popupClose)&&u,l=void 0===(l=n.closeOther)||l,c=void 0===(c=n.noCloseLayerName)?[]:c,p=void 0!==(p=n.customName)&&p,f=void 0===(f=n.offset)?[0,0]:f,h=n.closeClick;n=t(n,P),e=null!=(e=e.popupClass)?e:"commonPopup",p=p?"":e+" ",this.className=p,null!=o&&o.className&&(p+=o.className),this.fullName=p,this.noCloseLayerName=c,this.noCloseLayerName=[],this.customClick=s,this.popupCloseSign=u,this.closeOther=l,this.offset=f="number"==typeof f?[f,f]:f,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(r({},n,{offset:f,className:p,closeButton:null!=(e=null==n?void 0:n.closeButton)&&e,closeOnClick:null!=(o=null==n?void 0:n.closeOnClick)&&o,anchor:null!=(c=null==n?void 0:n.anchor)?c:"bottom",focusAfterOpen:null!=(s=null==n?void 0:n.focusAfterOpen)&&s,type:"popup",sourceName:this.layerName})),h&&"function"==typeof h&&(this.popup._closeClick=h),null!=(u=this.popup)&&u.on("close",(function(e){"function"==typeof i.closeCallback&&i.closeCallback(e),i.popupCloseSign&&null!=(e=i.vueInstance)&&e.popupClose&&"function"==typeof i.vueInstance.popupClose&&i.vueInstance.popupClose(),i.vueInstance&&a&&null!=(e=i.vueInstance)&&e.$destroy()})))}var n=e.prototype;return n.show=function(e,t){var r=this;this.componentCallBack=e,this.callBack=t,0<(null==(e=this.layerName)?void 0:e.length)&&this.layerName.forEach((function(e){r.map.on("click",e,r._click)}))},n.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){r.popup.removeClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){r.popup.addClassName(e)})),this.oldClassName=e)},n.showPosition=function(e,t,r,n){e&&(this._closeOtherPopup(),(r=(null!=r?r:{}).offset)&&this.popup.setOffset(r),this.popup.setLngLat(e).setDOMContent(t).addTo(this.map),n)&&"function"==typeof n&&n()},n.close=function(){var e;null!=(e=this.popup)&&e._onClose()},n.closeBack=function(e){this.closeCallback=e},n.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off("click",e,t._click)}))},e}(),_=function(){function e(e,t,r){var n=this,o=(this.clickEvent=function(e){var t=new THREE.Vector2,r=n.map.getCanvas();t.x=(e.clientX-r.getBoundingClientRect().left)/r.offsetWidth*2-1,t.y=-(e.clientY-r.getBoundingClientRect().top)/r.offsetHeight*2+1,e=(new THREE.Matrix4).getInverse(n.camera.projectionMatrix),r=(new THREE.Vector3).applyMatrix4(e),t=new THREE.Vector3(t.x,t.y,1).applyMatrix4(e).clone().sub(r).normalize(),(e=new THREE.Raycaster).set(r,t),r=e.intersectObjects(n.scene.children,!0),n.callback&&0<r.length&&(t=r[0],e=n.findProperties(t.object),n.callback(e))},this.findProperties=function(e){var t={},r=null;return"Scene"!==e.type&&(r=(e.lngLat?(t=e.properties,e):(t=(e=n.findProperties(e.parent)).properties,e)).lngLat),{properties:t,lngLat:r}},this.id="3d-"+e,this.type="custom",this.renderingMode="3d","function"==typeof r&&(this.callback=r),e=t.lngLat,r=t.url,void 0===(o=t.scale)?1:o),i=void 0===(i=t.height)?0:i,a=void 0===(a=t.rotate)?[Math.PI/2,0,0]:a,s=void 0===(s=t.properties)?{}:s,u=void 0===(u=t.AmbientLight)?{show:!0,color:16777215,intensity:.5}:u,l=void 0===(l=t.DirectionalLight)?[]:l,c=void 0===(c=t.PointLight)?[]:c;t=void 0!==(t=t.click)&&t,this.lngLat=e,this.url=r,this.scale=o,this.height=i,this.rotate=a,this.properties=s,this.AmbientLight=u,this.DirectionalLight=l,this.PointLight=c,this.click=t,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(e,i),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:a[0],rotateY:a[1],rotateZ:a[2],scale:o*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var t=e.prototype;return t.onAdd=function(e,t){var r,n,o=this;this.map=e,e=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,e.innerWidth/e.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(n=this.AmbientLight.color||16777215,r=this.AmbientLight.intensity||.5,n=new THREE.AmbientLight(n,r),this.scene.add(n)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1;e=e.position||[0,0,0],(t=new THREE.DirectionalLight(t,r)).position.set(e[0],e[1],e[2]).normalize(),o.scene.add(t)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1,n=e.distance||0,i=e.decay||2;e=e.position||[0,0,0],(t=new THREE.PointLight(t,r,n,i)).position.set(e[0],e[1],e[2]).normalize(),o.scene.add(t)})),(new THREE.GLTFLoader).load(this.url,(function(e){for(var t=0;t<e.scene.children.length;t++)e.scene.children[t].properties=o.properties,e.scene.children[t].lngLat=o.lngLat;o.scene.add(e.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:e,context:t,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},t.render=function(e,t){var r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),o=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),i=(new THREE.Matrix4).fromArray(t);r=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(r).multiply(n).multiply(o),this.camera.projectionMatrix.elements=t,this.camera.projectionMatrix=i.multiply(r),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},t.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},e}(),T=function(){function e(e){this.map=e,this.sourceName=[],this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map)return"vector"===e.type?(this.sourceName=[t],this.sourceType="vector",this._addSourceLayer(t,e,r),this.sourceName):"FeatureCollection"===e.type||Array.isArray(e.features)?(this.sourceName=[t],this._addSourceLayer(t,e,r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._addSourceLayer=function(e,t,n){"vector"===this.sourceType?this.map.addSource(e,r({},t,n.sourceConfig)):this.map.addSource(e,r({type:"geojson",data:t},n.sourceConfig)),t=n.beforeId||null,this.map.addLayer(r({id:e,type:"line",source:e},n.layerConfig),t),n.lineConfig&&(this.lineName=e+"-highlight",this.map.addLayer(r({id:this.lineName,type:"line",source:e},n.lineConfig)))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.lineName&&t.map.removeLayer(e+"-highlight"),t.map.removeSource(e))}))},e}(),j=function(){function e(e){this.map=e,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map){if("vector"===e.type)return this.sourceType="vector",this._addSourceLayer(t,e,r),this.sourceName=[t],this.sourceName;var n;if("FeatureCollection"===e.type||Array.isArray(e.features)){this.type=null!=(n=r.type)?n:"symbol";var o=r.sliceNum;if(!o||o<1e3)this.sourceName=[t],this._clearSource(),this._addSourceLayer(t,e,r);else{this._clearSource();for(var i=0,a=0;a<e.features.length;a+=o){var s={type:"FeatureCollection",features:[]},u=e.features.slice(a,o);s.features=[].concat(u),u=t+"-"+i,this.sourceName.push(u),this._addSourceLayer(u,s,r),i++}}return this.sourceName}}},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.map.removeSource(e))}))},t._addSourceLayer=function(e,t,n){"vector"===this.sourceType?this.map.addSource(e,r({},t,n.sourceConfig)):this.map.addSource(e,r({type:"geojson",data:t},n.sourceConfig)),t=n.beforeId||null,this.map.addLayer(r({id:e,type:this.type,source:e},n.layerConfig),t)},e}(),I={centimeters:100*(x=6371008.8),centimetres:100*x,degrees:x/111325,feet:3.28084*x,inches:39.37*x,kilometers:x/1e3,kilometres:x/1e3,meters:x,metres:x,miles:x/1609.344,millimeters:1e3*x,millimetres:1e3*x,nauticalmiles:x/1852,radians:1,yards:1.0936*x};function O(e,t,r){var n={type:"Feature"};return 0!==(r=void 0===r?{}:r).id&&!r.id||(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function R(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(G(e[0])&&G(e[1]))return O({type:"Point",coordinates:e},t,r);throw new Error("coordinates must contain numbers")}function F(e,t,r){void 0===r&&(r={});for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<i[i.length-1].length;a++)if(i[i.length-1][a]!==i[0][a])throw new Error("First and last Position are not equivalent.")}return O({type:"Polygon",coordinates:e},t,r)}function B(e){return e%(2*Math.PI)*180/Math.PI}function H(e){return e%360*Math.PI/180}function G(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function q(e,t,r){if(null!==e)for(var n,o,i,a=0,s=e.type,u="FeatureCollection"===s,l="Feature"===s,c=u?e.features.length:1,p=0;p<c;p++)for(var f,h,y=(h=!!(f=u?e.features[p].geometry:l?e.geometry:e)&&"GeometryCollection"===f.type)?f.geometries.length:1,d=0;d<y;d++){var m=0,v=0,g=h?f.geometries[d]:f;if(null!==g){var b=g.coordinates,L=g.type,w=!r||"Polygon"!==L&&"MultiPolygon"!==L?0:1;switch(L){case null:break;case"Point":if(!1===t(b,a,p,m,v))return!1;a++,m++;break;case"LineString":case"MultiPoint":for(n=0;n<b.length;n++){if(!1===t(b[n],a,p,m,v))return!1;a++,"MultiPoint"===L&&m++}"LineString"===L&&m++;break;case"Polygon":case"MultiLineString":for(n=0;n<b.length;n++){for(o=0;o<b[n].length-w;o++){if(!1===t(b[n][o],a,p,m,v))return!1;a++}"MultiLineString"===L&&m++,"Polygon"===L&&v++}"Polygon"===L&&m++;break;case"MultiPolygon":for(n=0;n<b.length;n++){for(o=v=0;o<b[n].length;o++){for(i=0;i<b[n][o].length-w;i++){if(!1===t(b[n][o][i],a,p,m,v))return!1;a++}v++}m++}break;case"GeometryCollection":for(n=0;n<g.geometries.length;n++)if(!1===q(g.geometries[n],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function D(e){var t=[1/0,1/0,-1/0,-1/0];return q(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}const z=D.default=D,J=function(e){e=z(e);var t=void 0,r=(void 0===t&&(t={}),Number(e[0])),n=Number(e[1]),o=Number(e[2]),i=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,n];return F([[a,[o,n],[o,i],[r,i],a]],t.properties,{bbox:e,id:t.id})};function Z(e,t,r,n){void 0===n&&(n={});var o=H((e=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&2<=e.length&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e))[0]),i=(e=H(e[1]),r=H(r),t=function(e,t){var r=I[t=void 0===t?"kilometers":t];if(r)return e/r;throw new Error(t+" units is invalid")}(t,n.units),Math.asin(Math.sin(e)*Math.cos(t)+Math.cos(e)*Math.sin(t)*Math.cos(r)));return R([B(o+Math.atan2(Math.sin(r)*Math.sin(t)*Math.cos(e),Math.cos(t)-Math.sin(e)*Math.sin(i))),B(i)],n.properties)}const V=function(e,t,r){for(var n=(r=void 0===r?{}:r).steps||64,o=r.properties||(!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{}),i=[],a=0;a<n;a++)i.push(Z(e,t,-360*a/n,r).geometry.coordinates);return i.push(i[0]),F([i],o)};var Y=function(){function e(e){this.map=e,this.sourceName=[],this.lineName=""}var t=e.prototype;return t.draw=function(e,t,r){if(e){this.sourceName=[t];var n,o=null!=r?r:{},i=void 0===(n=o.radius)?0:n,a=void 0===(n=o.steps)?64:n,s=o.endRadius,u=[];if("object"==typeof e){if("FeatureCollection"!==e.type&&!Array.isArray(e.features))return;for(var l=e.features,c=0;c<l.length;c++){var p,f,h,y,d,m=l[c].geometry.coordinates;"number"==typeof m[0]&&"number"==typeof m[1]&&(m[0]<m[1]&&(p=[m[1],m[0]],m[0]=p[0],m[1]=p[1]),p=!1,f=0<(f=(p="string"==typeof i||p)?l[c].properties[i]:i)?f:0,h={steps:a,units:"kilometers",properties:l[c].properties},y=V(m,f,h),s?(d=!1,d=0<(d=(d="string"==typeof s||d)?l[c].properties[s]:s)?d:0,m=V(m,s,h),u.push(f===d?y:f<d?this._getRingJson(m.geometry.coordinates[0],y.geometry.coordinates[0],y.properties):this._getRingJson(y.geometry.coordinates[0],m.geometry.coordinates[0],y.properties))):u.push(y))}}return this._addSourceLayer(t,{type:"FeatureCollection",features:u},r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},t._getRingJson=function(e,t,r){return{type:"Feature",geometry:{coordinates:[e,t],type:"Polygon"},properties:r}},t._addSourceLayer=function(e,t,n){this.map.addSource(e,r({type:"geojson",data:t},n.sourceConfig)),t=(null!=n?n:{}).beforeId,this.map.addLayer(r({id:e,type:"fill",source:e},n.layerConfig),t),n.lineConfig&&(this.lineName=e+"-line",this.map.addLayer(r({id:this.lineName,type:"line",source:e},n.lineConfig),t))},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.removeLayer(e),t.lineName&&t.map.removeLayer(e+"-line"),t.map.removeSource(e))}))},e}(),U=function(){function e(e,t){this.map=e,this.name=[],"string"==typeof t?this.name=[t]:Array.isArray(t)&&t.every((function(e){return"string"==typeof e}))&&(this.name=t),this.event=[]}var t=e.prototype;return t.add=function(e){var t,r=this;if(0===(null==(t=this.event)?void 0:t.length)&&e&&"object"==typeof e){var n,o=function(t){var n,o;r.event.push(t),0<(null==(o=r.name)?void 0:o.length)?null!=(o=r.name)&&o.forEach((function(n){function o(r){var n;"Map"===(null==r||null==(n=r.originalEvent)||null==(n=n.target)?void 0:n.ariaLabel)&&e[t](r)}var i;r[t]=o,null!=(i=r.map)&&i.on(t,n,o)})):(r[t]=o=function(r){var n;"Map"===(null==r||null==(n=r.originalEvent)||null==(n=n.target)?void 0:n.ariaLabel)&&e[t](r)},null!=(n=r.map)&&n.on(t,o))};for(n in e)o(n)}},t.destroy=function(e){var t,r=this;e&&Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))?null!=(t=this.name)&&t.forEach((function(t){e.forEach((function(e){var n,o;r.event.includes(e)&&(o=r[e],null!=(n=r.map))&&n.off(e,t,o)}))})):0<(null==(t=this.name)?void 0:t.length)?null!=(t=this.name)&&t.forEach((function(e){r.event.forEach((function(t){var n,o=r[t];null!=(n=r.map)&&n.off(t,e,o)}))})):this.event.forEach((function(e){var t,n=r[e];null!=(t=r.map)&&t.off(e,n)}))},e}(),$=["id","type"],W=["id","type","beforeId"],X=function(){function e(e){this.map=e,this.sourceName=[]}var n=e.prototype;return n.draw=function(e,n){var o,a,s,u,l=this;return i(e)||"vector"===e.type?(o=(a=null!=(a=n.sourceConfig)?a:{}).id,u=void 0===(u=a.type)?"geojson":u,a=t(a,$),s=o,"vector"===e.type?this.map.addSource(o,r({},a,e)):this.map.addSource(o,r({type:u,data:e},a)),u=null!=(o=n.layerConfig)?o:{},e=[],Array.isArray(u)?e=u:"object"==typeof u&&e.push(u),e.forEach((function(e){var n=e.id,o=e.type,i=e.beforeId;e=t(e,W),l.map.addLayer(r({id:n,type:o,source:s},e),i)})),this.sourceName=[s].concat(e.map((function(e){return e.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},n.destroy=function(){var e,t,r=this;0<(null==(t=this.sourceName)?void 0:t.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(e=(t=this.sourceName)[0],t=t.slice(1),this.map.getSource(e)&&(this.map.getLayer(e)&&this.map.removeLayer(e),t.forEach((function(e){r.map.removeLayer(e)})),this.map.removeSource(e))))},n.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},e}(),K=function(){function e(t,n,o){if((this instanceof e?this.constructor:void 0)!==e)throw new Error("MapLayer is a constructor and should be called with the new keyword");var i={layer:null,tooltip:null,popup:null};return n&&"object"==typeof n&&(i=r({},i,n)),this.name=t,this.layers=i,this.prop=null!=o?o:{},new Proxy(this,{deleteProperty:function(e,t){return(e!==this||"layers"!==t&&"name"!==t)&&(delete e[t],!0)},set:function(e,t,r){return(e!==this||"layers"!==t&&"name"!==t)&&(e[t]=r,!0)}})}var t=e.prototype;return t.addLayer=function(e){if(e&&"object"==typeof e)for(var t in e)this.layers[t]=e[t]},t.addProp=function(e){if(e&&"object"==typeof e)for(var t in e)this.prop[t]=e[t]},e}();function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ee=function(){function e(e,t){this.map=e,this.markers=[],this.options=t,this.properties=[]}var t=e.prototype;return t.draw=function(e,t){if(i(e))for(var n,o=null!=(n=this.options)?n:{},a=0,s=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){var r;if(e)return"string"==typeof e?Q(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(e,t):void 0}(e)))return n&&(e=n),r=0,function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.features);!(c=s()).done;){var u,l,c=c.value;"Point"===c.geometry.type&&(u=o,t&&"function"==typeof t&&1===(null==(l=t({lngLat:c.geometry.coordinates,properties:c.properties,index:a}))?void 0:l.nodeType)&&(u=r({},u,{element:l})),l=new mapboxgl.Marker(u).setLngLat(c.geometry.coordinates).addTo(this.map),this.markers.push(l),this.properties.push(c.properties),a++)}},t.addEvent=function(e){var t=this;if(e&&"object"==typeof e)for(var n=0;n<this.markers.length;n++)!function(n){["dragstart","drag","dragend"].forEach((function(o){e[o]&&"function"==typeof e[o]&&t.markers[n].on(o,(function(i){e[o](r({},i,{properties:t.properties[n]}))}))}))}(n)},t.destroy=function(){for(var e=0;e<this.markers.length;e++)this.markers[e].remove();this.markers=[]},t.visible=function(e){var t;"boolean"==typeof e&&null!=(t=this.markers)&&t.forEach((function(t){t.getElement().style.display=e?"block":"none"}))},e}(),te=function(){function e(e,t,r){var n;r=null!=(n=r)?n:{},this.map=e,this.name=t,this.dash=Array.isArray(r.dash)?r.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(n=r.step)?n:50,this.animateId=null}var t=e.prototype;return t.animate=function(){var e,t=this;this.name&&this.map.getLayer(this.name)&&function r(n){(n=parseInt(n/t.step%t.dash.length))!==e&&(t.map.setPaintProperty(t.name,"line-dasharray",t.dash[e]),e=n),t.animateId=requestAnimationFrame(r)}(e=0)},t.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},e}(),re=["padding","animate","maxZoom","essential"],ne=["url"],oe=null,ie=null,ae=function(e){return/^#([0-9a-fA-F]{3}){1,2}$/.test(e)},se=["line-color","line-opacity"],ue=["fill-color","fill-opacity"],le=["background-color","background-opacity"],ce=["text-color","text-opacity"],pe=function(e,t,r,n){if(r&&(ae(r)||Array.isArray(r))){var o=e.getLayer(t);if(o){var i=[];switch(o.type){case"line":i=se;break;case"fill":i=ue;break;case"background":i=le;break;case"symbol":i=ce}0<i.length&&(e.setPaintProperty(t,i[0],r),null!==n)&&e.setPaintProperty(t,i[1],n)}}},fe=function(e,t,r,n){if(t&&r&&"string"==typeof t&&e.getLayer(t)&&"object"==typeof r)for(var o in r)null!==r[o]&&void 0!==r[o]&&e[n](t,o,r[o])}})(),n;function e(n){var o=r[n];return void 0!==o||(o=r[n]={exports:{}},t[n](o,o.exports,e)),o.exports}var t,r,n}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zh-mapbox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.113",
|
|
4
4
|
"description": "mapbox的常用方法",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -32,8 +32,10 @@
|
|
|
32
32
|
"babel-loader": "^9.1.3",
|
|
33
33
|
"core-js": "^3.33.0",
|
|
34
34
|
"eslint": "^8.51.0",
|
|
35
|
+
"javascript-obfuscator": "^4.1.1",
|
|
35
36
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
36
37
|
"webpack": "^5.88.2",
|
|
37
|
-
"webpack-cli": "^5.1.4"
|
|
38
|
+
"webpack-cli": "^5.1.4",
|
|
39
|
+
"webpack-obfuscator": "^3.5.1"
|
|
38
40
|
}
|
|
39
41
|
}
|