gis-common 3.1.3 → 3.1.5

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.
@@ -0,0 +1,23 @@
1
+ declare const _default: {
2
+ LOGIN_EXPIRED: string;
3
+ CROSS_ERROR: string;
4
+ UNEXIST_RESOURCE: string;
5
+ TIMEOUT: string;
6
+ INTERNAL_ERROR: string;
7
+ NETWORK_ERROR: string;
8
+ PROCESS_FAIL: string;
9
+ AUTH_VERIFY_ERROR: string;
10
+ NO_DATA_FOUND: string;
11
+ DUPLICATE_INSTANCE: string;
12
+ COORDINATE_ERROR: string;
13
+ JSON_PARSE_ERROR: string;
14
+ JSON_VALUE_ERROR: string;
15
+ PARAMETER_ERROR: string;
16
+ PARAMETER_ERROR_ARRAY: string;
17
+ PARAMETER_ERROR_STRING: string;
18
+ PARAMETER_ERROR_FUNCTION: string;
19
+ PARAMETER_ERROR_OBJECT: string;
20
+ PARAMETER_ERROR_LACK: string;
21
+ STRING_CHECK_LOSS: string;
22
+ };
23
+ export default _default;
@@ -0,0 +1,24 @@
1
+ declare const _default: {
2
+ MAP_RENDER: string;
3
+ MAP_READY: string;
4
+ MOUSE_CLICK: string;
5
+ MOUSE_DOUBLE_CLICK: string;
6
+ MOUSE_MOVE: string;
7
+ MOUSE_IN: string;
8
+ MOUSE_OUT: string;
9
+ MOUSE_RIGHT_CLICK: string;
10
+ KEY_DOWN: string;
11
+ KEY_UP: string;
12
+ DRAW_ACTIVE: string;
13
+ DRAW_MOVE: string;
14
+ DRAW_COMPLETE: string;
15
+ MQTT_CONNECT: string;
16
+ MQTT_ERROR: string;
17
+ MQTT_MESSAGE: string;
18
+ MQTT_CLOSE: string;
19
+ WEB_SOCKET_CONNECT: string;
20
+ WEB_SOCKET_ERROR: string;
21
+ WEB_SOCKET_MESSAGE: string;
22
+ WEB_SOCKET_CLOSE: string;
23
+ };
24
+ export default _default;
@@ -0,0 +1,16 @@
1
+ export declare const GraphicType: {
2
+ POINT: string;
3
+ POLYLINE: string;
4
+ POLYGON: string;
5
+ BILLBOARD: string;
6
+ CYLINDER: string;
7
+ ELLIPSOID: string;
8
+ LABEL: string;
9
+ MODEL: string;
10
+ WALL: string;
11
+ };
12
+ export declare const MeasureMode: {
13
+ DISTANCE: string;
14
+ AREA: string;
15
+ HEIGHT: string;
16
+ };
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ SUPER_MAP_IMAGES: string;
3
+ SUPER_MAP_DATA: string;
4
+ ARC_GIS_MAP_IMAGES: string;
5
+ ARC_GIS_MAP_DATA: string;
6
+ OSGB_LAYER: string;
7
+ S3M_GROUP: string;
8
+ TERRAIN_LAYER: string;
9
+ };
10
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export { default as EventType } from './EventTypeConstant';
2
+ export { default as ErrorType } from './ErrorTypeConstant';
3
+ export { default as LayerType } from './LayerType';
4
+ export * from './GraphicConstant';
@@ -475,14 +475,14 @@ var Cookie = {
475
475
  set: function(name, value, Days = 30) {
476
476
  var exp = new Date();
477
477
  exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1e3);
478
- document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
478
+ document.cookie = name + "=" + escape(value) + ";expires=" + exp.toUTCString();
479
479
  },
480
480
  remove: function(name) {
481
481
  var exp = new Date();
482
482
  exp.setTime(exp.getTime() - 1);
483
483
  var cval = this.get(name);
484
484
  if (cval != null) {
485
- document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
485
+ document.cookie = name + "=" + cval + ";expires=" + exp.toUTCString();
486
486
  }
487
487
  },
488
488
  get: function(name) {
@@ -1 +1 @@
1
- (function(h,v){typeof exports=="object"&&typeof module!="undefined"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(h=typeof globalThis!="undefined"?globalThis:h||self,v(h["gis-common"]={}))})(this,function(h){"use strict";var v={animate(t,e,n,r="swing",s=5){for(var a in e)e[a]={target:a==="opacity"?parseInt(e[a]*100):e[a],iNow:parseInt(a==="opacity"?getComputedStyle(t)[a]*100:getComputedStyle(t)[a])};r==="liner"&&(s=e[a].iNow<e[a].target?Math.abs(s):-Math.abs(s)),clearInterval(t.timer),t.timer=setInterval(function(){for(var i in e){var o=e[i].target,c=e[i].iNow;if(r==="swing"&&(s=(o-c)/20,s=s>0?Math.ceil(s):Math.floor(s)),Math.abs(o-c)<=Math.abs(s)){i==="opacity"?t.style[i]=o/100:t.style[i]=o+"px",delete e[i];for(var l in e)return!1;clearInterval(t.timer),typeof n=="function"&&n()}else e[i].iNow+=s,i==="opacity"?t.style[i]=e[i].iNow/100:t.style[i]=e[i].iNow+"px"}},30)}},D={MAP_RENDER:"mapRender",MAP_READY:"mapReady",MOUSE_CLICK:"click",MOUSE_DOUBLE_CLICK:"dblclick",MOUSE_MOVE:"mousemove",MOUSE_IN:"mousein",MOUSE_OUT:"mouseout",MOUSE_RIGHT_CLICK:"mouseRightClick",KEY_DOWN:"keyDown",KEY_UP:"keyUp",DRAW_ACTIVE:"drawActive",DRAW_MOVE:"drawMove",DRAW_COMPLETE:"drawComplete",MQTT_CONNECT:"mqttConnect",MQTT_ERROR:"mqttError",MQTT_MESSAGE:"mqttMessage",MQTT_CLOSE:"mqttClose",WEB_SOCKET_CONNECT:"webSocketConnect",WEB_SOCKET_ERROR:"webSocketError",WEB_SOCKET_MESSAGE:"webSocketMessage",WEB_SOCKET_CLOSE:"webSocketClose"},g={LOGIN_EXPIRED:"\u767B\u5F55\u4FE1\u606F\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55",CROSS_ERROR:"\u8DE8\u57DF\u8BBF\u95EE",UNEXIST_RESOURCE:"\u8D44\u6E90\u4E0D\u5B58\u5728",TIMEOUT:"\u8BF7\u6C42\u8D85\u65F6",INTERNAL_ERROR:"\u5185\u90E8\u9519\u8BEF",NETWORK_ERROR:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u662F\u5426\u5DF2\u8FDE\u63A5",PROCESS_FAIL:"\u5904\u7406\u5931\u8D25",AUTH_VERIFY_ERROR:"\u6743\u9650\u9A8C\u8BC1\u5931\u8D25",NO_DATA_FOUND:"\u672A\u627E\u5230\u6570\u636E",DUPLICATE_INSTANCE:"\u5B9E\u4F8B\u4E3A\u5355\u4F8B\u6A21\u5F0F\uFF0C\u4E0D\u5141\u8BB8\u91CD\u590D\u6784\u5EFA",COORDINATE_ERROR:"\u5750\u6807\u9A8C\u8BC1\u5931\u8D25",JSON_PARSE_ERROR:"JSON\u89E3\u6790\u5931\u8D25\uFF0C\u683C\u5F0F\u6709\u8BEF",JSON_VALUE_ERROR:"JSON\u65E0\u6B64\u952E",PARAMETER_ERROR:"\u9A8C\u8BC1\u6570\u636E\u7C7B\u578B\u5931\u8D25",PARAMETER_ERROR_ARRAY:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u6570\u7EC4",PARAMETER_ERROR_STRING:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u5B57\u7B26",PARAMETER_ERROR_FUNCTION:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u51FD\u6570",PARAMETER_ERROR_OBJECT:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u5BF9\u8C61",PARAMETER_ERROR_LACK:"\u53C2\u6570\u7F3A\u5931",STRING_CHECK_LOSS:"\u5B57\u7B26\u7F3A\u5C11\u5173\u952E\u5B57"},$={SUPER_MAP_IMAGES:"SuperMapImages",SUPER_MAP_DATA:"SuperMapData",ARC_GIS_MAP_IMAGES:"ArcGisMapImages",ARC_GIS_MAP_DATA:"ArcGisMapData",OSGB_LAYER:"OSGBLayer",S3M_GROUP:"S3MGroup",TERRAIN_LAYER:"TerrainFileLayer"};const G={POINT:"point",POLYLINE:"polyline",POLYGON:"polygon",BILLBOARD:"billboard",CYLINDER:"cylinder",ELLIPSOID:"ellipsoid",LABEL:"label",MODEL:"model",WALL:"wall"},z={DISTANCE:"distance",AREA:"area",HEIGHT:"height"};var M={getDataType(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty(t){if(t==null)return!0;switch(this.getDataType(t)){case"String":return t.trim()==="";case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},isNotEmpty(t){return!this.isEmpty(t)},json2form(t){const e=new FormData;return Object.keys(t).forEach(n=>{e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])}),e},json2Query(t){var e=[];for(var n in t){var r=n,s=t[n];e.push(r+"="+s)}var a=e.join("&");return a},generateGuid(){const t=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict(...t){let e="";if(t.length>1){const n=t.slice(1,t.length%2===0?t.length-1:t.length);for(let r=0;r<n.length;r=r+2){const s=n[r];t[0]===s&&(e=n[r+1])}!e&&t.length%2===0&&(e=t[t.length-1])}else e=t[0];return e},extend(t,...e){let n,r,s,a;for(r=0,s=e.length;r<s;r++){a=e[r];for(n in a)t[n]=a[n]}return t},rgb2hex(t){var e="#"+(16777216+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1);return e},convertToTree2(t,e="id",n="parentId",r="children"){const s=[];function a(i){const o=i[e],c=t.filter(l=>l.hasOwnProperty(n)&&l[n]===o);c.length>0&&(c.forEach(a),i[r]=c)}for(const i of t)t.findIndex(o=>o[e]===i[n])===-1&&(a(i),s.push(i));return s},asyncLoadScript(t){return new Promise((e,n)=>{try{var r=document.createElement("script");r.readyState?r.onreadystatechange=function(){(r.readyState==="complete"||r.readyState==="loaded")&&e(r)}:r.onload=function(){e(r)},r.type="text/javascript",r.src=t,document.body.appendChild(r)}catch(s){n(s)}})},loadStyle(t){t.forEach(e=>{const n=document.createElement("link");n.href=e,n.rel="stylesheet",n.type="text/css",document.head.appendChild(n)})},template(t,e){const n=/\{ *([\w_-]+) *\}/g;return t.replace(n,function(r,s){var a=e[s];if(a===void 0)throw new Error(g.JSON_VALUE_ERROR+r);return typeof a=="function"&&(a=a(e)),a})},deleteEmptyProperty(t){return Object.fromEntries(Object.keys(t).filter(e=>!this.isEmpty(t[e])).map(e=>[e,t[e]]))},deepAssign(){let t=arguments.length,e=arguments[0];this.getDataType(e)!=="Object"&&(e={});for(let n=1;n<t;n++){let r=arguments[n];if(this.getDataType(r)==="Object")for(let s in r)s==="__proto__"||e===r[s]||(this.getDataType(r[s])==="Object"?e[s]=this.deepAssign(e[s],r[s]):e[s]=r[s])}return e},handleCopyValue(t){if(!navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);{const e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise((n,r)=>{document.execCommand("copy")?n():r(new Error("copy failed")),e.remove()})}}};Array.prototype.groupBy=function(t){var e={};return this.forEach(function(n){var r=JSON.stringify(t(n));e[r]=e[r]||[],e[r].push(n)}),Object.keys(e).map(n=>e[n])},Array.prototype.distinct=function(t=e=>e){const e=[],n={};return this.forEach(r=>{const s=t(r);!n[s]&&(n[s]=e.push(r))}),e},Array.prototype.max=function(){return Math.max.apply({},this)},Array.prototype.min=function(){return Math.min.apply({},this)},Array.prototype.sum=function(){return this.length>0?this.reduce((t=0,e=0)=>t+e):0},Array.prototype.avg=function(){return this.length?this.sum()/this.length:0},Array.prototype.desc=function(t=e=>e){return this.sort((e,n)=>t(n)-t(e))},Array.prototype.asc=function(t=e=>e){return this.sort((e,n)=>t(e)-t(n))},Array.prototype.clear=function(){return this.length=0,this};var j={asArray(t){return M.isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray(t){return[...new Array(t).keys()]},union(...t){let e=[];return t.forEach(n=>{Array.isArray(n)&&(e=e.concat(n.filter(r=>!e.includes(r))))}),e},intersection(...t){let e=t[0]||[];return t.forEach(n=>{Array.isArray(n)&&(e=e.filter(r=>n.includes(r)))}),e},unionAll(...t){return[...t].flat().filter(e=>!!e)},difference(...t){return this.union(...t).filter(e=>!this.intersection(...t).includes(e))}},q={getUrlParams(t=window.location.href,e=!0){const n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,{search:r,hash:s}=new URL(t),a=[r,s];let i={};for(let o=0;o<a.length;o++){const c=a[o];if(c){const u=c.replace(/#|\//g,"").split("?");if(u.length>1)for(let d=1;d<u.length;d++){let f;for(;f=n.exec(u[d]);)i[f[1]]=e?decodeURIComponent(f[2]):f[2]}}}return i},getExplorer(){var t=window.navigator.userAgent;if(t.indexOf("MSIE")>=0||!!window.ActiveXObject||"ActiveXObject"in window)return"IE";if(t.indexOf("Firefox")>=0)return"Firefox";if(t.indexOf("Chrome")>=0)return"Chrome";if(t.indexOf("Opera")>=0)return"Opera";if(t.indexOf("Safari")>=0)return"Safari"},detectOS(){let t="";const e=navigator.userAgent.indexOf("Windows",0)!=-1?1:0,n=navigator.userAgent.indexOf("mac",0)!=-1?1:0,r=navigator.userAgent.indexOf("Linux",0)!=-1?1:0,s=navigator.userAgent.indexOf("X11",0)!=-1?1:0;return e?t="MS Windows":n?t="Apple mac":r?t="Linux":s&&(t="Unix"),t},switchFullScreen(t){if(t){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},refreshScale(){const t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/e,s=16/9;let a=t/1920;r>s&&(a=e/1080),n.transformOrigin="left top",n.transform=`scale(${a}) translateX(-49.99%)`,n.width=`${t/a}px`},getHtmlFontSize(){const t=document.documentElement.clientWidth||document.body.clientWidth,e=document.querySelector("html");e.style.fontSize=t/192+"px"}},H={set:function(t,e,n=30){var r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3),document.cookie=t+"="+escape(e)+";expires="+r.toGMTString()},remove:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);n!=null&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return e!=null?e[2]:""}},Y={PI:3.141592653589793,XPI:3.141592653589793*3e3/180,delta(t,e){const r=.006693421622965943;let s=this.transformLat(e-105,t-35),a=this.transformLon(e-105,t-35);const i=t/180*this.PI;let o=Math.sin(i);o=1-r*o*o;const c=Math.sqrt(o);return s=s*180/(6378245*(1-r)/(o*c)*this.PI),a=a*180/(6378245/c*Math.cos(i)*this.PI),{lat:s,lng:a}},gcjEncrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}},gcjDecrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}},gcjDecryptExact(t,e){let s=.01,a=.01,i=t-s,o=e-a,c=t+s,l=e+a,u,d,f=0;for(;;){u=(i+c)/2,d=(o+l)/2;const m=this.gcj_encrypt(u,d);if(s=m.lat-t,a=m.lng-e,Math.abs(s)<1e-9&&Math.abs(a)<1e-9||(s>0?c=u:i=u,a>0?l=d:o=d,++f>1e4))break}return{lat:u,lng:d}},bdEncrypt(t,e){const n=e,r=t,s=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),a=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI),i=s*Math.cos(a)+.0065;return{lat:s*Math.sin(a)+.006,lng:i}},bdDecrypt(t,e){const n=e-.0065,r=t-.006,s=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),a=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),i=s*Math.cos(a);return{lat:s*Math.sin(a),lng:i}},mercatorEncrypt(t,e){const n=e*2003750834e-2/180;let r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return r=r*2003750834e-2/180,{lat:r,lng:n}},mercatorDecrypt(t,e){const n=e/2003750834e-2*180;let r=t/2003750834e-2*180;return r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),{lat:r,lng:n}},distance(t,e,n,r){const a=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180),i=Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);let o=a+i;return o>1&&(o=1),o<-1&&(o=-1),Math.acos(o)*6371e3},outOfChina(t,e){return e<72.004||e>137.8347||t<.8293||t>55.8271},transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))*2/3,n+=(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))*2/3,n+=(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))*2/3,n},transformLon(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))*2/3,n+=(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))*2/3,n+=(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))*2/3,n},randomCoordinate(t,e,n,r){return{lat:Math.random()*(r-e)+e,lng:Math.random()*(n-t)+t}}};Date.prototype.format=function(t){const e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(const n in e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,RegExp.$1.length===1?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){const n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+e*3);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+e*7);break;case"d":n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e);break;default:n.setDate(this.getDate()+e);break}return n};var K={lastMonthDate:new Date(new Date().getFullYear(),new Date().getMonth()-1,1),thisMonthDate:new Date(new Date().getFullYear(),new Date().getMonth(),1),nextMonthDate:new Date(new Date().getFullYear(),new Date().getMonth()+1,1),lastWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1-7-new Date().getDay()),thisWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1-new Date().getDay()),nextWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1+7-new Date().getDay()),lastDayDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-1),thisDayDate:new Date(new Date().setHours(0,0,0,0)),nextDayDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1),parseDate(t){if(typeof t=="string"){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if(e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/),e&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if(e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/),e&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null},formatDateInterval(t,e){const n=new Date(t),s=new Date(e).getTime()-n.getTime(),a=Math.floor(s/(24*3600*1e3)),i=s%(24*3600*1e3),o=Math.floor(i/(3600*1e3)),c=i%(3600*1e3),l=Math.floor(c/(60*1e3)),u=c%(60*1e3),d=Math.round(u/1e3);let f="";return a>0&&(f+=a+"\u5929"),o>0&&(f+=o+"\u65F6"),l>0&&(f+=l+"\u5206"),d>0&&(f+=d+"\u79D2"),a===0&&o===0&&l===0&&d===0&&(f="\u5C11\u4E8E1\u79D2"),f},formatterCounter(t){const e=function(o){return(o>10?"":"0")+(o||0)},n=e(Math.floor(t/3600)),r=t%3600,s=e(Math.floor(r/60)),a=r%60,i=e(Math.round(a));return`${n}:${s}:${i}`},sleep(t){}};function L(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function U(t){return L(t).split(/\s+/)}var J={getStyle(t,e){let n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||n==="auto")&&document.defaultView){const r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return n==="auto"?null:n},create(t,e,n){const r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove(t){const e=t.parentNode;e&&e.removeChild(t)},empty(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront(t){const e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack(t){const e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal},hasClass(t,e){if(t.classList!==void 0)return t.classList.contains(e);const n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass(t,e){if(t.classList!==void 0){const n=U(e);for(let r=0,s=n.length;r<s;r++)t.classList.add(n[r])}else if(!this.hasClass(t,e)){const n=this.getClass(t);this.setClass(t,(n?n+" ":"")+e)}},removeClass(t,e){t.classList!==void 0?U(e).forEach(r=>t.classList.remove(r)):this.setClass(t,L((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e},parseFromString(t){return new DOMParser().parseFromString(t,"text/xml").children[0]}},E={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat(t,e){return t+Math.random()*(e-t)},degreesToRadians(t){return t*this.DEG2RAD},toRadians(t){return t*this.DEG2RAD},radiansToDegrees(t){return t*this.RAD2DEG},toDegrees(t){return t*this.RAD2DEG},formatFloat(t,e=2){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},N={toRadian:Math.PI/180,R:6371393,isLnglat(t,e){return t&&e&&+e>-90&&+e<90&&+t>-180&&+t<180},formatLnglat(t,e){let n="";function r(s){const a=parseFloat(s),i=parseInt(a);let o=parseInt((a-i)*60),c=(a-i)*3600-o*60;return i+"\xB0"+o+"\u2032"+c.toFixed(2)+"\u2033"}return t&&e&&(n=r(t)+","+r(e)),n},transformLnglat(t,e){function n(r){for(var s=/[sw]/i.test(r),a=s?-1:1,i=r.match(/[\d.]+/g),o=0,c=0,l=i.length;c<l;c++)o+=i[c]/a,a*=60;return o}if(t&&e)return{lng:n(t),lat:n(e)}},rayCasting(t,e){for(var n=t.x,r=t.y,s=!1,a=0,i=e.length,o=i-1;a<i;o=a,a++){var c=e[a].x,l=e[a].y,u=e[o].x,d=e[o].y;if(c===n&&l===r||u===n&&d===r)return"on";if(l<r&&d>=r||l>=r&&d<r){var f=c+(r-l)*(u-c)/(d-l);if(f===n)return"on";f>n&&(s=!s)}}return s?"in":"out"},wgs84PointsDistance(t,e){var n=Math.PI;function r(it){return it*n/180}if(arguments.length!=2)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var s=6378137,a=63567523142e-4,i=1/298.257223563,o=r(lon2-lon1),c=Math.atan((1-i)*Math.tan(r(lat1))),l=Math.atan((1-i)*Math.tan(r(lat2))),u=Math.sin(c),d=Math.cos(c),f=Math.sin(l),m=Math.cos(l),O=o,F,B=100;do{var T=Math.sin(O),_=Math.cos(O),w=Math.sqrt(m*T*(m*T)+(d*f-u*m*_)*(d*f-u*m*_));if(w==0)return 0;var b=u*f+d*m*_,W=Math.atan2(w,b),C=d*m*T/w,A=1-C*C,p=b-2*u*f/A;isNaN(p)&&(p=0);var x=i/16*A*(4+i*(4-3*A));F=O,O=o+(1-x)*i*C*(W+x*w*(p+x*b*(-1+2*p*p)))}while(Math.abs(O-F)>1e-12&&--B>0);if(B==0)return NaN;var y=A*(s*s-a*a)/(a*a),rt=1+y/16384*(4096+y*(-768+y*(320-175*y))),P=y/1024*(256+y*(-128+y*(74-47*y))),at=P*w*(p+P/4*(b*(-1+2*p*p)-P/6*p*(-3+4*w*w)*(-3+4*p*p))),st=a*rt*(W-at);return st},rotatePoint(t,e,n){const r=(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,s=(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y;return{x:r,y:s}},calcBearAndDis(t,e){const{x:n,y:r}=t,{x:s,y:a}=e,i=s-n,o=a-r,c=Math.sqrt(i*i+o*o);return{angle:(Math.atan2(o,i)*(180/Math.PI)+360+90)%360,distance:c}},calcBearAndDisByPoints(t,e){var n=parseFloat(t.lat),r=parseFloat(t.lng),s=parseFloat(e.lat),a=parseFloat(e.lng),i=Math.sin((a-r)*this.toRadian)*Math.cos(s*this.toRadian),o=Math.cos(n*this.toRadian)*Math.sin(s*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(s*this.toRadian)*Math.cos((a-r)*this.toRadian),c=Math.atan2(i,o)*(180/Math.PI),l=(s-n)*this.toRadian,u=(a-r)*this.toRadian,d=Math.sin(l/2)*Math.sin(l/2)+Math.cos(n*this.toRadian)*Math.cos(s*this.toRadian)*Math.sin(u/2)*Math.sin(u/2),f=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)),m=this.R*f;return{angle:c,distance:m}},calcPointByBearAndDis(t,e,n){const r=E.toRadians(parseFloat(t.lat)),s=E.toRadians(parseFloat(t.lng));e=parseFloat(e),n=parseFloat(n);const a=n/this.R;e=E.toRadians(e);const i=Math.asin(Math.sin(r)*Math.cos(a)+Math.cos(r)*Math.sin(a)*Math.cos(e)),o=s+Math.atan2(Math.sin(e)*Math.sin(a)*Math.cos(r),Math.cos(a)-Math.sin(r)*Math.sin(i));return{lat:E.toDegrees(i),lng:E.toDegrees(o)}},mercatorTolonlat(t,e){const n=t/2003750834e-2*180;var r=e/2003750834e-2*180;const s=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2);return{lng:n,lat:s}},lonlatToMercator(t,e){var n=6378137;const r=t*Math.PI/180*n;var s=e*Math.PI/180;const a=n/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)));return{x:r,y:a}}},V={convertBase64ToBlob(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),s=new Uint8Array(r),a=0;a<n.length;a++)s[a]=n.charCodeAt(a);var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return i?(i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder),i.append(r),i.getBlob(e)):(i=new Blob([r],{type:e}),i)},convertUrlToBase64(t,e,n){return new Promise(function(r,s){var a=new Image;a.crossOrigin="Anonymous",a.src=t,a.onload=function(){var i=document.createElement("canvas");i.width=e||a.width,i.height=n||a.height;var o=i.getContext("2d");o.drawImage(a,0,0,a.width,a.height);var c=a.src.substring(a.src.lastIndexOf(".")+1).toLowerCase(),l=i.toDataURL("image/"+c),u={dataURL:l,type:"image/"+c,ext:c};r(u)}})},convertBase64ToFile(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],s=atob(n[1]),a=s.length,i=new Uint8Array(a);a--;)i[a]=s.charCodeAt(a);return new File([i],e,{type:r})},downloadFromFile(t,e){if(typeof t=="object")if(t instanceof Blob)t=URL.createObjectURL(t);else{const r=JSON.stringify(t),s=new Blob([r],{type:"text/json"});t=window.URL.createObjectURL(s)}else if(typeof t=="string"&&t.indexOf("http")===-1){const r=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(r)}var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)}},Q={debounce(t,e,n=!0){let r,s,a,i,o;const c=function(){const l=+new Date-i;l<e&&l>0?r=setTimeout(c,e-l):(r=null,n||(o=t.apply(a,s),r||(a=s=null)))};return function(...l){a=this,i=+new Date;const u=n&&!r;return r||(r=setTimeout(c,e)),u&&(o=t.apply(a,l),a=l=null),o}},throttle(t,e,n){if(n===1)var r=0;else if(n===2)var s;return function(){let a=this,i=arguments;if(n===1){let o=Date.now();o-r>e&&(t.apply(a,i),r=o)}else n===2&&(s||(s=setTimeout(()=>{s=null,t.apply(a,i)},e)))}},recurve(t,e=500,n=5e3){let r=0;setTimeout(function s(){r++,r<Math.floor(n/e)&&(t.call(this),setTimeout(s,e))})}},k={checkStr(t,e){switch(e){case"phone":return/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t);case"tel":return/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t);case"card":return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);case"pwd":return/^[a-zA-Z]\w{5,17}$/.test(t);case"postal":return/[1-9]\d{5}(?!\d)/.test(t);case"QQ":return/^[1-9][0-9]{4,9}$/.test(t);case"email":return/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(t);case"money":return/^\d*(?:\.\d{0,2})?$/.test(t);case"URL":return/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(t);case"IP":return/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/.test(t);case"date":return/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})(?:\:\d{2}|:(\d{2}):(\d{2}))$/.test(t)||/^(\d{4})\-(\d{2})\-(\d{2})$/.test(t);case"number":return/^[0-9]$/.test(t);case"english":return/^[a-zA-Z]+$/.test(t);case"chinese":return/^[\u4E00-\u9FA5]+$/.test(t);case"lower":return/^[a-z]+$/.test(t);case"upper":return/^[A-Z]+$/.test(t);case"HTML":return/<("[^"]*"|'[^']*'|[^'">])*>/.test(t);default:return!0}},changeCase(t,e){switch(e=e||4,e){case 1:return t.replace(/\b\w+\b/g,function(n){return n.substring(0,1).toUpperCase()+n.substring(1).toLowerCase()});case 2:return t.replace(/\b\w+\b/g,function(n){return n.substring(0,1).toLowerCase()+n.substring(1).toUpperCase()});case 3:return t.split("").map(function(n){return/[a-z]/.test(n)?n.toUpperCase():n.toLowerCase()}).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}},tag(t,...e){return e=e.map(n=>{switch(M.getDataType(n)){case"Object":return n||"{}";case"Array":return n||"[]";default:return n||""}}),t.reduce((n,r,s)=>`${n}${e[s-1]}${r}`)},getByteLength(t){return t.replace(/[\u0391-\uFFE5]/g,"aa").length},subStringByte(t,e,n){var r=/[^\x00-\xff]/g;if(t.replace(r,"mm").length<=n)return t;for(var s=Math.floor(n/2),a=s;a<t.length;a++){let i=t.substring(e,a);if(i.replace(r,"mm").length>=n)return i}return t},asString(t){if(M.isEmpty(t))return"";switch(M.getDataType()){case"Object":case"Array":return JSON.stringify(t);default:return t}}},X={notNull(t){if(M.isEmpty(t))throw Error("\u4E0D\u80FD\u4E3A\u7A7A:>>>"+t)},legalLnglat(t,e){if(!N.isLnglat(t,e))throw Error(g.COORDINATE_ERROR)},contain(t,...e){let n=!1;const r=e.length||0;for(let s=0,a=r;s<a;s++)n=t.indexOf(e[s])>=0;if(n)throw Error(g.STRING_CHECK_LOSS)},verify:{array(t){if(M.getDataType(t)!=="Array")throw Error(g.PARAMETER_ERROR_ARRAY+":>>>"+t)},function(t){if(M.getDataType(t)!=="Function")throw Error(g.PARAMETER_ERROR_FUNCTION+":>>>"+t)},object(t){if(M.getDataType(t)!=="Object")throw Error(g.PARAMETER_ERROR_OBJECT+":>>>"+t)}},legalJSON(t){try{JSON.parse(t)}catch{throw Error(g.JSON_PARSE_ERROR+":>>>"+t)}},legalData(t,e){const n=k.checkStr(t,e);let r="";switch(e){case"phone":r="\u7535\u8BDD";break;case"tel":r="\u5EA7\u673A";break;case"card":r="\u8EAB\u4EFD\u8BC1";break;case"pwd":r="\u5BC6\u7801";break;case"postal":r="\u90AE\u653F\u7F16\u7801";break;case"QQ":r="QQ";break;case"email":r="\u90AE\u7BB1";break;case"money":r="\u91D1\u989D";break;case"URL":r="\u7F51\u5740";break;case"IP":r="IP";break;case"date":r="\u65E5\u671F\u65F6\u95F4";break;case"number":r="\u6570\u5B57";break;case"english":r="\u82F1\u6587";break;case"chinese":r="\u4E2D\u6587";break;case"lower":r="\u5C0F\u5199";break;case"upper":r="\u5927\u5199";break;case"HTML":r="HTML\u6807\u8BB0";break}if(!n)throw Error(g.PARAMETER_ERROR+":>>>\u4E0D\u662F"+r)}};class Z{constructor(e){this.audio=new Audio,this.audio.src=e}play(){!this.muted&&this.audio.play()}pause(){this.audio.pause()}get muted(){return this.audio.muted}set muted(e){this.audio.muted=e}}class tt{constructor(e){M.getDataType(e)==="String"&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}drawLine(e,n,r,s,a={}){this.cxt.beginPath();const i=a.width||1,o=a.color||"#000";this.cxt.lineWidth=i,this.cxt.fillStyle=o,this.cxt.moveTo(e,n),this.cxt.lineTo(r,s),this.cxt.closePath(),this.cxt.fill()}drawArc(e,n,r,s,a,i,o,c){o?(this.cxt.fillStyle=c,this.cxt.beginPath(),this.cxt.arc(e,n,r,E.degreesToRadians(s),E.degreesToRadians(a),i),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=c,this.cxt.beginPath(),this.cxt.arc(e,n,r,E.degreesToRadians(s),E.degreesToRadians(a),i),this.cxt.stroke())}}function S(){}Object.assign(S.prototype,{addEventListener(t,e,n,r=!1){this._listeners===void 0&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;const s=this._mutex,a=this._listeners;return a[t]===void 0&&(a[t]=[]),a[t].indexOf(e)===-1&&(r&&(s[t]=e),a[t].push(e)),this},hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1},removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),r!==void 0){const s=r.map(a=>a.toString()).indexOf(e.toString());s!==-1&&r.splice(s,1)}},dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const r=n.slice(0);if(this._mutex[t.type]){r.find(a=>a===this._mutex[t.type]).call(this._context||this,t);return}for(let s=0,a=r.length;s<a;s++)r[s].call(this._context||this,t)}},removeAllListener(){this._mutex={};for(const t in this._listeners)this._listeners[t]=[]}}),Object.assign(Map.prototype,{isEmpty(){return this.size===0},_values(){return Array.from(Map.prototype.values.call(this))},_keys(){return Array.from(Map.prototype.keys.call(this))},_entries(){return Array.from(Map.prototype.entries.call(this))}});function I(){return new Map}I.fromEntries=function(t=[]){const e=new I;return t.forEach(n=>{Array.isArray(n)&&n.length===2&&e.set(n[0],n[1])}),e};class R extends S{constructor(e="ws://127.0.0.1:10088"){super(),this.maxCheckTimes=10,this.url=e,this.checkTimes=0,this.connectStatus=!1,this.connect(),this.connCheckStatus(this.maxCheckTimes),R.instance=this}connect(){if(this.disconnect(),this.url)try{if(console.info("\u521B\u5EFAws\u8FDE\u63A5>>>"+this.url),this.client=new WebSocket(this.url),this.client){const e=this;this.client.onopen=function(n){e.dispatchEvent({type:D.WEB_SOCKET_CONNECT,message:n})},this.client.onmessage=function(n){e.connectStatus=!0,e.dispatchEvent({type:D.WEB_SOCKET_MESSAGE,message:n})},this.client.onclose=function(n){e.dispatchEvent({type:D.WEB_SOCKET_CLOSE,message:n})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(n){e.dispatchEvent({type:D.WEB_SOCKET_ERROR,message:n})})}}catch(e){console.error("\u521B\u5EFAws\u8FDE\u63A5\u5931\u8D25"+this.url+":"+e)}}disconnect(){if(this.client)try{console.log("ws\u65AD\u5F00\u8FDE\u63A5"+this.url),this.client.close(),this.client=null}catch{this.client=null}}connCheckStatus(e){this.checkTimes>e||setTimeout(()=>{this.checkTimes++,this.client&&this.client.readyState!==0&&this.client.readyState!==1&&this.connect(),this.connCheckStatus(e)},2e3)}send(e){return this.client&&this.client.readyState===1?(this.client.send(e),!0):(console.error(this.url+"\u6D88\u606F\u53D1\u9001\u5931\u8D25\uFF1A"+e),!1)}heartbeat(){setTimeout(()=>{this.client&&this.client.readyState===1&&this.send("HeartBeat"),console.log("HeartBeat,"+this.url),setTimeout(this.heartbeat,3e4)},1e3)}static getInstance(){return R.instance?R.instance:Object.freeze(new R)}static get _instance(){return this.getInstance()}}class et{constructor(e=1){if(this.cacheType=e,e===1)this.storage=window.localStorage;else if(e===2)this.storage=window.sessionStorage;else throw new Error(g.PARAMETER_ERROR)}setItem(e,n,r){const s={key:e,value:n};if(this.cacheType===1){const a=Date.now();r&&(s.expired=a+r*1e3)}return this.storage[e]=JSON.stringify(s),s}getItem(e){const n=this.storage.getItem(e)||null,r=JSON.parse(n)||{};if(this.cacheType===1){const s=r.expired||Date.now();if(Date.now()>s)return this.remove(e),null}return r.value}remove(e){e&&(e.indexOf(",")>-1?e.split(",").forEach(n=>{this.storage.removeItem(n)}):this.storage.removeItem(e))}clear(){this.storage.clear()}}class nt{constructor(e=1){this.magnification=e}_getSystem(){var e=navigator.userAgent.toLowerCase();if(e.indexOf("windows")>=0)return!0}_addHandler(e,n,r){e.addEventListener?e.addEventListener(n,r,!1):e.attachEvent?e.attachEvent("on"+n,r):e["on"+n]=r}_correct(){let e=window.innerWidth;if(typeof e!="number"&&(document.compatMode=="CSS1Compat"?e=document.documentElement.clientWidth:e=document.body.clientWidth),e<=750){const r=document.documentElement.clientWidth/e;document.documentElement.style.fontSize=this.magnification*75*Math.min(r,2)+"px"}else if(e>750&&e<=1200){const r=document.documentElement.clientWidth/e;document.documentElement.style.fontSize=this.magnification*85*Math.min(r,2)+"px"}else{const r=document.documentElement.clientWidth/1920;document.documentElement.style.fontSize=this.magnification*100*Math.min(r,2)+"px"}}_watch(){let e=this;e._addHandler(window,"resize",function(){e._correct()})}init(){let e=this;e._getSystem()&&(e._correct(),e._watch())}}h.AnimateUtils=v,h.ArrayUtils=j,h.AssertUtils=X,h.AudioPlayer=Z,h.BrowserUtils=q,h.CanvasDrawer=tt,h.Cookie=H,h.CoordsUtils=Y,h.DateUtils=K,h.DevicePixelRatio=nt,h.DomUtils=J,h.ErrorType=g,h.EventDispatcher=S,h.EventType=D,h.FileUtils=V,h.GeoUtils=N,h.GraphicType=G,h.HashMap=I,h.LayerType=$,h.MathUtils=E,h.MeasureMode=z,h.OptimizeUtils=Q,h.StringUtils=k,h.Utils=M,h.WebSocketClient=R,h.WebStorage=et,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(u,D){typeof exports=="object"&&typeof module!="undefined"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(u=typeof globalThis!="undefined"?globalThis:u||self,D(u["gis-common"]={}))})(this,function(u){"use strict";var D={animate(t,e,n,r="swing",s=5){for(var a in e)e[a]={target:a==="opacity"?parseInt(e[a]*100):e[a],iNow:parseInt(a==="opacity"?getComputedStyle(t)[a]*100:getComputedStyle(t)[a])};r==="liner"&&(s=e[a].iNow<e[a].target?Math.abs(s):-Math.abs(s)),clearInterval(t.timer),t.timer=setInterval(function(){for(var i in e){var o=e[i].target,c=e[i].iNow;if(r==="swing"&&(s=(o-c)/20,s=s>0?Math.ceil(s):Math.floor(s)),Math.abs(o-c)<=Math.abs(s)){i==="opacity"?t.style[i]=o/100:t.style[i]=o+"px",delete e[i];for(var l in e)return!1;clearInterval(t.timer),typeof n=="function"&&n()}else e[i].iNow+=s,i==="opacity"?t.style[i]=e[i].iNow/100:t.style[i]=e[i].iNow+"px"}},30)}},v={MAP_RENDER:"mapRender",MAP_READY:"mapReady",MOUSE_CLICK:"click",MOUSE_DOUBLE_CLICK:"dblclick",MOUSE_MOVE:"mousemove",MOUSE_IN:"mousein",MOUSE_OUT:"mouseout",MOUSE_RIGHT_CLICK:"mouseRightClick",KEY_DOWN:"keyDown",KEY_UP:"keyUp",DRAW_ACTIVE:"drawActive",DRAW_MOVE:"drawMove",DRAW_COMPLETE:"drawComplete",MQTT_CONNECT:"mqttConnect",MQTT_ERROR:"mqttError",MQTT_MESSAGE:"mqttMessage",MQTT_CLOSE:"mqttClose",WEB_SOCKET_CONNECT:"webSocketConnect",WEB_SOCKET_ERROR:"webSocketError",WEB_SOCKET_MESSAGE:"webSocketMessage",WEB_SOCKET_CLOSE:"webSocketClose"},g={LOGIN_EXPIRED:"\u767B\u5F55\u4FE1\u606F\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55",CROSS_ERROR:"\u8DE8\u57DF\u8BBF\u95EE",UNEXIST_RESOURCE:"\u8D44\u6E90\u4E0D\u5B58\u5728",TIMEOUT:"\u8BF7\u6C42\u8D85\u65F6",INTERNAL_ERROR:"\u5185\u90E8\u9519\u8BEF",NETWORK_ERROR:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u662F\u5426\u5DF2\u8FDE\u63A5",PROCESS_FAIL:"\u5904\u7406\u5931\u8D25",AUTH_VERIFY_ERROR:"\u6743\u9650\u9A8C\u8BC1\u5931\u8D25",NO_DATA_FOUND:"\u672A\u627E\u5230\u6570\u636E",DUPLICATE_INSTANCE:"\u5B9E\u4F8B\u4E3A\u5355\u4F8B\u6A21\u5F0F\uFF0C\u4E0D\u5141\u8BB8\u91CD\u590D\u6784\u5EFA",COORDINATE_ERROR:"\u5750\u6807\u9A8C\u8BC1\u5931\u8D25",JSON_PARSE_ERROR:"JSON\u89E3\u6790\u5931\u8D25\uFF0C\u683C\u5F0F\u6709\u8BEF",JSON_VALUE_ERROR:"JSON\u65E0\u6B64\u952E",PARAMETER_ERROR:"\u9A8C\u8BC1\u6570\u636E\u7C7B\u578B\u5931\u8D25",PARAMETER_ERROR_ARRAY:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u6570\u7EC4",PARAMETER_ERROR_STRING:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u5B57\u7B26",PARAMETER_ERROR_FUNCTION:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u51FD\u6570",PARAMETER_ERROR_OBJECT:"\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF1A\u5FC5\u987B\u662F\u5BF9\u8C61",PARAMETER_ERROR_LACK:"\u53C2\u6570\u7F3A\u5931",STRING_CHECK_LOSS:"\u5B57\u7B26\u7F3A\u5C11\u5173\u952E\u5B57"},$={SUPER_MAP_IMAGES:"SuperMapImages",SUPER_MAP_DATA:"SuperMapData",ARC_GIS_MAP_IMAGES:"ArcGisMapImages",ARC_GIS_MAP_DATA:"ArcGisMapData",OSGB_LAYER:"OSGBLayer",S3M_GROUP:"S3MGroup",TERRAIN_LAYER:"TerrainFileLayer"};const G={POINT:"point",POLYLINE:"polyline",POLYGON:"polygon",BILLBOARD:"billboard",CYLINDER:"cylinder",ELLIPSOID:"ellipsoid",LABEL:"label",MODEL:"model",WALL:"wall"},z={DISTANCE:"distance",AREA:"area",HEIGHT:"height"};var E={getDataType(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty(t){if(t==null)return!0;switch(this.getDataType(t)){case"String":return t.trim()==="";case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},isNotEmpty(t){return!this.isEmpty(t)},json2form(t){const e=new FormData;return Object.keys(t).forEach(n=>{e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])}),e},json2Query(t){var e=[];for(var n in t){var r=n,s=t[n];e.push(r+"="+s)}var a=e.join("&");return a},generateGuid(){const t=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict(...t){let e="";if(t.length>1){const n=t.slice(1,t.length%2===0?t.length-1:t.length);for(let r=0;r<n.length;r=r+2){const s=n[r];t[0]===s&&(e=n[r+1])}!e&&t.length%2===0&&(e=t[t.length-1])}else e=t[0];return e},extend(t,...e){let n,r,s,a;for(r=0,s=e.length;r<s;r++){a=e[r];for(n in a)t[n]=a[n]}return t},rgb2hex(t){var e="#"+(16777216+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1);return e},convertToTree2(t,e="id",n="parentId",r="children"){const s=[];function a(i){const o=i[e],c=t.filter(l=>l.hasOwnProperty(n)&&l[n]===o);c.length>0&&(c.forEach(a),i[r]=c)}for(const i of t)t.findIndex(o=>o[e]===i[n])===-1&&(a(i),s.push(i));return s},asyncLoadScript(t){return new Promise((e,n)=>{try{var r=document.createElement("script");r.readyState?r.onreadystatechange=function(){(r.readyState==="complete"||r.readyState==="loaded")&&e(r)}:r.onload=function(){e(r)},r.type="text/javascript",r.src=t,document.body.appendChild(r)}catch(s){n(s)}})},loadStyle(t){t.forEach(e=>{const n=document.createElement("link");n.href=e,n.rel="stylesheet",n.type="text/css",document.head.appendChild(n)})},template(t,e){const n=/\{ *([\w_-]+) *\}/g;return t.replace(n,function(r,s){var a=e[s];if(a===void 0)throw new Error(g.JSON_VALUE_ERROR+r);return typeof a=="function"&&(a=a(e)),a})},deleteEmptyProperty(t){return Object.fromEntries(Object.keys(t).filter(e=>!this.isEmpty(t[e])).map(e=>[e,t[e]]))},deepAssign(){let t=arguments.length,e=arguments[0];this.getDataType(e)!=="Object"&&(e={});for(let n=1;n<t;n++){let r=arguments[n];if(this.getDataType(r)==="Object")for(let s in r)s==="__proto__"||e===r[s]||(this.getDataType(r[s])==="Object"?e[s]=this.deepAssign(e[s],r[s]):e[s]=r[s])}return e},handleCopyValue(t){if(!navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);{const e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise((n,r)=>{document.execCommand("copy")?n():r(new Error("copy failed")),e.remove()})}}};Array.prototype.groupBy=function(t){var e={};return this.forEach(function(n){var r=JSON.stringify(t(n));e[r]=e[r]||[],e[r].push(n)}),Object.keys(e).map(n=>e[n])},Array.prototype.distinct=function(t=e=>e){const e=[],n={};return this.forEach(r=>{const s=t(r);!n[s]&&(n[s]=e.push(r))}),e},Array.prototype.max=function(){return Math.max.apply({},this)},Array.prototype.min=function(){return Math.min.apply({},this)},Array.prototype.sum=function(){return this.length>0?this.reduce((t=0,e=0)=>t+e):0},Array.prototype.avg=function(){return this.length?this.sum()/this.length:0},Array.prototype.desc=function(t=e=>e){return this.sort((e,n)=>t(n)-t(e))},Array.prototype.asc=function(t=e=>e){return this.sort((e,n)=>t(e)-t(n))},Array.prototype.clear=function(){return this.length=0,this};var j={asArray(t){return E.isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray(t){return[...new Array(t).keys()]},union(...t){let e=[];return t.forEach(n=>{Array.isArray(n)&&(e=e.concat(n.filter(r=>!e.includes(r))))}),e},intersection(...t){let e=t[0]||[];return t.forEach(n=>{Array.isArray(n)&&(e=e.filter(r=>n.includes(r)))}),e},unionAll(...t){return[...t].flat().filter(e=>!!e)},difference(...t){return this.union(...t).filter(e=>!this.intersection(...t).includes(e))}},q={getUrlParams(t=window.location.href,e=!0){const n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,{search:r,hash:s}=new URL(t),a=[r,s];let i={};for(let o=0;o<a.length;o++){const c=a[o];if(c){const h=c.replace(/#|\//g,"").split("?");if(h.length>1)for(let d=1;d<h.length;d++){let f;for(;f=n.exec(h[d]);)i[f[1]]=e?decodeURIComponent(f[2]):f[2]}}}return i},getExplorer(){var t=window.navigator.userAgent;if(t.indexOf("MSIE")>=0||!!window.ActiveXObject||"ActiveXObject"in window)return"IE";if(t.indexOf("Firefox")>=0)return"Firefox";if(t.indexOf("Chrome")>=0)return"Chrome";if(t.indexOf("Opera")>=0)return"Opera";if(t.indexOf("Safari")>=0)return"Safari"},detectOS(){let t="";const e=navigator.userAgent.indexOf("Windows",0)!=-1?1:0,n=navigator.userAgent.indexOf("mac",0)!=-1?1:0,r=navigator.userAgent.indexOf("Linux",0)!=-1?1:0,s=navigator.userAgent.indexOf("X11",0)!=-1?1:0;return e?t="MS Windows":n?t="Apple mac":r?t="Linux":s&&(t="Unix"),t},switchFullScreen(t){if(t){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},refreshScale(){const t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/e,s=16/9;let a=t/1920;r>s&&(a=e/1080),n.transformOrigin="left top",n.transform=`scale(${a}) translateX(-49.99%)`,n.width=`${t/a}px`},getHtmlFontSize(){const t=document.documentElement.clientWidth||document.body.clientWidth,e=document.querySelector("html");e.style.fontSize=t/192+"px"}},H={set:function(t,e,n=30){var r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3),document.cookie=t+"="+escape(e)+";expires="+r.toUTCString()},remove:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);n!=null&&(document.cookie=t+"="+n+";expires="+e.toUTCString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return e!=null?e[2]:""}},Y={PI:3.141592653589793,XPI:3.141592653589793*3e3/180,delta(t,e){const r=.006693421622965943;let s=this.transformLat(e-105,t-35),a=this.transformLon(e-105,t-35);const i=t/180*this.PI;let o=Math.sin(i);o=1-r*o*o;const c=Math.sqrt(o);return s=s*180/(6378245*(1-r)/(o*c)*this.PI),a=a*180/(6378245/c*Math.cos(i)*this.PI),{lat:s,lng:a}},gcjEncrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}},gcjDecrypt(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};const n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}},gcjDecryptExact(t,e){let s=.01,a=.01,i=t-s,o=e-a,c=t+s,l=e+a,h,d,f=0;for(;;){h=(i+c)/2,d=(o+l)/2;const m=this.gcj_encrypt(h,d);if(s=m.lat-t,a=m.lng-e,Math.abs(s)<1e-9&&Math.abs(a)<1e-9||(s>0?c=h:i=h,a>0?l=d:o=d,++f>1e4))break}return{lat:h,lng:d}},bdEncrypt(t,e){const n=e,r=t,s=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),a=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI),i=s*Math.cos(a)+.0065;return{lat:s*Math.sin(a)+.006,lng:i}},bdDecrypt(t,e){const n=e-.0065,r=t-.006,s=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),a=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),i=s*Math.cos(a);return{lat:s*Math.sin(a),lng:i}},mercatorEncrypt(t,e){const n=e*2003750834e-2/180;let r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return r=r*2003750834e-2/180,{lat:r,lng:n}},mercatorDecrypt(t,e){const n=e/2003750834e-2*180;let r=t/2003750834e-2*180;return r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),{lat:r,lng:n}},distance(t,e,n,r){const a=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180),i=Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);let o=a+i;return o>1&&(o=1),o<-1&&(o=-1),Math.acos(o)*6371e3},outOfChina(t,e){return e<72.004||e>137.8347||t<.8293||t>55.8271},transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))*2/3,n+=(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))*2/3,n+=(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))*2/3,n},transformLon(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))*2/3,n+=(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))*2/3,n+=(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))*2/3,n},randomCoordinate(t,e,n,r){return{lat:Math.random()*(r-e)+e,lng:Math.random()*(n-t)+t}}};Date.prototype.format=function(t){const e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(const n in e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,RegExp.$1.length===1?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){const n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+e*3);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+e*7);break;case"d":n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e);break;default:n.setDate(this.getDate()+e);break}return n};var K={lastMonthDate:new Date(new Date().getFullYear(),new Date().getMonth()-1,1),thisMonthDate:new Date(new Date().getFullYear(),new Date().getMonth(),1),nextMonthDate:new Date(new Date().getFullYear(),new Date().getMonth()+1,1),lastWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1-7-new Date().getDay()),thisWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1-new Date().getDay()),nextWeekDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1+7-new Date().getDay()),lastDayDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-1),thisDayDate:new Date(new Date().setHours(0,0,0,0)),nextDayDate:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()+1),parseDate(t){if(typeof t=="string"){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if(e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/),e&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if(e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/),e&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null},formatDateInterval(t,e){const n=new Date(t),s=new Date(e).getTime()-n.getTime(),a=Math.floor(s/(24*3600*1e3)),i=s%(24*3600*1e3),o=Math.floor(i/(3600*1e3)),c=i%(3600*1e3),l=Math.floor(c/(60*1e3)),h=c%(60*1e3),d=Math.round(h/1e3);let f="";return a>0&&(f+=a+"\u5929"),o>0&&(f+=o+"\u65F6"),l>0&&(f+=l+"\u5206"),d>0&&(f+=d+"\u79D2"),a===0&&o===0&&l===0&&d===0&&(f="\u5C11\u4E8E1\u79D2"),f},formatterCounter(t){const e=function(o){return(o>10?"":"0")+(o||0)},n=e(Math.floor(t/3600)),r=t%3600,s=e(Math.floor(r/60)),a=r%60,i=e(Math.round(a));return`${n}:${s}:${i}`},sleep(t){}};function B(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function P(t){return B(t).split(/\s+/)}var J={getStyle(t,e){let n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||n==="auto")&&document.defaultView){const r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return n==="auto"?null:n},create(t,e,n){const r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove(t){const e=t.parentNode;e&&e.removeChild(t)},empty(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront(t){const e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack(t){const e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal},hasClass(t,e){if(t.classList!==void 0)return t.classList.contains(e);const n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass(t,e){if(t.classList!==void 0){const n=P(e);for(let r=0,s=n.length;r<s;r++)t.classList.add(n[r])}else if(!this.hasClass(t,e)){const n=this.getClass(t);this.setClass(t,(n?n+" ":"")+e)}},removeClass(t,e){t.classList!==void 0?P(e).forEach(r=>t.classList.remove(r)):this.setClass(t,B((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e},parseFromString(t){return new DOMParser().parseFromString(t,"text/xml").children[0]}},M={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat(t,e){return t+Math.random()*(e-t)},degreesToRadians(t){return t*this.DEG2RAD},toRadians(t){return t*this.DEG2RAD},radiansToDegrees(t){return t*this.RAD2DEG},toDegrees(t){return t*this.RAD2DEG},formatFloat(t,e=2){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},L={toRadian:Math.PI/180,R:6371393,isLnglat(t,e){return t&&e&&+e>-90&&+e<90&&+t>-180&&+t<180},formatLnglat(t,e){let n="";function r(s){const a=parseFloat(s),i=parseInt(a);let o=parseInt((a-i)*60),c=(a-i)*3600-o*60;return i+"\xB0"+o+"\u2032"+c.toFixed(2)+"\u2033"}return t&&e&&(n=r(t)+","+r(e)),n},transformLnglat(t,e){function n(r){for(var s=/[sw]/i.test(r),a=s?-1:1,i=r.match(/[\d.]+/g),o=0,c=0,l=i.length;c<l;c++)o+=i[c]/a,a*=60;return o}if(t&&e)return{lng:n(t),lat:n(e)}},rayCasting(t,e){for(var n=t.x,r=t.y,s=!1,a=0,i=e.length,o=i-1;a<i;o=a,a++){var c=e[a].x,l=e[a].y,h=e[o].x,d=e[o].y;if(c===n&&l===r||h===n&&d===r)return"on";if(l<r&&d>=r||l>=r&&d<r){var f=c+(r-l)*(h-c)/(d-l);if(f===n)return"on";f>n&&(s=!s)}}return s?"in":"out"},wgs84PointsDistance(t,e){var n=Math.PI;function r(it){return it*n/180}if(arguments.length!=2)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var s=6378137,a=63567523142e-4,i=1/298.257223563,o=r(lon2-lon1),c=Math.atan((1-i)*Math.tan(r(lat1))),l=Math.atan((1-i)*Math.tan(r(lat2))),h=Math.sin(c),d=Math.cos(c),f=Math.sin(l),m=Math.cos(l),C=o,N,k=100;do{var I=Math.sin(C),T=Math.cos(C),w=Math.sqrt(m*I*(m*I)+(d*f-h*m*T)*(d*f-h*m*T));if(w==0)return 0;var A=h*f+d*m*T,W=Math.atan2(w,A),F=d*m*I/w,O=1-F*F,p=A-2*h*f/O;isNaN(p)&&(p=0);var _=i/16*O*(4+i*(4-3*O));N=C,C=o+(1-_)*i*F*(W+_*w*(p+_*A*(-1+2*p*p)))}while(Math.abs(C-N)>1e-12&&--k>0);if(k==0)return NaN;var y=O*(s*s-a*a)/(a*a),rt=1+y/16384*(4096+y*(-768+y*(320-175*y))),x=y/1024*(256+y*(-128+y*(74-47*y))),at=x*w*(p+x/4*(A*(-1+2*p*p)-x/6*p*(-3+4*w*w)*(-3+4*p*p))),st=a*rt*(W-at);return st},rotatePoint(t,e,n){const r=(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,s=(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y;return{x:r,y:s}},calcBearAndDis(t,e){const{x:n,y:r}=t,{x:s,y:a}=e,i=s-n,o=a-r,c=Math.sqrt(i*i+o*o);return{angle:(Math.atan2(o,i)*(180/Math.PI)+360+90)%360,distance:c}},calcBearAndDisByPoints(t,e){var n=parseFloat(t.lat),r=parseFloat(t.lng),s=parseFloat(e.lat),a=parseFloat(e.lng),i=Math.sin((a-r)*this.toRadian)*Math.cos(s*this.toRadian),o=Math.cos(n*this.toRadian)*Math.sin(s*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(s*this.toRadian)*Math.cos((a-r)*this.toRadian),c=Math.atan2(i,o)*(180/Math.PI),l=(s-n)*this.toRadian,h=(a-r)*this.toRadian,d=Math.sin(l/2)*Math.sin(l/2)+Math.cos(n*this.toRadian)*Math.cos(s*this.toRadian)*Math.sin(h/2)*Math.sin(h/2),f=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)),m=this.R*f;return{angle:c,distance:m}},calcPointByBearAndDis(t,e,n){const r=M.toRadians(parseFloat(t.lat)),s=M.toRadians(parseFloat(t.lng));e=parseFloat(e),n=parseFloat(n);const a=n/this.R;e=M.toRadians(e);const i=Math.asin(Math.sin(r)*Math.cos(a)+Math.cos(r)*Math.sin(a)*Math.cos(e)),o=s+Math.atan2(Math.sin(e)*Math.sin(a)*Math.cos(r),Math.cos(a)-Math.sin(r)*Math.sin(i));return{lat:M.toDegrees(i),lng:M.toDegrees(o)}},mercatorTolonlat(t,e){const n=t/2003750834e-2*180;var r=e/2003750834e-2*180;const s=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2);return{lng:n,lat:s}},lonlatToMercator(t,e){var n=6378137;const r=t*Math.PI/180*n;var s=e*Math.PI/180;const a=n/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)));return{x:r,y:a}}},V={convertBase64ToBlob(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),s=new Uint8Array(r),a=0;a<n.length;a++)s[a]=n.charCodeAt(a);var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return i?(i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder),i.append(r),i.getBlob(e)):(i=new Blob([r],{type:e}),i)},convertUrlToBase64(t,e,n){return new Promise(function(r,s){var a=new Image;a.crossOrigin="Anonymous",a.src=t,a.onload=function(){var i=document.createElement("canvas");i.width=e||a.width,i.height=n||a.height;var o=i.getContext("2d");o.drawImage(a,0,0,a.width,a.height);var c=a.src.substring(a.src.lastIndexOf(".")+1).toLowerCase(),l=i.toDataURL("image/"+c),h={dataURL:l,type:"image/"+c,ext:c};r(h)}})},convertBase64ToFile(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],s=atob(n[1]),a=s.length,i=new Uint8Array(a);a--;)i[a]=s.charCodeAt(a);return new File([i],e,{type:r})},downloadFromFile(t,e){if(typeof t=="object")if(t instanceof Blob)t=URL.createObjectURL(t);else{const r=JSON.stringify(t),s=new Blob([r],{type:"text/json"});t=window.URL.createObjectURL(s)}else if(typeof t=="string"&&t.indexOf("http")===-1){const r=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(r)}var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)}},Q={debounce(t,e,n=!0){let r,s,a,i,o;const c=function(){const l=+new Date-i;l<e&&l>0?r=setTimeout(c,e-l):(r=null,n||(o=t.apply(a,s),r||(a=s=null)))};return function(...l){a=this,i=+new Date;const h=n&&!r;return r||(r=setTimeout(c,e)),h&&(o=t.apply(a,l),a=l=null),o}},throttle(t,e,n){if(n===1)var r=0;else if(n===2)var s;return function(){let a=this,i=arguments;if(n===1){let o=Date.now();o-r>e&&(t.apply(a,i),r=o)}else n===2&&(s||(s=setTimeout(()=>{s=null,t.apply(a,i)},e)))}},recurve(t,e=500,n=5e3){let r=0;setTimeout(function s(){r++,r<Math.floor(n/e)&&(t.call(this),setTimeout(s,e))})}},U={checkStr(t,e){switch(e){case"phone":return/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t);case"tel":return/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t);case"card":return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);case"pwd":return/^[a-zA-Z]\w{5,17}$/.test(t);case"postal":return/[1-9]\d{5}(?!\d)/.test(t);case"QQ":return/^[1-9][0-9]{4,9}$/.test(t);case"email":return/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(t);case"money":return/^\d*(?:\.\d{0,2})?$/.test(t);case"URL":return/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(t);case"IP":return/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/.test(t);case"date":return/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})(?:\:\d{2}|:(\d{2}):(\d{2}))$/.test(t)||/^(\d{4})\-(\d{2})\-(\d{2})$/.test(t);case"number":return/^[0-9]$/.test(t);case"english":return/^[a-zA-Z]+$/.test(t);case"chinese":return/^[\u4E00-\u9FA5]+$/.test(t);case"lower":return/^[a-z]+$/.test(t);case"upper":return/^[A-Z]+$/.test(t);case"HTML":return/<("[^"]*"|'[^']*'|[^'">])*>/.test(t);default:return!0}},changeCase(t,e){switch(e=e||4,e){case 1:return t.replace(/\b\w+\b/g,function(n){return n.substring(0,1).toUpperCase()+n.substring(1).toLowerCase()});case 2:return t.replace(/\b\w+\b/g,function(n){return n.substring(0,1).toLowerCase()+n.substring(1).toUpperCase()});case 3:return t.split("").map(function(n){return/[a-z]/.test(n)?n.toUpperCase():n.toLowerCase()}).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}},tag(t,...e){return e=e.map(n=>{switch(E.getDataType(n)){case"Object":return n||"{}";case"Array":return n||"[]";default:return n||""}}),t.reduce((n,r,s)=>`${n}${e[s-1]}${r}`)},getByteLength(t){return t.replace(/[\u0391-\uFFE5]/g,"aa").length},subStringByte(t,e,n){var r=/[^\x00-\xff]/g;if(t.replace(r,"mm").length<=n)return t;for(var s=Math.floor(n/2),a=s;a<t.length;a++){let i=t.substring(e,a);if(i.replace(r,"mm").length>=n)return i}return t},asString(t){if(E.isEmpty(t))return"";switch(E.getDataType()){case"Object":case"Array":return JSON.stringify(t);default:return t}}},X={notNull(t){if(E.isEmpty(t))throw Error("\u4E0D\u80FD\u4E3A\u7A7A:>>>"+t)},legalLnglat(t,e){if(!L.isLnglat(t,e))throw Error(g.COORDINATE_ERROR)},contain(t,...e){let n=!1;const r=e.length||0;for(let s=0,a=r;s<a;s++)n=t.indexOf(e[s])>=0;if(n)throw Error(g.STRING_CHECK_LOSS)},verify:{array(t){if(E.getDataType(t)!=="Array")throw Error(g.PARAMETER_ERROR_ARRAY+":>>>"+t)},function(t){if(E.getDataType(t)!=="Function")throw Error(g.PARAMETER_ERROR_FUNCTION+":>>>"+t)},object(t){if(E.getDataType(t)!=="Object")throw Error(g.PARAMETER_ERROR_OBJECT+":>>>"+t)}},legalJSON(t){try{JSON.parse(t)}catch{throw Error(g.JSON_PARSE_ERROR+":>>>"+t)}},legalData(t,e){const n=U.checkStr(t,e);let r="";switch(e){case"phone":r="\u7535\u8BDD";break;case"tel":r="\u5EA7\u673A";break;case"card":r="\u8EAB\u4EFD\u8BC1";break;case"pwd":r="\u5BC6\u7801";break;case"postal":r="\u90AE\u653F\u7F16\u7801";break;case"QQ":r="QQ";break;case"email":r="\u90AE\u7BB1";break;case"money":r="\u91D1\u989D";break;case"URL":r="\u7F51\u5740";break;case"IP":r="IP";break;case"date":r="\u65E5\u671F\u65F6\u95F4";break;case"number":r="\u6570\u5B57";break;case"english":r="\u82F1\u6587";break;case"chinese":r="\u4E2D\u6587";break;case"lower":r="\u5C0F\u5199";break;case"upper":r="\u5927\u5199";break;case"HTML":r="HTML\u6807\u8BB0";break}if(!n)throw Error(g.PARAMETER_ERROR+":>>>\u4E0D\u662F"+r)}};class Z{constructor(e){this.audio=new Audio,this.audio.src=e}play(){!this.muted&&this.audio.play()}pause(){this.audio.pause()}get muted(){return this.audio.muted}set muted(e){this.audio.muted=e}}class tt{constructor(e){E.getDataType(e)==="String"&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}drawLine(e,n,r,s,a={}){this.cxt.beginPath();const i=a.width||1,o=a.color||"#000";this.cxt.lineWidth=i,this.cxt.fillStyle=o,this.cxt.moveTo(e,n),this.cxt.lineTo(r,s),this.cxt.closePath(),this.cxt.fill()}drawArc(e,n,r,s,a,i,o,c){o?(this.cxt.fillStyle=c,this.cxt.beginPath(),this.cxt.arc(e,n,r,M.degreesToRadians(s),M.degreesToRadians(a),i),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=c,this.cxt.beginPath(),this.cxt.arc(e,n,r,M.degreesToRadians(s),M.degreesToRadians(a),i),this.cxt.stroke())}}function b(){}Object.assign(b.prototype,{addEventListener(t,e,n,r=!1){this._listeners===void 0&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;const s=this._mutex,a=this._listeners;return a[t]===void 0&&(a[t]=[]),a[t].indexOf(e)===-1&&(r&&(s[t]=e),a[t].push(e)),this},hasEventListener(t,e){if(this._listeners===void 0)return!1;const n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1},removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),r!==void 0){const s=r.map(a=>a.toString()).indexOf(e.toString());s!==-1&&r.splice(s,1)}},dispatchEvent(t){if(this._listeners===void 0)return;const n=this._listeners[t.type];if(n!==void 0){t.target=this;const r=n.slice(0);if(this._mutex[t.type]){r.find(a=>a===this._mutex[t.type]).call(this._context||this,t);return}for(let s=0,a=r.length;s<a;s++)r[s].call(this._context||this,t)}},removeAllListener(){this._mutex={};for(const t in this._listeners)this._listeners[t]=[]}}),Object.assign(Map.prototype,{isEmpty(){return this.size===0},_values(){return Array.from(Map.prototype.values.call(this))},_keys(){return Array.from(Map.prototype.keys.call(this))},_entries(){return Array.from(Map.prototype.entries.call(this))}});function S(){return new Map}S.fromEntries=function(t=[]){const e=new S;return t.forEach(n=>{Array.isArray(n)&&n.length===2&&e.set(n[0],n[1])}),e};class R extends b{constructor(e="ws://127.0.0.1:10088"){super(),this.maxCheckTimes=10,this.url=e,this.checkTimes=0,this.connectStatus=!1,this.connect(),this.connCheckStatus(this.maxCheckTimes),R.instance=this}connect(){if(this.disconnect(),this.url)try{if(console.info("\u521B\u5EFAws\u8FDE\u63A5>>>"+this.url),this.client=new WebSocket(this.url),this.client){const e=this;this.client.onopen=function(n){e.dispatchEvent({type:v.WEB_SOCKET_CONNECT,message:n})},this.client.onmessage=function(n){e.connectStatus=!0,e.dispatchEvent({type:v.WEB_SOCKET_MESSAGE,message:n})},this.client.onclose=function(n){e.dispatchEvent({type:v.WEB_SOCKET_CLOSE,message:n})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(n){e.dispatchEvent({type:v.WEB_SOCKET_ERROR,message:n})})}}catch(e){console.error("\u521B\u5EFAws\u8FDE\u63A5\u5931\u8D25"+this.url+":"+e)}}disconnect(){if(this.client)try{console.log("ws\u65AD\u5F00\u8FDE\u63A5"+this.url),this.client.close(),this.client=null}catch{this.client=null}}connCheckStatus(e){this.checkTimes>e||setTimeout(()=>{this.checkTimes++,this.client&&this.client.readyState!==0&&this.client.readyState!==1&&this.connect(),this.connCheckStatus(e)},2e3)}send(e){return this.client&&this.client.readyState===1?(this.client.send(e),!0):(console.error(this.url+"\u6D88\u606F\u53D1\u9001\u5931\u8D25\uFF1A"+e),!1)}heartbeat(){setTimeout(()=>{this.client&&this.client.readyState===1&&this.send("HeartBeat"),console.log("HeartBeat,"+this.url),setTimeout(this.heartbeat,3e4)},1e3)}static getInstance(){return R.instance?R.instance:Object.freeze(new R)}static get _instance(){return this.getInstance()}}class et{constructor(e=1){if(this.cacheType=e,e===1)this.storage=window.localStorage;else if(e===2)this.storage=window.sessionStorage;else throw new Error(g.PARAMETER_ERROR)}setItem(e,n,r){const s={key:e,value:n};if(this.cacheType===1){const a=Date.now();r&&(s.expired=a+r*1e3)}return this.storage[e]=JSON.stringify(s),s}getItem(e){const n=this.storage.getItem(e)||null,r=JSON.parse(n)||{};if(this.cacheType===1){const s=r.expired||Date.now();if(Date.now()>s)return this.remove(e),null}return r.value}remove(e){e&&(e.indexOf(",")>-1?e.split(",").forEach(n=>{this.storage.removeItem(n)}):this.storage.removeItem(e))}clear(){this.storage.clear()}}class nt{constructor(e=1){this.magnification=e}_getSystem(){var e=navigator.userAgent.toLowerCase();if(e.indexOf("windows")>=0)return!0}_addHandler(e,n,r){e.addEventListener?e.addEventListener(n,r,!1):e.attachEvent?e.attachEvent("on"+n,r):e["on"+n]=r}_correct(){let e=window.innerWidth;if(typeof e!="number"&&(document.compatMode=="CSS1Compat"?e=document.documentElement.clientWidth:e=document.body.clientWidth),e<=750){const r=document.documentElement.clientWidth/e;document.documentElement.style.fontSize=this.magnification*75*Math.min(r,2)+"px"}else if(e>750&&e<=1200){const r=document.documentElement.clientWidth/e;document.documentElement.style.fontSize=this.magnification*85*Math.min(r,2)+"px"}else{const r=document.documentElement.clientWidth/1920;document.documentElement.style.fontSize=this.magnification*100*Math.min(r,2)+"px"}}_watch(){let e=this;e._addHandler(window,"resize",function(){e._correct()})}init(){let e=this;e._getSystem()&&(e._correct(),e._watch())}}u.AnimateUtils=D,u.ArrayUtils=j,u.AssertUtils=X,u.AudioPlayer=Z,u.BrowserUtils=q,u.CanvasDrawer=tt,u.Cookie=H,u.CoordsUtils=Y,u.DateUtils=K,u.DevicePixelRatio=nt,u.DomUtils=J,u.ErrorType=g,u.EventDispatcher=b,u.EventType=v,u.FileUtils=V,u.GeoUtils=L,u.GraphicType=G,u.HashMap=S,u.LayerType=$,u.MathUtils=M,u.MeasureMode=z,u.OptimizeUtils=Q,u.StringUtils=U,u.Utils=E,u.WebSocketClient=R,u.WebStorage=et,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -0,0 +1,9 @@
1
+ export * from './utils';
2
+ export * from './constant';
3
+ export { default as AudioPlayer } from './core/AudioPlayer';
4
+ export { default as CanvasDrawer } from './core/CanvasDrawer';
5
+ export { default as EventDispatcher } from './core/EventDispatcher';
6
+ export { default as HashMap } from './core/HashMap';
7
+ export { default as WebSocketClient } from './core/WebSocketClient';
8
+ export { default as WebStorage } from './core/WebStorage';
9
+ export { default as DevicePixelRatio } from './core/DevicePixelRatio';
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ set: (name: string, value: string, Days?: number) => void;
3
+ remove: (name: string) => void;
4
+ get: (name: string) => string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,36 @@
1
+ declare const _default: {
2
+ DEG2RAD: number;
3
+ RAD2DEG: number;
4
+ randInt(low: number, high: number): number;
5
+ randFloat(low: number, high: number): number;
6
+ /**
7
+ * 角度转弧度
8
+ *
9
+ * @param {*} degrees
10
+ * @returns {*}
11
+ */
12
+ degreesToRadians(degrees: number): number;
13
+ /**
14
+ * 角度转弧度
15
+ *
16
+ * @param {*} degrees
17
+ * @returns {*}
18
+ */
19
+ toRadians(degrees: number): number;
20
+ /**
21
+ * 弧度转角度
22
+ *
23
+ * @param {*} radians
24
+ * @returns {*}
25
+ */
26
+ radiansToDegrees(radians: number): number;
27
+ /**
28
+ * 弧度转角度
29
+ *
30
+ * @param {*} radians
31
+ * @returns {*}
32
+ */
33
+ toDegrees(radians: number): number;
34
+ formatFloat(value: number, n?: number): number;
35
+ };
36
+ export default _default;
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "gis-common",
3
- "version": "3.1.3",
3
+ "version": "3.1.5",
4
4
  "author": "Guo.Yan <luv02@vip.qq.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "module": "./dist/gis-common.es.js",
8
8
  "main": "./dist/gis-common.umd.js",
9
+ "type": "module",
9
10
  "files": [
10
11
  "dist"
11
12
  ],
13
+ "types": "dist/index.d.ts",
12
14
  "exports": {
13
15
  ".": {
14
16
  "import": "./dist/gis-common.es.js",
15
- "require": "./dist/gis-common.umd.js"
17
+ "require": "./dist/gis-common.umd.js",
18
+ "types": "./dist/index.d.ts"
16
19
  },
17
20
  "./style.css": "./dist/style.css"
18
21
  },
@@ -25,8 +28,9 @@
25
28
  "type": "git",
26
29
  "url": ""
27
30
  },
28
- "dependencies": {},
29
31
  "devDependencies": {
30
- "vite": "^2.6.4"
32
+ "typescript": "^5.5.4",
33
+ "vite": "^2.6.4",
34
+ "vite-plugin-dts": "^4.0.1"
31
35
  }
32
36
  }