var _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _asyncToGenerator(e){return function(){var s=e.apply(this,arguments);return new Promise(function(n,a){return function t(e,i){try{var r=s[e](i),o=r.value}catch(e){return void a(e)}if(!r.done)return Promise.resolve(o).then(function(e){t("next",e)},function(e){t("throw",e)});n(o)}("next")})}}function _toConsumableArray2(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);ti.x?o.xMax:i.x,o.yMax=o.yMax>i.y?o.yMax:i.y}return o}}!function(m){var n,a,p,g,f={},v={},_={},y={},i=Object.prototype.hasOwnProperty,r=[].slice,C=/\.js$/;function w(e,t){return i.call(e,t)}function s(e,t){var i,r,o,n,a,s,l,u,c,h,d,m=t&&t.split("/"),p=_.map,g=p&&p["*"]||{};if(e){for(a=(e=e.split("/")).length-1,_.nodeIdCompat&&C.test(e[a])&&(e[a]=e[a].replace(C,"")),"."===e[0].charAt(0)&&m&&(e=m.slice(0,m.length-1).concat(e)),c=0;c>>6:(i<65536?t[n++]=224|i>>>12:(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63),t[n++]=128|i>>>6&63),t[n++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,r=t.length;i>10&1023,s[r++]=56320|1023&o)}return c(s,r)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+u[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,r){for(var o=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,r){var o=s,n=r+i;e^=-1;for(var a=r;a>>8^o[255&(e^t[a])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,r,o,n,a,s,l,u,c,h,d,m,p,g,f,v,_,y,C,w,b,E,S,P,x;i=e.state,r=e.next_in,P=e.input,o=r+(e.avail_in-5),n=e.next_out,x=e.output,a=n-(t-e.avail_out),s=n+(e.avail_out-257),l=i.dmax,u=i.wsize,c=i.whave,h=i.wnext,d=i.window,m=i.hold,p=i.bits,g=i.lencode,f=i.distcode,v=(1<>>=C=y>>>24,p-=C,0===(C=y>>>16&255))x[n++]=65535&y;else{if(!(16&C)){if(0==(64&C)){y=g[(65535&y)+(m&(1<>>=C,p-=C),p<15&&(m+=P[r++]<>>=C=y>>>24,p-=C,!(16&(C=y>>>16&255))){if(0==(64&C)){y=f[(65535&y)+(m&(1<>>=C,p-=C,(C=n-a)>3,m&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=n,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new D.Buf16(320),this.work=new D.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=H,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new D.Buf32(r),t.distcode=t.distdyn=new D.Buf32(o),t.sane=1,t.back=-1,V):F}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):F}function l(e,t){var i,r;return e&&e.state?(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=n.wsize?(D.arraySet(n.window,t,i-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):(r<(o=n.wsize-n.wnext)&&(o=r),D.arraySet(n.window,t,i-r,o,n.wnext),(r-=o)?(D.arraySet(n.window,t,i-r,r,0),n.wnext=r,n.whave=n.wsize):(n.wnext+=o,n.wnext===n.wsize&&(n.wnext=0),n.whave>>8&255,i.check=M(i.check,T,2,0),c=u=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",i.mode=30;break}if(c-=4,b=8+(15&(u>>>=4)),0===i.wbits)i.wbits=b;else if(b>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0)),c=u=0,i.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,u+=r[n++]<>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,i.check=M(i.check,T,4,0)),c=u=0,i.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,u+=r[n++]<>8),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=M(i.check,T,2,0)),c=u=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===s)break e;s--,u+=r[n++]<>>8&255,i.check=M(i.check,T,2,0)),c=u=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(s<(m=i.length)&&(m=s),m&&(i.head&&(b=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),D.arraySet(i.head.extra,r,n,m,b)),512&i.flags&&(i.check=M(i.check,r,m,n)),s-=m,n+=m,i.length-=m),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(m=0;b=r[n+m++],i.head&&b&&i.length<65536&&(i.head.name+=String.fromCharCode(b)),b&&m>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,u+=r[n++]<>>=7&c,c-=7&c,i.mode=27;break}for(;c<3;){if(0===s)break e;s--,u+=r[n++]<>>=1)){case 0:i.mode=14;break;case 1:if(k(i),i.mode=20,6!==t)break;u>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,u+=r[n++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&u,c=u=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(m=i.length){if(s>>=5,c-=5,i.ndist=1+(31&u),u>>>=5,c-=5,i.ncode=4+(15&u),u>>>=4,c-=4,286>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},E=R(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<>>=f,c-=f,i.lens[i.have++]=_;else{if(16===_){for(P=f+2;c>>=f,c-=f,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}b=i.lens[i.have-1],m=3+(3&u),u>>>=2,c-=2}else if(17===_){for(P=f+3;c>>=f)),u>>>=3,c-=3}else{for(P=f+7;c>>=f)),u>>>=7,c-=7}if(i.have+m>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;m--;)i.lens[i.have++]=b}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,S={bits:i.lenbits},E=R(O,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,E){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},E=R(N,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,E){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=l){e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=u,i.bits=c,A(e,d),a=e.next_out,o=e.output,l=e.avail_out,n=e.next_in,r=e.input,s=e.avail_in,u=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;v=(x=i.lencode[u&(1<>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<>y)])>>>16&255,_=65535&x,!(y+(f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,i.length=_,0===v){i.mode=26;break}if(32&v){i.back=-1,i.mode=12;break}if(64&v){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&v,i.mode=22;case 22:if(i.extra){for(P=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;v=(x=i.distcode[u&(1<>>16&255,_=65535&x,!((f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<>y)])>>>16&255,_=65535&x,!(y+(f=x>>>24)<=c);){if(0===s)break e;s--,u+=r[n++]<>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,64&v){e.msg="invalid distance code",i.mode=30;break}i.offset=_,i.extra=15&v,i.mode=24;case 24:if(i.extra){for(P=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break e;if(m=d-l,i.offset>m){if((m=i.offset-m)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}p=m>i.wnext?(m-=i.wnext,i.wsize-m):i.wnext-m,m>i.length&&(m=i.length),g=i.window}else g=o,p=a-i.offset,m=i.length;for(lm?(g=A[R+a[y]],I[D+a[y]]):(g=96,0),l=1<<_-S,C=u=1<>S)+(u-=l)]=p<<24|g<<16|f|0,0!==u;);for(l=1<<_-1;T&l;)l>>=1;if(0!==l?(T&=l-1,T+=l):T=0,y++,0==--L[_]){if(_===w)break;_=t[i+a[y]]}if(b<_&&(T&h)!==c){for(0===S&&(S=b),d+=C,P=1<<(E=_-S);E+S"']/g,ys=RegExp(vs.source),Cs=RegExp(_s.source),ws=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Es=/<%=([\s\S]+?)%>/g,Ss=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ps=/^\w*$/,xs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ts=/[\\^$.*+?()[\]{}|]/g,Is=RegExp(Ts.source),Ds=/^\s+|\s+$/g,Ls=/^\s+/,Ms=/\s+$/,As=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Rs=/\{\n\/\* \[wrapped with (.+)\] \*/,Os=/,? & /,Ns=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vs=/\\(\\)?/g,Fs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hs=/\w*$/,Gs=/^[-+]0x[0-9a-f]+$/i,ks=/^0b[01]+$/i,Bs=/^\[object .+?Constructor\]$/,js=/^0o[0-7]+$/i,zs=/^(?:0|[1-9]\d*)$/,Ws=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Us=/($^)/,qs=/['\n\r\u2028\u2029\\]/g,t="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",r="\\u2700-\\u27bf",o="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\ufe0e\\ufe0f",s="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",l="['’]",u="["+t+"]",c="["+s+"]",h="["+i+"]",d="\\d+",m="["+r+"]",p="["+o+"]",g="[^"+t+s+d+r+o+n+"]",f="\\ud83c[\\udffb-\\udfff]",v="[^"+t+"]",_="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",C="["+n+"]",w="\\u200d",b="(?:"+p+"|"+g+")",E="(?:"+C+"|"+g+")",S="(?:['’](?:d|ll|m|re|s|t|ve))?",P="(?:['’](?:D|LL|M|RE|S|T|VE))?",x="(?:"+h+"|"+f+")"+"?",T="["+a+"]?",I=T+x+("(?:"+w+"(?:"+[v,_,y].join("|")+")"+T+x+")*"),D="(?:"+[m,_,y].join("|")+")"+I,L="(?:"+[v+h+"?",h,_,y,u].join("|")+")",Ys=RegExp(l,"g"),Xs=RegExp(h,"g"),M=RegExp(f+"(?="+f+")|"+L+I,"g"),Js=RegExp([C+"?"+p+"+"+S+"(?="+[c,C,"$"].join("|")+")",E+"+"+P+"(?="+[c,C+b,"$"].join("|")+")",C+"?"+b+"+"+S,C+"+"+P,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",d,D].join("|"),"g"),A=RegExp("["+w+t+i+a+"]"),Qs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ks=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$s=-1,Zs={};Zs[ns]=Zs[as]=Zs[ss]=Zs[ls]=Zs[us]=Zs[cs]=Zs[hs]=Zs[ds]=Zs[ms]=!0,Zs[Ba]=Zs[ja]=Zs[rs]=Zs[za]=Zs[os]=Zs[Wa]=Zs[Ua]=Zs[qa]=Zs[Xa]=Zs[Ja]=Zs[Qa]=Zs[$a]=Zs[Za]=Zs[es]=Zs[is]=!1;var el={};el[Ba]=el[ja]=el[rs]=el[os]=el[za]=el[Wa]=el[ns]=el[as]=el[ss]=el[ls]=el[us]=el[Xa]=el[Ja]=el[Qa]=el[$a]=el[Za]=el[es]=el[ts]=el[cs]=el[hs]=el[ds]=el[ms]=!0,el[Ua]=el[qa]=el[is]=!1;var R={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tl=parseFloat,il=parseInt,O="object"==("undefined"==typeof global?"undefined":_typeof2(global))&&global&&global.Object===Object&&global,N="object"==("undefined"==typeof self?"undefined":_typeof2(self))&&self&&self.Object===Object&&self,rl=O||N||Function("return this")(),V="object"==("undefined"==typeof exports?"undefined":_typeof2(exports))&&exports&&!exports.nodeType&&exports,F=V&&"object"==("undefined"==typeof module?"undefined":_typeof2(module))&&module&&!module.nodeType&&module,ol=F&&F.exports===V,H=ol&&O.process,G=function(){try{var e=F&&F.require&&F.require("util").types;return e||H&&H.binding&&H.binding("util")}catch(e){}}(),nl=G&&G.isArrayBuffer,al=G&&G.isDate,sl=G&&G.isMap,ll=G&&G.isRegExp,ul=G&&G.isSet,cl=G&&G.isTypedArray,k=ga("length"),hl=e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),dl=e({"&":"&","<":"<",">":">",'"':""","'":"'"}),ml=e({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pl=function e(t){function f(e){if(oi(e)&&!$o(e)&&!(e instanceof _)){if(e instanceof v)return e;if(Xi.call(e,"__wrapped__"))return Lt(e)}return new v(e)}function n(){}function v(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=Aa}function _(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ga,this.__views__=[]}function i(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t>>0,t>>>=0;for(var n=Oi(o);++r>>1,a=e[n];null!==a&&!li(a)&&(i?a<=t:a>>0)?(e=gi(e))&&("string"==typeof t||null!=t&&!on(t))&&!(t=me(t))&&Pa(e)?Se(Ma(e),0,i):e.split(t,i):[]},f.spread=function(r,o){if("function"!=typeof r)throw new ji(Ra);return o=null==o?0:Er(hi(o),0),ne(function(e){var t=e[o],i=Se(e,0,o);return t&&na(i,t),Kn(r,this,i)})},f.tail=function(e){var t=null==e?0:e.length;return t?se(e,1,t):[]},f.take=function(e,t,i){return e&&e.length?se(e,0,(t=i||t===Aa?1:hi(t))<0?0:t):[]},f.takeRight=function(e,t,i){var r=null==e?0:e.length;return r?se(e,(t=r-(t=i||t===Aa?1:hi(t)))<0?0:t,r):[]},f.takeRightWhile=function(e,t){return e&&e.length?ve(e,lt(t,3),!1,!0):[]},f.takeWhile=function(e,t){return e&&e.length?ve(e,lt(t,3)):[]},f.tap=function(e,t){return t(e),e},f.throttle=function(e,t,i){var r=!0,o=!0;if("function"!=typeof e)throw new ji(Ra);return ri(i)&&(r="leading"in i?!!i.leading:r,o="trailing"in i?!!i.trailing:o),Yt(e,t,{leading:r,maxWait:t,trailing:o})},f.thru=Bt,f.toArray=ui,f.toPairs=En,f.toPairsIn=Sn,f.toPath=function(e){return $o(e)?oa(e,It):li(e)?[e]:Me(ho(gi(e)))},f.toPlainObject=pi,f.transform=function(e,r,o){var t=$o(e),i=t||en(e)||an(e);if(r=lt(r,4),null==o){var n=e&&e.constructor;o=i?t?new n:[]:ri(e)&&ei(n)?Ur(nr(e)):{}}return(i?Zn:D)(e,function(e,t,i){return r(o,e,t,i)}),o},f.unary=function(e){return Ut(e,1)},f.union=wo,f.unionBy=bo,f.unionWith=Eo,f.uniq=function(e){return e&&e.length?pe(e):[]},f.uniqBy=function(e,t){return e&&e.length?pe(e,lt(t,2)):[]},f.uniqWith=function(e,t){return t="function"==typeof t?t:Aa,e&&e.length?pe(e,Aa,t):[]},f.unset=function(e,t){return null==e||ge(e,t)},f.unzip=Ht,f.unzipWith=Gt,f.update=function(e,t,i){return null==e?e:fe(e,t,be(i))},f.updateWith=function(e,t,i,r){return r="function"==typeof r?r:Aa,null==e?e:fe(e,t,be(i),r)},f.values=wi,f.valuesIn=function(e){return null==e?[]:Ca(e,yi(e))},f.without=So,f.words=Si,f.wrap=function(e,t){return qo(be(t),e)},f.xor=Po,f.xorBy=xo,f.xorWith=To,f.zip=Io,f.zipObject=function(e,t){return Ce(e||[],t||[],P)},f.zipObjectDeep=function(e,t){return Ce(e||[],t||[],ae)},f.zipWith=Do,f.entries=En,f.entriesIn=Sn,f.extend=cn,f.extendWith=hn,Ii(f,f),f.add=Wn,f.attempt=Rn,f.camelCase=Pn,f.capitalize=bi,f.ceil=Un,f.clamp=function(e,t,i){return i===Aa&&(i=t,t=Aa),i!==Aa&&(i=(i=mi(i))==i?i:0),t!==Aa&&(t=(t=mi(t))==t?t:0),d(mi(e),t,i)},f.clone=function(e){return T(e,4)},f.cloneDeep=function(e){return T(e,5)},f.cloneDeepWith=function(e,t){return T(e,5,t="function"==typeof t?t:Aa)},f.cloneWith=function(e,t){return T(e,4,t="function"==typeof t?t:Aa)},f.conformsTo=function(e,t){return null==t||m(e,t,_i(t))},f.deburr=Ei,f.defaultTo=function(e,t){return null==e||e!=e?t:e},f.divide=qn,f.endsWith=function(e,t,i){e=gi(e),t=me(t);var r=e.length,o=i=i===Aa?r:d(hi(i),0,r);return 0<=(i-=t.length)&&e.slice(i,o)==t},f.eq=Qt,f.escape=function(e){return(e=gi(e))&&Cs.test(e)?e.replace(_s,dl):e},f.escapeRegExp=function(e){return(e=gi(e))&&Is.test(e)?e.replace(Ts,"\\$&"):e},f.every=function(e,t,i){var r=$o(e)?ea:w;return i&&ft(e,t,i)&&(t=Aa),r(e,lt(t,3))},f.find=Ao,f.findIndex=Mt,f.findKey=function(e,t){return ua(e,lt(t,3),D)},f.findLast=Ro,f.findLastIndex=At,f.findLastKey=function(e,t){return ua(e,lt(t,3),L)},f.floor=Yn,f.forEach=jt,f.forEachRight=zt,f.forIn=function(e,t){return null==e?e:Xr(e,lt(t,3),yi)},f.forInRight=function(e,t){return null==e?e:Jr(e,lt(t,3),yi)},f.forOwn=function(e,t){return e&&D(e,lt(t,3))},f.forOwnRight=function(e,t){return e&&L(e,lt(t,3))},f.get=fi,f.gt=Jo,f.gte=Qo,f.has=function(e,t){return null!=e&&dt(e,t,V)},f.hasIn=vi,f.head=Ot,f.identity=xi,f.includes=function(e,t,i,r){e=Kt(e)?e:wi(e),i=i&&!r?hi(i):0;var o=e.length;return i<0&&(i=Er(o+i,0)),si(e)?i<=o&&-1=Sr(o=t,n=i)&&r=this.__values__.length;return{done:e,value:e?Aa:this.__values__[this.__index__++]}},f.prototype.plant=function(e){for(var t,i=this;i instanceof n;){var r=Lt(i);r.__index__=0,r.__values__=Aa,t?o.__wrapped__=r:t=r;var o=r;i=i.__wrapped__}return o.__wrapped__=e,t},f.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _){var t=e;return this.__actions__.length&&(t=new _(this)),(t=t.reverse()).__actions__.push({func:Bt,args:[Ft],thisArg:Aa}),new v(t,this.__chain__)}return this.thru(Ft)},f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=function(){return _e(this.__wrapped__,this.__actions__)},f.prototype.first=f.prototype.head,cr&&(f.prototype[cr]=function(){return this}),f}();"function"==typeof define&&"object"==_typeof2(define.amd)&&define.amd?(rl._=pl,define("SGWorld/../../node_modules/lodash/lodash.min",[],function(){return pl})):F?((F.exports=pl)._=pl,V._=pl):rl._=pl}.call(this),define("SGWorld/ProjectTree/treeSource",["../../../node_modules/lodash/lodash.min"],function(a){"use strict";var s={Source:[],TempSource:[],entity:[],lastSelectEntity:null,pointsId:[],states:0,PointSelectSource:[],currentObj:null,selectedItem:null,setSource:function(e){this.Source=e},setTempSource:function(e){this.TempSource=e},setPointSelectSource:function(e){this.PointSelectSource=e},getSource:function(){return this.Source},getTempSource:function(){return this.TempSource},getPointSelectSource:function(){return this.PointSelectSource},push:function(e){this.Source.push(e)},pusTemSource:function(e){this.TempSource.push(e)},pusPointSelectSource:function(e){this.PointSelectSource.push(e)},insertGroupId:function(e,t){null!=e.checked&&"true"!=e.checked&&null!=e.checked||(e.checked=!0);try{0==e.item.item.show&&(e.checked=!1)}catch(e){}var i=this.getSourceById(s.Source,t);if(i){for(var r=0,o=this.TempSource.length;rr)c=l;else if(e.x-n[l].x<-r)u=l;else if(Math.abs(e.x-n[l].x)r){u=a;break}for(a=l;cr){c=a+1;break}for(a=c;aCesium.Math.toRadians(80))return!1;var r=t.cartesianToCanvasCoordinates(i);return r?[r.x-this._mapOffset[0],r.y-this._mapOffset[1]]:[]}},{key:"pointToData",value:function(e){var t=this._mapOffset,i=a.scene.globe.ellipsoid,r=new Cesium.cartesian3(e[1]+t,e[2]+t[2],0),o=i.cartesianToCartographic(r);return[o.lng,o.lat]}},{key:"getViewRect",value:function(){var e=this._api;return new echarts.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())}},{key:"getRoamTransform",value:function(){return echarts.matrix.create()}}]),o(e,t),r}();function n(){echarts.registerCoordinateSystem("GLMap",r),echarts.registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(e,t){})}echarts.extendComponentModel({type:"GLMap",getViewer:function(){return echarts.cesiumViewer},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(e,t){this.api=t,echarts.cesiumViewer.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(e,t){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e){echarts.cesiumViewer.scene.postRender.removeEventListener(this.moveHandler,this)}}),i.d(t,"load",function(){return n})}]),echarts.cesiumViewer=a)}return e.prototype.setOption=function(e,t){return this._echartsContainer&&t&&this.clear(),!this._overlay&&(this._overlay=this._createChartOverlay()),this._overlay.setOption(e),this},e.prototype._createChartOverlay=function(){var e=this._mapContainer.scene;e.canvas.setAttribute("tabIndex",0);var t=document.createElement("div");return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=e.canvas.width+"px",t.style.height=e.canvas.height+"px",t.style.pointerEvents="none",t.setAttribute("id","smartearth-cesium-echarts"),t.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(t),this._echartsContainer=t,echarts.init(t)},e.prototype.clear=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},e.prototype.updateOverlay=function(e){this._overlay&&this._overlay.setOption(e)},e.prototype.getMap=function(){return this._mapContainer},e.prototype.getOverlay=function(){return this._overlay},e.prototype.show=function(){document.getElementById(this._id).style.visibility="visible"},e.prototype.hide=function(){document.getElementById(this._id).style.visibility="hidden"},e}),define("SGWorld/Core/jquery",[],function(){return $}),define("SGWorld/Core/CIMServerTool",["./jquery"],function(o){"use strict";function e(e){this.serverUrl=e}return e.prototype.xhr=function(e,t,i,r,o){var n=new XMLHttpRequest;n.open(e,t),n.setRequestHeader("CONTENT-TYPE","application/x-www-from-urlencoded"),n.send(i),n.onreadystatechange=function(){4===n.readyState&&200===n.status?r(JSON.parse(n.responseText)):o(n),n=null}},e.prototype.getSceneList=function(t){o.ajax({url:this.serverUrl+"/scene/sceneList",type:"get",success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))}})},e.prototype.query=function(e,t){var i=e.database,r={type:e.type||"building",id:e.id,returnGeometry:!0,returnChildren:!0};void 0!==e.returnGeometry&&(r.returnGeometry=e.returnGeometry),void 0!==e.returnChildren&&(r.returnChildren=e.returnChildren),o.ajax({url:this.serverUrl+"/"+i+"/query?version=v2.1",type:"post",async:!0,data:r,success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))},error:function(e,t,i){alert("error:"+e.status)}})},e}),define("SGWorld/Core/Recorder",[],function(){"use strict";function e(e,t){this.mediaOutputPath=e||"test.mp4",this.videoBPS=t||512e4}return e.prototype.startRecord=function(){var t=this;navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0}).then(function(e){t.createRecorder(e)}).catch(function(e){t.getUserMediaError(e)})},e.prototype.getUserMediaError=function(e){console.log("mediaError",e)},e.prototype.createRecorder=function(e){var i=this;console.log("start record");var t={videoBitsPerSecond:this.videoBPS};this.recorder=new MediaRecorder(e,t),this.recorder.start();var r=[];this.recorder.onstop=function(e){var t=new Blob(r,{type:"video/mp4"});i.saveMedia(t)},this.recorder.ondataavailable=function(e){r.push(e.data)}},e.prototype.saveMedia=function(e){var t=window.URL.createObjectURL(e),i=document.createElement("a");i.innerHTML="test",i.download=this.mediaOutputPath,i.href=t,i.click()},e.prototype.stopRecord=function(){this.recorder.stop()},e}),define("SGWorld/Core/Core",["../configData","../ProjectTree/treeSource","./CombineEcharts","./CIMServerTool","./Recorder"],function(o,e,r,t,n){"use strict";function a(){this._tree=e,this._selectedColor="#ff0000",this.curCanvas="a",this.images="../../img/arrow.png",this.i=0,this.id="0"}a.prototype.defaultValue=function(e,t){return null!=e?e:t},a.prototype.Entityadd=function(e){this._tree.entity.push(e)},a.prototype.Pointadd=function(e){this._tree.pointsId.push(e)},a.prototype.Point=function(){this._tree.pointsId=[]},a.prototype.getPoint=function(){return this._tree.pointsId},a.prototype.mouse=function(e,t,i){e.style.cursor=1==t?"url("+i+"),auto":"default"},a.prototype.CreateTooltip=function(e,t,i){var r,o,n,a,s;e&&"object"===(void 0===e?"undefined":_typeof2(e))&&(r=e),r&&r.origin?("center"===r.origin&&(o=15,n=-12),"top"===r.origin&&(o=15,n=-44),"bottom"===r.origin&&(o=15,n=20)):(o=15,n=20),r&&r.color?("white"===r.color&&(a="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===r.color&&(a="background: rgba(0, 0, 0, 0.5);color: white;"),"yellow"===r.color&&(a="color: black;background-color: #ffcc33;border: 1px solid white;")):a="background: rgba(0, 0, 0, 0.5);color: white;",s=r&&r.id?"toolTip"+r.id:"toolTip";var l=document.getElementById(s);if(!l){var u=document.createElement("div");$(".cesium-viewer").append(u);var c='';$(".cesium-viewer").append(c),l=document.getElementById(s)}return i?(l.innerHTML=e,l.style.left=t.x+o+"px",l.style.top=t.y+n+"px",l.style.display="block"):l.style.display="none",{tooltip:l,style:r,showAt:function(e,t){this.tooltip.innerHTML=t,this.style&&this.style.origin?("center"===this.style.origin&&(o=15,n=-this.tooltip.offsetHeight/2),"top"===this.style.origin&&(o=15,n=-this.tooltip.offsetHeight-20),"bottom"===this.style.origin&&(o=15,n=20)):(o=15,n=-this.tooltip.offsetHeight/2),this.tooltip.style.left=e.x+o+"px",this.tooltip.style.top=e.y+n+"px",this.tooltip.style.display="block"},show:function(e){this.tooltip.style.display=e?"block":"none"}}},a.prototype.CreateResultTooltip=function(r,t){var o,n,e;!t&&(t={});var i=t.id?"resultToolTip"+t.id:"resultToolTip",a=document.getElementById(i);if(t.color?("white"===t.color&&(e="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===t.color&&(e="background: rgba(0, 0, 0, 0.5);color: white;"),"blue"===t.color&&(e="background: rgba(48, 119, 221);color: white;"),"yellow"===t.color&&(e="color: black;background-color: #ffcc33;border: 1px solid white;")):e="color: black;background-color: #ffcc33;border: 1px solid white;",!a){var s='';$(r.container).append(s),a=document.getElementById(i)}var l,u=t.addX||0,c=t.addY||0;return r.scene.camera.percentageChanged=1e-6,r.scene.camera.changed.addEventListener(function(){if(l){if(void 0!==t.distance){if(Cesium.Cartesian3.distance(l,r.camera.position)>t.distance)return void(a.style.display="none");a.style.display="block"}var e=r.scene.cartesianToCanvasCoordinates(l);if(!e)return;o=-a.offsetWidth/2+u,n=-a.offsetHeight+c,a.style.left=e.x+o+"px",a.style.top=e.y+n+"px"}}),{tooltip:a,position:l,showAt:function(e,t){if(this.tooltip.innerHTML=t,this.tooltip.style.display="block",this.position=e,l=e){var i=r.scene.cartesianToCanvasCoordinates(l);if(!i)return;o=-this.tooltip.offsetWidth/2+u,n=-this.tooltip.offsetHeight+c,this.tooltip.style.left=i.x+o+"px",this.tooltip.style.top=i.y+n+"px"}},show:function(e){l=e?(this.tooltip.style.display="block",this.position):void(this.tooltip.style.display="none")}}},a.prototype.CombineEcharts=function(e,t,i){return this._CombineEcharts||(this._CombineEcharts=new r(e)),this._CombineEcharts.setOption(t,i)},a.prototype.getPositionFromWKT=function(e){var t=e+"!",n=void 0,a=[];return-1parseFloat(a.max)&&(a.max=parseFloat(r)),a.gcs.push(r)}t&&(o.scene.globe.depthTestAgainstTerrain=!1),""!=n&&null!=n&&"function"==typeof n&&n(a)}})},a.prototype.getPmfxPro=function(v,e,t,_,a,s){for(var i=this,l=this,u={gcs:[],min:99999,max:0,juli:0,cys:0},y=[],r=[],o=0;oparseFloat(u.max)&&(u.max=parseFloat(o)),u.gcs.push(o)}a.scene.globe.depthTestAgainstTerrain=t,s&&"function"==typeof s&&s(u)}})};1e3=1/3&&t.time<2/3&&0===this.u_radius1?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3):t.time>=2/3?(this.u_radius3=t.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):t.time<1/3&&0!==this.u_radius2&&0!==this.u_radius1?(this.u_radius1=t.time,this.u_radius2=t.time+1/3,this.u_radius3=t.time+2/3):t.time>=1/3&&t.time<2/3&&0!==this.u_radius1&&(this.u_radius1=t.time-1/3,this.u_radius2=t.time,this.u_radius3=t.time+1/3),t.u_radius1=this.u_radius1,t.u_radius2=this.u_radius2,t.u_radius3=this.u_radius3,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMultiMaterialProperty=i,Cesium.Material.CircleScanMultiType="CircleScanMulti",Cesium.Material.CircleScanMultiSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n dis = dis * 2.0;\n if(dis < u_radius1)\n\n {\n float f = dis / u_radius1;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius2){\n float f = dis / u_radius2;\n material.alpha = pow(f, 9.0);\n }else if(dis < u_radius3){\n float f = dis / u_radius3;\n material.alpha = pow(f, 9.0);\n }else{\n material.alpha = 0.0;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanMultiType,{fabric:{type:Cesium.Material.CircleScanMultiType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:Cesium.Material.CircleScanMultiSource},translucent:function(e){return!0}})}return new Cesium.CircleScanMultiMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},a.prototype.getSectorScanMaterial=function(e,t){if(!Cesium.EllipsoidFadeMaterialProperty){var i=function(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color"),angle:Cesium.createPropertyDescriptor("angle")}),i.prototype.getType=function(e){return"EllipsoidFade"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.ColorWHITE,t.color),t.angle=this._angle,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Property.equals(this._color,e._color)},Cesium.EllipsoidFadeMaterialProperty=i,Cesium.Material.EllipsoidFadeType="EllipsoidFade",Cesium.Material.EllipsoidFadeSource="float getAngle(in vec2 dv)\n{\n if(dv.y == 0.0 && dv.x > 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle)\n {\n material.alpha = 1.0 - dis/0.5;\n float intensity =step(0.001,ripple(dis, 100.0, 15.0));\n if(intensity == 1.0)\n {\n material.alpha = material.alpha/2.0;\n }\n }\n else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n}",Cesium.Material._materialCache.addMaterial(Cesium.Material.EllipsoidFadeType,{fabric:{type:Cesium.Material.EllipsoidFadeType,uniforms:{color:new Cesium.Color(1,0,0,1),angle:90},source:Cesium.Material.EllipsoidFadeSource},translucent:function(e){return!0}})}return new Cesium.EllipsoidFadeMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,45))},a.prototype.getCircleScanMaterial=function(e,t){if(!Cesium.CircleScanMaterialProperty){var i=function(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()};Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"CircleScan"},i.prototype.getValue=function(e,t){return Cesium.defined(t)||(t={}),t.color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.CircleScanMaterialProperty=i,Cesium.Material.CircleScanType="CircleScan",Cesium.Material.CircleScanSource="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n if(dis 0.0)\n {\n return 90.0;\n }\n if(dv.y == 0.0 && dv.x < 0.0)\n {\n return 270.0;\n }\n float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n rAngle = 180.0 + rAngle;\n }\n if(dv.y > 0.0)\n {\n rAngle = 360.0 + rAngle;\n }\n }\n return rAngle;\n }\n float ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n }\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5, 0.5));\n float f = 0.0;\n float nowAngle = getAngle(st.xy-vec2(0.5, 0.5));\n if(nowAngle < angle2 && nowAngle > angle1)\n {\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){\n f = (nowAngle - angle1) / 60.0;\n material.alpha = f;\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){\n f = (nowAngle + 360.0 - angle1) / 60.0;\n material.alpha = f;\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }",Cesium.Material._materialCache.addMaterial(Cesium.Material.RadarScanType,{fabric:{type:Cesium.Material.RadarScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0,angle2:0,angle1:0},source:Cesium.Material.RadarScanSource},translucent:function(e){return!0}})}return new Cesium.RadarScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},a.prototype.gradientColor=function(e,t,i){return new l(e,t,i)},a.prototype.xhr=function(e){var t=new XMLHttpRequest,i=!0;i=null==e.async||(null==e.async||e.async),t.open(e.type,e.url,i),t.send(e.data||{}),t.onreadystatechange=function(){4===this.readyState&&200===this.status?e.success&&"function"==typeof e.success&&e.success(e.isXml?this.responseXML:JSON.parse(this.responseText)):e.error&&"function"==typeof e.error&&e.error(t),e.complete&&"function"==typeof e.complete&&e.complete()}};var s="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};function l(e,t,i){if(e&&t){"#"!==e[0]&&(e=this.colorHex(e)),"#"!==t[0]&&(t=this.colorHex(t));for(var r=this.colorRgb(e),o=r[0],n=r[1],a=r[2],s=this.colorRgb(t),l=(s[0]-o)/i,u=(s[1]-n)/i,c=(s[2]-a)/i,h=[],d=0;d\n
\n
'+e.description+"
\n ":'
\n
'+e.name+"
\n
",$(".cesium-viewer").append(t),document.getElementById(e.id))),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}}}this.item=this.pointPrimitive.add({id:"DivPoint"+t,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=name,this.item.description=e;var s={id:this.item.id,name:name,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this.item},t.prototype.getVisibility=function(){return this.item.show},t.prototype.setRadius=function(e){try{this.item._label.outlineWidth=e,this.item._label.outlineColor=this._cesium.Color.RED.withAlpha(.4)}catch(e){console.log(e)}return this},t.prototype.setText=function(e){try{this.item._label.text=e}catch(e){console.log(e)}return this},t.prototype.setHeightType=function(e){try{1==e?this.item._label.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._label.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._label.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},t.prototype.setUrl=function(e){try{this.item.billboard=new this._cesium.BillboardGraphics({id:this._core.getuid(),image:e,show:!0})}catch(e){console.log(e)}return this},t.prototype.setFillColorRgba=function(e,t,i,r){try{this.item._label.fillColor=new l(this._viewer,this._cesium).createColor(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setFillColorHtml=function(e){try{this.item._label.fillColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._label.fillColor}catch(e){console.log(e)}},t.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setBackgroundColorRgba=function(e,t,i,r){try{this.item._label.backgroundColor=new l(this._viewer,this._cesium).createColor(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setBackgroundColorHtml=function(e){try{this.item._label.backgroundColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},t.prototype.setBackgroundColorAlpha=function(e){try{this.item._label.backgroundColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setFontSize=function(e){try{this.item._label.font=parseFloat(e)+"px sans-serif"}catch(e){console.log(e)}},t.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.showBackground=function(e){try{this.item._label.showBackground=e}catch(e){console.log(e)}},t.prototype.setOutlineWidth=function(e){try{this.item._label.outlineWidth=e}catch(e){console.log(e)}},t.prototype.setOutlineColorRgba=function(e,t,i,r){try{this.item._label.outlineColor=new this._cesium.Color(e,t,i,r)}catch(e){console.log(e)}},t.prototype.setOutlineColorHtml=function(e){try{this.item._label.outlineColor=new l(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},t.prototype.setOutlineColorAlpha=function(e){try{this.item._label.outlineColor._value.alpha=e}catch(e){console.log(e)}},t.prototype.setStyle_LabelStyle_FILL=function(e){try{this.item._label.style=this.LabelStyle_FILL}catch(e){console.log(e)}},t.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_FILL_AND_OUTLINE}catch(e){console.log(e)}},t.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._label.distanceDisplayCondition=i}catch(e){console.log(e)}return this},t.prototype.setStyle_LabelStyle_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_OUTLINE}catch(e){console.log(e)}},t.prototype.setItem=function(e){this.item=e},t.prototype.CreateLabel=function(e,t,i,r,o,n){this._postion=e;var a={id:this._core.getuid(),text:t,backgroundColor:r.BackgroundColor,font:r.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:r.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(r.MinViewingHeight,r.MaxViewingHeight)};r.Italic&&(a.font="italic "+a.font),r.Bold&&(a.font="Bold "+a.font),this._core.isnull(r)||this._core.isnull(r.IconColor)||"["==r.IconColor.toString().charAt(0)&&"]"==r.IconColor.toString().charAt(r.IconColor.length-1)||(this._core.isHtmlColor(r.IconColor)?a.fillColor=this._Color.colorFromHtmlColor(r.IconColor):(/^rgb/.test(r.IconColor)&&(a.fillColor=this._Color.rgbaStringToRgbaObj(r.IconColor)),1s[0]+.01&&l.lats[1]+.005&&l.lon>s[0]?l.lon-=1e-5:l.lon<=s[0]&&l.lat>s[1]?l.lat-=1e-5:l.lon+=1e-5,l.planePosition=l._cesium.Cartesian3.fromDegrees(l.lon,l.lat,l.height/2),l.planePosition},!1):l._cesium.Cartesian3.fromDegrees(l.lon,l.lat,(l.height+t)/2),orientation:e.rotate?new this._cesium.CallbackProperty(function(){var e=Cesium.Cartographic.fromDegrees(l.lon,s[1],0);l.geoD.setEndPoints(l.startPt,e);var t=l.geoD.surfaceDistance,i=Math.atan(t/l.halfLen),r=Cesium.Cartographic.fromDegrees(l.lon,l.lat,0);l.geoD.setEndPoints(l.startPt,r),t=l.geoD.surfaceDistance,l.lengthl=Math.sqrt(t*t+l.halfLen*l.halfLen);var o=Cesium.Cartographic.fromDegrees(s[0],l.lat,0);l.geoD.setEndPoints(l.startPt,o),t=l.geoD.surfaceDistance;var n=Math.asin(t/l.lengthl),a=new Cesium.HeadingPitchRoll(0,i,n);return Cesium.Transforms.headingPitchRollQuaternion(l.planePosition,a)},!1):void 0,cylinder:{length:e.rotate?new l._cesium.CallbackProperty(function(){return 2*l.lengthl},!1):l.height-t,topRadius:0,bottomRadius:l._core.defaultValue(e.radius,300),bottomSurface:!1,material:l._core.getConeRadarMaterial(e.color)}});var i={id:this._core.getuid(),name:"新建卫星雷达",pId:0,type:"ConeRadar",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},e.prototype.setLength=function(e){try{this.item._cylinder.length=e}catch(e){console.log(e)}return this},e.prototype.createCylinderOptimization=function(e,t){this.style=e;var l=this;this.handler.setInputAction(function(e){var t=l.getCatesian3FromPX(e.position,l._viewer,[l.circle]);0==l.positions.length&&l.positions.push(t.clone()),l.positions.push(t);var i=l.createPoint(t,!1);0=c.minLevel&&c.Level<=c.maxLevel)(e=document.getElementById(c.item.id))&&(e.style.display="block");else if(c.Levelc.maxLevel)return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}else if(c.item&&!c.isShow){var e;return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}for(var t,i,r=0;r"}):o='
'+t.description+"
",i='
'+t.name+'
'+o+'
',$(c._viewer.container).append(i),e=document.getElementById(t.id)}else i='
'+t.name+'
',$(c._viewer.container).append(i),e=document.getElementById(t.id);e.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-e.offsetHeight)+")"}n.update&&n.update()}}this.item=this.pointPrimitive.add({id:s,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=e,this.item.description=r,this.updateDivPoint=function(e,t){a.item.name=e,a.item.description=t;var i=document.getElementById(a.item.id);i&&i.remove()};var h={id:this.item.id,name:e,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),this},t.prototype.createDivPointAndCallback=function(e,t,i,r,n,o){var a,s=this._core.getuid();if(!n&&(n={}),void 0!==t.length?2===t.length?a=this._cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(a=this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):a=t.z?this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):this._cesium.Cartesian3.fromDegrees(t.x,t.y),this._position=a,void 0!==n.level&&("number"==typeof n.level?(this.minLevel=n.level,this.maxLevel=28):(n.level=n.level.split(","),this.minLevel=n.level[0],this.maxLevel=n.level[1])),!this.pointPrimitive){var l,u;this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection),this.callback=o;var c=this;this.Level=0,c.isShow=!0,c.callback=o,this.pointPrimitive.update=function(){if(c.item&&c.isShow&&c.minLevel&&c.maxLevel){if(c.Level=c.getLevel(),c.Level>=c.minLevel&&c.Level<=c.maxLevel)(e=document.getElementById(c.item.id))&&(e.style.display="block");else if(c.Levelc.maxLevel)return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}else if(c.item&&!c.isShow){var e;return void((e=document.getElementById(c.item.id))&&(e.style.display="none"))}for(var t,i,r=0;r"}):o='
'+t.description+"
",i='
'+t.name+'
'+o+'
',$(c._viewer.container).append(i),(e=document.getElementById(t.id)).onclick=function(){c.callback(n)}}else i='
'+t.name+'
',$(c._viewer.container).append(i),(e=document.getElementById(t.id)).onclick=function(){c.callback(n)};e.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-e.offsetHeight)+")"}n.update&&n.update()}}this.item=this.pointPrimitive.add({id:"DivPoint"+s,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=e,this.item.description=r;var h={id:this.item.id,name:e,pId:this._core.isnull(i)?0:i,type:"Point",item:this};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),this},t.prototype.getLevel=function(){var e,t,i=this._viewer.camera;if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0;return t},t.prototype.createRichTextPoint=function(e,t,i,r){var o,n=this,a=this._core.getuid();void 0!==t.length?2===t.length?o=this._cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(o=this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):o=t.z?this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):this._cesium.Cartesian3.fromDegrees(t.x,t.y),this._position=o;var f,v,_,y,C,s={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(n._core.defaultValue(i.near,0),n._core.defaultValue(i.far,Number.MAX_VALUE))},l=this._core.extend(s,i,!0),u="",c=15;i&&i.fontColor&&(u=i.fontColor),i&&i.fontSize&&(c=i.fontSize),f=e,v=c,_=u,y=function(e){l.image=e,n.item=n._viewer.entities.add({id:a,name:"新建富文本点"+a,position:n._position,billboard:l}),n.item.type="RichPoint"},(C=document.createElement("img")).src=n._core.defaultValue(l.url,window.SmartEarthRootUrl+p.richtextpoint),v=parseFloat(v),C.crossOrigin="Anonymous",C.onload=function(){var e=document.createElement("canvas"),t=e.getContext("2d"),i=C.width,r=C.height;if(e.width=i,e.height=r,t.drawImage(C,0,0,i,r),t.shadowOffsetX=1,t.shadowOffsetY=0,t.shadowColor="#fff",t.shadowBlur=1,/^\$/.test(f)){var o=''+f+"",n=window.URL||window.webkitURL||window,a=document.createElement("img"),s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),l=n.createObjectURL(s);a.crossOrigin="Anonymous",a.src=l,a.onload=function(){t.drawImage(a,0,0,a.width,a.height),n.revokeObjectURL(l)},y(e)}else{if(t.fillStyle=_||"#fff",t.font=v+"px Calibri,sans-serif",f.length*v>i){var u=f.substring(0,Math.ceil(f.length/2)),c=f.substring(Math.floor(f.length/2),f.length),h=(r-100-2*v)/2,d=h+v,m=(i-u.length*v)/2;t.fillText(u,m,h),t.fillText(c,m,d)}else{var p=(r-100-v)/2,g=(i-f.length*v)/2;t.fillText(f,g,p)}y(e)}};var h={id:a,name:"新建富文本点"+a,pId:n._core.isnull(r)?0:r,type:"Imagelabel",item:n};return n.setTreeobj(h),n._tree.insertGroupId(h,n._core.isnull(r)?0:r),this},t.prototype.createPoints=function(e,t){var i={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},r=this._core.extend(i,e,!0);this._core.isnull(text)||(r.text=text),this._position=position,this.item=this._viewer.entities.add({name:name,position:this._cesium.Cartesian3.fromDegrees(position[0],position[1]),point:r});var o={id:this.item.id,name:r.text,pId:this._core.isnull(t)?0:t,type:"Point",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(t)?0:t),this},t.prototype.createLocations=function(e,t,i){var r={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND};this._position=t,this._core.isnull(e)&&(e="新建兴趣点"),this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),point:r});var o={id:r.id,name:e,pId:this._core.isnull(i)?0:i,type:"Location",item:this};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLocation=function(t,e,i){var r={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},o={destination:e.position,orientation:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll}};this._position=e,this._core.isnull(t)&&(t="新建兴趣点");var n=this._core.getuid();this.item=this._viewer.entities.add({name:t,position:e.position,point:r}),this.item.originalCameraLocation=o;var a=this;return setTimeout(function(){var e={id:n,name:t+n,pId:a._core.isnull(i)?0:i,type:"Location",item:a};a.setTreeobj(e),a._tree.insertGroupId(e,a._core.isnull(i)?0:i)}),this},t.prototype.createPointOptimization=function(e,t){var s=this,l=[],u=this._core.StyleContrastGeoJson(e,this._cesium);return this.handler.setInputAction(function(e){var t,i,r=s._viewer.scene.camera.getPickRay(e.position);if(r&&(t=s._viewer.scene.globe.pick(r,s._viewer.scene)),t){i=s._cesium.Ellipsoid.WGS84.cartesianToCartographic(t);var o=s._viewer.scene.globe.getHeight(i);s._point=s._cesium.Cartesian3.fromDegrees(i.longitude/Math.PI*180,i.latitude/Math.PI*180,o),u.position=new s._cesium.CallbackProperty(function(){return s._point},!1),s.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=s._viewer.entities.add(u);n.objId=s.objId,(n.obj=s)._core.Entityadd(s);var a={point:n};l.push(a),s.state=1,s.handler.destroy(),"function"==typeof method&&method(l),s.item=n}},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this},t.prototype.startModify=function(){var r="拖动修改位置";if(2==this.state||1==this.state){this._tree.starttemporaryItem(this._viewer),this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));var o=this;this.modifyHandler.setInputAction(function(e){var t=o._viewer.scene.pick(e.position);o._cesium.defined(t)&&t.id&&o._cesium.defined(t)&&t.id&&t.id.objId&&t.id.objId==o.objId&&(o.modifyPoint=t.id,r="释放后完成修改",o.forbidDrawWorld(!0)),o.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t=o._viewer.scene.pick(e.endPosition);if(o._core.CreateTooltip(r,e.endPosition,!1),o.modifyPoint){if(o.modifyPoint){var i=o.getCatesian3FromPX(e.endPosition,o._viewer,[o.modifyPoint]);i&&(o._point=i,o.modifyPoint.position=i),o._core.CreateTooltip(r,e.endPosition,!0)}}else o._cesium.defined(t)&&t.id&&t.id.objId&&o._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){var t=o.getCatesian3FromPX(e.position,o._viewer,[o.modifyPoint]);o.modifyPoint&&(t&&(o._point=t),o.modifyPoint.position=t,o.modifyPoint=null,o.forbidDrawWorld(!1),r="拖动修改位置")},this._cesium.ScreenSpaceEventType.LEFT_UP)}},t.prototype.getCatesian3FromPX=function(e,t,i){var r,o=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(0o[1].x&&o[0].y>o[1].y?d=n<0?-d:d:o[0].x>o[1].x&&o[0].yo[1].y&&(d=n<0?-d:d,u=-u);var m=new Cesium.HeadingPitchRoll(0,u,d)}var p=r[0];this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return p},!1),orientation:i.cylinder?new this._cesium.CallbackProperty(function(){return Cesium.Transforms.headingPitchRollQuaternion(p,m)},!1):void 0,polyline:{positions:r,width:this._core.defaultValue(i.width,2),material:i.material,clampToGround:!1},cylinder:i.cylinder?{length:this._core.defaultValue(i.length,20),topRadius:this._core.defaultValue(i.size,8),bottomRadius:this._core.defaultValue(i.size,8),material:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED)}:void 0,point:i.cylinder?void 0:{color:this._core.defaultValue(i.pointColor&&this._cesium.Color.fromCssColorString(i.pointColor),this._cesium.Color.RED),outlineColor:this._core.defaultValue(i.outlineColor&&this._cesium.Color.fromCssColorString(i.outlineColor),this._cesium.Color.YELLOW),outlineWidth:this._core.defaultValue(i.outlineWidth,2),pixelSize:this._core.defaultValue(i.size,8)}});var g=this._core.defaultValue(i.num,200),f=this._cesium.Math.lerp(o[0].x,o[1].x,1/g)-o[0].x,v=this._cesium.Math.lerp(o[0].y,o[1].y,1/g)-o[0].y,_=this._cesium.Math.lerp(o[0].z,o[1].z,1/g)-o[0].z,y=[];y.push(r[0]);for(var C=0;C=y.length-1&&0o._points.length&&a.pop(),a.push(i)):s=new d(a)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){o._viewer.camera.getPickRay(e.position);if(i=o._getPosition.getMousePosition(e)){0==a.length?a.push(i,i):a.length>o._points.length?(a.pop(),a.push(i)):a.push(i,i),2<=a.length&&(o._cesium.defined(s)||(s=new d(a)),t=o._core.getSpaceDistance(a,o._cesium)),n&&(o._viewer.entities.remove(n),n=void 0);l="总长:"+t,c.spot.push(i),c.distance.push(t)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o.end&&o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){var t={width:4,lineColor:"#0000ff"},i=s.positions;u.show(!1),o._tree&&o._tree.endtemporaryItem(),n&&(o._viewer.entities.remove(n),n=void 0,a.pop()),o._points[o._points.length-1]&&(o._points[o._points.length-1].label.text=l),o._tree&&o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,o._viewer.entities.remove(o.item),"cancel"===e||a.length<2||(o.item=o._viewer.entities.add({name:"新建链路",polyline:{positions:i,width:o._core.defaultValue(t.width,2),material:o._core.getLinkMaterial(t.lineColor,t.pointColor,t.time),clampToGround:!0}}),r&&r(o.item))};var d=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:h.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1);var t=o._viewer.entities.add(this.options);o.item=t,o._tree.temporaryItem.obj.push(t),c.ployline.push(t);var i=o._core.getuid();c.name="新建空间距离"+i},e}();return this},t.prototype.createLinkPro=function(e,t,i){!i&&(i={});var r=[],o=[];e.lon&&e.lat?void 0!==e.height?(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),o.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(r.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),r.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),o.push({x:e.lon,y:e.lat,z:0},{x:t.lon,y:t.lat,z:0})):e.x&&e.y?(void 0!==e.z?(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(r.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),r.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),o.push(e,t)):2===e.length?(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),o.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(r.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),r.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),o.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),this.item=this._viewer.entities.add({name:"新建链路",polyline:{positions:r,width:this._core.defaultValue(i.width,2),material:this._core.getLinkMaterial(i.lineColor,i.pointColor,i.time)}});var n={id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this};return this.setTreeobj(n),this._tree.insertGroupId(n,0),this},t.prototype.executePolyline=function(t,u){var c=this,i=function(){function e(e){this.options={polyline:{show:!0,positions:[],material:new c._cesium.PolylineOutlineMaterialProperty({color:c._core.defaultValue(t.color,c._cesium.Color.YELLOW)}),clampToGround:c._core.defaultValue(t.clampToGround,!0),width:c._core.defaultValue(t.width,3)}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1),this.polyline=c._viewer.entities.add(this.options),c.item=this.polyline},e}(),h=new c._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),d=[],m=void 0,p=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+C.draw),h.setInputAction(function(e){var t=c._getPosition.getMousePosition(e);0==d.length&&d.push(t.clone()),d.push(t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){0===d.length?p.showAt(e.endPosition,"左键开始绘制!"):p.showAt(e.endPosition,"右键结束绘制!");var t=c._getPosition.getMousePosition(e);2<=d.length&&(c._cesium.defined(m)?null!=t&&(d.pop(),t.y+=1+Math.random(),d.push(t)):m=new i(d))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),h.setInputAction(function(e){p.show(!1);var t={polyline:{},positions:[],positionsp:[],distance:[],setDistance:function(){alert("qq")}};h.destroy(),t.polyline=m;for(var i=[],r=0;rr._points.length&&n.pop(),n.push(l)):a=new m(n),s=r._core.getSpaceDistance(n,r._cesium)),o&&(r._viewer.entities.remove(o),o=void 0),o=r._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],label:{text:"总长:"+s,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(o))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){r._viewer.camera.getPickRay(e.position);if(l=r._getPosition.getMousePosition(e)){0==n.length?n.push(l,l):n.length>r._points.length?(n.pop(),n.push(l)):n.push(l,l),2<=n.length&&(r._cesium.defined(a)||(a=new m(n)),s=r._core.getSpaceDistance(n,r._cesium)),o&&(r._viewer.entities.remove(o),o=void 0);var t=s;u="总长:"+s,i=r._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],point:{pixelSize:5,color:d.point,outlineColor:r._cesium.Color.WHITE,outlineWidth:2,clampToGround:!0},label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(i),r._points.push(i),h.spot.push(l),h.distance.push(s),h.label.push(i)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){c.show(!1),r._tree&&r._tree.endtemporaryItem(),r.end=void 0,o&&(r._viewer.entities.remove(o),o=void 0,n.pop()),r._points[r._points.length-1]&&(r._points[r._points.length-1].label.text=u),r._tree&&r._tree.handler.destroy(),r._core.mouse(r._viewer.container,0,"0"),"cancel"!==e?(n.length<2&&r.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(h)):r.deleteObject()};var m=function(){function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:d.polyline,width:3,clampToGround:!1}},this.positions=e,this._init()}return e.prototype._init=function(){var e=this;this.options.polyline.positions=new r._cesium.CallbackProperty(function(){return e.positions},!1);var t=r._viewer.entities.add(this.options);r.item=t,r._tree.temporaryItem.obj.push(t),h.ployline.push(t);var i=r._core.getuid();h.name="新建空间距离"+i},e}();return this},t.prototype.executeHorizontal=function(t,e){var h=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene._imageryLayerCollection);var i,r,o=[],n=null,a="0米",s=null,d=(h=this,[]),l="",u=this._core.CreateTooltip(),c={spot:[],distance:[],label:[],ployline:[]},m={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW};0e[1].lon?(t=e[1].lon,e[0].lon):(t=e[0].lon,e[1].lon),o=e[0].lat>e[1].lat?(r=e[0].lat,e[1].lat):(r=e[1].lat,e[0].lat),new this._cesium.Rectangle.fromDegrees(t,o,i,r)},e.prototype.createRectanglelbj=function(e,o){var n,a=this,s=this,l=[];a.shape={points:[],button:0,rect:null,entity:null},this._tree.removeHandler(),this.closeBrowseBorder();var t=0;null!=e&&null!=e&&null!=e.id&&(t=e.id);var r=this._core.CreateTooltip();s._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas);var u=null,c=null;s._tree.handler.setInputAction(function(e){n=s._core.getPointFromWindowPoint(e.position,s._viewer);var t=s._viewer.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);if(1<=a.shape.button){var i={obj1:u,obj2:c=t},r={originalCameraLocation:{position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}},pointes:i,terrainExaggeration:"5",zj:"true"};s.llbj(r,a.shape.entity),"function"==typeof o&&o(a.shape.entity),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)}else u=t;a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(l.push(n),a.shape.points.push(s._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=s._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:s._cesium.Color.YELLOW.withAlpha(0),outline:!0,outlineWidth:10,outlineColor:s._cesium.Color.YELLOW,height:0}}),a.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return a.shape.rect},!1),s.item=a.shape.entity):2==a.shape.points.length||s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s._tree.handler.setInputAction(function(e){if(0==a.shape.points.length?r.showAt(e.endPosition,"点击左键在球面上绘制矩形!"):c&&r.showAt(e.endPosition,"请将视野缩放到范围内以开启边界浏览"),0!=a.shape.points.length&&!c){r.showAt(e.endPosition,"再次点击结束绘制!");var t=s._core.getPointFromWindowPoint(e.endPosition,s._viewer);if(t){var i=s._viewer.camera.getPickRay(e.endPosition);s._viewer.scene.globe.pick(i,s._viewer.scene);l[1]=t,a.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=s._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);s._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||m.selectedItem.id;var i=s._core.getuid(),h={id:i,name:"新建浏览边界"+i,pId:s._core.isnull(t)?0:t,type:"rectangle",item:s};return s.setTreeobj(h),m.insertGroupId(h,s._core.isnull(t)?0:t),this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.rectangle.coordinates?void 0:this.item.rectangle.coordinates._value;null!=t&&(t={east:t.east,north:t.north,south:t.south,west:t.west});var i=null==this.item.rectangle.height?void 0:this.item.rectangle.height._value,r=null==this.item.rectangle.extrudedHeight?void 0:this.item.rectangle.extrudedHeight._value,o=null==this.item.rectangle.rotation?void 0:this.item.rectangle.rotation._value,n=null==this.item.rectangle.stRotation?void 0:this.item.rectangle.stRotation._value,a=null==this.item.rectangle.fill?void 0:this.item.rectangle.fill._value,s=this.item.rectangle.material;null!=s&&(s={color:null==s.color._value?void 0:"rgba("+s.color._value.red+","+s.color._value.green+","+s.color._value.blue+","+s.color._value.alpha+")",image:null==s.image?void 0:s.image._value,diffusemap:null==s.diffusemap?void 0:s.diffusemap._value,alphamap:null==s.alphamap?void 0:s.alphamap._value});var l=null==this.item.rectangle.outline?void 0:this.item.rectangle.outline._value,u=null==this.item.rectangle.outlineColor?void 0:"rgba("+this.item.rectangle.outlineColor._value.red+","+this.item.rectangle.outlineColor._value.green+","+this.item.rectangle.outlineColor._value.blue+","+this.item.rectangle.outlineColor._value.alpha+")",c=null==this.item.rectangle.outlineWidth?void 0:this.item.rectangle.outlineWidth._value,h=this.item.rectangle.distanceDisplayCondition,d=null==h?void 0:h._value.near,m=null==h?void 0:h._value.far;return{type:"rectangle",treeobj:{name:this.treeobj.name},style:{show:e,coordinates:t,height:i,extrudedHeight:r,rotation:o,stRotation:n,fill:a,material:s,outline:l,outlineColor:u,outlineWidth:c,near:d,far:m}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.llbj=function(e,t){var i=document.getElementById("toolTip");i.innerHTML="请将视野缩放到范围内以开启边界浏览";var r=t.rectangle;r.height=void 0,r.heightReference=void 0,r.perPositionHeight=!1;var o=e.pointes,n=[];n.push(o.obj1),n.push(o.obj2);for(var a,s,l,u={},c=0;cu.west?u.east=s:u.west=s,l>u.south?u.north=l:u.south=l);n[0].x,n[1].x,n[0].y,n[1].y,n[0].z,this._viewer.camera.heading,this._viewer.camera.pitch,this._viewer.camera.roll;var h=this._viewer.camera.heading,d=this._viewer.camera.pitch,m=this._viewer.camera.roll,p=this._viewer.camera.position.clone(),g={orientation:{heading:h,pitch:d,roll:m},position:p},f=this;f.flyListener=function(){var e=f._viewer.camera.computeViewRectangle(),t={west:e.west/Math.PI*180,north:e.north/Math.PI*180,east:e.east/Math.PI*180,south:e.south/Math.PI*180};f.isInArea(t,u)?(f._tree.removeHandler(),i.style.left="50%",i.style.top="50%",i.innerHTML="边界浏览已开启,右键结束边界浏览",setTimeout(function(){i.style.display="none"},2e3),f._viewer.scene.camera.changed.removeEventListener(f.flyListener),f.flyListener=void 0,f._tree.handler=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),f._viewEvent=function(e){g=f.limitView(u,g)},f._viewer.scene.camera.percentageChanged=.001,f._viewer.scene.camera.changed.addEventListener(f._viewEvent),f._tree.handler.setInputAction(function(e){f.closeBrowseBorder()},f._cesium.ScreenSpaceEventType.RIGHT_CLICK)):(h=f._viewer.camera.heading,d=f._viewer.camera.pitch,m=f._viewer.camera.roll,p=f._viewer.camera.position.clone(),g={orientation:{heading:h,pitch:d,roll:m},position:p})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(f.flyListener)},e.prototype.closeBrowseBorder=function(){var e=document.getElementById("toolTip");this._tree.endtemporaryItem(),this._tree.handler&&this._tree.handler.destroy(),this.flyListener&&(this._viewer.scene.camera.changed.removeEventListener(this.flyListener),this.flyListener=void 0),this._viewEvent?(this._viewer.scene.camera.changed.removeEventListener(this._viewEvent),this._viewEvent=void 0,e.style.display="block",e.innerHTML="取消边界浏览",setTimeout(function(){e.style.display="none"},1e3)):e&&(e.style.display="none")},e.prototype.limitView=function(e,t){var i=this._viewer.camera.computeViewRectangle(),r={west:i.west/Math.PI*180,north:i.north/Math.PI*180,east:i.east/Math.PI*180,south:i.south/Math.PI*180};this.isInArea(r,e)?t={orientation:{heading:this._viewer.camera.heading,pitch:this._viewer.camera.pitch,roll:this._viewer.camera.roll},position:this._viewer.camera.position.clone()}:null!==t&&this._viewer.camera.setView({destination:t.position,orientation:t.orientation});return t},e.prototype.isInArea=function(e,t){var i=!1;return e.south>t.south&&e.eastt.west&&(i=!0),i},e.prototype.createRectangledxkz=function(o){var n=this,a=this,s=[];a.shape={points:[],rect:null,entity:null};var l,u=null,c=null,h=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);function d(e){if("EllipsoidTerrainProvider"==n._viewer.scene.terrainProvider.constructor.name)return n._viewer.camera.pickEllipsoid(e,n._viewer.scene.globe.ellipsoid);var t=n._viewer.scene.camera.getPickRay(e);return n._viewer.scene.globe.pick(t,n._viewer.scene)}return h.setInputAction(function(e){l=d(e.position);var t=n._viewer.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid);if(null==u&&(u=t),u.x==t.x&&u.y==t.y&&u.z==t.z||(c=t),l)if(0==a.shape.points.length)s.push(l),a.shape.points.push(n._viewer.scene.globe.ellipsoid.cartesianToCartographic(l)),a.shape.rect=n._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=n._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:n._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:n._cesium.Color.RED,height:0}}),a.bufferEntity=a.shape.entity;else{h.removeInputAction(n._cesium.ScreenSpaceEventType.MOUSE_MOVE),h.removeInputAction(n._cesium.ScreenSpaceEventType.LEFT_CLICK);var i={obj1:u,obj2:c},r={position:n._viewer.camera.position.clone(),orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll}};""!=o&&null!=o&&"function"==typeof o&&o({pointes:i,originalCameraLocation:r})}},n._cesium.ScreenSpaceEventType.LEFT_CLICK),h.setInputAction(function(e){if(0!=a.shape.points.length){var t=d(e.endPosition);t&&(s[1]=t,a.shape.points[1]=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=n._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.west==a.shape.rect.east&&(a.shape.rect.east+=1e-6),a.shape.rect.south==a.shape.rect.north&&(a.shape.rect.north+=1e-6),a.shape.entity.rectangle.coordinates=a.shape.rect)}},n._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},e.prototype.executeExcavation=function(e){var a,s=this,l=this,u=[];s.shape={points:[],button:0,rect:null,entity:null};var c=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas),h=[];c.setInputAction(function(e){if(a=l._core.getPointFromWindowPoint(e.position,l._viewer),2<=s.shape.button){var t=s._viewer.scene.globe;s.shape.box=l._viewer.entities.add({position:l._cesium.Cartesian3.fromDegrees(h[0].lon,h[0].lat,100),box:{dimensions:new l._cesium.Cartesian3(1e4,1e4,1e4),material:l._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:l._cesium.Color.WHITE}}),t.depthTestAgainstTerrain=!0,t.clippingPlanes=new s._cesium.ClippingPlaneCollection({modelMatrix:s.shape.box.computeModelMatrix(l._cesium.JulianDate.now()),planes:[new l._cesium.Plane(new l._cesium.Cartesian3(1,0,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(-1,0,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(0,1,0),-700),new l._cesium.Plane(new l._cesium.Cartesian3(0,-1,0),-700)],edgeWidth:1,edgeColor:l._cesium.Color.WHITE}),c.removeInputAction(l._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.removeInputAction(l._cesium.ScreenSpaceEventType.LEFT_CLICK)}if(s.shape.button=s.shape.button+1,a)if(0==s.shape.points.length){u.push(a),s.shape.points.push(l._viewer.scene.globe.ellipsoid.cartesianToCartographic(a));var i=l._viewer.scene.camera.pickEllipsoid(movement.position,l._viewer.scene.globe.ellipsoid),r=l._cesium.Cartographic.fromCartesian(i),o=l._cesium.Math.toDegrees(r.longitude),n=l._cesium.Math.toDegrees(r.latitude);h.push({lon:o,lat:n}),s.shape.rect=l._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.east+=1e-6,s.shape.rect.north+=1e-6,s.shape.entity=l._viewer.entities.add({rectangle:{coordinates:s.shape.rect,material:l._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:l._cesium.Color.RED,height:0}}),s.bufferEntity=s.shape.entity,l.item=s.shape.entity}else 2==s.shape.points.length||(c.removeInputAction(l._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.removeInputAction(l._cesium.ScreenSpaceEventType.LEFT_CLICK))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){if(0!=s.shape.points.length){var t=l._core.getPointFromWindowPoint(e.endPosition,l._viewer);if(t){var i=l._viewer.camera.getPickRay(e.endPosition);l._viewer.scene.globe.pick(i,l._viewer.scene);u[1]=t,s.shape.points[1]=l._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),s.shape.rect=l._cesium.Rectangle.fromCartographicArray(s.shape.points),s.shape.rect.west==s.shape.rect.east&&(s.shape.rect.east+=1e-6),s.shape.rect.south==s.shape.rect.north&&(s.shape.rect.north+=1e-6),s.shape.entity.rectangle.coordinates=s.shape.rect}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var t=0;l._core.isnull(m.selectedItem)||"group"!=m.selectedItem.type||(t=m.selectedItem.id);var i=l._core.getuid(),r={id:i,name:"新建矩形"+i,pId:l._core.isnull(t)?0:t,type:"rectangle",item:l};return l.setTreeobj(r),m.insertGroupId(r,l._core.isnull(t)?0:t),"function"==typeof e&&e(ploylinejl),this},e.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),null!=this._viewEvent&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))},e.prototype.setVisibility=function(e){this.item.show=e},e.prototype.getVisibility=function(){return this.item.show},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setRectangleAlpha=function(e){try{this.item._rectangle.material.color._value.alpha=e,this.item._rectangle.show=!0}catch(e){console.log(e)}return this},e.prototype.setRectangleColor=function(e){try{this.item._rectangle.material.color=new d(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setDistanceDisplayCondition=function(e,t){var i=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=i}catch(e){console.log(e)}return this},e.prototype.setPolygonImage=function(e){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},e.prototype.setRectangleRepeat=function(e,t){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},e.prototype.setOutlineColor=function(e){try{this.item._rectangle.outlineColor=new d(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},e.prototype.setOutline=function(e){try{this.item._rectangle.outline=e}catch(e){console.log(e)}return this},e.prototype.setExtrudedHeight=function(e){try{this.item._rectangle.extrudedHeight=e}catch(e){console.log(e)}return this},e.prototype.setHeight=function(e){try{this.item._rectangle.height=e}catch(e){console.log(e)}return this},Object.defineProperties(e.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),e.prototype.setItem=function(e){this.item=e},Object.defineProperties(e.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(e.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(e.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(e.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(e.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(e.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(e.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}}),e}),define("SGWorld/Creator/Polygon",["../configData","./Color","../Core/Core","../Navigate/getPosition","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min"],function(b,c,i,r,d,e){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._Color=new c(this._viewer,this._cesium),this._core=new i,this._getPosition=new r(this._viewer,this._cesium),this._tree=d,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a"}return t.prototype.createPolygon=function(e,t,i,r,o){var n,a=[];if(e[0]instanceof Array){if(2===e[0].length){for(var s=0;si.length-1&&(s=0)),i[s]},!1),color:new this._cesium.CallbackProperty(function(){return n._cesium.Color.WHITE.withAlpha(l<15?.5+l/30:1.5-l/30)},!1),repeat:new n._cesium.Cartesian2(1,1)})}});var u={id:this.item.id,name:e,pId:0,type:"polygon",item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,0),this},t.prototype.createSector=function(e,t,T,i,r){var o,n={fillColor:this._cesium.Color.YELLOW.withAlpha(.5),outlineColor:this._cesium.Color.YELLOW},a=2*Math.PI/360*r,s=Math.sin(a)*t,l=function(e,t,i){var r={a:6378137,b:6356752.3142,f:1/298.257223563};function o(e){return e*Math.PI/180}function n(e){return 180*e/Math.PI}var a=r.a,s=r.b,l=r.f,u=1*e.lon,c=1*e.lat,h=i,d=o(t),m=Math.sin(d),p=Math.cos(d),g=(1-l)*Math.tan(o(c)),f=1/Math.sqrt(1+g*g),v=g*f,_=Math.atan2(g,p),y=f*m,C=1-y*y,w=C*(a*a-s*s)/(s*s),b=1+w/16384*(4096+w*(w*(320-175*w)-768)),E=w/1024*(256+w*(w*(74-47*w)-128)),S=h/(s*b),P=2*Math.PI;for(;1e-12'),e=document.getElementById("videoToolbar")}var n='';$(e).append(n);var p=document.getElementById("video"+m);p.style.transform="rotate("+t.angle+"deg)";var g=void 0;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+b.draw),this._tree.handler.setInputAction(function(e){var t=c._getPosition.getMousePosition(e);if(0==h.length&&h.push(t.clone()),h.push(t),2!==h.length||g||(g=c._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return h},!1),clampToGround:!0,material:new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW.withAlpha(.5)),width:3}})),3<=h.length&&!o)return g&&c._viewer.entities.remove(g),r=new c._cesium.PolygonHierarchy(h),void(o=new i(r));r=new c._cesium.PolygonHierarchy(h)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){if(0===h.length?d.showAt(e.endPosition,"左键开始绘制!"):h.length<=2?d.showAt(e.endPosition,"点击继续绘制!"):d.showAt(e.endPosition,"右键结束绘制!"),2<=h.length){var t=c._getPosition.getMousePosition(e);t&&(h.pop(),h.push(t),r=new c._cesium.PolygonHierarchy(h))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){c.end&&c.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(c._tree.endtemporaryItem(),c._tree.handler.destroy(),d.show(!1),c._core.mouse(c._viewer.container,0,"0"),u.end=void 0,g&&c._viewer.entities.remove(g),"cancel"===e||h.length<3)c.item&&c._viewer.entities.remove(c.item);else{p.play(),c.item.polygon.material=p;var t={polygon:{},positions:[],area:[]};t.polygon=c.item;for(var i=[],r=0;r'),n=document.getElementById("videoToolbar")}var a=this._core.getuid(),s='';$(n).append(s);var l=document.getElementById("video"+a);l.play();var u=this._core.defaultValue(t.heightReference,1),c=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"面贴视频",polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:l,color:Cesium.Color.fromCssColorString(c)}),heightReference:u,perPositionHeight:1!==u,stRotation:Cesium.Math.toRadians(t.angle||0),rotation:Cesium.Math.toRadians(t.rotation||0)}}),this},t.prototype.addVideoBox=function(e,t){var i,r;e instanceof Array?i=(r=this._cesium.Cartesian3).fromDegrees.apply(r,_toConsumableArray2(e)):e.x?i=this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z):e.lon&&(i=this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height));var o=document.getElementById("videoToolbar");if(!o){$(".cesium-viewer").append('
'),o=document.getElementById("videoToolbar")}var n=this._core.getuid(),a='';$(o).append(a);var s=document.getElementById("video"+n);s.play();var l=this._core.defaultValue(t.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"盒子贴视频",position:i,orientation:Cesium.Transforms.headingPitchRollQuaternion(i,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t.heading||0),Cesium.Math.toRadians(t.pitch||0),Cesium.Math.toRadians(t.roll||0))),box:{dimensions:new Cesium.Cartesian3(t.long||100,t.width||100,t.height||100),material:new Cesium.ImageMaterialProperty({image:s,color:Cesium.Color.fromCssColorString(l)})}}),this},t.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),0不允许出现交叉面!');if(Cesium.turf.lineIntersect(p,v).features.length){g=!1,x.innerHTML='不允许出现交叉面!';break}}else if(Cesium.turf.lineIntersect(m,v).features.length){g=!1,x.innerHTML='不允许出现交叉面!';break}}else if(Cesium.turf.lineIntersect(p,v).features.length){g=!1,x.innerHTML='不允许出现交叉面!';break}}if(!g)return;I.pop(),I.push(C),T=new P._cesium.PolygonHierarchy(I)}else T=new P._cesium.PolygonHierarchy(I),_=new w(T);y||(y=P._viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return I.concat([I[0]])},!1),clampToGround:!0,width:3}}),P._points.push(y))}}},P._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t=P._getPosition.getMousePosition(e);if(t)if(A){var i=P._cesium.Cartographic.fromCartesian(t);if(void 0===L)L=i.height;else if(void 0===M){if((M=i.height)不允许出现交叉面!');if(Cesium.turf.lineIntersect(f,y).features.length){v=!1,x.innerHTML='不允许出现交叉面!';break}}else if(Cesium.turf.lineIntersect(g,y).features.length){v=!1,x.innerHTML='不允许出现交叉面!';break}}else if(Cesium.turf.lineIntersect(f,y).features.length){v=!1,x.innerHTML='不允许出现交叉面!';break}}if(!v)return}r=I[I.length-2],o=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(r),n=Cesium.Math.toDegrees(o.latitude),a=Cesium.Math.toDegrees(o.longitude),l=P._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),u=Cesium.Math.toDegrees(l.latitude),c=Cesium.Math.toDegrees(l.longitude),h=Cesium.turf.lineString([[a,n],[c,u]]);O.push(h)}I.push(t),T=new P._cesium.PolygonHierarchy(I);var C=P._cesium.Cartographic.fromCartesian(I[I.length-1]),w=P._cesium.Math.toDegrees(C.longitude),b=P._cesium.Math.toDegrees(C.latitude),E=C.height;D.push({lon:w,lat:b,hei:E});var S=P._viewer.entities.add({name:"多边形",position:I[I.length-1],point:{pixelSize:5,color:P._cesium.Color.RED,outlineColor:P._cesium.Color.WHITE,outlineWidth:1,heightReference:P._cesium.HeightReference.CLAMP_TO_GROUND}});P._tree.temporaryItem.obj.push(S),R.label.push(S),P._points.push(S)}},P._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){A||I.length<=3||(x.show(!1),I.pop(),T=new P._cesium.PolygonHierarchy(I),n.pointSelect?A=!(M=L=void 0):N())},P._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){if(x.show(!1),P._core.mouse(P._viewer.container,0),P._tree.handler.destroy(),P._tree.endtemporaryItem(),P.end=void 0,"cancel"===e&&!i.waterTimer&&(P.item&&P._viewer.entities.remove(P.item),0this._0&&(r=this.baseurl2);var o=r.replace("{x}",e);return o=(o=(o=o.replace("{l}",t%8)).replace("{y}",t)).replace("{z}",i+1),Cesium.ImageryProvider.loadImage(this,o)},e}),define("SGWorld/Creator/BaiduImageryProvider",[],function(){"use strict";function e(e,t){this._viewer=e,this._cesium=t}var i=function(){function r(e,t){for(var i=0;ia.cacheMaxLevel?(s.show=!0,l.maximumTerrainLevel=u[1],l.show=!0):(s.show=!0,l.show=!1),u[0]>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=u[0],l.show=!0):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel)):(u>a.cacheMaxLevel?(s.show=!1,l.minimumTerrainLevel=u):(s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel),l.show=!0)}else s.show=!0,l.minimumTerrainLevel=a.cacheMaxLevel,l.show=!0;this.availability=s.availability;var c=null;s.show&&(c=new this._cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl(a.cacheUrl),fileExtension:a.fileExtension}),this.item=new this._cesium.ImageryLayer(c,s),this._viewer.imageryLayers.add(this.item,r)),this.items||(this.items=[]);var h=null;if(l.show)if(a.minimumLevel=l.minimumTerrainLevel|a.cacheMaxLevel,l.maximumTerrainLevel&&(a.maximumLevel=l.maximumTerrainLevel),h=new this._cesium.WebMapServiceImageryProvider(a),this.item){var d=this.items.push(new this._cesium.ImageryLayer(h,l));this._viewer.imageryLayers.add(this.items[d-1],r+1)}else this.item=new this._cesium.ImageryLayer(h,l),this._viewer.imageryLayers.add(this.item,r+1);!o&&this.setVisibility(!1),n&&"function"==typeof n&&n(this.item),this._core.isnull(a.id)&&(a.id=this._core.getuid());var m={id:a.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",checked:o,item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(i)?0:i),this},e.prototype.createPolylineImageryProviderer=function(e,t,i,r){var o=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),n=new this._cesium.WebMapTileServiceImageryProvider(o);this.item=this._viewer.imageryLayers.addImageryProvider(n),"function"==typeof r&&r(this.item),this._core.isnull(o.id)&&(o.id=this._core.getuid());var a={id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},e.prototype.createterrainProvider=function(e,t,i,r){var o=this._core.extend({url:""},t,!0),n=new this._cesium.CesiumTerrainProvider(o);this._viewer.terrainProvider=n,this.item=this._viewer.terrainProvider,"function"==typeof r&&r(dataSource),this._core.isnull(o.id)&&(o.id=this._core.getuid());var a={id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},e.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item.imageryProvider.url;return{type:"ImageryLayer",treeobj:{name:this.treeobj.name,type:this.treeobj.smtype},style:{show:e,url:t}}},e.prototype.setTreeobj=function(e){this.treeobj=e},e.prototype.getLevel=function(){var e,t,i=this._viewer.camera;try{if(i&&i.positionCartographic&&i.positionCartographic.height){var r=this._viewer.scene.globe.getHeight(i.positionCartographic);!r&&(r=0),e=i.positionCartographic.height-r,t=Math.round(80955.31/(1+Math.pow(e/91610.74,7096758e-11))-40467.74)}else t=0}catch(e){}return t},e.prototype.setVisibility=function(e){if(this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability),this.items)for(var t=0;t=s&&h.Level<=a&&!h.item.show?h.item.show=!0:(h.Levela)&&(h.item.show=!1))})),l.then(function(e){for(var t=(h.item=e).entities.values,i=0;i=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2this._upperLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);2=r-2})),e.sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return o._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=n;var a=[],s=0,l=0;e.forEach(function(i){var r="z"+i.level+"x"+i.x+"y"+i.y;if(a.push(r),o._tileKeys.push(r),!o._primitiveByTile[r]){var e=o._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level);s++,o._fetch(e).then(function(e){if(o._isRemoved)throw new Error("DISCARD");if(o._isCameraMoving)throw new Error("DISCARD");if(n!==o._moveEndTimestamp)throw new Error("DISCARD");var t=o._loadTile(e,i);o._primitiveCollection.add(t),o._primitiveByTile[r]=t,s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a))}).catch(function(e){s<=++l&&(o._tileKeys=a,o._removeObsoletePrimitives(o._primitiveByTile,a)),e.message})}})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level=v.level_min&&g.level=g.level_min&&m.levelr[m+1]?d:r[m+1],c=cr[m]?h:r[m];var p=this.GetPositionFromA_D(e.lat,e.lon,i,0);for(o=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,n=p[1]-e.lat,u.push({lon:e.lon,lat:e.lat}),(l={lon:e.lon,lat:e.lat}).lat+=n;l.lat<=d;l.lat+=n){for(a={lon:l.lon-o,lat:l.lat},s={lon:l.lon+o,lat:l.lat},this.IsInPolygon(l.lon,l.lat,r)&&u.push({lon:l.lon,lat:l.lat});a.lon>=c;a.lon-=o)this.IsInPolygon(a.lon,a.lat,r)&&u.push({lon:a.lon,lat:a.lat});for(;s.lon<=h;s.lon+=o)this.IsInPolygon(s.lon,s.lat,r)&&u.push({lon:s.lon,lat:s.lat})}return u},n.prototype.IsInPolygon=function(e,t,i){var r,o,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l=i&&e.x<=r&&e.y>=o&&e.y<=n}catch(e){return!1}},e.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},e.prototype._loadTile=function(e,t){var l=[],u=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),c=this;return e.features.forEach(function(e){if(c._propertyToBeFiltered&&Array.isArray(c._valuesToBeFiltered)){var t=e.properties[c._propertyToBeFiltered];if(c._valuesToBeFiltered.includes(t))return}var i=e.geometry.type;if("Polygon"===i||"MultiPolygon"===i){var s=[];c.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){s.push([]),e.forEach(function(e){var t;2this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),t=[]),2=n-2})),t.sort(function(e,t){return-(e.level-t.level)}),t=t.filter(function(e){return i._isTileInRange(e)}),this._upperLevelLimit&&(t=this._refineTiles(t,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=e,this._viewer.scene.primitives.remove(this.dx),this.dx={},this._primitiveByTile={};var a=[],s=0,l=this._viewer.camera.computeViewRectangle(),u=this._radianToDegree(l.west),c=this._radianToDegree(l.south),h=this._radianToDegree(l.east),d=this._radianToDegree(l.north);this.UrlData.area="RECT("+u+" "+c+","+h+" "+d+")";var m="";o<=this.minLevel1||"Infinity"==o?(this.cluster="city",this.UrlData.cluster=this.cluster,m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):o>this.minLevel1&&this.minLevel3>o?(this.cluster="county",this.UrlData.cluster=this.cluster,m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):o>=this.minLevel3&&(this.cluster="",m=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&callback="+this.UrlData.callback),i._fetch(m).then(function(e){var t=i._loadTile(e,i.cluster);i._primitiveCollection=t,0<=++s&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a))}).catch(function(e){0<=++s&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a)),e.message})}},e.prototype._refineTiles=function(e,c){var h=[],d=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level\n
'+_.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),h=document.getElementById(e.id)),e.description?h.style.transform="matrix(1, 0, 0, 1, "+d.x+", "+(d.y-157)+")":h.style.transform="matrix(1, 0, 0, 1, "+d.x+", "+(d.y-134)+")"}p&&(f||_.setVisibility(!1),p=!1)},"function"==typeof v&&v(e)}),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");var o={id:g.id,name:e,checked:f,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:g};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,l,i,u,r){var o={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this,n=new h(this._viewer,this._cesium,o);(this._Provider=n)._loadTile=function(e){var r,o,n,a=new c._cesium.PointPrimitiveCollection;c.optiontext=[],e.features.forEach(function(e){var t=options.pointHeight;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)+t),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var i=options.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}if(l.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(l.text)&&/\]$/.test(l.text)){var r=l.text.replace(/\[/,"").replace(/\]/,"");l.text=e.properties[r]}var o="DivPoint"+c._core.getuid();a.add({id:o,position:Cartesian3,color:c._cesium.Color.YELLOW,description:l.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(a);var s=!0;return c.pointPrimitive.update=function(){for(var e,t,i=0;i\n
'+c.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}s&&(u||c.setVisibility(!1),s=!1)},c.item=a,""},n.addTo(this._viewer),u||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var a={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:l};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},t.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,s,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this;s.material;l._core.isnull(s)||l._core.isnull(s.color)||/^\[/.test(s.color)&&"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(l._core.isHtmlColor(s.color)?s.color=l._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=l._color.rgbaStringToRgbaObj(s.color)),1=r.level_min&&i.level=u.level_min&&l.level=p.level_min&&a.levelt.maxCol||a.xt.maxRow||a.y=d.level_min&&r.level","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.fillColor=a.Value,m._core.isHtmlColor(h.fillColor)?h.fillColor=m._color.colorFromHtmlColor(h.fillColor):(/^rgb/.test(h.fillColor)&&(h.fillColor=m._color.rgbaStringToRgbaObj(h.fillColor)),1","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.outlineColor=s.Value,m._core.isHtmlColor(h.outlineColor)?h.outlineColor=m._color.colorFromHtmlColor(h.outlineColor):(/^rgb/.test(h.outlineColor)&&(h.outlineColor=m._color.rgbaStringToRgbaObj(h.outlineColor)),1","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.backgroundColor=getSGColor(s.Value),m._core.isHtmlColor(h.backgroundColor)?h.backgroundColor=m._color.colorFromHtmlColor(h.backgroundColor):(/^rgb/.test(h.backgroundColor)&&(h.backgroundColor=m._color.rgbaStringToRgbaObj(h.backgroundColor)),1","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]&&(h.scale=a.Value)}else d.scale&&"{}"!=d.scale.Class.toString()?h.scale=d.scale.Value:d.scale&&"[object Object]"!=d.scale.toString()&&"{}"!=d.scale.toString()&&(h.scale=d.scale);if(/^\[/.test(d.text)&&/\]$/.test(d.text)||d.textTe)if(d.textTe)if(d.text.Class instanceof Object){var n=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[n]}else if(d.text&&d.text.Class&&"{}"!=d.text.Class.toString()){r=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else{r=d.text.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else if(d.text&&"[object Object]"!=d.text.toString()&&"{}"!=d.text.toString())h.text=d.text;else{r=d.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.text=e.properties[r]}else d.text&&"[object Object]"!=d.text.toString()&&"{}"!=d.text.toString()&&(h.text=d.text);if(h.labelData&&(h=m._core.extend(h,h.labelData,!0)),h.verticalOrigin=Cesium.VerticalOrigin.CENTER,h.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,u&&u.add(h),d.image&&d.image.Class instanceof Array)for(o=0;o","").split("="))[0]=s[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s[1]=s[1].replace(/\"/,"").replace(/\"/,""),e.properties[s[0]]==s[1]){h.image=a.Value;break}}else if(d.image&&d.image.Class&&"{}"!=d.image.Class.toString()){r=d.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");h.image=e.properties[r]}else d.image&&"[object Object]"!=d.image.toString()&&"{}"!=d.image.toString()&&(h.image=d.image);var l=p.cloneDeep(h);l.verticalOrigin=Cesium.VerticalOrigin.CENTER,l.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,c&&c.add(l)}),0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t||(c||u),r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)},error:function(){r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;d&&d.time&&(this._Provider._availability=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:d.time.start?m._cesium.JulianDate.fromDate(new Date(d.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?m._cesium.JulianDate.fromDate(new Date(d.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d};return this._Provider.treeID=d.id,this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,m,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},a=this,p=(m.material,{show:!0,position:a._cesium.Cartesian3.ZERO,pixelOffset:a._cesium.Cartesian2.ZERO,eyeOffset:a._cesium.Cartesian3.ZERO,heightReference:a._cesium.HeightReference.NONE,horizontalOrigin:a._cesium.HorizontalOrigin.CENTER,verticalOrigin:a._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:a._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:a._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0});m.width&&(p.width=m.width),m.height&&(p.height=m.height),m.image&&(p.image=m.image),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams);var s=t.url+"?"+this._core._serialize(n.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(h,d){if(d.state===Cesium.QuadtreeTileLoadState.START){if(d.data={lines:[],geometryPrimitive:void 0},!(d.level>=m.level_min&&d.level<=m.level_max&&a.item.show))return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);var e=s.replace(window.encodeURIComponent("{x}"),d.x).replace(window.encodeURIComponent("{y}"),d.y).replace(window.encodeURIComponent("{z}"),d.level);a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return d.state=Cesium.QuadtreeTileLoadState.DONE,void(d.renderable=!0);var t;if(d.level==parseInt(m.level_max)-1)"function"==typeof initSXTData&&(t=initSXTData(e));else{t=new Cesium.BillboardCollection;var i=!0,r=!1,o=void 0;try{for(var n,a=e.features[Symbol.iterator]();!(i=(n=a.next()).done);i=!0){var s=n.value,l=s.geometry.coordinates[0],u=s.geometry.coordinates[1],c=m.pointHeight?parseFloat(m.pointHeight):0;p.position=Cesium.Cartesian3.fromDegrees(l,u,c),t.add(p)}}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}}0==e.features.length&&(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0),d.data.geometryPrimitive=t,d.state=Cesium.QuadtreeTileLoadState.LOADING,d.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof d.data.geometryPrimitive.update?(d.data.geometryPrimitive.update(h,[]),d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0):(d.data.geometryPrimitive.destroy=function(){},d.data.geometryPrimitive.update=function(){})},error:function(){null==d.count&&(d.count=0),d.count+=1,2<=d.count?(d.state=Cesium.QuadtreeTileLoadState.DONE,d.renderable=!0):d.state=Cesium.QuadtreeTileLoadState.START}}),d.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;m&&m.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:m.time.start?a._cesium.JulianDate.fromDate(new Date(m.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?a._cesium.JulianDate.fromDate(new Date(m.time.end)):a._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:m};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},t.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,o,i,r,n,a){var s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},l=this,u=(o.material,{show:!0,position:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,eyeOffset:l._cesium.Cartesian3.ZERO,heightReference:l._cesium.HeightReference.NONE,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:l._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:l._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0});o.width&&(u.width=o.width),o.height&&(u.height=o.height),o.image&&(u.image=o.image),this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams);var c=t.url+"?"+this._core._serialize(s.urlParams);this._Provider=new g(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(o.height)||0,this._Provider.loadTile=function(i,r){if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=o.level_min&&r.level<=o.level_max&&l.item.show))return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);var t;"function"==typeof n&&(t=n(e)),0==e.features.length&&(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0),r.data.geometryPrimitive=t,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof r.data.geometryPrimitive.update?(r.data.geometryPrimitive.update(i,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):(r.data.geometryPrimitive.destroy=function(){},r.data.geometryPrimitive.update=function(){})},error:function(){null==r.count&&(r.count=0),r.count+=1,2<=r.count?(r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0):r.state=Cesium.QuadtreeTileLoadState.START}}),r.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var h=this._viewer.scene,d=h.primitives;o&&o.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:o.time.start?l._cesium.JulianDate.fromDate(new Date(o.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?l._cesium.JulianDate.fromDate(new Date(o.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),d.add(this._primitive),h.primitivesQuadTrees&&h.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(o.id)&&(o.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+o.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var m={id:o.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(m),this._tree.insertGroupId(m,this._core.isnull(i)?0:i),"function"==typeof a&&a(this.item),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,f,i,v,_){null==t&&console.log("geojson is required");var r=this._cesium.GeoJsonDataSource.load(t);this._viewer.dataSources.add(r);var y=this,C=new this._cesium.PointPrimitiveCollection;y.optiontext=[],r.then(function(e){for(var t,i=(y.item=e).entities.values,r=0;r\n
'+y.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),d=document.getElementById(e.id)),e.description?d.style.transform="matrix(1, 0, 0, 1, "+m.x+", "+(m.y-157)+")":d.style.transform="matrix(1, 0, 0, 1, "+m.x+", "+(m.y-134)+")",d&&(d.style.display=y.pointPrimitive.show?"block":"none")}g&&(v||y.setVisibility(!1),g=!1)},"function"==typeof _&&_(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本");var o={id:f.id,name:e,checked:v,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:f};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},t.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,l,i,u,r){var o={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this,n=new s(this._viewer,this._cesium,o);(this._Provider=n)._loadTile=function(e){var r,o,n,a=new c._cesium.PointPrimitiveCollection;c.optiontext=[],e.features.forEach(function(e){var t=options.pointHeight;if(null!=e.properties.height&&(t=parseFloat(e.properties.height)+t),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var i=options.pointHeight.replace(/\[/,"").replace(/\]/,"");t=parseFloat(e.properties[i])}if(l.position=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),/^\[/.test(l.text)&&/\]$/.test(l.text)){var r=l.text.replace(/\[/,"").replace(/\]/,"");l.text=e.properties[r]}var o="DivPoint"+c._core.getuid();a.add({id:o,position:Cartesian3,color:c._cesium.Color.YELLOW,description:l.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(a);var s=!0;return c.pointPrimitive.update=function(){for(var e,t,i=0;i\n
'+c.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),r=document.getElementById(e.id)),e.description?r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-157)+")":r.style.transform="matrix(1, 0, 0, 1, "+o.x+", "+(o.y-134)+")"}s&&(u||c.setVisibility(!1),s=!1)},c.item=a,""},n.addTo(this._viewer),u||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var a={id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:l};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},t.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,u,i,r,o){var n={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=this;u.material;c._core.isnull(u)||c._core.isnull(u.color)||/^\[/.test(u.color)&&"["==u.color.toString().charAt(0)&&"]"==u.color.toString().charAt(u.color.length-1)||(c._core.isHtmlColor(u.color)?u.color=c._color.colorFromHtmlColor(u.color):(/^rgb/.test(u.color)&&(u.color=c._color.rgbaStringToRgbaObj(u.color)),1=u.level_min&&l.level=u.level_min&&l.levelu.Level&&!u.show?u.show=!0:c.Level=t.west*Cesium.Math.DEGREES_PER_RADIAN&&e.east<=t.east*Cesium.Math.DEGREES_PER_RADIAN&&e.south>=t.south*Cesium.Math.DEGREES_PER_RADIAN&&e.north<=t.north*Cesium.Math.DEGREES_PER_RADIAN},t.prototype.isT_Intersects_E=function(e,t){var i=e.west*Cesium.Math.RADIANS_PER_DEGREE,r=e.east*Cesium.Math.RADIANS_PER_DEGREE,o=e.south*Cesium.Math.RADIANS_PER_DEGREE,n=e.north*Cesium.Math.RADIANS_PER_DEGREE,a=new Cesium.Rectangle(i,o,r,n);return Cesium.Rectangle.intersection(a,t,new Cesium.Rectangle)},t.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";var r=(e+t+i)%this._subdomains.length;return this._subdomains[r]},t.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==w.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},t.prototype.findDirectParent=function(e,t){var i=function e(t,i,r){var o=r?4.1:2.1;if(t._rectangle.width<=i.width*o&&Cesium.Rectangle.contains(t._rectangle,Cesium.Rectangle.center(i)))return t;for(var n=t.children.length,a=0;a=_-y&&t._buffer[a]<=_+y?e._buffer[a]:t._buffer[a]*m+p:t._buffer[a]?t._buffer[a]*m+p:e._buffer[a];return this.arrayToHeightmapTerrainData(C,33,33,15)},t.prototype.requestTileHeightBuffer=function(u,c,h,e,t,r){if(!isNaN(u+c+h)){Cesium.defined(e)&&!1!==e||(e=new Cesium.Request({defer:!0}));var i=0==e.defer;t=Cesium.defaultValue(i,!1);var o,d=Cesium.when.defer();if(void 0!==r)r.getUrlFromSTag=function(e,t,i){return void 0===r.subdomains?r.url:r.subdomains[0]+"/SG"},o=this.getRequestElevationLayer(u,c,h).replace(this._options.url,r.getUrlFromSTag(u,c,h)+"/Elevation").replace(this._options.layerName,r.name),"mpt"===r.format&&(o=o.replace("image/png","image/mpt"));else{o=this.getRequestBaseTerrainUrl(u,c,h,i||t);var m=w.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),n=w.terrainProvider._modifyTerrainObjects,a=Cesium.when.defer();if(void 0!==n){var s=[];if(n.forEach(function(e){e.show&&null!=Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&s.push(e)}),0s[0].modelFloorBestLevel)a.resolve("NoMerge");else{var l=b(s,m);Cesium.when(l,function(e){a.resolve(e)}).otherwise(function(e){console.log(e)})}else a.resolve("NoMerge")}else a.resolve("NoMerge");var p=Cesium.when.defer(),g=$.grep([],function(e){return 0g[0].level)p.resolve("NoFloor");else{var f=!1;g.forEach(function(e){if(e.ready&&e.show&&void 0!==e.rootFloorRectangle&&void 0!==Cesium.Rectangle.intersection(m,e.rootFloorRectangle)){for(var t,i=new Uint16Array(1024),r=m.west,o=(m.south,(m.east-m.west)/32),n=(m.north-m.south)/32,a=0;a<32;a++)for(var s=0;s<32;s++){var l=r+o*s+o/2,u=m.north-n*a-n/2,c=new Cesium.Cartographic(l,u);t=65535;var h=e.getHRMTFP(e,c,!0);null!=h&&h.content&&h.content._model&&h.content._model.floor&&(t=h.content._model.floor.getHeight(c.longitude,c.latitude)),65535!==t&&(t+=1.5),i[32*a+s]=t}f=!0,p.resolve(i)}}),f||p.resolve("NoFloor")}w.scene.globe.ellipsoid}if(!1===this._requestsCache.hasOwnProperty(o)){if(this._requestsCache[o]={},this._requestsCacheKeys.push(o),100u&&(u=e[g]),e[g]u&&(u=e[g]),e[g]=a&&t.level=T.level_min&&P.level=parseFloat(T.level_max)-8&&19=parseFloat(T.level_max)-4&&16=parseFloat(T.level_max)-4){v=I.shape;y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}else{v="";var C={positions:I.position,width:1,vertexFormat:x._cesium.PolylineColorAppearance.VERTEX_FORMAT,colors:u};_=new x._cesium.PolylineGeometry(C),!1}else{v=I.shape;y={polylinePositions:I.position,shapePositions:v,cornerType:I.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};_=new x._cesium.PolylineVolumeGeometry(y)}var w=new x._cesium.GeometryInstance({id:a,geometry:_,attributes:{color:new x._cesium.ColorGeometryInstanceAttribute.fromColor(I.material)}});""==v&&(w=new x._cesium.GeometryInstance({id:a,geometry:_})),o.push(w)}var b="material:"+255*I.material.red+","+255*I.material.green+","+255*I.material.blue;x.Legend.push(b),0==o.length&&(P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0);var E=null;E=""==v?new x._cesium.Primitive({appearance:new x._cesium.PolylineColorAppearance,geometryInstances:o}):new x._cesium.Primitive({allowPicking:!0,appearance:new x._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:x._core.Shaders("vertexShaderSource"),fragmentShaderSource:x._core.Shaders("fragmentShaderSource")}),shadows:I.shadows,geometryInstances:o}),P.data.geometryPrimitive=E,P.state=Cesium.QuadtreeTileLoadState.LOADING,P.state===Cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive.update(S,[]),P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0)},error:function(){null==P.count&&(P.count=0),P.count+=1,2<=P.count?(P.state=Cesium.QuadtreeTileLoadState.DONE,P.renderable=!0):P.state=Cesium.QuadtreeTileLoadState.START}}),P.state=Cesium.QuadtreeTileLoadState.LOADING}}(e,t,n)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var c=this._viewer.scene,h=c.primitives;T&&T.time&&(this._Provider._availability=new n._cesium.TimeIntervalCollection([new n._cesium.TimeInterval({start:T.time.start?n._cesium.JulianDate.fromDate(new Date(T.time.start)):n._cesium.Iso8601.MINIMUM_VALUE,stop:T.time.end?n._cesium.JulianDate.fromDate(new Date(T.time.end)):n._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),h.add(this._primitive),c.primitivesQuadTrees&&c.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(I.id)&&(I.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+I.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var d={id:I.id,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:T};return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this};var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};return t.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},t.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,h,i,r,o){var n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(h)||this._core.isnull(h.material)||"["==h.material.toString().charAt(0)&&"]"==h.material.toString().charAt(h.material.length-1)||(this._core.isHtmlColor(h.material)?h.material=this._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=this._color.rgbaStringToRgbaObj(h.material)),1=h.level_min&&t.level=o.level_min&&t.level=s.level_min&&t.level=h.tilesLength&&(h.returnCount=0,h.tilesLength=0,h.Primitivekey=[])},error:function(){l=v.remove(l,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(e,t){n.state=h._cesium.QuadtreeTileLoadState.LOADING,n.state===h._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&(n.state=h._cesium.QuadtreeTileLoadState.DONE),n.renderable=!0)}}))}var n,a},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var u={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s};this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},t.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,o,i,r,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(o)||this._core.isnull(o.material)||"["==o.material.toString().charAt(0)&&"]"==o.material.toString().charAt(o.material.length-1)||(this._core.isHtmlColor(o.material)?o.material=this._color.colorFromHtmlColor(o.material):(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1=o.level_min&&t.level=o.level_min&&t.level=a&&t.levelr[m+1]?d:r[m+1],c=cr[m]?h:r[m];var p=this.GetPositionFromA_D(e.lat,e.lon,i,0);for(o=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,n=p[1]-e.lat,u.push({lon:e.lon,lat:e.lat}),(l={lon:e.lon,lat:e.lat}).lat+=n;l.lat<=d;l.lat+=n){for(a={lon:l.lon-o,lat:l.lat},s={lon:l.lon+o,lat:l.lat},this.IsInPolygon(l.lon,l.lat,r)&&u.push({lon:l.lon,lat:l.lat});a.lon>=c;a.lon-=o)this.IsInPolygon(a.lon,a.lat,r)&&u.push({lon:a.lon,lat:a.lat});for(;s.lon<=h;s.lon+=o)this.IsInPolygon(s.lon,s.lat,r)&&u.push({lon:s.lon,lat:s.lat})}return u},t.prototype.GetPositionFromA_D=function(e,t,i,r){var o=i*Math.sin(r*Math.PI/180),n=i*Math.cos(r*Math.PI/180),a=6356725+21412*(90-e)/90;return[180*(o/(a*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(n/a+e*Math.PI/180)/Math.PI]},t.prototype.IsInPolygon=function(e,t,i){var r,o,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;lMath.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),o=e.num&&50Math.abs(e.pt1.lat-e.pt2.lat)){var u=(e.pt2.lat-e.pt1.lat)/o;0>1,c=-7,h=i?o-1:0,d=i?-1:1,m=e[t+h];for(h+=d,n=m&(1<<-c)-1,m>>=-c,c+=s;0>=-c,c+=r;0>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:n-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+h?d/l:d*Math.pow(2,1-h))*l&&(a++,l/=2),c<=a+h?(s=0,a=c):1<=a+h?(s=(t*l-1)*Math.pow(2,o),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,o),a=0));8<=o;e[i+m]=255&s,m+=p,s/=256,o-=8);for(a=a<>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var o=i.pos-1;e<=o;o--)i.buf[o+r]=i.buf[o]}function l(e,t){for(var i=0;i>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function y(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}return r.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos>3,n=this.pos;this.type=7&r,e(o,t,this),this.pos===n&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=y(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=v(this.buf,this.pos)+v(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=v(this.buf,this.pos)+y(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,o,n=i.buf;if(o=n[i.pos++],r=(112&o)>>4,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<3,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<10,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<17,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(127&o)<<24,o<128)return a(e,r,t);if(o=n[i.pos++],r|=(1&o)<<31,o<128)return a(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){var r="",o=t;for(;o>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),o+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=n(this);for(e=e||[];this.pos>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos++]=127&o|128,o>>>=7,n.buf[n.pos]=127&o,function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t);var o,n}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(127>>=7)|(127>>=7)|(127>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,o,n=0;n>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;128<=i&&s(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),t.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),t.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(i))}function r(e,t,i){if(3===e){var r=new o(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}return u.prototype={clone:function(){return new u(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,o=i*this.x+t*this.y;return this.x=r,this.y=o,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),o=t.x+i*(this.x-t.x)-r*(this.y-t.y),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=o,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},u.convert=function(e){return e instanceof u?e:Array.isArray(e)?new u(e[0],e[1]):e},p.types=["Unknown","Point","LineString","Polygon"],p.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,r=1,o=0,n=0,a=0,s=[];e.pos>3}if(o--,1===r||2===r)n+=e.readSVarint(),a+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new u(n,a));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},p.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,o=0,n=0,a=1/0,s=-1/0,l=1/0,u=-1/0;e.pos>3}if(r--,1===i||2===i)(o+=e.readSVarint())=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new p(this._pbf,t,this.extent,this._keys,this._values)},function(e,t){this.layers=e.readFields(r,{},t)}}),define("SGWorld/Creator/PolygonVectorTileLayerArcgis",["../Core/Core","./Color","../ProjectTree/treeSource","../../../node_modules/lodash/lodash.min","../Core/jquery","../VectorTileProvider/VectorTileProvider","../VectorTileProvider/GeoJSONVectorTileProvider","../Core/pbf-dev","../Core/vectortile"],function(i,r,o,p,e,l,u,I,D){"use strict";function t(e,t){this._viewer=e,this._cesium=t,this._core=new i,this._color=new r(this._viewer,this._cesium),this._tree=o,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.labelCollections=new this._cesium.PointPrimitiveCollection,this.geometries_line=[],this.geometries_polygon=[]}var n="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)};return t.prototype._serialize=function(e){var t=[],i=window.encodeURIComponent;for(var r in e){var o=e[r];"object"===(void 0===o?"undefined":n(o))?t.push(i(r)+"="+i(JSON.stringify(o))):t.push(i(r)+"="+i(e[r]))}return t.join("&")},t.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,x,i,r){var o={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium;this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},this._core.isnull(x)||this._core.isnull(x.fill)||"["==x.fill.toString().charAt(0)&&"]"==x.fill.toString().charAt(x.fill.length-1)||(this._core.isHtmlColor(x.fill)?x.fill=this._color.colorFromHtmlColor(x.fill):(/^rgb/.test(x.fill)&&(x.fill=this._color.rgbaStringToRgbaObj(x.fill)),1=r.level_min&&t.levelthis.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",e)},e.prototype.setRotation=function(e){return this.setAttribute("rotation",e)},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},e.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},e.prototype.getRotation=function(){return this.getAttribute("rotation")},e.prototype.getGeometry=function(){if(Cesium.defined(this.center)&&Cesium.defined(this.semiMajorAxis)&&Cesium.defined(this.semiMinorAxis))return new Cesium.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new Cesium.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},e}(),g.PolylinePrimitive=function(){function e(e){e=w(e,c),this.initialiseOptions(e)}return(e.prototype=new r).setPositions=function(e){this.setAttribute("positions",e)},e.prototype.setWidth=function(e){this.setAttribute("width",e)},e.prototype.setGeodesic=function(e){this.setAttribute("geodesic",e)},e.prototype.getPositions=function(){return this.getAttribute("positions")},e.prototype.getWidth=function(){return this.getAttribute("width")},e.prototype.getGeodesic=function(e){return this.getAttribute("geodesic")},e.prototype.getGeometry=function(){if(Cesium.defined(this.positions)&&!(this.positions.length<2))return new Cesium.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},e}();var m={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0},f={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0},v={iconUrl:"static/bj/dragIcon.png",shiftX:0,shiftY:0};function _(e){return p.cartographicArrayToCartesianArray([Cesium.Rectangle.northwest(e),Cesium.Rectangle.northeast(e),Cesium.Rectangle.southeast(e),Cesium.Rectangle.southwest(e)])}function y(e,t){var i=new Cesium.Rectangle;i.west=Math.min(e.longitude,t.longitude),i.east=Math.max(e.longitude,t.longitude),i.south=Math.min(e.latitude,t.latitude),i.north=Math.max(e.latitude,t.latitude);var r=Cesium.Math.EPSILON7;return i.east-i.west点击添加标记 位置是:

"+((t=p.cartesianToCartographic(o)).longitude.toFixed(i||3)+", "+t.latitude.toFixed(i||3))):a.showAt(r,"

点击添加标记

")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingPolygon=function(e){e=w(e,d);this.startDrawingPolyshape(!0,e)},g.prototype.startDrawingPolyline=function(e){e=w(e,c);this.startDrawingPolyshape(!1,e)},g.prototype.startDrawingPolyshape=function(e,i){this.startDrawing(function(){t.remove(r),u.remove(),c.destroy(),a.setVisible(!1)});var r,o=this,n=this._scene,t=n.primitives,a=this._tooltip,s=e?3:2;(r=e?new h.PolygonPrimitive(i):new h.PolylinePrimitive(i)).asynchronous=!1,t.add(r);var l=[],u=new g.BillboardGroup(this,m),c=new Cesium.ScreenSpaceEventHandler(n.canvas);c.setInputAction(function(e){if(null!=e.position){var t=n.camera.pickEllipsoid(e.position,p);t&&(0==l.length&&(l.push(t.clone()),u.addBillboard(l[0]),o._viewer.camera&&(o._cameraPosition=o._viewer.camera.position,o._cameraHeading=o._viewer.camera.heading,o._cameraPitch=o._viewer.camera.pitch,o._cameraRoll=o._viewer.camera.roll)),l.length>=s&&(r.positions=l,r._createPrimitive=!0),l.push(t),u.addBillboard(t))}},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(0==l.length)a.showAt(t,"

添加第一个点

");else{var i=n.camera.pickEllipsoid(t,p);i&&(l.pop(),i.y+=1+Math.random(),l.push(i),l.length>=s&&(r.positions=l,r._createPrimitive=!0),u.getBillboard(l.length-1).position=i,a.showAt(t,"

添加一个新的坐标点 ("+l.length+")

"+(l.length>s?"

双击完成多边形绘制

":"")))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){var t=e.position;if(null!=t){if(l.length点击添加矩形坐标点

");else{var i=o.camera.pickEllipsoid(t,p);if(i)c(y(s,p.cartesianToCartographic(i))),a.showAt(t,"

拖动改变矩形大小

点击完成矩形绘制

")}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.startDrawingCircle=function(i){i=w(i,d);this.startDrawing(function(){null!=s&&n.remove(s),e.remove(),t.destroy(),a.setVisible(!1)});var r=this,o=this._scene,n=this._scene.primitives,a=this._tooltip,s=null,e=null,t=new Cesium.ScreenSpaceEventHandler(o.canvas);t.setInputAction(function(e){if(null!=e.position){var t=o.camera.pickEllipsoid(e.position,p);t&&(null==s?(s=new g.CirclePrimitive({center:t,radius:0,asynchronous:!1,material:i.material}),n.add(s)):("function"==typeof i.callback&&i.callback(s.getCenter(),s.getRadius()),r.stopDrawing()))}},Cesium.ScreenSpaceEventType.LEFT_DOWN),t.setInputAction(function(e){var t=e.endPosition;if(null!=t)if(null==s)a.showAt(t,"

添加圆心点

");else{var i=o.camera.pickEllipsoid(t,p);i&&s.setRadius(Cesium.Cartesian3.distance(s.getCenter(),i))}},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},g.prototype.enhancePrimitives=function(){var m=this;function e(e){m._scene;this._highlighted&&this._highlighted==e||!0!==this._editMode&&((this._highlighted=e)?(m.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(Cesium.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function i(e){if(this._editMode!=e)if(m.disableAllHighlights(),e){m.setEdited(this);var i=m._scene,r=this;if(null==this._markers){var o=new g.BillboardGroup(m,f),n=new g.BillboardGroup(m,v),a={dragHandlers:{onDrag:function(e,t){r.positions[e]=t,h(e,r.positions),r._createPrimitive=!0},onDragEnd:function(e,t){r._createPrimitive=!0,d()}},onDoubleClick:function(e){r.positions.length<4||(r.positions.splice(e,1),r._createPrimitive=!0,o.removeBillboard(e),n.removeBillboard(e),h(e,r.positions),d())},tooltip:function(){if(3e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]e[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}t.exports=function(e,t){var i=l.getCoord(e),r=t.geometry.coordinates;"Polygon"===t.geometry.type&&(r=[r]);for(var o=0,n=!1;o line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var o=i[0][0],n=i[0][1],a=i[1][0],s=i[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-o)-(c-l)*(s-n),m=(c-l)*(n-u)-(h-u)*(o-l),p=(a-o)*(n-u)-(s-n)*(o-l);if(0===d)return null;var g=m/d,f=p/d;return 0<=g&&g<=1&&0<=f&&f<=1?_([o+g*(a-o),n+g*(s-n)]):null}t.exports=function(e,t){var r=[];if("LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=u(e,t);return i&&r.push(i),s(r)}var o=a();return o.load(n(t)),l(n(e),function(i){l(o.search(i),function(e){var t=u(i,e);t&&r.push(t)})}),s(r)}},{"@turf/helpers":18,"@turf/invariant":19,"@turf/line-segment":22,"@turf/meta":20,"geojson-rbush":41}],18:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],19:[function(e,t,i){arguments[4][5][0].apply(i,arguments)},{dup:5}],20:[function(e,t,i){function _(e,t,i){var r,o,n,a,s,l,u,c,h,d,m=0,p=0,g="FeatureCollection"===e.type,f="Feature"===e.type,v=g?e.features.length:1;for(r=0;r>31;return(e^t)-t},i.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=i=(15<(e>>>=i))<<2,(t|=i=(3<(e>>>=i))<<1)|(e>>>=i)>>1},i.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},i.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},i.countTrailingZeros=r,i.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},i.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},i.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var o=new Array(256);!function(e){for(var t=0;t<256;++t){var i=t,r=t,o=7;for(i>>>=1;i;i>>>=1)r<<=1,r|=1&i,--o;e[t]=r<>>8&255]<<16|o[e>>>16&255]<<8|o[e>>>24&255]},i.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},i.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},i.interleave3=function(e,t,i){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|i<<8))|i<<4))|i<<2))<<2},i.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},i.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},{}],37:[function(e,t,i){"use strict";var r=e("./lib/ch1d"),o=e("./lib/ch2d"),n=e("./lib/chnd");t.exports=function(e){var t=e.length;{if(0===t)return[];if(1===t)return[[0]]}var i=e[0].length;{if(0===i)return[];if(1===i)return r(e);if(2===i)return o(e)}return n(e,i)}},{"./lib/ch1d":38,"./lib/ch2d":39,"./lib/chnd":40}],38:[function(e,t,i){"use strict";t.exports=function(e){for(var t=0,i=0,r=1;re[i][0]&&(i=r);return t=t[l]&&(s+=1);n[a]=s}}return e}(n,r)}};var a=e("incremental-convex-hull"),s=e("affine-hull")},{"affine-hull":35,"incremental-convex-hull":42}],41:[function(e,t,i){var r=e("@turf/bbox"),o=e("@turf/helpers").featureCollection,n=e("@turf/meta").featureEach,a=e("rbush");t.exports=function(e){var t=a(e);return t.insert=function(e){return e.bbox=e.bbox?e.bbox:r(e),a.prototype.insert.call(this,e)},t.load=function(e){var t=[];return n(e,function(e){e.bbox=e.bbox?e.bbox:r(e),t.push(e)}),a.prototype.load.call(this,t)},t.remove=function(e){return a.prototype.remove.call(this,e)},t.clear=function(){return a.prototype.clear.call(this)},t.search=function(e){var t=a.prototype.search.call(this,this.toBBox(e));return o(t)},t.collides=function(e){return a.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=a.prototype.all.call(this);return o(e)},t.toJSON=function(){return a.prototype.toJSON.call(this)},t.fromJSON=function(e){return a.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t=e.bbox?e.bbox:r(e);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}},{"@turf/bbox":6,"@turf/helpers":14,"@turf/meta":28,rbush:47}],42:[function(e,t,i){"use strict";t.exports=function(e,t){var i=e.length;if(0===i)throw new Error("Must have at least d+1 points");var r=e[0].length;if(i<=r)throw new Error("Must input at least d+1 points");var o=e.slice(0,r+1),n=C.apply(void 0,o);if(0===n)throw new Error("Input not in general position");for(var a=new Array(r+1),s=0;s<=r;++s)a[s]=s;n<0&&(a[0]=1,a[1]=0);for(var l=new A(a,new Array(r+1),!1),u=l.adjacent,c=new Array(r+2),s=0;s<=r;++s){for(var h=a.slice(),d=0;d<=r;++d)d===s&&(h[d]=-1);var m=h[0];h[0]=h[1],h[1]=m;var p=new A(h,new Array(r+1),!0);u[s]=p,c[s]=p}c[r+1]=l;for(var s=0;s<=r;++s)for(var h=u[s].vertices,g=u[s].adjacent,d=0;d<=r;++d){var f=h[d];if(f<0)g[d]=l;else for(var v=0;v<=r;++v)u[v].vertices.indexOf(f)<0&&(g[d]=u[v])}for(var _=new w(r,o,c),y=!!t,s=r+1;s=i)){var d=n[c];n[c]=e;var m=this.orient();if(n[c]=d,m<0){s=h;continue e}h.boundary?h.lastVisited=-i:h.lastVisited=i}}return}return s},o.addPeaks=function(e,t){var i=this.vertices.length-1,r=this.dimension,o=this.vertices,n=this.tuple,a=this.interior,s=this.simplices,l=[t];t.lastVisited=i,t.vertices[t.vertices.indexOf(-1)]=i,t.boundary=!1,a.push(t);for(var u=[];0=i)){var g=p.vertices;if(p.lastVisited!==-i){for(var f=0,v=0;v<=r;++v)g[v]<0?n[f=v]=e:n[v]=o[g[v]];if(0t.x?1:this.yt.y?1:0},clone:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return m.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw e}},copy:function(){return new C(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+i*i+r*r)},distance:function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},hashCode:function(){var e=17;return 37*(e=37*e+C.hashCode(this.x))+C.hashCode(this.y)},setCoordinate:function(e){this.x=e.x,this.y=e.y,this.z=e.z},interfaces_:function(){return[i,o,a]},getClass:function(){return C}}),C.hashCode=function(){if(1===arguments.length){var e=arguments[0],t=_.doubleToLongBits(e);return Math.trunc(t^t>>>32)}},t(u.prototype,{compare:function(e,t){var i=e,r=t,o=u.compare(i.x,r.x);if(0!==o)return o;var n=u.compare(i.y,r.y);return 0!==n?n:this.dimensionsToTest<=2?0:u.compare(i.z,r.z)},interfaces_:function(){return[n]},getClass:function(){return u}}),u.compare=function(e,t){return e=this.size())throw new d;return this.array_[e]},w.prototype.isEmpty=function(){return 0===this.array_.length},w.prototype.size=function(){return this.array_.length},w.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;te.minx?this.minx:e.minx,i=this.miny>e.miny?this.miny:e.miny;return new E(t,this.maxx=this.minx&&t.getMaxX()<=this.maxx&&t.getMinY()>=this.miny&&t.getMaxY()<=this.maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return!this.isNull()&&i>=this.minx&&i<=this.maxx&&r>=this.miny&&r<=this.maxy}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e.minx>this.maxx||e.maxxthis.maxy||e.maxythis.maxx||ithis.maxy||rthis.maxx&&(this.maxx=t.maxx),t.minythis.maxy&&(this.maxy=t.maxy))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.isNull()?(this.minx=i,this.maxx=i,this.miny=r,this.maxy=r):(ithis.maxx&&(this.maxx=i),rthis.maxy&&(this.maxy=r))}},minExtent:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et.minx?1:this.minyt.miny?1:this.maxxt.maxx?1:this.maxyt.maxy?1:0},translate:function(e,t){return this.isNull()?null:void this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return tthis.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof E){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},centre:function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof E){var t=arguments[0];this.minx=t.minx,this.maxx=t.maxx,this.miny=t.miny,this.maxy=t.maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(4===arguments.length){var o=arguments[0],n=arguments[1],a=arguments[2],s=arguments[3];oe.maxx&&(t=this.minx-e.maxx);var i=0;return this.maxye.maxy&&(i=this.miny-e.maxy),0===t?i:0===i?t:Math.sqrt(t*t+i*i)},hashCode:function(){var e=17;return 37*(e=37*(e=37*(e=37*e+C.hashCode(this.minx))+C.hashCode(this.maxx))+C.hashCode(this.miny))+C.hashCode(this.maxy)},interfaces_:function(){return[i,a]},getClass:function(){return E}}),E.intersects=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2];return i.x>=(e.xt.x?e.x:t.x)&&i.y>=(e.yt.y?e.y:t.y)}if(4===arguments.length){var r=arguments[0],o=arguments[1],n=arguments[2],a=arguments[3],s=Math.min(n.x,a.x),l=Math.max(n.x,a.x),u=Math.min(r.x,o.x),c=Math.max(r.x,o.x);return!(le?1:0},L.isNaN=function(e){return Number.isNaN(e)},M.isWhitespace=function(e){return e<=32&&0<=e||127==e},M.toUpperCase=function(e){return e.toUpperCase()},t(A.prototype,{le:function(e){return this.hi=s-l&&(d=!1),!d)break}return t[0]=r,a.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},equals:function(){if(1===arguments.length){var e=arguments[0];return this.hi===e.hi&&this.lo===e.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e.hi,-e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(e){return this.le(e)?this:e},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfDivide(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var i,r,o,n,a=arguments[0],s=arguments[1],l=null,u=null,c=null,h=null;return o=this.hi/a,h=(l=(c=A.SPLIT*o)-(l=c-o))*(u=(h=A.SPLIT*a)-(u=h-a))-(n=o*a)+l*(r=a-u)+(i=o-l)*u+i*r,h=o+(c=(this.hi-n-h+this.lo-o*s)/a),this.hi=h,this.lo=o-h+c,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof A){var e,t,i,r,o=arguments[0],n=null,a=null,s=null,l=null;return e=(i=this.hi/o.hi)-(n=(s=A.SPLIT*i)-(n=s-i)),l=n*(a=(l=A.SPLIT*o.hi)-(a=l-o.hi))-(r=i*o.hi)+n*(t=o.hi-a)+e*a+e*t,new A(l=i+(s=(this.hi-r-l+this.lo-i*o.lo)/o.hi),i-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return _.isNaN(u)?A.createNaN():A.copy(this).selfDivide(u,0)}},ge:function(e){return this.hi>e.hi||this.hi===e.hi&&this.lo>=e.lo},pow:function(e){if(0===e)return A.valueOf(1);var t=new A(this),i=A.valueOf(1),r=Math.abs(e);if(1t.hi?1:this.lot.lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof A){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},max:function(e){return this.ge(e)?this:e},sqrt:function(){if(this.isZero())return A.valueOf(0);if(this.isNegative())return A.NaN;var e=1/Math.sqrt(this.hi),t=this.hi*e,i=A.valueOf(t),r=this.subtract(i.sqr()).hi*(.5*e);return i.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfAdd(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0],i=null,r=null,o=null,n=null,a=null,s=null;return n=(o=this.hi+t)-(a=o-this.hi),r=(s=(n=t-a+(this.hi-n))+this.lo)+(o-(i=o+s)),this.hi=i+r,this.lo=r+(i-this.hi),this}}else if(2===arguments.length){var l,u=arguments[0],c=arguments[1],h=(i=null,r=null,null);o=null,n=null,a=null,s=null;o=this.hi+u,l=this.lo+c,n=o-(a=o-this.hi),h=l-(s=l-this.lo);var d=(i=o+(a=(n=u-a+(this.hi-n))+l))+(a=(h=c-s+(this.lo-h))+(r=a+(o-i))),m=a+(i-d);return this.hi=d,this.lo=m,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof A){var e=arguments[0];return this.selfMultiply(e.hi,e.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var i,r,o=arguments[0],n=arguments[1],a=null,s=null,l=null,u=null;a=(l=A.SPLIT*this.hi)-this.hi,u=A.SPLIT*o,a=l-a,i=this.hi-a,s=u-o;var c=(l=this.hi*o)+(u=a*(s=u-s)-l+a*(r=o-s)+i*s+i*r+(this.hi*n+this.lo*o)),h=u+(a=l-c);return this.hi=c,this.lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return A.NaN;var e=Math.floor(this.hi),t=0;return e===this.hi&&(t=Math.floor(this.lo)),new A(e,t)},negate:function(){return this.isNaN()?this:new A(-this.hi,-this.lo)},clone:function(){try{return null}catch(e){if(e instanceof CloneNotSupportedException)return null;throw e}},multiply:function(){if(arguments[0]instanceof A){var e=arguments[0];return e.isNaN()?A.createNaN():A.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)?A.createNaN():A.copy(this).selfMultiply(t,0)}},isNaN:function(){return _.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var e=A.magnitude(this.hi);return-3<=e&&e<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!0,t),r=t[0]+1,o=i;if("."===i.charAt(0))o="0"+i;else if(r<0)o="0."+A.stringOfChar("0",-r)+i;else if(-1===i.indexOf(".")){var n=r-i.length;o=i+A.stringOfChar("0",n)+".0"}return this.isNegative()?"-"+o:o},reciprocal:function(){var e,t,i,r,o=null,n=null,a=null,s=null;e=(i=1/this.hi)-(o=(a=A.SPLIT*i)-(o=a-i)),n=(s=A.SPLIT*this.hi)-this.hi;var l=i+(a=(1-(r=i*this.hi)-(s=o*(n=s-n)-r+o*(t=this.hi-n)+e*n+e*t)-i*this.lo)/this.hi);return new A(l,i-l+a)},toSciNotation:function(){if(this.isZero())return A.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!1,t),r=A.SCI_NOT_EXPONENT_CHAR+t[0];if("0"===i.charAt(0))throw new IllegalStateException("Found leading zero: "+i);var o="";1e.hi||this.hi===e.hi&&this.lo>e.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?A.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return 0=e?t:[]},q.indexOf=function(e,t){for(var i=0;i=e.length&&(r=0),ir.length)return 1;if(0===i.length)return 0;var o=q.compare(i,r);return q.isEqualReversed(i,r)?0:o},OLDcompare:function(e,t){var i=e,r=t;if(i.lengthr.length)return 1;if(0===i.length)return 0;for(var o=q.increasingDirection(i),n=q.increasingDirection(r),a=0= 2)");this.points=e},isCoordinate:function(e){for(var t=0;t= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new De(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return De}}),De.MINIMUM_VALID_SIZE=4,De.serialVersionUID=-0x3b229e262367a600,s(Le,de),t(Le.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2!==arguments.length)return de.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&de.prototype.equalsExact.call(this,e,t)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var e=this.geometries.length,t=new Array(e).fill(null),i=0;ii.y&&(i=n,r=o)}for(var a=r;(a-=1)<0&&(a=t),e[a].equals2D(i)&&a!==r;);for(var s=r;e[s=(s+1)%t].equals2D(i)&&s!==r;);var l=e[a],u=e[s];if(l.equals2D(i)||u.equals2D(i)||l.equals2D(u))return!1;var c=Qe.computeOrientation(l,i,u);return 0===c?l.x>u.x:0>32),i=java.lang.Double.doubleToLongBits(this.p1.x);return i^=31*java.lang.Double.doubleToLongBits(this.p1.y),t^(Math.trunc(i)^Math.trunc(i>>32))},interfaces_:function(){return[i,a]},getClass:function(){return Ke}}),Ke.midPoint=function(e,t){return new C((e.x+t.x)/2,(e.y+t.y)/2)},Ke.serialVersionUID=0x2d2172135f411c00,t($e.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return($e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])||$e.isTrue(this.matrix[x.INTERIOR][x.BOUNDARY])||$e.isTrue(this.matrix[x.BOUNDARY][x.INTERIOR])||$e.isTrue(this.matrix[x.BOUNDARY][x.BOUNDARY]))&&this.matrix[x.EXTERIOR][x.INTERIOR]===ue.FALSE&&this.matrix[x.EXTERIOR][x.BOUNDARY]===ue.FALSE},isCoveredBy:function(){return($e.isTrue(this.matrix[x.INTERIOR][x.INTERIOR])||$e.isTrue(this.matrix[x.INTERIOR][x.BOUNDARY])||$e.isTrue(this.matrix[x.BOUNDARY][x.INTERIOR])||$e.isTrue(this.matrix[x.BOUNDARY][x.BOUNDARY]))&&this.matrix[x.INTERIOR][x.EXTERIOR]===ue.FALSE&&this.matrix[x.BOUNDARY][x.EXTERIOR]===ue.FALSE},set:function(){if(1===arguments.length)for(var e=arguments[0],t=0;t=this.size())throw new IndexOutOfBoundsException;return this.array_[e]},tt.prototype.push=function(e){return this.array_.push(e),e},tt.prototype.pop=function(e){if(0===this.array_.length)throw new et;return this.array_.pop()},tt.prototype.peek=function(){if(0===this.array_.length)throw new et;return this.array_[this.array_.length-1]},tt.prototype.empty=function(){return 0===this.array_.length},tt.prototype.isEmpty=function(){return this.empty()},tt.prototype.search=function(e){return this.array_.indexOf(e)},tt.prototype.size=function(){return this.array_.length},tt.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;tt[2].y&&(t[2]=e[r]),e[r].x+e[r].y>t[3].x+t[3].y&&(t[3]=e[r]),e[r].x>t[4].x&&(t[4]=e[r]),e[r].x-e[r].y>t[5].x-t[5].y&&(t[5]=e[r]),e[r].y>52},ut.zeroLowerBits=function(e,t){return e&~((1<=this.max)throw new p;var e=this.parent.getGeometryN(this.index++);return e instanceof de?(this.subcollectionIterator=new mt(e),this.subcollectionIterator.next()):e},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[c]},getClass:function(){return mt}}),mt.isAtomic=function(e){return!(e instanceof de)},t(pt.prototype,{locateInternal:function(){if(arguments[0]instanceof C&&arguments[1]instanceof Te){var e=arguments[0],t=arguments[1];if(t.isEmpty())return x.EXTERIOR;var i=t.getExteriorRing(),r=this.locateInPolygonRing(e,i);if(r===x.EXTERIOR)return x.EXTERIOR;if(r===x.BOUNDARY)return x.BOUNDARY;for(var o=0;oSt.area(this.boundable2)?this.expand(this.boundable1,this.boundable2,e,t):this.expand(this.boundable2,this.boundable1,e,t),null;if(i)return this.expand(this.boundable1,this.boundable2,e,t),null;if(r)return this.expand(this.boundable2,this.boundable1,e,t),null;throw new h("neither boundable is composite")},isLeaves:function(){return!(St.isComposite(this.boundable1)||St.isComposite(this.boundable2))},compareTo:function(e){var t=e;return this._distancet._distance?1:0},expand:function(e,t,i,r){for(var o=e.getChildBoundables().iterator();o.hasNext();){var n=new St(o.next(),t,this.itemDistance);n.getDistance()=i.x?r.y>=i.y?Ft.NE:Ft.SE:r.y>=i.y?Ft.NW:Ft.SW}},Ft.NE=0,Ft.NW=1,Ft.SW=2,Ft.SE=3,t(Ht.prototype,{interfaces_:function(){return[]},getClass:function(){return Ht}}),Ht.getChainStartIndices=function(e){var t=0,i=new w;i.add(new L(t));do{var r=Ht.findChainEnd(e,t);i.add(new L(r)),t=r}while(t=e.length-1)return e.length-1;for(var r=Ft.quadrant(e[i],e[i+1]),o=t+1;oi.getId()&&(i.computeOverlaps(o,e),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return Bt}}),s(jt,Nt),t(jt.prototype,{overlap:function(){if(4!==arguments.length)return Nt.prototype.overlap.apply(this,arguments);var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3],o=e.getContext(),n=i.getContext();this.si.processIntersections(o,t,n,r)},interfaces_:function(){return[]},getClass:function(){return jt}}),Bt.SegmentOverlapAction=jt,s(zt,y),t(zt.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return zt}}),zt.msgWithCoord=function(e,t){return null!==t?e+" [ "+t+" ]":e},t(Wt.prototype,{processIntersections:function(e,t,i,r){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return Wt}}),t(Ut.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(e){this.isCheckEndSegmentsOnly=e},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(e){this.findAllIntersections=e},setKeepIntersections:function(e){this.keepIntersections=e},processIntersections:function(e,t,i,r){if(!this.findAllIntersections&&this.hasIntersection())return null;if(e===i&&t===r)return null;if(this.isCheckEndSegmentsOnly&&!(this.isEndSegment(e,t)||this.isEndSegment(i,r)))return null;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=o,this.intSegments[1]=n,this.intSegments[2]=a,this.intSegments[3]=s,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(e,t){return 0===t||t>=e.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[Wt]},getClass:function(){return Ut}}),Ut.createAllIntersectionsFinder=function(e){var t=new Ut(e);return t.setFindAllIntersections(!0),t},Ut.createAnyIntersectionFinder=function(e){return new Ut(e)},Ut.createIntersectionCounter=function(e){var t=new Ut(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t},t(qt.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(e){this.findAllIntersections=e},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new Ut(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var e=new Bt;if(e.setSegmentIntersector(this.segInt),e.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new zt(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var e=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+Ue.toLineString(e[0],e[1])+" and "+Ue.toLineString(e[2],e[3])},interfaces_:function(){return[]},getClass:function(){return qt}}),qt.computeIntersections=function(e){var t=new qt(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()},t(Yt.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return Yt}}),Yt.toSegmentStrings=function(e){for(var t=new w,i=e.iterator();i.hasNext();){var r=i.next();t.add(new vt(r.getCoordinates(),r))}return t},Yt.checkValid=function(e){new Yt(e).checkValid()},t(Xt.prototype,{map:function(e){for(var t=new w,i=0;ithis.location.length){var t=new Array(3).fill(null);t[Jt.ON]=this.location[Jt.ON],t[Jt.LEFT]=x.NONE,t[Jt.RIGHT]=x.NONE,this.location=t}for(var i=0;ithis.maxNodeDegree&&(this.maxNodeDegree=t),e=this.getNext(e)}while(e!==this.startDe);this.maxNodeDegree*=2},addPoints:function(e,t,i){var r=e.getCoordinates();if(t){var o=1;i&&(o=0);for(var n=o;ne.quadrant?1:this.quadrantt.xValue?1:this.eventTypet.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===vi.INSERT},isSameLabel:function(e){return null!==this.label&&this.label===e.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[i]},getClass:function(){return vi}}),vi.INSERT=1,vi.DELETE=2,t(_i.prototype,{interfaces_:function(){return[]},getClass:function(){return _i}}),t(yi.prototype,{isTrivialIntersection:function(e,t,i,r){if(e===i&&1===this.li.getIntersectionNum()){if(yi.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var o=e.getNumPoints()-1;if(0===t&&r===o||0===r&&t===o)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(e){this.isDoneWhenProperInt=e},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next().getCoordinate();if(e.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(e,t){return!(null===t||!this.isBoundaryPointInternal(e,t[0])&&!this.isBoundaryPointInternal(e,t[1]))},setBoundaryNodes:function(e,t){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=e,this.bdyNodes[1]=t},addIntersections:function(e,t,i,r){if(e===i&&t===r)return null;this.numTests++;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&(this.recordIsolated&&(e.setIsolated(!1),i.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(e,t,i,r)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(e.addIntersections(this.li,t,0),i.addIntersections(this.li,r,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return yi}}),yi.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)},s(Ci,_i),t(Ci.prototype,{prepareEvents:function(){Xn.sort(this.events);for(var e=0;et||this.maxt&&(r=1),this.depth[e][i]=r}}},getDelta:function(e){return this.depth[e][Jt.RIGHT]-this.depth[e][Jt.LEFT]},getLocation:function(e,t){return this.depth[e][t]<=0?x.EXTERIOR:x.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<2;t++)for(var i=1;i<3;i++){var r=e.getLocation(t,i);r!==x.EXTERIOR&&r!==x.INTERIOR||(this.isNull(t,i)?this.depth[t][i]=Ni.depthAtLocation(r):this.depth[t][i]+=Ni.depthAtLocation(r))}else if(3===arguments.length){var o=arguments[0],n=arguments[1];arguments[2]===x.INTERIOR&&this.depth[o][n]++}},interfaces_:function(){return[]},getClass:function(){return Ni}}),Ni.depthAtLocation=function(e){return e===x.EXTERIOR?0:e===x.INTERIOR?1:Ni.NULL_VALUE},Ni.NULL_VALUE=-1,s(Vi,ti),t(Vi.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var e=new Array(2).fill(null);return e[0]=this.pts[0],e[1]=this.pts[1],new Vi(e,Kt.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(e){this._isIsolated=e},setName:function(e){this.name=e},equals:function(e){if(!(e instanceof Vi))return!1;var t=e;if(this.pts.length!==t.pts.length)return!1;for(var i=!0,r=!0,o=this.pts.length,n=0;nthis.maxWidth)&&(this.interiorPoint=t,this.maxWidth=i)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){if(arguments[0]instanceof de){var e=arguments[0];if(e.isEmpty())return e;for(var t=e.getGeometryN(0),i=1;it.getEnvelopeInternal().getWidth()&&(t=e.getGeometryN(i));return t}if(arguments[0]instanceof G){var r=arguments[0];return r instanceof de?this.widestGeometry(r):r}},horizontalBisector:function(e){var t=e.getEnvelopeInternal(),i=Ui.getBisectorY(e);return this.factory.createLineString([new C(t.getMinX(),i),new C(t.getMaxX(),i)])},add:function(e){if(e instanceof Te)this.addPolygon(e);else if(e instanceof de)for(var t=e,i=0;ithis.loY&&(this.loY=e):e>this.centreY&&e=t&&(i=1),e.max<=t&&(i=0),i},t(Qi.prototype,{expandToInclude:function(e){e.max>this.max&&(this.max=e.max),e.mini||this.max=this.min&&t<=this.max}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return i>=this.min&&r<=this.max}},init:function(e,t){this.min=e,(this.max=t)Math.PI;)e-=ar.PI_TIMES_2;for(;e<=-Math.PI;)e+=ar.PI_TIMES_2;return e},ar.angle=function(){if(1===arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2===arguments.length){var t=arguments[0],i=arguments[1],r=i.x-t.x,o=i.y-t.y;return Math.atan2(o,r)}},ar.isAcute=function(e,t,i){var r=e.x-t.x,o=e.y-t.y;return 0Math.PI&&(i=2*Math.PI-i),i},ar.toRadians=function(e){return e*Math.PI/180},ar.getTurn=function(e,t){var i=Math.sin(t-e);return 0Math.PI?o-ar.PI_TIMES_2:o},ar.PI_TIMES_2=2*Math.PI,ar.PI_OVER_2=Math.PI/2,ar.PI_OVER_4=Math.PI/4,ar.COUNTERCLOCKWISE=Qe.COUNTERCLOCKWISE,ar.CLOCKWISE=Qe.CLOCKWISE,ar.NONE=Qe.COLLINEAR,t(sr.prototype,{area:function(){return sr.area(this.p0,this.p1,this.p2)},signedArea:function(){return sr.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(e){if(null===e)throw new h("Supplied point is null.");return sr.interpolateZ(e,this.p0,this.p1,this.p2)},longestSideLength:function(){return sr.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return sr.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return sr.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return sr.area3D(this.p0,this.p1,this.p2)},centroid:function(){return sr.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return sr.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return sr}}),sr.area=function(e,t,i){return Math.abs(((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2)},sr.signedArea=function(e,t,i){return((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2},sr.det=function(e,t,i,r){return e*r-t*i},sr.interpolateZ=function(e,t,i,r){var o=t.x,n=t.y,a=i.x-o,s=r.x-o,l=i.y-n,u=r.y-n,c=a*u-s*l,h=e.x-o,d=e.y-n,m=(u*h-s*d)/c,p=(-l*h+a*d)/c;return t.z+m*(i.z-t.z)+p*(r.z-t.z)},sr.longestSideLength=function(e,t,i){var r=e.distance(t),o=t.distance(i),n=i.distance(e),a=r;return a=e.length&&(t=0),t},ur.computeC=function(e,t,i){return e*i.y-t*i.x},ur.getMinimumDiameter=function(e){return new ur(e).getDiameter()},ur.getMinimumRectangle=function(e){return new ur(e).getMinimumRectangle()},ur.computeSegmentForLine=function(e,t,i){var r=null,o=null;return o=Math.abs(t)>Math.abs(e)?(r=new C(0,i/t),new C(1,i/t-e/t)):(r=new C(i/e,0),new C(i/e-t/e,1)),new Ke(r,o)};var Jn=Object.freeze({Centroid:Ze,CGAlgorithms:Qe,ConvexHull:rt,InteriorPointArea:Wi,InteriorPointLine:qi,InteriorPointPoint:Yi,RobustLineIntersector:Ye,MCPointInRing:or,MinimumBoundingCircle:lr,MinimumDiameter:ur});t(cr.prototype,{getResultGeometry:function(){return new hr(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(e){if(e<=0)throw new h("Tolerance must be positive");this.distanceTolerance=e},interfaces_:function(){return[]},getClass:function(){return cr}}),cr.densifyPoints=function(e,t,i){for(var r=new Ke,o=new b,n=0;n=t&&(e.getMinY()>=i&&(r=3),e.getMaxY()<=i&&(r=1)),e.getMaxX()<=t&&(e.getMinY()>=i&&(r=2),e.getMaxY()<=i&&(r=0)),r},t(yr.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var e=arguments[0];for(this.level=yr.computeQuadLevel(e),this.env=new E,this.computeKey(this.level,e);!this.env.contains(e);)this.level+=1,this.computeKey(this.level,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=Ki.powerOf2(t);this.pt.x=Math.floor(i.getMinX()/r)*r,this.pt.y=Math.floor(i.getMinY()/r)*r,this.env.init(this.pt.x,this.pt.x+r,this.pt.y,this.pt.y+r)}},getEnvelope:function(){return this.env},getCentre:function(){return new C((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return yr}}),yr.computeQuadLevel=function(e){var t=e.getWidth(),i=e.getHeight();return Ki.exponent(ithis.minCoord.y&&i.y>this.minCoord.y&&r===Qe.CLOCKWISE&&(o=!0),o&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(e,t){var i=e.getEdge().getCoordinates();if(t<0||t+1>=i.length)return-1;if(i[t].y===i[t+1].y)return-1;var r=Jt.LEFT;return i[t].ythis.minCoord.x)&&(this.minDe=e,this.minIndex=i,this.minCoord=t[i])},findRightmostEdgeAtNode:function(){var e=this.minDe.getNode().getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();i.isForward()&&this.checkForRightmostCoordinate(i)}m.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe,this.getRightmostSide(this.minDe,this.minIndex)===Jt.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Rr}}),Or.prototype.addLast=function(e){this.array_.push(e)},Or.prototype.removeFirst=function(){return this.array_.shift()},Or.prototype.isEmpty=function(){return 0===this.array_.length},t(Nr.prototype,{clearVisitedEdges:function(){for(var e=this.dirEdgeList.iterator();e.hasNext();){e.next().setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(e){for(var t=null,i=e.getEdges().iterator();i.hasNext();){if((r=i.next()).isVisited()||r.getSym().isVisited()){t=r;break}}if(null===t)throw new zt("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(i=e.getEdges().iterator();i.hasNext();){var r;(r=i.next()).setVisited(!0),this.copySymDepths(r)}},computeDepth:function(e){this.clearVisitedEdges();var t=this.finder.getEdge();t.getNode(),t.getLabel(),t.setEdgeDepths(Jt.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},create:function(e){this.addReachable(e),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var e=this.dirEdgeList.iterator();e.hasNext();){var t=e.next();1<=t.getDepth(Jt.RIGHT)&&t.getDepth(Jt.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},computeDepths:function(e){var t=new $,i=new Or,r=e.getNode();for(i.addLast(r),t.add(r),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();t.add(o),this.computeNodeDepth(o);for(var n=o.getEdges().iterator();n.hasNext();){var a=n.next().getSym();if(!a.isVisited()){var s=a.getNode();t.contains(s)||(i.addLast(s),t.add(s))}}}},compareTo:function(e){var t=e;return this.rightMostCoord.xt.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var e=new E,t=this.dirEdgeList.iterator();t.hasNext();)for(var i=t.next().getEdge().getCoordinates(),r=0;rthis.bufParams.getMitreLimit()&&(o=!1)}catch(e){if(!(e instanceof P))throw e;n=new C(0,0),o=!1}o?this.segList.addPt(n):this.addLimitedMitreJoin(t,i,r,this.bufParams.getMitreLimit())},addFilletCorner:function(e,t,i,r,o){var n=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,n),l=i.x-e.x,u=i.y-e.y,c=Math.atan2(u,l);r===Qe.CLOCKWISE?s<=c&&(s+=2*Math.PI):c<=s&&(s-=2*Math.PI),this.segList.addPt(t),this.addFilletArc(e,s,c,r,o),this.segList.addPt(i)},addOutsideTurn:function(e,t){return this.offset0.p1.distance(this.offset1.p0)o.getMaxY()||this.findStabbedSegments(e,r.getDirectedEdges(),t)}return t}if(3===arguments.length)if(T(arguments[2],v)&&arguments[0]instanceof C&&arguments[1]instanceof ni){var n=arguments[0],a=arguments[1],s=arguments[2],l=a.getEdge().getCoordinates();for(i=0;ithis.seg.p1.y&&this.seg.reverse(),!(Math.max(this.seg.p0.x,this.seg.p1.x)this.seg.p1.y||Qe.computeOrientation(this.seg.p0,this.seg.p1,n)===Qe.RIGHT)){var u=a.getDepth(Jt.LEFT);this.seg.p0.equals(l[i])||(u=a.getDepth(Jt.RIGHT));var c=new Br(this.seg,u);s.add(c)}}}else if(T(arguments[2],v)&&arguments[0]instanceof C&&T(arguments[1],v)){var h=arguments[0],d=arguments[1],m=arguments[2];for(i=d.iterator();i.hasNext();){var p=i.next();p.isForward()&&this.findStabbedSegments(h,p,m)}}},getDepth:function(e){var t=this.findStabbedSegments(e);return 0===t.size()?0:Xn.min(t).leftDepth},interfaces_:function(){return[]},getClass:function(){return kr}}),t(Br.prototype,{compareTo:function(e){var t=e;if(this.upwardSeg.minX()>=t.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=t.upwardSeg.minX())return-1;var i=this.upwardSeg.orientationIndex(t.upwardSeg);return 0!==i?i:0!==(i=-1*t.upwardSeg.orientationIndex(this.upwardSeg))?i:this.upwardSeg.compareTo(t.upwardSeg)},compareX:function(e,t){var i=e.p0.compareTo(t.p0);return 0!==i?i:e.p1.compareTo(t.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[i]},getClass:function(){return Br}}),kr.DepthSegment=Br,t(jr.prototype,{addPoint:function(e){if(this.distance<=0)return null;var t=e.getCoordinates(),i=this.curveBuilder.getLineCurve(t,this.distance);this.addCurve(i,x.EXTERIOR,x.INTERIOR)},addPolygon:function(e){var t=this.distance,i=Jt.LEFT;this.distance<0&&(t=-this.distance,i=Jt.RIGHT);var r=e.getExteriorRing(),o=q.removeRepeatedPoints(r.getCoordinates());if(this.distance<0&&this.isErodedCompletely(r,this.distance))return null;if(this.distance<=0&&o.length<3)return null;this.addPolygonRing(o,t,i,x.EXTERIOR,x.INTERIOR);for(var n=0;n=De.MINIMUM_VALID_SIZE&&Qe.isCCW(e)&&(n=o,a=r,i=Jt.opposite(i));var s=this.curveBuilder.getRingCurve(e,i,t);this.addCurve(s,n,a)},add:function(e){if(e.isEmpty())return null;if(e instanceof Te)this.addPolygon(e);else if(e instanceof Ee)this.addLineString(e);else if(e instanceof Pe)this.addPoint(e);else if(e instanceof Ie)this.addCollection(e);else if(e instanceof me)this.addCollection(e);else if(e instanceof Le)this.addCollection(e);else{if(!(e instanceof de))throw new UnsupportedOperationException(e.getClass().getName());this.addCollection(e)}},isErodedCompletely:function(e,t){var i=e.getCoordinates();if(i.length<4)return t<0;if(4===i.length)return this.isTriangleErodedCompletely(i,t);var r=e.getEnvelopeInternal(),o=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>o},addCollection:function(e){for(var t=0;tr||this.maxyn;if(a)return!1;var s=this.intersectsToleranceSquare(e,t);return m.isTrue(!(a&&s),"Found bad envelope test"),s},initCorners:function(e){this.minx=e.x-.5,this.maxx=e.x+.5,this.miny=e.y-.5,this.maxy=e.y+.5,this.corner[0]=new C(this.maxx,this.maxy),this.corner[1]=new C(this.minx,this.maxy),this.corner[2]=new C(this.minx,this.miny),this.corner[3]=new C(this.maxx,this.miny)},intersects:function(e,t){return 1===this.scaleFactor?this.intersectsScaled(e,t):(this.copyScaled(e,this.p0Scaled),this.copyScaled(t,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},scale:function(e){return Math.round(e*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var e=qr.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new E(this.originalPt.x-e,this.originalPt.x+e,this.originalPt.y-e,this.originalPt.y+e)}return this.safeEnv},intersectsPixelClosure:function(e,t){return this.li.computeIntersection(e,t,this.corner[0],this.corner[1]),!!(this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[1],this.corner[2]),this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[2],this.corner[3]),this.li.hasIntersection()||(this.li.computeIntersection(e,t,this.corner[3],this.corner[0]),this.li.hasIntersection()))))},intersectsToleranceSquare:function(e,t){var i=!1,r=!1;return this.li.computeIntersection(e,t,this.corner[0],this.corner[1]),!!(this.li.isProper()||(this.li.computeIntersection(e,t,this.corner[1],this.corner[2]),this.li.isProper()||(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(e,t,this.corner[2],this.corner[3]),this.li.isProper()||(this.li.hasIntersection()&&(r=!0),this.li.computeIntersection(e,t,this.corner[3],this.corner[0]),this.li.isProper()||i&&r||e.equals(this.pt)||t.equals(this.pt)))))},addSnappedNode:function(e,t){var i=e.getCoordinate(t),r=e.getCoordinate(t+1);return!!this.intersects(i,r)&&(e.addIntersection(this.getCoordinate(),t),!0)},interfaces_:function(){return[]},getClass:function(){return qr}}),qr.SAFE_ENV_EXPANSION_FACTOR=.75,t(Yr.prototype,{snap:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2],o=t.getSafeEnvelope(),n=new Xr(t,i,r);return this.index.query(o,{interfaces_:function(){return[wt]},visitItem:function(e){e.select(o,n)}}),n.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return Yr}}),s(Xr,Xi),t(Xr.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return Xi.prototype.select.apply(this,arguments);var e=arguments[0],t=arguments[1],i=e.getContext();return null!==this.parentEdge&&i===this.parentEdge&&t===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(i,t))},interfaces_:function(){return[]},getClass:function(){return Xr}}),Yr.HotPixelSnapAction=Xr,t(Jr.prototype,{processIntersections:function(e,t,i,r){if(e===i&&t===r)return null;var o=e.getCoordinates()[t],n=e.getCoordinates()[t+1],a=i.getCoordinates()[r],s=i.getCoordinates()[r+1];if(this.li.computeIntersection(o,n,a,s),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var l=0;lthis.minDistance)return null;for(var r=e.getCoordinates(),o=t.getCoordinate(),n=0;nthis.minDistance)return null;r=s.getCoordinates();var c=l.getCoordinates();for(n=0;ne.quadrant?1:this.quadrant=e.getNumPoints()&&null===r)return null;var n=e.getCoordinate(o);null!==r&&r.segmentIndex===i.segmentIndex&&(n=r.coord);var a=new oi(e,i.coord,n,new Kt(e.getLabel()));t.add(a)},createEdgeEndForPrev:function(e,t,i,r){var o=i.segmentIndex;if(0===i.dist){if(0===o)return null;o--}var n=e.getCoordinate(o);null!==r&&r.segmentIndex>=o&&(n=r.coord);var a=new Kt(e.getLabel());a.flip();var s=new oi(e,i.coord,n,a);t.add(s)},computeEdgeEnds:function(){if(1===arguments.length){for(var e=arguments[0],t=new w,i=e;i.hasNext();){var r=i.next();this.computeEdgeEnds(r,t)}return t}if(2===arguments.length){var o=arguments[0],n=arguments[1],a=o.getEdgeIntersectionList();a.addEndpoints();var s=a.iterator(),l=null,u=null;if(!s.hasNext())return null;for(var c=s.next();l=u,u=c,c=null,s.hasNext()&&(c=s.next()),null!==u&&(this.createEdgeEndForPrev(o,n,u,l),this.createEdgeEndForNext(o,n,u,c)),null!==u;);}},interfaces_:function(){return[]},getClass:function(){return yo}}),s(Co,oi),t(Co.prototype,{insert:function(e){this.edgeEnds.add(e)},print:function(e){e.println("EdgeEndBundle--\x3e Label: "+this.label);for(var t=this.iterator();t.hasNext();){t.next().print(e),e.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(e,t){for(var i=0,r=!1,o=this.iterator();o.hasNext();){(n=o.next().getLabel().getLocation(e))===x.BOUNDARY&&i++,n===x.INTERIOR&&(r=!0)}var n=x.NONE;r&&(n=x.INTERIOR),0e.y&&(o=!0),o?this.li.computeIntersection(e,t,this.diagDown0,this.diagDown1):this.li.computeIntersection(e,t,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return Vo}}),t(Fo.prototype,{applyTo:function(e){for(var t=0;t=this.rectEnv.getMinX()&&t.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):t.getMinY()>=this.rectEnv.getMinY()&&t.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return Go}}),s(ko,Fo),t(ko.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(e){if(!(e instanceof Te))return null;var t=e.getEnvelopeInternal();if(!this.rectEnv.intersects(t))return null;for(var i=new C,r=0;r<4;r++)if(this.rectSeq.getCoordinate(r,i),t.contains(i)&&di.containsPointInPolygon(i,e))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return ko}}),s(Bo,Fo),t(Bo.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(e){var t=e.getEnvelopeInternal();if(!this.rectEnv.intersects(t))return null;var i=xi.getLines(e);this.checkIntersectionWithLineStrings(i)},checkIntersectionWithLineStrings:function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();if(this.checkIntersectionWithSegments(i),this.hasIntersection)return null}},checkIntersectionWithSegments:function(e){for(var t=e.getCoordinateSequence(),i=1;i=e.size()?null:e.get(t)},qo.union=function(e){return new qo(e).union()},qo.STRTREE_NODE_CAPACITY=4,t(Yo.prototype,{unionNoOpt:function(e){var t=this.geomFact.createPoint();return zi.overlayOp(e,t,Bi.UNION)},unionWithNull:function(e,t){return null===e&&null===t?null:null===t?e:null===e?t:e.union(t)},extract:function(){if(T(arguments[0],f))for(var e=arguments[0].iterator();e.hasNext();){var t=e.next();this.extract(t)}else if(arguments[0]instanceof G){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),Uo.extract(i,G.SORTINDEX_POLYGON,this.polygons),Uo.extract(i,G.SORTINDEX_LINESTRING,this.lines),Uo.extract(i,G.SORTINDEX_POINT,this.points)}},union:function(){if(null===this.geomFact)return null;var e=null;if(0this.distanceTolerance&&(n=!1);var l=new Ke;if(l.p0=this.linePts[e],l.p1=this.linePts[t],r[0]=e,r[1]=t,this.hasBadIntersection(this.line,r,l)&&(n=!1),n){o=this.flatten(e,t);return this.line.addToResult(o),null}this.simplifySection(e,s,i),this.simplifySection(s,t,i)},hasBadOutputIntersection:function(e){for(var t=this.outputIndex.query(e).iterator();t.hasNext();){var i=t.next();if(this.hasInteriorIntersection(i,e))return!0}return!1},findFurthestPoint:function(e,t,i,r){var o=new Ke;o.p0=e[t],o.p1=e[i];for(var n=-1,a=t,s=t+1;s=t[0]&&rt[2]&&(i|=2),e[1]t[3]&&(i|=8),i}((t.exports=r).polyline=r).polygon=function(e,t){var i,r,o,n,a,s,l;for(r=1;r<=8;r*=2){for(i=[],o=e[e.length-1],n=!(d(o,t)&r),a=0;a=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,t,i,r,o){for(var n,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,s(e,n,t,i,o),a.push(t,n,n,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!u(e,t))return i;for(var o,n,a,s,l=[];t;){for(o=0,n=t.children.length;othis._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(o,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var n=this._chooseSplitIndex(i,o,r),a=g(i.children.splice(n,i.children.length-n));a.height=i.height,a.leaf=i.leaf,m(i,this.toBBox),m(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,m(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,o,n,a,s,l,u,c,h,d,m,p,g,f;for(l=u=1/0,r=t;r<=i-t;r++)o=v(e,0,r,this.toBBox),n=v(e,r,i,this.toBBox),h=o,d=n,void 0,m=Math.max(h.minX,d.minX),p=Math.max(h.minY,d.minY),g=Math.min(h.maxX,d.maxX),f=Math.min(h.maxY,d.maxY),a=Math.max(0,g-m)*Math.max(0,f-p),s=_(o)+_(n),a>1;return["sum(",g(e.slice(0,t)),",",g(e.slice(t)),")"].join("")}function f(e){if(2===e.length)return[["sum(prod(",e[0][0],",",e[1][1],"),prod(-",e[0][1],",",e[1][0],"))"].join("")];for(var t=[],i=0;i>1,a=g(e[n],t);a<=0?(0===a&&(o=n),i=n+1):0=e.length||0!==g(e[m],n)););}return i}function v(e,t){if(t<0)return[];for(var i=[],r=(1<>>u&1&&l.push(o[u]);t.push(l)}return d(t)},i.skeleton=v,i.boundary=function(e){for(var t=[],i=0,r=e.length;ie[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2] line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var o=i[0][0],n=i[0][1],a=i[1][0],s=i[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],d=(h-u)*(a-o)-(c-l)*(s-n),m=(c-l)*(n-u)-(h-u)*(o-l),p=(a-o)*(n-u)-(s-n)*(o-l);if(0===d)return null;var g=m/d,f=p/d;return 0<=g&&g<=1&&0<=f&&f<=1?_([o+g*(a-o),n+g*(s-n)]):null}t.exports=function(e,t){var r=[];if("LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=u(e,t);return i&&r.push(i),s(r)}var o=a();return o.load(n(t)),l(n(e),function(i){l(o.search(i),function(e){var t=u(i,e);t&&r.push(t)})}),s(r)}},{"@turf/helpers":8,"@turf/invariant":9,"@turf/line-segment":11,"@turf/meta":10,"geojson-rbush":20}],8:[function(e,t,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],9:[function(e,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],10:[function(e,t,i){function _(e,t,i){var r,o,n,a,s,l,u,c,h,d,m=0,p=0,g="FeatureCollection"===e.type,f="Feature"===e.type,v=g?e.features.length:1;for(r=0;rt[2]&&(i|=2),e[1]t[3]&&(i|=8),i}((t.exports=r).polyline=r).polygon=function(e,t){var i,r,o,n,a,s,l;for(r=1;r<=8;r*=2){for(i=[],o=e[e.length-1],n=!(d(o,t)&r),a=0;a=e.minX&&t.maxY>=e.minY}function g(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function f(e,t,i,r,o){for(var n,a=[t,i];a.length;)(i=a.pop())-(t=a.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,s(e,n,t,i,o),a.push(t,n,n,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!u(e,t))return i;for(var o,n,a,s,l=[];t;){for(o=0,n=t.children.length;othis._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(o,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);var n=this._chooseSplitIndex(i,o,r),a=g(i.children.splice(n,i.children.length-n));a.height=i.height,a.leaf=i.leaf,m(i,this.toBBox),m(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=g([e,t]),this.data.height=e.height+1,this.data.leaf=!1,m(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,o,n,a,s,l,u,c,h,d,m,p,g,f;for(l=u=1/0,r=t;r<=i-t;r++)o=v(e,0,r,this.toBBox),n=v(e,r,i,this.toBBox),h=o,d=n,void 0,m=Math.max(h.minX,d.minX),p=Math.max(h.minY,d.minY),g=Math.min(h.maxX,d.maxX),f=Math.min(h.maxY,d.maxY),a=Math.max(0,g-m)*Math.max(0,f-p),s=_(o)+_(n),ae[1]!=u>e[1]&&e[0]<(l-a)*(e[1]-s)/(u-s)+a&&(r=!r)}return r}n.earthRadius=6371008.8,n.factors={centimeters:100*n.earthRadius,centimetres:100*n.earthRadius,degrees:n.earthRadius/111325,feet:3.28084*n.earthRadius,inches:39.37*n.earthRadius,kilometers:n.earthRadius/1e3,kilometres:n.earthRadius/1e3,meters:n.earthRadius,metres:n.earthRadius,miles:n.earthRadius/1609.344,millimeters:1e3*n.earthRadius,millimetres:1e3*n.earthRadius,nauticalmiles:n.earthRadius/1852,radians:1,yards:n.earthRadius/1.0936},n.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/n.earthRadius,yards:1/1.0936},n.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},n.feature=s,n.geometry=function(e,t,i){switch(void 0===i&&(i={}),e){case"Point":return r(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return a(t).geometry;case"MultiPoint":return c(t).geometry;case"MultiLineString":return u(t).geometry;case"MultiPolygon":return h(t).geometry;default:throw new Error(e+" is invalid")}},n.point=r,n.points=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return r(e,t)}),i)},n.polygon=a,n.polygons=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return a(e,t)}),i)},n.lineString=o,n.lineStrings=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return o(e,t)}),i)},n.featureCollection=l,n.multiLineString=u,n.multiPoint=c,n.multiPolygon=h,n.geometryCollection=function(e,t,i){return void 0===i&&(i={}),s({type:"GeometryCollection",geometries:e},t,i)},n.round=function(e,t){if(void 0===t&&(t=0),t&&!(0<=t))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i},n.radiansToLength=d,n.lengthToRadians=m,n.lengthToDegrees=function(e,t){return i(m(e,t))},n.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},n.radiansToDegrees=i,n.degreesToRadians=function(e){return e%360*Math.PI/180},n.convertLength=function(e,t,i){if(void 0===t&&(t="kilometers"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("length must be a positive number");return d(m(e,t),i)},n.convertArea=function(e,t,i){if(void 0===t&&(t="meters"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("area must be a positive number");var r=n.areaFactors[t];if(!r)throw new Error("invalid original units");var o=n.areaFactors[i];if(!o)throw new Error("invalid final units");return e/r*o},n.isNumber=g,n.isObject=function(e){return!!e&&e.constructor===Object},n.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!g(e))throw new Error("bbox must only contain numbers")})},n.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(void 0===e?"undefined":_typeof2(e)))throw new Error("id must be a number or a string")},n.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},n.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},n.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},n.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},n.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},n.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},n.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")},n.lineEquals=function(e,t){var i=e.length==t.length;if(i)for(var r=0;r=r[0]&&o[3]>=r[1]))return!1;"Polygon"===s&&(u=[u]);for(var c=!1,h=0;hMath.PI&&(o-=2*Math.PI),o<-Math.PI&&(o+=2*Math.PI);var n=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),a=Math.atan2(o,n);return(v.radiansToDegrees(a)+360)%360}function I(e,t,i){void 0===i&&(i={});var r=y.getCoord(e),o=y.getCoord(t);o[0]+=180Math.PI&&(s-=2*Math.PI);var l=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),u=1e-11=t?_getParentLevelTile(e,t,i):_getAllChildLevelTile(e,t,i),i}function _getParentLevelTile(e,t,i){for(var r=e,o=0;o<30;o++){if(r.level==t)return i.push({x:r.x,y:r.y,level:r.level}),!0;r=r.parent}return!0}function _getAllChildLevelTile(e,t,i){if(e.level==t)return i.push({x:e.x,y:e.y,level:e.level}),!0;if(e.level>t)return!1;for(var r=0;r=i.level_min&&c.level=u.level_min&&t.level=n.level_min&&t.level=d.level_min&&t.level=p.tilesLength&&(p.returnCount=0,p.tilesLength=0,p.Primitivekey=[])},error:function(){s=loadsh.remove(s,function(e){return e.x==h.x&&e.y==h.y&&e.level==h.level})},complete:function(e,t){h.state=p._cesium.QuadtreeTileLoadState.LOADING,h.state===p._cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive&&(h.state=p._cesium.QuadtreeTileLoadState.DONE),h.renderable=!0)}}))}var h,n},this._primitive=new p._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var l=this._viewer.scene,u=l.primitives;d&&d.time&&(this._Provider._availability=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:d.time.start?p._cesium.JulianDate.fromDate(new Date(d.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?p._cesium.JulianDate.fromDate(new Date(d.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("time is required.");var t=this._availability;return!Cesium.defined(t)||t.contains(e)}),u.add(this._primitive),l.primitivesQuadTrees&&l.primitivesQuadTrees.push(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;var c={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d};return this._Provider.treeID=m.id,this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},_.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2=function(e,t,i,r,o,n){var a={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium};this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1=i.level_min&&c.level=i.level_min&&c.level=n.level_min&&t.level=u.level_min&&t.level=i.level_min&&c.level=i.level_min&&h.level=l.level_min&&i.level=i.level_min&&h.level=r.level_min&&i.level=o.level_min&&r.levela.level_max+2&&0=a.level_min&&t.levela.level_max+2&&0=a.level_min&&t.level=i.level_min&&d.levelr)if(this._viewer.scene.primitives.remove(n.data))-1<(h=this.Primitivekey.indexOf(this.loadFinishKey[o]))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(o,1),this.loadFinishKey.splice(o,1)}var a=[],s=e.parent;if(s&&s.parent){var l=s.parent;a.push(l)}var u=e.children;a=a.concat(u);for(o=0;or)if(this._viewer.entities.remove(n.data))-1<(h=this.Primitivekey.indexOf(this.loadFinishKey[o]))&&this.Primitivekey.splice(h,1),this.PrimitiveData.splice(o,1),this.loadFinishKey.splice(o,1)}var a=[],s=e.parent;if(s&&s.parent){var l=s.parent;a.push(l)}var u=e.children;a=a.concat(u);for(o=0;o