gis-common 1.0.10 → 1.0.11
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/dist/resource.min.js +1 -1
- package/package.json +1 -1
package/dist/resource.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("mqtt")):"function"==typeof define&&define.amd?define("Gis",["mqtt"],e):"object"==typeof exports?exports.Gis=e(require("mqtt")):t.Gis=e(t.mqtt)}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"AnimateUtils",(function(){return r})),n.d(e,"ArrayUtils",(function(){return o})),n.d(e,"BrowserUtils",(function(){return a})),n.d(e,"Cookie",(function(){return s})),n.d(e,"CoordsUtils",(function(){return c})),n.d(e,"DateUtils",(function(){return u})),n.d(e,"DomUtils",(function(){return h})),n.d(e,"GeoUtils",(function(){return p})),n.d(e,"FileUtils",(function(){return y})),n.d(e,"MathUtils",(function(){return m})),n.d(e,"OptimizeUtils",(function(){return g})),n.d(e,"StringUtils",(function(){return E})),n.d(e,"Utils",(function(){return M})),n.d(e,"EventType",(function(){return w})),n.d(e,"ErrorType",(function(){return d})),n.d(e,"LayerType",(function(){return b})),n.d(e,"AudioPlayer",(function(){return R})),n.d(e,"CanvasDrawer",(function(){return O})),n.d(e,"ElQuery",(function(){return x})),n.d(e,"EventDispatcher",(function(){return P})),n.d(e,"HashMap",(function(){return N})),n.d(e,"MqttClient",(function(){return q})),n.d(e,"WebSocketClient",(function(){return Q})),n.d(e,"WebStorage",(function(){return V}));var r={animate:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"swing",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;for(var o in e)e[o]={target:"opacity"===o?parseInt(100*e[o]):e[o],iNow:"opacity"===o?parseInt(100*getComputedStyle(t)[o]):parseInt(getComputedStyle(t)[o])};"liner"===r&&(i=e[o].iNow<e[o].target?Math.abs(i):-Math.abs(i)),clearInterval(t.timer),t.timer=setInterval((function(){for(var o in e){var a=e[o].target,s=e[o].iNow;if("swing"===r&&(i=(i=(a-s)/20)>0?Math.ceil(i):Math.floor(i)),Math.abs(a-s)<=Math.abs(i)){for(var c in t.style[o]="opacity"===o?a/100:a+"px",delete e[o],e)return!1;clearInterval(t.timer),"function"==typeof n&&n()}else e[o].iNow+=i,t.style[o]="opacity"===o?e[o].iNow/100:e[o].iNow+"px"}}),30)}};function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}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((function(t){return e[t]}))},Array.prototype.distinct=function(t){var e=[],n={};return this.forEach((function(r){var i=t(r);!n[i]&&(n[i]=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((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t+e})):0},Array.prototype.desc=function(t){return this.sort((function(e,n){return(t?t(n):n)-(t?t(e):e)}))},Array.prototype.asc=function(t){return this.sort((function(e,n){return(t?t(e):e)-(t?t(n):n)}))},Array.prototype.clear=function(){return this.length=0,this};var o={asArray:function(t){return isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray:function(t){return[].concat(i(new Array(t).keys()))},union:function(){for(var t=[],e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){Array.isArray(e)&&(t=t.concat(e.filter((function(e){return!t.includes(e)}))))})),t},intersection:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0]||[];return e.forEach((function(t){Array.isArray(t)&&(r=r.filter((function(e){return t.includes(e)})))})),r},unionAll:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return[].concat(i(e)).flat().filter((function(t){return!!t}))},difference:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.union.apply(this,i(n)).filter((function(e){return!t.intersection.apply(t,i(n)).includes(e)}))}},a={getUrlParams:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,r=new URL(t),i=r.search,o=r.hash,a=[i,o],s={},c=0;c<a.length;c++){var u=a[c];if(u){var l=u.replace(/#|\//g,""),f=l.split("?");if(f.length>1)for(var h=1;h<f.length;h++)for(var d=void 0;d=n.exec(f[h]);)s[d[1]]=e?decodeURIComponent(d[2]):d[2]}}return s},getExplorer:function(){var t=window.navigator.userAgent;return t.indexOf("MSIE")>=0||window.ActiveXObject||"ActiveXObject"in window?"IE":t.indexOf("Firefox")>=0?"Firefox":t.indexOf("Chrome")>=0?"Chrome":t.indexOf("Opera")>=0?"Opera":t.indexOf("Safari")>=0?"Safari":void 0},switchFullScreen:function(t){if(t){var 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:function(){var t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/1920;t/e>16/9&&(r=e/1080),n.transformOrigin="left top",n.transform="scale("+r+") translateX(-49.99%)",n.width=t/r+"px"},getHtmlFontSize:function(){var t=document.documentElement.clientWidth||document.body.clientWidth;document.querySelector("html").style.fontSize=t/192+"px"}},s={set:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=new Date;r.setTime(r.getTime()+24*n*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=getCookie(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},c={PI:3.141592653589793,XPI:52.35987755982988,delta:function(t,e){var n=6378245,r=.006693421622965943,i=this.transformLat(e-105,t-35),o=this.transformLon(e-105,t-35),a=t/180*this.PI,s=Math.sin(a);s=1-r*s*s;var c=Math.sqrt(s);return{lat:i=180*i/(n*(1-r)/(s*c)*this.PI),lon:o=180*o/(n/c*Math.cos(a)*this.PI)}},gcjEncrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lon:e};var n=this.delta(t,e);return{lat:t+n.lat,lon:e+n.lon}},gcjDecrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lon:e};var n=this.delta(t,e);return{lat:t-n.lat,lon:e-n.lon}},gcjDecryptExact:function(t,e){for(var n=.01,r=.01,i=t-n,o=e-r,a=t+n,s=e+r,c=void 0,u=void 0,l=0;;){c=(i+a)/2,u=(o+s)/2;var f=this.gcj_encrypt(c,u);if(n=f.lat-t,r=f.lon-e,Math.abs(n)<1e-9&&Math.abs(r)<1e-9)break;if(n>0?a=c:i=c,r>0?s=u:o=u,++l>1e4)break}return{lat:c,lon:u}},bdEncrypt:function(t,e){var n=e,r=t,i=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),o=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI);return bdLon=i*Math.cos(o)+.0065,bdLat=i*Math.sin(o)+.006,{lat:bdLat,lon:bdLon}},bdDecrypt:function(t,e){var n=e-.0065,r=t-.006,i=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),o=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),a=i*Math.cos(o);return{lat:i*Math.sin(o),lon:a}},mercatorEncrypt:function(t,e){var n=20037508.34*e/180,r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return{lat:r=20037508.34*r/180,lon:n}},mercatorDecrypt:function(t,e){var n=e/20037508.34*180,r=t/20037508.34*180;return{lat:r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),lon:n}},distance:function(t,e,n,r){var i=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180)+Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);i>1&&(i=1),i<-1&&(i=-1);var o=6371e3*Math.acos(i);return o},outOfChina:function(t,e){return e<72.004||e>137.8347||(t<.8293||t>55.8271)},transformLat:function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},transformLon:function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3}};Date.prototype.format=function(t){var 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()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){var n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);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)}return n};var u={lastMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth()-1,1),thisMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth(),1),nextMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth()+1,1),parseDate:function(t){if("string"==typeof t){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.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.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:function(t,e){var n=new Date(t),r=new Date(e).getTime()-n.getTime(),i=Math.floor(r/864e5),o=r%864e5,a=Math.floor(o/36e5),s=o%36e5,c=Math.floor(s/6e4),u=s%6e4,l=Math.round(u/1e3),f="";return i>0&&(f+=i+"天"),a>0&&(f+=a+"时"),c>0&&(f+=c+"分"),l>0&&(f+=l+"秒"),0===i&&0===a&&0===c&&0===l&&(f="少于1秒"),f},sleep:function(t){for(var e=Date.now();Date.now()-e<=t;);}};function l(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function f(t){return l(t).split(/\s+/)}var h={getStyle:function(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n},create:function(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove:function(t){var e=t.parentNode;e&&e.removeChild(t)},empty:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront:function(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack:function(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:function(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal},hasClass:function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(void 0!==t.classList)for(var n=f(e),r=0,i=n.length;r<i;r++)t.classList.add(n[r]);else if(!this.hasClass(t,e)){var o=this.getClass(t);this.setClass(t,(o?o+" ":"")+e)}},removeClass:function(t,e){void 0!==t.classList?f(e).forEach((function(e){return t.classList.remove(e)})):this.setClass(t,l((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass:function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}},d={LOGIN_EXPIRED:"登录信息过期,请重新登录",CROSS_ERROR:"跨域访问",UNEXIST_RESOURCE:"资源不存在",TIMEOUT:"请求超时",INTERNAL_ERROR:"内部错误",NETWORK_ERROR:"请求失败,请检查网络是否已连接",PROCESS_FAIL:"处理失败",AUTH_VERIFY_ERROR:"权限验证失败",NO_DATA_FOUND:"未找到数据",DUPLICATE_INSTANCE:"实例为单例模式,不允许重复构建",COORDINATE_ERROR:"坐标验证失败",JSON_PARSE_ERROR:"JSON解析失败,格式有误",JSON_VALUE_ERROR:"JSON无此键",PARAMETER_ERROR:"参数验证失败",PARAMETER_ERROR_ARRAY:"参数格式验证失败:必须是数组",PARAMETER_ERROR_STRING:"参数格式验证失败:必须是字符",PARAMETER_ERROR_FUNCTION:"参数格式验证失败:必须是函数",PARAMETER_ERROR_LACK:"参数缺失项"},p={isLnglat:function(t,e){t*=1;var n=!!((e*=1)>0&&e<90&&t>0&&t<180);if(n)return n;throw new Error(d.COORDINATE_ERROR)},formatLnglat:function(t,e){var n="";function r(t){var e=parseFloat(t),n=parseInt(e),r=parseInt(60*(e-n));r<10&&(r="0"+r);var i=parseInt(3600*(e-n)-60*r);return i<10&&(i="0"+i),n+"°"+r+"′"+i+"″"}return t&&e&&(n=r(t)+","+r(e)),n},rayCasting:function(t,e){for(var n=t.x,r=t.y,i=!1,o=0,a=e.length,s=a-1;o<a;s=o,o++){var c=e[o].x,u=e[o].y,l=e[s].x,f=e[s].y;if(c===n&&u===r||l===n&&f===r)return"on";if(u<r&&f>=r||u>=r&&f<r){var h=c+(r-u)*(l-c)/(f-u);if(h===n)return"on";h>n&&(i=!i)}}return i?"in":"out"},wgs84PointsDistance:function(t,e){var n=Math.PI;function r(t){return t*n/180}if(2!=arguments.length)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var i,o=6378137,a=6356752.3142,s=1/298.257223563,c=r(lon2-lon1),u=Math.atan((1-s)*Math.tan(r(lat1))),l=Math.atan((1-s)*Math.tan(r(lat2))),f=Math.sin(u),h=Math.cos(u),d=Math.sin(l),p=Math.cos(l),v=c,y=100;do{var m=Math.sin(v),g=Math.cos(v),E=Math.sqrt(p*m*(p*m)+(h*d-f*p*g)*(h*d-f*p*g));if(0==E)return 0;var w=f*d+h*p*g,b=Math.atan2(E,w),M=h*p*m/E,S=1-M*M,R=w-2*f*d/S;isNaN(R)&&(R=0);var _=s/16*S*(4+s*(4-3*S));i=v,v=c+(1-_)*s*M*(b+_*E*(R+_*w*(2*R*R-1)))}while(Math.abs(v-i)>1e-12&&--y>0);if(0==y)return NaN;var O=S*(o*o-a*a)/(a*a),T=1+O/16384*(4096+O*(O*(320-175*O)-768)),C=O/1024*(256+O*(O*(74-47*O)-128)),A=C*E*(R+C/4*(w*(2*R*R-1)-C/6*R*(4*E*E-3)*(4*R*R-3))),I=a*T*(b-A);Math.atan2(p*m,h*d-f*p*g),Math.atan2(h*m,-f*p+h*d*g);return I}},v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y={convertBase64ToBlob:function(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return a?((a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder)).append(r),a.getBlob(e)):a=new Blob([r],{type:e})},convertUrlToBase64:function(t,e,n){return new Promise((function(r,i){var o=new Image;o.crossOrigin="Anonymous",o.src=t,o.onload=function(){var t=document.createElement("canvas");t.width=e||o.width,t.height=n||o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var i=o.src.substring(o.src.lastIndexOf(".")+1).toLowerCase(),a=t.toDataURL("image/"+i);r({dataURL:a,type:"image/"+i,ext:i})}}))},convertBase64ToFile:function(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],e,{type:r})},downloadFromFile:function(t,e){"object"==(void 0===t?"undefined":v(t))&&t instanceof Blob&&(t=URL.createObjectURL(t));var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)}},m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},degreesToRadians:function(t){return t*this.DEG2RAD},radiansToDegrees:function(t){return t*this.RAD2DEG},formatFloat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},g={debounce:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,c=function c(){var u=+new Date-a;u<e&&u>0?r=setTimeout(c,e-u):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){for(var i=arguments.length,u=Array(i),l=0;l<i;l++)u[l]=arguments[l];o=this,a=+new Date;var f=n&&!r;return r||(r=setTimeout(c,e)),f&&(s=t.apply(o,u),o=u=null),s}},throttle:function(t,e,n){if(1===n);else if(2===n);return function(){var r=this,i=arguments;if(1===n){var o=Date.now();o-previous>e&&(t.apply(r,i),previous=o)}else 2===n&&(timeout||(timeout=setTimeout((function(){timeout=null,t.apply(r,i)}),e)))}},recurve:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=0;setTimeout((function i(){++r<Math.floor(n/e)&&(t.call(this),setTimeout(i,e))}))}},E={checkStr:function(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:function(t,e){switch(e=e||4){case 1:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case 2:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case 3:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}}},w={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"},b={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"},M={getDataType:function(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty:function(t){if(null==t)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:function(t){return!this.isEmpty(t)},json2form:function(t){var e=new FormData;return Object.keys(t).forEach((function(n){e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},jsontoQuery:function(t){var e=[];for(var n in t){var r=n,i=t[n];e.push(r+"="+i)}return e.join("&")},generateGuid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict:function(){for(var t="",e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(n.length>1){for(var i=n.slice(1,n.length%2==0?n.length-1:n.length),o=0;o<i.length;o+=2){var a=i[o];n[0]===a&&(t=i[o+1])}t||n.length%2!=0||(t=n[n.length-1])}else t=n[0];return t},extend:function(t){for(var e=void 0,n=void 0,r=void 0,i=void 0,o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];for(n=0,r=a.length;n<r;n++)for(e in i=a[n])t[e]=i[e];return t},rgb2hex:function(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1)},convertToTree2:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parentId",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",i=[];function o(i){var a=i[e],s=t.filter((function(t){return t.hasOwnProperty(n)&&t[n]===a}));s.length>0&&(s.forEach(o),i[r]=s)}var a=function(r){-1===t.findIndex((function(t){return t[e]===r[n]}))&&(o(r),i.push(r))},s=!0,c=!1,u=void 0;try{for(var l,f=t[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;a(h)}}catch(t){c=!0,u=t}finally{try{!s&&f.return&&f.return()}finally{if(c)throw u}}return i},loadScript:function(t,e){var n=document.createElement("script");n.readyState?n.onreadystatechange=function(){"complete"!==n.readyState&&"loaded"!==n.readyState||e()}:n.onload=function(){e()},n.src=t,document.body.appendChild(n)},template:function(t,e){return t.replace(/\{ *([\w_-]+) *\}/g,(function(t,n){var r=e[n];if(void 0===r)throw new Error(d.JSON_VALUE_ERROR+t);return"function"==typeof r&&(r=r(e)),r}))}},S=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var R=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.audio=new Audio,this.audio.src=e}return S(t,[{key:"play",value:function(){!this.muted&&this.audio.play()}},{key:"pause",value:function(){this.audio.pause()}},{key:"muted",get:function(){return this.audio.muted},set:function(t){this.audio.muted=t}}]),t}(),_=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var O=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"String"===M.getDataType(e)&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}return _(t,[{key:"drawLine",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};this.cxt.beginPath();var o=i.width||1,a=i.color||"#000";this.cxt.lineWidth=o,this.cxt.fillStyle=a,this.cxt.moveTo(t,e),this.cxt.lineTo(n,r),this.cxt.closePath(),this.cxt.fill()}},{key:"drawArc",value:function(t,e,n,r,i,o,a,s){a?(this.cxt.fillStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,m.degreesToRadians(r),m.degreesToRadians(i),o),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,m.degreesToRadians(r),m.degreesToRadians(i),o),this.cxt.stroke())}}]),t}(),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var I=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(A(this,t),"string"==typeof e)if("<"==e.charAt(0)&&">"==e.slice(-1)){var r=e.slice(1,-1);this[0]=document.createElement(r),this.length=1}else{for(var i=n.querySelectorAll(e),o=0;o<i.length;o++)this[o]=i[o];this.length=i.length}else{if(void 0===e)return this;"function"==typeof e?this.ready(e):1==e.nodeType&&(this[0]=e,this.length=1)}}return C(t,[{key:"each",value:function(t){for(var e=0;e<this.length;e++)t(this[e],e)}},{key:"html",value:function(t){return this.each((function(e){e.innerHTML=t})),this}},{key:"css",value:function(t,e){return this.each((function(n){if("object"==(void 0===t?"undefined":T(t)))for(var r in t)"width"!=r&&"height"!=r&&"margin"!=r&&"fontSize"!=r||(n.style[r]=parseInt(t[r])+"px"),n.style[r]=t[r];else n.style[t]=e})),this}},{key:"ready",value:function(t){var e=this;document.addEventListener("DOMContentLoaded",(function(n){t.call(e,n)}))}},{key:"click",value:function(t){return this.each((function(e){var n=this;e.onclick=function(r){t.call(n,r,e)}})),this}},{key:"on",value:function(t,e){var n=this;this.each((function(r){r.addEventListener(t,(function(t){e.call(n,t)}))}))}},{key:"appendTo",value:function(t){if("string"==typeof t)for(var e=document.querySelectorAll(t),n=this[0],r=0;r<e.length;r++)this[r]=n.cloneNode(!0),e[r].appendChild(this[r]),this.length=e.length;else t.appendChild(this[0]);return this}}]),t}(),x=I;function k(){}window.$=function(t,e){return new I(t,e)},Object.assign(k.prototype,{addEventListener:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];void 0===this._listeners&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;var i=this._mutex,o=this._listeners;return void 0===o[t]&&(o[t]=[]),-1===o[t].indexOf(e)&&(r&&(i[t]=e),o[t].push(e)),this},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){var e=this;if(void 0!==this._listeners){var n=this._listeners[t.type];if(void 0!==n){t.target=this;var r=n.slice(0);if(this._mutex[t.type])return void r.find((function(n){return n===e._mutex[t.type]})).call(this._context||this,t);for(var i=0,o=r.length;i<o;i++)r[i].call(this._context||this,t)}}},removeAllListener:function(){for(var t in this._mutex={},this._listeners)this._listeners[t]=[]}});var P=k,D=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var N=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=[],new Map}return D(t,[{key:"set",value:function(t,e){Map.prototype.set.call(this,t,e),this.elements.push({key:t,value:e})}},{key:"delete",value:function(t){Map.prototype.delete.call(this,t),this.elements=this.elements.filter((function(e){return e.key!==t}))}},{key:"isEmpty",value:function(){return 0===this.size}},{key:"clear",value:function(){Map.prototype.clear.call(this),this.elements=[]}}],[{key:"fromEntries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=new t;return e.forEach((function(t){Array.isArray(t)&&2===t.length&&n.set(t[0],t[1])})),n}}]),t}(),L=n(0),U=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var B=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,e);var n=F(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.context=M.extend(e.defaultContext,t),n.options={connectTimeout:n.context.MQTT_TIMEOUTM,clientId:M.generateGuid(),username:n.context.MQTT_USERNAME,password:n.context.MQTT_PASSWORD,clean:!0},n.client=Object(L.connect)(n.context.MQTT_SERVICE,n.options),n._onConnect(),n._onMessage(),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),U(e,[{key:"_onConnect",value:function(){var t=this;this.client.on("connect",(function(){console.log("链接mqtt成功==>"+t.context.MQTT_SERVICE),t.dispatchEvent({type:w.MQTT_CONNECT,message:t})})),this.client.on("error",(function(e){console.log("链接mqtt报错",e),t.dispatchEvent({type:w.MQTT_ERROR,message:t}),t.client.end(),t.client.reconnect()}))}},{key:"_onMessage",value:function(){var t=this;this.client.on("message",(function(e,n){var r=n,i="";n instanceof Uint8Array&&(r=n.toString());try{i=JSON.parse(r)}catch(t){throw new Error(d.JSON_PARSE_ERROR)}t.dispatchEvent({type:w.MQTT_MESSAGE,message:{topic:e,data:i}})}))}},{key:"sendMsg",value:function(t,e){this.client.connected?this.client.publish(t,e,{qos:1,retain:!0}):console.error("客户端未连接")}},{key:"subscribe",value:function(t){return this.client.subscribe(t,{qos:1},(function(e,n){e instanceof Error||0===n.length?console.error("订阅失败==>"+t,e):console.log("订阅成功==>"+t)})),this}},{key:"unsubscribe",value:function(t){return this.client.unsubscribe(t,{qos:1},(function(e,n){e instanceof Error||0===n.length?console.error("取消订阅失败==>"+t,e):console.log("取消订阅成功==>"+t)})),this}},{key:"unconnect",value:function(){this.client.end(),this.client=null,this.dispatchEvent({type:w.MQTT_CLOSE,message:null}),console.log("断开mqtt成功==>"+this.context.MQTT_SERVICE)}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.instance?Object.freeze(e.instance):Object.freeze(new e(t))}}]),e}(P),q=B;B.defaultContext={MQTT_TIMEOUTM:2e4,MQTT_USERNAME:"iRVMS-WEB",MQTT_PASSWORD:"novasky888",MQTT_SERVICE:"ws://"+window.document.domain+":20007/mqtt"};var G=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Q=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://127.0.0.1:10088";$(this,e);var n=W(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.maxCheckTimes=10,n.url=t,n.checkTimes=0,n.connectStatus=!1,n.connect(),n.connCheckStatus(n.maxCheckTimes),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),G(e,[{key:"connect",value:function(){var t=this;if(this.checkTimes++,this.disconnect(),this.url)try{console.info("创建ws连接"+this.url),this.client=new WebSocket(this.url),this.client&&(!this.connectStatus&&this.checkTimes===Math.floor(this.maxCheckTimes/2)||this.connectStatus)&&(this.client.onopen=function(e){t.dispatchEvent({type:w.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:w.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:w.WEB_SOCKET_CLOSE,message:e})},this.client.onerror=function(e){t.dispatchEvent({type:w.WEB_SOCKET_ERROR,message:e})})}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}},{key:"disconnect",value:function(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}},{key:"connCheckStatus",value:function(t){var e=this;this.checkTimes>t||setTimeout((function(){e.client&&0!==e.client.readyState&&1!==e.client.readyState&&e.connect(),e.connCheckStatus(t)}),2e3)}},{key:"send",value:function(t){return this.client&&1===this.client.readyState?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),!1)}},{key:"heartbeat",value:function(){var t=this;setTimeout((function(){t.client&&1===t.client.readyState&&t.send("HeartBeat"),console.log("HeartBeat,"+t.url),setTimeout(t.heartbeat,3e4)}),1e3)}}],[{key:"getInstance",value:function(){return e.instance?e.instance:Object.freeze(new e)}},{key:"_instance",get:function(){return this.getInstance()}}]),e}(P),z=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var V=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(K(this,t),this.cacheType=e,1===e)this.storage=window.localStorage;else{if(2!==e)throw new Error(d.PARAMETER_ERROR);this.storage=window.sessionStorage}}return z(t,[{key:"setItem",value:function(t,e,n){var r={key:t,value:e};if(1===this.cacheType){var i=Date.now();n&&(r.expired=i+1e3*n)}return this.storage[t]=JSON.stringify(r),r}},{key:"getItem",value:function(t){var e=this.storage.getItem(t)||null,n=JSON.parse(e)||{};if(1===this.cacheType){var r=n.expired||Date.now();if(Date.now()>r)return this.remove(t),null}return n.value}},{key:"remove",value:function(t){var e=this;t&&(t.indexOf(",")>-1?t.split(",").forEach((function(t){e.storage.removeItem(t)})):this.storage.removeItem(t))}},{key:"clear",value:function(){this.storage.clear()}}]),t}()}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("mqtt")):"function"==typeof define&&define.amd?define("Gis",["mqtt"],e):"object"==typeof exports?exports.Gis=e(require("mqtt")):t.Gis=e(t.mqtt)}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"AnimateUtils",(function(){return r})),n.d(e,"ArrayUtils",(function(){return o})),n.d(e,"BrowserUtils",(function(){return a})),n.d(e,"Cookie",(function(){return s})),n.d(e,"CoordsUtils",(function(){return c})),n.d(e,"DateUtils",(function(){return u})),n.d(e,"DomUtils",(function(){return h})),n.d(e,"GeoUtils",(function(){return d})),n.d(e,"FileUtils",(function(){return v})),n.d(e,"MathUtils",(function(){return y})),n.d(e,"OptimizeUtils",(function(){return m})),n.d(e,"StringUtils",(function(){return g})),n.d(e,"Utils",(function(){return M})),n.d(e,"EventType",(function(){return E})),n.d(e,"ErrorType",(function(){return b})),n.d(e,"LayerType",(function(){return w})),n.d(e,"AudioPlayer",(function(){return _})),n.d(e,"CanvasDrawer",(function(){return O})),n.d(e,"ElQuery",(function(){return x})),n.d(e,"EventDispatcher",(function(){return P})),n.d(e,"HashMap",(function(){return L})),n.d(e,"MqttClient",(function(){return q})),n.d(e,"WebSocketClient",(function(){return Q})),n.d(e,"WebStorage",(function(){return V}));var r={animate:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"swing",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;for(var o in e)e[o]={target:"opacity"===o?parseInt(100*e[o]):e[o],iNow:"opacity"===o?parseInt(100*getComputedStyle(t)[o]):parseInt(getComputedStyle(t)[o])};"liner"===r&&(i=e[o].iNow<e[o].target?Math.abs(i):-Math.abs(i)),clearInterval(t.timer),t.timer=setInterval((function(){for(var o in e){var a=e[o].target,s=e[o].iNow;if("swing"===r&&(i=(i=(a-s)/20)>0?Math.ceil(i):Math.floor(i)),Math.abs(a-s)<=Math.abs(i)){for(var c in t.style[o]="opacity"===o?a/100:a+"px",delete e[o],e)return!1;clearInterval(t.timer),"function"==typeof n&&n()}else e[o].iNow+=i,t.style[o]="opacity"===o?e[o].iNow/100:e[o].iNow+"px"}}),30)}};function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}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((function(t){return e[t]}))},Array.prototype.distinct=function(t){var e=[],n={};return this.forEach((function(r){var i=t(r);!n[i]&&(n[i]=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((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t+e})):0},Array.prototype.desc=function(t){return this.sort((function(e,n){return(t?t(n):n)-(t?t(e):e)}))},Array.prototype.asc=function(t){return this.sort((function(e,n){return(t?t(e):e)-(t?t(n):n)}))},Array.prototype.clear=function(){return this.length=0,this};var o={asArray:function(t){return isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray:function(t){return[].concat(i(new Array(t).keys()))},union:function(){for(var t=[],e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){Array.isArray(e)&&(t=t.concat(e.filter((function(e){return!t.includes(e)}))))})),t},intersection:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0]||[];return e.forEach((function(t){Array.isArray(t)&&(r=r.filter((function(e){return t.includes(e)})))})),r},unionAll:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return[].concat(i(e)).flat().filter((function(t){return!!t}))},difference:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.union.apply(this,i(n)).filter((function(e){return!t.intersection.apply(t,i(n)).includes(e)}))}},a={getUrlParams:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,r=new URL(t),i=r.search,o=r.hash,a=[i,o],s={},c=0;c<a.length;c++){var u=a[c];if(u){var l=u.replace(/#|\//g,""),f=l.split("?");if(f.length>1)for(var h=1;h<f.length;h++)for(var d=void 0;d=n.exec(f[h]);)s[d[1]]=e?decodeURIComponent(d[2]):d[2]}}return s},getExplorer:function(){var t=window.navigator.userAgent;return t.indexOf("MSIE")>=0||window.ActiveXObject||"ActiveXObject"in window?"IE":t.indexOf("Firefox")>=0?"Firefox":t.indexOf("Chrome")>=0?"Chrome":t.indexOf("Opera")>=0?"Opera":t.indexOf("Safari")>=0?"Safari":void 0},switchFullScreen:function(t){if(t){var 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:function(){var t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/1920;t/e>16/9&&(r=e/1080),n.transformOrigin="left top",n.transform="scale("+r+") translateX(-49.99%)",n.width=t/r+"px"},getHtmlFontSize:function(){var t=document.documentElement.clientWidth||document.body.clientWidth;document.querySelector("html").style.fontSize=t/192+"px"}},s={set:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=new Date;r.setTime(r.getTime()+24*n*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=getCookie(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},c={PI:3.141592653589793,XPI:52.35987755982988,delta:function(t,e){var n=6378245,r=.006693421622965943,i=this.transformLat(e-105,t-35),o=this.transformLon(e-105,t-35),a=t/180*this.PI,s=Math.sin(a);s=1-r*s*s;var c=Math.sqrt(s);return{lat:i=180*i/(n*(1-r)/(s*c)*this.PI),lon:o=180*o/(n/c*Math.cos(a)*this.PI)}},gcjEncrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lon:e};var n=this.delta(t,e);return{lat:t+n.lat,lon:e+n.lon}},gcjDecrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lon:e};var n=this.delta(t,e);return{lat:t-n.lat,lon:e-n.lon}},gcjDecryptExact:function(t,e){for(var n=.01,r=.01,i=t-n,o=e-r,a=t+n,s=e+r,c=void 0,u=void 0,l=0;;){c=(i+a)/2,u=(o+s)/2;var f=this.gcj_encrypt(c,u);if(n=f.lat-t,r=f.lon-e,Math.abs(n)<1e-9&&Math.abs(r)<1e-9)break;if(n>0?a=c:i=c,r>0?s=u:o=u,++l>1e4)break}return{lat:c,lon:u}},bdEncrypt:function(t,e){var n=e,r=t,i=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),o=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI);return bdLon=i*Math.cos(o)+.0065,bdLat=i*Math.sin(o)+.006,{lat:bdLat,lon:bdLon}},bdDecrypt:function(t,e){var n=e-.0065,r=t-.006,i=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),o=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),a=i*Math.cos(o);return{lat:i*Math.sin(o),lon:a}},mercatorEncrypt:function(t,e){var n=20037508.34*e/180,r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return{lat:r=20037508.34*r/180,lon:n}},mercatorDecrypt:function(t,e){var n=e/20037508.34*180,r=t/20037508.34*180;return{lat:r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),lon:n}},distance:function(t,e,n,r){var i=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180)+Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);i>1&&(i=1),i<-1&&(i=-1);var o=6371e3*Math.acos(i);return o},outOfChina:function(t,e){return e<72.004||e>137.8347||(t<.8293||t>55.8271)},transformLat:function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},transformLon:function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3}};Date.prototype.format=function(t){var 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()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){var n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);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)}return n};var u={lastMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth()-1,1),thisMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth(),1),nextMonthDay:new Date((new Date).getFullYear(),(new Date).getMonth()+1,1),parseDate:function(t){if("string"==typeof t){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.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.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:function(t,e){var n=new Date(t),r=new Date(e).getTime()-n.getTime(),i=Math.floor(r/864e5),o=r%864e5,a=Math.floor(o/36e5),s=o%36e5,c=Math.floor(s/6e4),u=s%6e4,l=Math.round(u/1e3),f="";return i>0&&(f+=i+"天"),a>0&&(f+=a+"时"),c>0&&(f+=c+"分"),l>0&&(f+=l+"秒"),0===i&&0===a&&0===c&&0===l&&(f="少于1秒"),f},sleep:function(t){for(var e=Date.now();Date.now()-e<=t;);}};function l(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function f(t){return l(t).split(/\s+/)}var h={getStyle:function(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n},create:function(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove:function(t){var e=t.parentNode;e&&e.removeChild(t)},empty:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront:function(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack:function(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:function(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal},hasClass:function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(void 0!==t.classList)for(var n=f(e),r=0,i=n.length;r<i;r++)t.classList.add(n[r]);else if(!this.hasClass(t,e)){var o=this.getClass(t);this.setClass(t,(o?o+" ":"")+e)}},removeClass:function(t,e){void 0!==t.classList?f(e).forEach((function(e){return t.classList.remove(e)})):this.setClass(t,l((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass:function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}},d={isLnglat:function(t,e){return t*=1,!!((e*=1)>0&&e<90&&t>0&&t<180)},formatLnglat:function(t,e){var n="";function r(t){var e=parseFloat(t),n=parseInt(e),r=parseInt(60*(e-n));r<10&&(r="0"+r);var i=parseInt(3600*(e-n)-60*r);return i<10&&(i="0"+i),n+"°"+r+"′"+i+"″"}return t&&e&&(n=r(t)+","+r(e)),n},rayCasting:function(t,e){for(var n=t.x,r=t.y,i=!1,o=0,a=e.length,s=a-1;o<a;s=o,o++){var c=e[o].x,u=e[o].y,l=e[s].x,f=e[s].y;if(c===n&&u===r||l===n&&f===r)return"on";if(u<r&&f>=r||u>=r&&f<r){var h=c+(r-u)*(l-c)/(f-u);if(h===n)return"on";h>n&&(i=!i)}}return i?"in":"out"},wgs84PointsDistance:function(t,e){var n=Math.PI;function r(t){return t*n/180}if(2!=arguments.length)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var i,o=6378137,a=6356752.3142,s=1/298.257223563,c=r(lon2-lon1),u=Math.atan((1-s)*Math.tan(r(lat1))),l=Math.atan((1-s)*Math.tan(r(lat2))),f=Math.sin(u),h=Math.cos(u),d=Math.sin(l),p=Math.cos(l),v=c,y=100;do{var m=Math.sin(v),g=Math.cos(v),E=Math.sqrt(p*m*(p*m)+(h*d-f*p*g)*(h*d-f*p*g));if(0==E)return 0;var b=f*d+h*p*g,w=Math.atan2(E,b),M=h*p*m/E,S=1-M*M,_=b-2*f*d/S;isNaN(_)&&(_=0);var R=s/16*S*(4+s*(4-3*S));i=v,v=c+(1-R)*s*M*(w+R*E*(_+R*b*(2*_*_-1)))}while(Math.abs(v-i)>1e-12&&--y>0);if(0==y)return NaN;var O=S*(o*o-a*a)/(a*a),T=1+O/16384*(4096+O*(O*(320-175*O)-768)),C=O/1024*(256+O*(O*(74-47*O)-128)),A=C*E*(_+C/4*(b*(2*_*_-1)-C/6*_*(4*E*E-3)*(4*_*_-3))),I=a*T*(w-A);Math.atan2(p*m,h*d-f*p*g),Math.atan2(h*m,-f*p+h*d*g);return I}},p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v={convertBase64ToBlob:function(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return a?((a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder)).append(r),a.getBlob(e)):a=new Blob([r],{type:e})},convertUrlToBase64:function(t,e,n){return new Promise((function(r,i){var o=new Image;o.crossOrigin="Anonymous",o.src=t,o.onload=function(){var t=document.createElement("canvas");t.width=e||o.width,t.height=n||o.height,t.getContext("2d").drawImage(o,0,0,o.width,o.height);var i=o.src.substring(o.src.lastIndexOf(".")+1).toLowerCase(),a=t.toDataURL("image/"+i);r({dataURL:a,type:"image/"+i,ext:i})}}))},convertBase64ToFile:function(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]),o=i.length,a=new Uint8Array(o);o--;)a[o]=i.charCodeAt(o);return new File([a],e,{type:r})},downloadFromFile:function(t,e){"object"==(void 0===t?"undefined":p(t))&&t instanceof Blob&&(t=URL.createObjectURL(t));var n=document.createElement("a");n.href=t,n.download=e||"",n.click(),window.URL.revokeObjectURL(n.href)}},y={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},degreesToRadians:function(t){return t*this.DEG2RAD},radiansToDegrees:function(t){return t*this.RAD2DEG},formatFloat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},m={debounce:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,c=function c(){var u=+new Date-a;u<e&&u>0?r=setTimeout(c,e-u):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){for(var i=arguments.length,u=Array(i),l=0;l<i;l++)u[l]=arguments[l];o=this,a=+new Date;var f=n&&!r;return r||(r=setTimeout(c,e)),f&&(s=t.apply(o,u),o=u=null),s}},throttle:function(t,e,n){if(1===n);else if(2===n);return function(){var r=this,i=arguments;if(1===n){var o=Date.now();o-previous>e&&(t.apply(r,i),previous=o)}else 2===n&&(timeout||(timeout=setTimeout((function(){timeout=null,t.apply(r,i)}),e)))}},recurve:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=0;setTimeout((function i(){++r<Math.floor(n/e)&&(t.call(this),setTimeout(i,e))}))}},g={checkStr:function(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:function(t,e){switch(e=e||4){case 1:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case 2:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case 3:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}}},E={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"},b={LOGIN_EXPIRED:"登录信息过期,请重新登录",CROSS_ERROR:"跨域访问",UNEXIST_RESOURCE:"资源不存在",TIMEOUT:"请求超时",INTERNAL_ERROR:"内部错误",NETWORK_ERROR:"请求失败,请检查网络是否已连接",PROCESS_FAIL:"处理失败",AUTH_VERIFY_ERROR:"权限验证失败",NO_DATA_FOUND:"未找到数据",DUPLICATE_INSTANCE:"实例为单例模式,不允许重复构建",COORDINATE_ERROR:"坐标验证失败",JSON_PARSE_ERROR:"JSON解析失败,格式有误",JSON_VALUE_ERROR:"JSON无此键",PARAMETER_ERROR:"参数验证失败",PARAMETER_ERROR_ARRAY:"参数格式验证失败:必须是数组",PARAMETER_ERROR_STRING:"参数格式验证失败:必须是字符",PARAMETER_ERROR_FUNCTION:"参数格式验证失败:必须是函数",PARAMETER_ERROR_LACK:"参数缺失项"},w={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"},M={getDataType:function(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty:function(t){if(null==t)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:function(t){return!this.isEmpty(t)},json2form:function(t){var e=new FormData;return Object.keys(t).forEach((function(n){e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},jsontoQuery:function(t){var e=[];for(var n in t){var r=n,i=t[n];e.push(r+"="+i)}return e.join("&")},generateGuid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict:function(){for(var t="",e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(n.length>1){for(var i=n.slice(1,n.length%2==0?n.length-1:n.length),o=0;o<i.length;o+=2){var a=i[o];n[0]===a&&(t=i[o+1])}t||n.length%2!=0||(t=n[n.length-1])}else t=n[0];return t},extend:function(t){for(var e=void 0,n=void 0,r=void 0,i=void 0,o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];for(n=0,r=a.length;n<r;n++)for(e in i=a[n])t[e]=i[e];return t},rgb2hex:function(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1)},convertToTree2:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parentId",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",i=[];function o(i){var a=i[e],s=t.filter((function(t){return t.hasOwnProperty(n)&&t[n]===a}));s.length>0&&(s.forEach(o),i[r]=s)}var a=function(r){-1===t.findIndex((function(t){return t[e]===r[n]}))&&(o(r),i.push(r))},s=!0,c=!1,u=void 0;try{for(var l,f=t[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var h=l.value;a(h)}}catch(t){c=!0,u=t}finally{try{!s&&f.return&&f.return()}finally{if(c)throw u}}return i},loadScript:function(t,e){var n=document.createElement("script");n.readyState?n.onreadystatechange=function(){"complete"!==n.readyState&&"loaded"!==n.readyState||e()}:n.onload=function(){e()},n.src=t,document.body.appendChild(n)},template:function(t,e){return t.replace(/\{ *([\w_-]+) *\}/g,(function(t,n){var r=e[n];if(void 0===r)throw new Error(b.JSON_VALUE_ERROR+t);return"function"==typeof r&&(r=r(e)),r}))}},S=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var _=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.audio=new Audio,this.audio.src=e}return S(t,[{key:"play",value:function(){!this.muted&&this.audio.play()}},{key:"pause",value:function(){this.audio.pause()}},{key:"muted",get:function(){return this.audio.muted},set:function(t){this.audio.muted=t}}]),t}(),R=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var O=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"String"===M.getDataType(e)&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}return R(t,[{key:"drawLine",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};this.cxt.beginPath();var o=i.width||1,a=i.color||"#000";this.cxt.lineWidth=o,this.cxt.fillStyle=a,this.cxt.moveTo(t,e),this.cxt.lineTo(n,r),this.cxt.closePath(),this.cxt.fill()}},{key:"drawArc",value:function(t,e,n,r,i,o,a,s){a?(this.cxt.fillStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,y.degreesToRadians(r),y.degreesToRadians(i),o),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,y.degreesToRadians(r),y.degreesToRadians(i),o),this.cxt.stroke())}}]),t}(),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var I=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(A(this,t),"string"==typeof e)if("<"==e.charAt(0)&&">"==e.slice(-1)){var r=e.slice(1,-1);this[0]=document.createElement(r),this.length=1}else{for(var i=n.querySelectorAll(e),o=0;o<i.length;o++)this[o]=i[o];this.length=i.length}else{if(void 0===e)return this;"function"==typeof e?this.ready(e):1==e.nodeType&&(this[0]=e,this.length=1)}}return C(t,[{key:"each",value:function(t){for(var e=0;e<this.length;e++)t(this[e],e)}},{key:"html",value:function(t){return this.each((function(e){e.innerHTML=t})),this}},{key:"css",value:function(t,e){return this.each((function(n){if("object"==(void 0===t?"undefined":T(t)))for(var r in t)"width"!=r&&"height"!=r&&"margin"!=r&&"fontSize"!=r||(n.style[r]=parseInt(t[r])+"px"),n.style[r]=t[r];else n.style[t]=e})),this}},{key:"ready",value:function(t){var e=this;document.addEventListener("DOMContentLoaded",(function(n){t.call(e,n)}))}},{key:"click",value:function(t){return this.each((function(e){var n=this;e.onclick=function(r){t.call(n,r,e)}})),this}},{key:"on",value:function(t,e){var n=this;this.each((function(r){r.addEventListener(t,(function(t){e.call(n,t)}))}))}},{key:"appendTo",value:function(t){if("string"==typeof t)for(var e=document.querySelectorAll(t),n=this[0],r=0;r<e.length;r++)this[r]=n.cloneNode(!0),e[r].appendChild(this[r]),this.length=e.length;else t.appendChild(this[0]);return this}}]),t}(),x=I;function k(){}window.$=function(t,e){return new I(t,e)},Object.assign(k.prototype,{addEventListener:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];void 0===this._listeners&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;var i=this._mutex,o=this._listeners;return void 0===o[t]&&(o[t]=[]),-1===o[t].indexOf(e)&&(r&&(i[t]=e),o[t].push(e)),this},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){var e=this;if(void 0!==this._listeners){var n=this._listeners[t.type];if(void 0!==n){t.target=this;var r=n.slice(0);if(this._mutex[t.type])return void r.find((function(n){return n===e._mutex[t.type]})).call(this._context||this,t);for(var i=0,o=r.length;i<o;i++)r[i].call(this._context||this,t)}}},removeAllListener:function(){for(var t in this._mutex={},this._listeners)this._listeners[t]=[]}});var P=k,D=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var L=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=[],new Map}return D(t,[{key:"set",value:function(t,e){Map.prototype.set.call(this,t,e),this.elements.push({key:t,value:e})}},{key:"delete",value:function(t){Map.prototype.delete.call(this,t),this.elements=this.elements.filter((function(e){return e.key!==t}))}},{key:"isEmpty",value:function(){return 0===this.size}},{key:"clear",value:function(){Map.prototype.clear.call(this),this.elements=[]}}],[{key:"fromEntries",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=new t;return e.forEach((function(t){Array.isArray(t)&&2===t.length&&n.set(t[0],t[1])})),n}}]),t}(),N=n(0),U=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var B=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};j(this,e);var n=F(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.context=M.extend(e.defaultContext,t),n.options={connectTimeout:n.context.MQTT_TIMEOUTM,clientId:M.generateGuid(),username:n.context.MQTT_USERNAME,password:n.context.MQTT_PASSWORD,clean:!0},n.client=Object(N.connect)(n.context.MQTT_SERVICE,n.options),n._onConnect(),n._onMessage(),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),U(e,[{key:"_onConnect",value:function(){var t=this;this.client.on("connect",(function(){console.log("链接mqtt成功==>"+t.context.MQTT_SERVICE),t.dispatchEvent({type:E.MQTT_CONNECT,message:t})})),this.client.on("error",(function(e){console.log("链接mqtt报错",e),t.dispatchEvent({type:E.MQTT_ERROR,message:t}),t.client.end(),t.client.reconnect()}))}},{key:"_onMessage",value:function(){var t=this;this.client.on("message",(function(e,n){var r=n,i="";n instanceof Uint8Array&&(r=n.toString());try{i=JSON.parse(r)}catch(t){throw new Error(b.JSON_PARSE_ERROR)}t.dispatchEvent({type:E.MQTT_MESSAGE,message:{topic:e,data:i}})}))}},{key:"sendMsg",value:function(t,e){this.client.connected?this.client.publish(t,e,{qos:1,retain:!0}):console.error("客户端未连接")}},{key:"subscribe",value:function(t){return this.client.subscribe(t,{qos:1},(function(e,n){e instanceof Error||0===n.length?console.error("订阅失败==>"+t,e):console.log("订阅成功==>"+t)})),this}},{key:"unsubscribe",value:function(t){return this.client.unsubscribe(t,{qos:1},(function(e,n){e instanceof Error||0===n.length?console.error("取消订阅失败==>"+t,e):console.log("取消订阅成功==>"+t)})),this}},{key:"unconnect",value:function(){this.client.end(),this.client=null,this.dispatchEvent({type:E.MQTT_CLOSE,message:null}),console.log("断开mqtt成功==>"+this.context.MQTT_SERVICE)}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.instance?Object.freeze(e.instance):Object.freeze(new e(t))}}]),e}(P),q=B;B.defaultContext={MQTT_TIMEOUTM:2e4,MQTT_USERNAME:"iRVMS-WEB",MQTT_PASSWORD:"novasky888",MQTT_SERVICE:"ws://"+window.document.domain+":20007/mqtt"};var G=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Q=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://127.0.0.1:10088";$(this,e);var n=W(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.maxCheckTimes=10,n.url=t,n.checkTimes=0,n.connectStatus=!1,n.connect(),n.connCheckStatus(n.maxCheckTimes),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),G(e,[{key:"connect",value:function(){var t=this;if(this.checkTimes++,this.disconnect(),this.url)try{console.info("创建ws连接"+this.url),this.client=new WebSocket(this.url),this.client&&(!this.connectStatus&&this.checkTimes===Math.floor(this.maxCheckTimes/2)||this.connectStatus)&&(this.client.onopen=function(e){t.dispatchEvent({type:E.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:E.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:E.WEB_SOCKET_CLOSE,message:e})},this.client.onerror=function(e){t.dispatchEvent({type:E.WEB_SOCKET_ERROR,message:e})})}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}},{key:"disconnect",value:function(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}},{key:"connCheckStatus",value:function(t){var e=this;this.checkTimes>t||setTimeout((function(){e.client&&0!==e.client.readyState&&1!==e.client.readyState&&e.connect(),e.connCheckStatus(t)}),2e3)}},{key:"send",value:function(t){return this.client&&1===this.client.readyState?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),!1)}},{key:"heartbeat",value:function(){var t=this;setTimeout((function(){t.client&&1===t.client.readyState&&t.send("HeartBeat"),console.log("HeartBeat,"+t.url),setTimeout(t.heartbeat,3e4)}),1e3)}}],[{key:"getInstance",value:function(){return e.instance?e.instance:Object.freeze(new e)}},{key:"_instance",get:function(){return this.getInstance()}}]),e}(P),z=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var V=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(K(this,t),this.cacheType=e,1===e)this.storage=window.localStorage;else{if(2!==e)throw new Error(b.PARAMETER_ERROR);this.storage=window.sessionStorage}}return z(t,[{key:"setItem",value:function(t,e,n){var r={key:t,value:e};if(1===this.cacheType){var i=Date.now();n&&(r.expired=i+1e3*n)}return this.storage[t]=JSON.stringify(r),r}},{key:"getItem",value:function(t){var e=this.storage.getItem(t)||null,n=JSON.parse(e)||{};if(1===this.cacheType){var r=n.expired||Date.now();if(Date.now()>r)return this.remove(t),null}return n.value}},{key:"remove",value:function(t){var e=this;t&&(t.indexOf(",")>-1?t.split(",").forEach((function(t){e.storage.removeItem(t)})):this.storage.removeItem(t))}},{key:"clear",value:function(){this.storage.clear()}}]),t}()}])}));
|
|
2
2
|
//# sourceMappingURL=resource.min.js.map
|