管道基础大数据平台系统开发-【前端】-新系統界面
编辑 | blame | 历史 | 原始文档
/**
 * 
 * SmartEarthSDK 基于Cesium的三维web开发
 * @author 张丹钊、金磊、薛鹏、张恒
 * 
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SmartEarth={})}(this,function(o){"use strict";var I=Object.freeze({testModel:"Workers/Model/xiaoche.glb",modelAxis:"Workers/Model/axis.gltf",flyModel:"Workers/Model/fly.glb",divpoint:"Workers/image/divpoint.png",divpoint1:"Workers/image/divpoint1.png",richtextpoint:"Workers/image/richtextpoint1.png",mark:"Workers/image/mark.png",mark1:"Workers/image/mark1.png",TrailLine:"Workers/image/TrailLine.png",road:"Workers/image/road.jpg",colors3:"Workers/image/colors3.png",loading:"Workers/image/loading.gif",smog:"Workers/image/smog.png",penquan:"Workers/image/penquan.png",fire:"Workers/image/fire.png",fire2:"Workers/image/fire2.png",bottomplane:"Workers/image/bottomplane.jpg",wall:"Workers/image/ggy.jpg",rotate:"Workers/image/rotate.png",move:"Workers/image/move.png",draw:"Workers/image/cursor/draw.cur",water:"Workers/image/waterNormals.jpg",movingRiver:"Workers/image/movingRiver.png",effectCircle:"Workers/image/circle.png",scanCircle:"Workers/image/scan.png",particles:"Workers/image/particles.png",trafficLight:{l_go:"Workers/image/trafficLights/l-go.png",l_wait:"Workers/image/trafficLights/l-wait.png",l_stop:"Workers/image/trafficLights/l-stop.png",l_null:"Workers/image/trafficLights/l-null.png",go:"Workers/image/trafficLights/go.png",wait:"Workers/image/trafficLights/wait.png",stop:"Workers/image/trafficLights/stop.png",null:"Workers/image/trafficLights/null.png",r_go:"Workers/image/trafficLights/r-go.png",r_wait:"Workers/image/trafficLights/r-wait.png",r_stop:"Workers/image/trafficLights/r-stop.png",r_null:"Workers/image/trafficLights/r-null.png",bg:"Workers/image/trafficLights/bg.png"}});function X(e,t){return null!=e?e:t}var Z="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nif(twoColor){\nif(st.sCesium.Math.toRadians(80))return!1;t=t.cartesianToCanvasCoordinates(e);return t?[t.x-this._mapOffset[0],t.y-this._mapOffset[1]]:[]}return[]}},{key:"pointToData",value:function(e){var t=this._mapOffset,i=u.scene.globe.ellipsoid,e=new Cesium.cartesian3(e[1]+t,e[2]+t[2],0),t=i.cartesianToCartographic(e);return[t.lng,t.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(r,n);var r,n,a=s;function s(e,t){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function");this._viewer=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}function l(){echarts.registerCoordinateSystem("GLMap",a),echarts.registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(e,t){})}echarts.extendComponentModel({type:"GLMap",getViewer:function(){return u},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(e,t){this.api=t,this.dispose(),u.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(e,t){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e){u.scene.postRender.removeEventListener(this.moveHandler,this)}}),i.d(t,"load",function(){return l})}],o={},r.m=i,r.c=o,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(i,o,function(e){return t[e]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)},ne.prototype.getSceneList=function(t){$.ajax({url:this.serverUrl+"/scene/sceneList",type:"get",success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))}})},ne.prototype.query=function(e,t){var i=e.database,e={type:X(e.type,"building"),id:e.id,returnGeometry:X(e.returnGeometry,!0),returnChildren:X(e.returnChildren,!0)};$.ajax({url:this.serverUrl+"/"+i+"/query?version=v2.1",type:"post",async:!0,data:e,success:function(e){t&&"function"==typeof t&&e&&t(JSON.parse(e))},error:function(e,t,i){alert("error:"+e.status)}})},ae.prototype.startRecord=function(){navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0}).then(e=>{this.createRecorder(e)}).catch(e=>{this.getUserMediaError(e)})},ae.prototype.getUserMediaError=function(e){console.log("mediaError",e)},ae.prototype.createRecorder=function(e){console.log("start record");var t={videoBitsPerSecond:this.videoBPS},i=(this.recorder=new MediaRecorder(e,t),this.recorder.start(),[]);this.recorder.onstop=e=>{var t=new Blob(i,{type:"video/mp4"});this.saveMedia(t)},this.recorder.ondataavailable=e=>{i.push(e.data)}},ae.prototype.saveMedia=function(e){var e=window.URL.createObjectURL(e),t=document.createElement("a");t.innerHTML="test",t.download=this.mediaOutputPath,t.href=e,t.click()},ae.prototype.stopRecord=function(){this.recorder.stop()};const se=52.35987755982988,le=3.141592653589793,ue=6378245,ce=.006693421622965943,he={BD09ToGCJ02(e,t){var e=+e-.0065,t=+t-.006,i=Math.sqrt(e*e+t*t)-2e-5*Math.sin(t*se),t=Math.atan2(t,e)-3e-6*Math.cos(e*se);return[i*Math.cos(t),i*Math.sin(t)]},GCJ02ToBD09(e,t){t=+t,e=+e;var i=Math.sqrt(e*e+t*t)+2e-5*Math.sin(t*se),t=Math.atan2(t,e)+3e-6*Math.cos(e*se);return[i*Math.cos(t)+.0065,i*Math.sin(t)+.006]},WGS84ToGCJ02(e,t){return this.out_of_china(e=+e,t=+t)?[e,t]:[e+(e=this.delta(e,t))[0],t+e[1]]},GCJ02ToWGS84(e,t){return this.out_of_china(e=+e,t=+t)?[e,t]:[2*e-(e+(e=this.delta(e,t))[0]),2*t-(t+e[1])]},delta(e,t){var i=this.transformLng(e-105,t-35),e=this.transformLat(e-105,t-35),t=t/180*le,o=Math.sin(t),o=1-ce*o*o,r=Math.sqrt(o);return[180*i/(ue/r*Math.cos(t)*le),180*e/(ue*(1-ce)/(o*r)*le)]},transformLng(e,t){t=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e));return(t+=2*(20*Math.sin(6*e*le)+20*Math.sin(2*e*le))/3)+2*(20*Math.sin(e*le)+40*Math.sin(e/3*le))/3+2*(150*Math.sin(e/12*le)+300*Math.sin(e/30*le))/3},transformLat(e,t){var i=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return(i+=2*(20*Math.sin(6*e*le)+20*Math.sin(2*e*le))/3)+2*(20*Math.sin(t*le)+40*Math.sin(t/3*le))/3+2*(160*Math.sin(t/12*le)+320*Math.sin(t*le/30))/3},out_of_china(e,t){return t=+t,!(73.66<(e=+e)&&e<135.05&&3.86http://")).replace("https:/","https://"),pe.has(i))return pe.get(i);{let e=new de({workerPath:SmartEarthRootUrl+"Workers/xhrworker.js"}),t=e.queueWorkItem({type:"get",url:i});return t.then(e=>{e.xmlObj=fe(e.xmlText),t.resolve(e)}),pe.set(i,t),t}}function fe(t){let i={};if(document.all){let e=new ActiveXObject("Microsoft.XMLDOM");e.loadXML(t),i=e}else i=(new DOMParser).parseFromString(t,"text/xml");return i}function _e(e){return e?3==(e="string"==typeof e?fe(e):e).nodeType||4==e.nodeType?e.nodeValue:function r(n){try{let o={};if(0>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=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,o=t.length;i>10&1023,n[a++]=56320|1023&i)}return c(n,a)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+u[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){t.exports=function(e,t,i,o){for(var r=65535&e|0,n=e>>>16&65535|0,a=0;0!==i;){for(i-=a=2e3>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,o){var r=s,n=o+i;e^=-1;for(var a=o;a>>8^r[255&(e^t[a])];return-1^e}},{}],6:[function(e,t,i){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){t.exports=function(e,t){var i,o,r,n,a,s,l=e.state,u=e.next_in,c=e.input,h=u+(e.avail_in-5),m=e.next_out,d=e.output,p=m-(t-e.avail_out),g=m+(e.avail_out-257),f=l.dmax,_=l.wsize,C=l.whave,y=l.wnext,v=l.window,w=l.hold,b=l.bits,T=l.lencode,E=l.distcode,S=(1<>>=o=i>>>24,b-=o,0===(o=i>>>16&255))d[m++]=65535&i;else{if(!(16&o)){if(0==(64&o)){i=T[(65535&i)+(w&(1<>>=o,b-=o),b<15&&(w+=c[u++]<>>=o=i>>>24,b-=o,!(16&(o=i>>>16&255))){if(0==(64&o)){i=E[(65535&i)+(w&(1<>>=o,b-=o,(o=m-p)>3)<<3))-1,e.next_in=u-=r,e.next_out=m,e.avail_in=u>>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 L.Buf16(320),this.work=new L.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=k,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new L.Buf32(o),t.distcode=t.distdyn=new L.Buf32(r),t.sane=1,t.back=-1,V):G}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):G}function l(e,t){var i,o;return e&&e.state?(o=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=e.wsize?(L.arraySet(e.window,t,i-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):(o<(r=e.wsize-e.wnext)&&(r=o),L.arraySet(e.window,t,i-o,r,e.wnext),(o-=r)?(L.arraySet(e.window,t,i-o,o,0),e.wnext=o,e.whave=e.wsize):(e.wnext+=r,e.wnext===e.wsize&&(e.wnext=0),e.whave>>8&255,i.check=R(i.check,x,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&&(x[0]=255&u,x[1]=u>>>8&255,i.check=R(i.check,x,2,0)),c=u=0,i.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,u+=o[n++]<>>8&255,x[2]=u>>>16&255,x[3]=u>>>24&255,i.check=R(i.check,x,4,0)),c=u=0,i.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,u+=o[n++]<>8),512&i.flags&&(x[0]=255&u,x[1]=u>>>8&255,i.check=R(i.check,x,2,0)),c=u=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===s)break e;s--,u+=o[n++]<>>8&255,i.check=R(i.check,x,2,0)),c=u=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((d=s<(d=i.length)?s:d)&&(i.head&&(b=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),L.arraySet(i.head.extra,o,n,d,b)),512&i.flags&&(i.check=R(i.check,o,d,n)),s-=d,n+=d,i.length-=d),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(d=0;b=o[n+d++],i.head&&b&&i.length<65536&&(i.head.name+=String.fromCharCode(b)),b&&d>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+=o[n++]<>>=7&c,c-=7&c,i.mode=27;break}for(;c<3;){if(0===s)break e;s--,u+=o[n++]<>>=1)){case 0:i.mode=14;break;case 1:I=A=void 0;var I,A=i;if(U){for(j=new L.Buf32(512),z=new L.Buf32(32),I=0;I<144;)A.lens[I++]=8;for(;I<256;)A.lens[I++]=9;for(;I<280;)A.lens[I++]=7;for(;I<288;)A.lens[I++]=8;for(B(F,A.lens,0,288,j,0,A.work,{bits:9}),I=0;I<32;)A.lens[I++]=5;B(H,A.lens,0,32,z,0,A.work,{bits:5}),U=!1}if(A.lencode=j,A.lenbits=9,A.distcode=z,A.distbits=5,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+=o[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(d=i.length){if(0===(d=l<(d=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[D[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,E={bits:i.lenbits},T=B(0,i.lens,0,19,i.lencode,0,i.work,E),i.lenbits=E.bits,T){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,C=65535&P,!((f=P>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<>>=f,c-=f,i.lens[i.have++]=C;else{if(16===C){for(S=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],d=3+(3&u),u>>>=2,c-=2}else if(17===C){for(S=f+3;c>>=f)),u>>>=3,c=c-f-3}else{for(S=f+7;c>>=f)),u>>>=7,c=c-f-7}if(i.have+d>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;d--;)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,E={bits:i.lenbits},T=B(F,i.lens,0,i.nlen,i.lencode,0,i.work,E),i.lenbits=E.bits,T){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,E={bits:i.distbits},T=B(H,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,E),i.distbits=E.bits,T){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,O(e,m),a=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,o=e.input,s=e.avail_in,u=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;_=(P=i.lencode[u&(1<>>16&255,C=65535&P,!((f=P>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<>y)])>>>16&255,C=65535&P,!(y+(f=P>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,i.length=C,0===_){i.mode=26;break}if(32&_){i.back=-1,i.mode=12;break}if(64&_){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&_,i.mode=22;case 22:if(i.extra){for(S=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;_=(P=i.distcode[u&(1<>>16&255,C=65535&P,!((f=P>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<>y)])>>>16&255,C=65535&P,!(y+(f=P>>>24)<=c);){if(0===s)break e;s--,u+=o[n++]<>>=y,c-=y,i.back+=y}if(u>>>=f,c-=f,i.back+=f,64&_){e.msg="invalid distance code",i.mode=30;break}i.offset=C,i.extra=15&_,i.mode=24;case 24:if(i.extra){for(S=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(i.offset>(d=m-l)){if((d=i.offset-d)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}p=d>i.wnext?(d-=i.wnext,i.wsize-d):i.wnext-d,d>i.length&&(d=i.length),g=i.window}else g=r,p=a-i.offset,d=i.length;for(l-=d=ld?(g=M[R+a[y]],D[I+a[y]]):(g=96,0),l=1<<(p=C-E),v=u=1<>E)+(u-=l)]=p<<24|g<<16|f|0,0!==u;);for(l=1<>=1;if(x=0!==l?(x&l-1)+l:0,y++,0==--A[C]){if(C===w)break;C=t[i+a[y]]}if(b>11&31,r=e>>5&63,n=31&e;return i[o+0]=t<<3|t>>2,i[o+1]=r<<2|r>>4,i[o+2]=n<<3|n>>2,i[o+3]=255,e}function Ee(e,t,i,o){for(var r=0,n=e,a=t,s=i+(r=0!=(o&(we|be))?8:r),l=0!=(o&ve),u=new Uint8Array(16),c=Te(a[s+0],a[s+1],u,0),h=Te(a[s+2],a[s+3],u,4),m=0;m<3;m++){var d=u[m],p=u[4+m];l&&c<=h?(u[8+m]=(d+p)/2,u[12+m]=0):(u[8+m]=(2*d+p)/3,u[12+m]=(d+2*p)/3)}u[11]=255,u[15]=l&&c<=h?0:255;for(var g=new Uint8Array(16),m=0;m<4;++m){var f=a[s+4+m];g[4*m+0]=3&f,g[4*m+1]=f>>2&3,g[4*m+2]=f>>4&3,g[4*m+3]=f>>6&3}for(m=0;m<16;++m)for(var _=4*g[m],C=0;C<4;++C)n[4*m+C]=u[_+C];if(0!=(o&we))for(var y=e,v=i,w=0;w<8;++w){var b=bytes[v+w],T=15&b,b=240&b;y[8*w+3]=T|T<<4,y[8*w+7]=b|b>>4}else if(0!=(o&be)){var E=e,S=t,P=S[(L=i)+0],x=S[L+1],D=new Uint8Array(8);if((D[0]=P)<=(D[1]=x)){for(var I=1;I<5;++I)D[1+I]=((5-I)*P+I*x)/5;D[6]=0,D[7]=255}else for(I=1;I<7;++I)D[1+I]=((7-I)*P+I*x)/7;for(var A=new Uint8Array(16),L=L+2,M=0,I=0;I<2;++I){for(var R=0,O=0;O<3;++O)R|=S[L++]<<8*O;for(O=0;O<8;++O)A[M++]=R>>3*O&7}for(I=0;I<16;++I)E[4*I+3]=D[A[I]]}}function Se(e){}Se.decode=function(e,t,i,o,r){if(null!=e&&null!=o&&0!=i&&0!=t){var n=0;if((n=11>3|5*l+3*h>>3&2016|5*u+3*m>>3&63488,f[3]=5*c+3*s>>3|5*h+3*l>>3&2016|5*m+3*u>>3&63488,c=g[2+a],_[s=4*v*d+4*w]=f[3&c],_[1+s]=f[c>>2&3],_[2+s]=f[c>>4&3],_[3+s]=f[c>>6&3],_[s+=d]=f[c>>8&3],_[s+1]=f[c>>10&3],_[s+2]=f[c>>12&3],_[s+3]=f[c>>14],c=g[3+a],_[s+=d]=f[3&c],_[s+1]=f[c>>2&3],_[s+2]=f[c>>4&3],_[s+3]=f[c>>6&3],_[s+=d]=f[c>>8&3],_[s+1]=f[c>>10&3],_[s+2]=f[c>>12&3],_[s+3]=f[c>>14];else for(var b=e,T=t,E=i,F=o,S=n,H=0!=(S&ve)?8:16,P=0,x=0;x>=1,a>>=1,0===n&&0===a)break;n=Math.max(n,1),a=Math.max(a,1)}return s===r}(this.arrayBufferView,t,r,n);do{var s=Cesium.PixelFormat.compressedTextureSizeInBytes(t,r,n),l=new Uint8Array(this.arrayBufferView.buffer,this.arrayBufferView.byteOffset+o,s);4369===t?e.texImage2D(e.TEXTURE_2D,i++,e.RGBA,r,n,0,e.RGBA,e.UNSIGNED_BYTE,l):e.compressedTexImage2D(e.TEXTURE_2D,i++,t,r,n,0,l),r=Math.max(r>>1,1),n=Math.max(n>>1,1),o+=s}while(o=Cesium.Math.SIXTY_FOUR_KILOBYTES)&&t.elementIndexUint&&(e=Cesium.IndexDatatype.UNSIGNED_INT),Cesium.defined(i.indexBuffer)||(i.indexBuffer=Cesium.Buffer.createIndexBuffer({context:t,typedArray:i.indicesTypedArray,usage:Cesium.BufferUsage.STATIC_DRAW,indexDatatype:e})),i.indicesTypedArray=null,delete i.indicesTypedArray}};var tt=Object.freeze({VertexNormal:"VertexNormal",VertexColor:"VertexColor",TexCoord:"TexCoord",TexCoord2:"TexCoord2",Instance:"Instance",COMPRESS_VERTEX:"COMPRESS_VERTEX",COMPRESS_NORMAL:"COMPRESS_NORMAL",COMPRESS_COLOR:"COMPRESS_COLOR",COMPRESS_TEXCOORD:"COMPRESS_TEXCOORD",UseLineColor:"USE_LINECOLOR",InstanceBim:"InstanceBim",InstancePipe:"InstancePipe",COMPUTE_TEXCOORD:"COMPUTE_TEXCOORD"}),it=Object.freeze({SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32}),ot=Object.freeze({BIM:17,PIPELINE:29});function rt(){this.model=void 0,this.context=void 0}function nt(e){this.layer=e.layer,this.vertexPackage=e.vertexPackage,this.arrIndexPackage=e.arrIndexPackage,this.vertexBufferToCreate=new Cesium.Queue,this.indexBufferToCreate=new Cesium.Queue,this.shaderProgramToCreate=new Cesium.Queue;let t,i;for(t=0,i=this.vertexPackage.vertexAttributes.length;ts.lodRangeData:s.lodRangeMode===_t.GeometryError?16this.lodRangeData)},Ct.prototype.getPixel=function(e){var t=this.boundingVolume.boundingSphere,i=t.radius,t=t.center,t=Cesium.Cartesian3.distance(e.camera.positionWC,t),o=e.context.drawingBufferHeight,e=.5*e.camera.frustum._fovy;return.5*o/Math.tan(e)*i/t},Ct.prototype.getGeometryError=function(e){var t=e.camera,i=this.layer.context.drawingBufferHeight;return this.lodRangeData*i/(this.boundingVolume.distanceToCamera(e)*t.frustum.sseDenominator)},Ct.prototype.distanceToTile=function(e){let t=yt(this);return t.distanceToCamera(e)},Ct.prototype.distanceToTileCenter=function(e){var t=new Cesium.Cartesian3,i=yt(this).boundingVolume,i=Cesium.Cartesian3.subtract(i.center,e.camera.positionWC,t);return Cesium.Cartesian3.dot(e.camera.directionWC,i)},Ct.prototype.visibility=function(e,t){var i=yt(this);return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},Ct.prototype.updateVisibility=function(e,t){var i,o,r,n=this.parent,n=Cesium.defined(n)?n.visibilityPlaneMask:Cesium.CullingVolume.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(e),this.centerZDepth=this.distanceToTileCenter(e),this.pixel=this.getPixel(e),this.geometryError=this.getGeometryError(e),this.visibilityPlaneMask=this.visibility(e,n),this.visible=this.visibilityPlaneMask!==Cesium.CullingVolume.MASK_OUTSIDE&&this.distanceToCamera>=t.visibleDistanceMin&&this.distanceToCamera<=t.visibleDistanceMax,this.priorityDeferred=(n=this,t=e,e=new Cesium.Cartesian3,t=t.camera,i=n.boundingVolume.boundingSphere,o=i.radius,r=Cesium.Cartesian3.multiplyByScalar(t.directionWC,n.centerZDepth,e),r=Cesium.Cartesian3.add(t.positionWC,r,e),r=Cesium.Cartesian3.subtract(r,i.center,e),void(or||i);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}},At.prototype.trim=function(){this._trimTiles=!0};var Lt=Object.freeze({RESET:0,SetColor:1,SELECTED:2,HIDE:4,OFFSET:8,CLIP:16,BLOOM:32,ALL:255});function Mt(){this._fillForeColor=new Cesium.Color,this._lineColor=new Cesium.Color,this._lineWidth=1,this._bottomAltitude=0,this._pointSize=1,this._pointColor=new Cesium.Color}function Rt(e,t){e=Cesium.defaultValue(e,Cesium.defaultValue.EMPTY_OBJECT),Cesium.Check.defined("options.url",e.url),Cesium.Check.defined("options.context",e.scene),this.id=Cesium.createGuid(),this.name=e.name,this.scene=e.scene,this.context=this.scene._context,this.show=!0,this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=new Cesium.Matrix4,this.invModelMatrix=new Cesium.Matrix4,this._visibleDistanceMax=Cesium.defaultValue(e.far,Number.MAX_VALUE),this._visibleDistanceMin=Cesium.defaultValue(e.near,0),this._lodRangeScale=Cesium.defaultValue(e.lodRangeScale,1),this._selectedColor=new Cesium.Color(1,0,0,1),this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new Tt,this._selections=[],this._objsOperationList={},this._requestTiles=[],this._processTiles=[],this._selectedTiles=[],this._cache=new At,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._vertexCompressionType=void 0,this._style3D=new Mt,this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,pixel:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,pixel:Number.MAX_VALUE},this._readyPromise=Cesium.when.defer(),this.loadConfig(e.url),this.scene.primitives.add(this),this.readyPromise.then(()=>{t&&t(this)}).otherwise(function(e){console.log(e)})}function Ot(e,t){e.updateObjsOperation(t.ids,t)}function Bt(e,t){return e.priority-t.priority}function Ft(e,t){t.free()}function Ht(e){e._cache.unloadTiles(e,Ft)}Object.defineProperties(Mt.prototype,{fillForeColor:{get:function(){return this._fillForeColor},set:function(e){Cesium.Check.typeOf.object("fillForeColor value",e),Cesium.Color.clone(e,this._fillForeColor)}},bottomAltitude:{get:function(){return this._bottomAltitude},set:function(e){Cesium.Check.typeOf.number("bottomAltitude value",e),this._bottomAltitude!==e&&(this._bottomAltitude=e,this._dirty=!0)}},altitudeMode:{get:function(){return this._altitudeMode},set:function(e){Cesium.Check.typeOf.number("altitudeMode value",e),this._altitudeMode=e}},lineColor:{get:function(){return this._lineColor},set:function(e){Cesium.Check.typeOf.object("line color",e),Cesium.Color.clone(e,this._lineColor)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){Cesium.Check.typeOf.number("line width",e),this._lineWidth=e}},pointSize:{get:function(){return this._pointSize},set:function(e){Cesium.Check.typeOf.number("point size",e),this._pointSize=e}},pointColor:{get:function(){return this._pointColor},set:function(e){Cesium.Check.typeOf.object("point color",e),Cesium.Color.clone(e,this._pointColor)}}}),Object.defineProperties(Rt.prototype,{ready:{get:function(){return 0
',$(".cesium-viewer").append(l),u=document.getElementById(s)),i?(u.innerHTML=e,u.style.left=t.x+r+"px",u.style.top=t.y+n+"px",u.style.display="block"):u.style.display="none",{tooltip:u,style:o,showAt:function(e,t){this.tooltip.innerHTML=t,this.style&&this.style.origin?("center"===this.style.origin&&(r=15,n=-this.tooltip.offsetHeight/2),"top"===this.style.origin&&(r=15,n=-this.tooltip.offsetHeight-20),"bottom"===this.style.origin&&(r=15,n=20)):(r=15,n=-this.tooltip.offsetHeight/2),this.tooltip.style.left=e.x+r+"px",this.tooltip.style.top=e.y+n+"px",this.tooltip.style.display="block"},show:function(e){this.tooltip.style.display=e?"block":"none"}}},v.prototype.getWMTSData=function(u,t){ge(u.url+"?service=WMTS&request=GetCapabilities").then(o=>{let r=o.xmlObj,e,n,a,s={};if(u.gisserverTMS)e=_e(r),n=e.Contents&&e.Contents.Layer;else{let i=r.getElementsByTagName("Layer");for(let e=0,t;ee.TileMatrixSet===t)[0]}i&&i.TileMatrixSetLimits&&i.TileMatrixSetLimits.TileMatrixLimits.forEach(e=>{let t=e.TileMatrix;var i=(t=t.split(":"))[t.length-1];s[i]={maxCol:e.MaxTileCol,minCol:e.MinTileCol,maxRow:e.MaxTileRow,minRow:e.MinTileRow}})}t&&t({boundingSphere:a,TileMatrixLimits:s})})},v.prototype.getPointToCameraDistance=function(e,t){let i;var o;return i=2===e.scene.mode?(o=e.camera.positionCartographic.clone(),Cesium.Cartesian3.distance(t,Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height))):Cesium.Cartesian3.distance(t,e.camera.position)},v.prototype.getPositionFromHR=function(e,t,i,o=0){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-t)/90;return[180*(r/(o*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(i/o+t*Math.PI/180)/Math.PI]},v.prototype.getPositionFromHPR=function(e,t,i=0,o=0){var r=Math.cos(Math.radians(o))*t,o=Math.sin(Math.radians(o))*t,t=this.getPositionFromHR(e[0],e[1],r,i);return{lon:t[0],lat:t[1],height:e[2]+o}},v.prototype.CreateResultTooltip=function(i,t={}){var o,r,e,n,a=t.id?"resultToolTip"+t.id:"resultToolTip",s=document.getElementById(a),l=(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;",s||(e='',$(i.container).append(e),s=document.getElementById(a)),t.addX||0),u=t.addY||0,c=this;function h(){if(n){if(void 0!==t.far||void 0!==t.near){var e=c.getPointToCameraDistance(i,n);if(e>t.far)return void(s.style.display="none");if(e{s.style.display="none",n=void 0,t.close&&t.close()}),i.clock.onTick.addEventListener(h),{tooltip:s,position:n,showAt:function(e,t){this.tooltip.innerHTML=t,this.tooltip.style.display="block",this.position=e,(n=e)&&(t=i.scene.cartesianToCanvasCoordinates(n))&&(o=-this.tooltip.offsetWidth/2+l,r=-this.tooltip.offsetHeight+u,this.tooltip.style.left=t.x+o+"px",this.tooltip.style.top=t.y+r+"px")},show:function(e){n=e?(this.tooltip.style.display="block",this.position):void(this.tooltip.style.display="none")},destroy(){i.clock.onTick.removeEventListener(h),s.remove()}}},v.prototype.CombineEcharts=function(e,t,i){return this._CombineEcharts||(this._CombineEcharts=new re(e)),this._CombineEcharts.setOption(t,i)},v.prototype.getHeatmapData=function(t,i,o=600){let r=[];for(let e=0;e{let n=new Map;e.forEach((e,t)=>{var i=e.name.substring(0,e.name.length-4);let o=n.get(i);o||(n.set(i,{shp:void 0,dbf:void 0}),o=n.get(i)),e.name.includes(".shp")?o.shp=r[t]:o.dbf=r[t]}),n.forEach((e,t)=>{e.shp?this.loadShpFile({shp:e.shp,dbf:e.dbf,encoding:o,fileName:t},i):console.error("请选择"+t+".shp文件")})}})},v.prototype.loadShpFile=function({fileName:o,shp:e,dbf:t,encoding:i},r){if(!window.shapefile){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/shapefile.js")}return shapefile.open(e,t,{encoding:i||"utf-8"}).then(i=>i.read().then(function e(t){if(!t.done)return Cesium.GeoJsonDataSource.load(t.value,{clampToGround:!0}).then(e=>{r&&o?r(o,e.entities.values[0]):r(e.entities.values[0])}),i.read().then(e)})).catch(e=>console.error(e.stack))},v.prototype.getGifImageProperty=function(e,t=6){if(!e||-1===e.indexOf(".gif"))return e;if(!window.SuperGif){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/libgif.js")}let i=document.createElement("img"),o=(i.src=e,i.setAttribute("rel:animated_src",e),i.setAttribute("rel:auto_play","0"),document.body.appendChild(i),new SuperGif({gif:i})),r=[],n=(new Promise(e=>{o.load(()=>{for(let e=1;e<=o.get_length();e++)o.move_to(e),r.push(o.get_canvas().toDataURL());e(r)})}),0);return new Cesium.CallbackProperty(function(){return r.length?(n{let r;(r=(r=1===n.length?e.substring(1,e.length-1):0===t?e.substring(1,e.length)+")":t===n.length-1?"("+e.substring(0,e.length-1):"("+e+")").split("),(")).forEach((e,t)=>{let i,o=(1===r.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===r.length-1&&(i=e.substring(0,e.length-1)),i=i.split(","),[]);i.forEach(e=>{e=e.split(" ");o.push(Cesium.Cartesian3.fromDegrees(e[0],e[1]))}),a.push(o)})}):-1{let i,o=(1===n.length?i=e.substring(1,e.length-1):0===t?i=e.substring(1,e.length):t===n.length-1&&(i=e.substring(0,e.length-1)),i=i.split(","),[]);i.forEach(e=>{e=e.split(" ");o.push(Cesium.Cartesian3.fromDegrees(e[0],e[1]))}),a.push(o)}),a},v.prototype.VectorSlice=function(e){var t="EPSG:4490";return e.port&&(t=e.port),{url:e.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:e.layer,STYLE:"",TILEMATRIX:t+":{z}",TILEMATRIXSET:t,FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:e.upperLevelLimit,lowerLevelLimit:e.lowerLevelLimit,rectangle:Cesium.Rectangle.fromDegrees(e.minx,e.miny,e.maxx,e.maxy)}},v.prototype.arge=function(e,t,i,o="180",r=!1){var n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),a=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),s=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),s=(Math.pow(n,2)+Math.pow(a,2)-Math.pow(s,2))/(2*n*a);let l=Math.round(180*Math.acos(s)/Math.PI);return"360"!==o&&"+-"!==o||(this.isClockwise([[t.x,(n=r?-1:1)*t.y],[e.x,n*e.y],[i.x,n*i.y],[t.x,n*t.y]])||(l="+-"===o?-l:360-l)),l},v.prototype.isClockwise=function(e){e=Cesium_turf.lineString(e);return Cesium_turf.booleanClockwise(e)},v.prototype.saveAs=function(e,t){if(!window.saveAs){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/FileSaver.js")}saveAs(e,t)},v.prototype.getEntityProp=function(e){var t=e.properties&&e.properties.getValue();return{id:e.id,properties:t}},v.prototype.getEntityPropValue=function(e,t){e=e.properties&&e.properties.getValue();return-1{e=Cesium.Transforms.headingPitchRollToFixedFrame(e,i||new Cesium.HeadingPitchRoll),i=new Cesium.Cartesian3(0,0,0);return Cesium.Matrix4.multiplyByPoint(e,t,i),i},v.prototype.getOffsetTilingScheme=function(e="GCJ02"){let t,i;return"GCJ02"===e&&(t=new Cesium.WebMercatorTilingScheme,i=new Cesium.WebMercatorProjection,t._projection.project=function(e,t){return t=he.WGS84ToGCJ02(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),t=i.project(new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))),new Cesium.Cartesian2(t.x,t.y)},t._projection.unproject=function(e,t){e=i.unproject(e);return t=he.GCJ02ToWGS84(Cesium.Math.toDegrees(e.longitude),Cesium.Math.toDegrees(e.latitude)),new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]))}),t},v.prototype.trackedEntity=function(n,a,e={}){let c={type:"tracked",heading:0,pitch:-45,distance:1e3,minDistance:0};Object.assign(c,e);let h,m,d;if(c.tooltip){c.tooltip=Object.assign({innerHTML:"",drag:!1,near:0,far:1e3,addX:0,addY:0},c.tooltip);e=``;if($(n.container).append(e),h=document.getElementById("trackedTooltip"+a.id),(m=h.firstElementChild).innerHTML=c.tooltip.innerHTML,m.style.left=c.tooltip.addX+"px",m.style.top=c.tooltip.addY+"px",m.style.position="relative",c.tooltip.drag){(d=document.createElement("div")).className="trackedTooltip-arrow",h.appendChild(d);let n,a,s,l,u=(e,t)=>{let i;n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),a=-(n-e)/2+"px",s=-t/2+"px",e?(i=Cesium.Math.toDegrees(Math.atan(t/e)),e<0&&(a=(n+e)/2-n+"px")):i=0{o=e.pageX-t,r=e.pageY-i,m.style.left=o+"px",m.style.top=r+"px",u(o,r),d.style.width=n+"px",d.style.left=a,d.style.bottom=s,d.style.transform=l},document.onmouseup=e=>{document.onmousemove=null}})}}this.endTrackedEntity&&this.endTrackedEntity(),c.start&&"function"==typeof c.start&&c.start();let s=new Cesium.ScreenSpaceEventHandler(n.scene.canvas),l;if("setView"===c.type){l=()=>{var e=n.clock.currentTime.clone(),e=a.position.getValue(e);if(n.scene.camera.setView({destination:e,orientation:{heading:Cesium.Math.toRadians(c.heading),pitch:Cesium.Math.toRadians(c.pitch)}}),n.scene.camera.moveBackward(c.distance),c.tooltip){c.distance<=c.tooltip.far&&c.distance>=c.tooltip.near?h.style.display="block":h.style.display="none";var t=n.scene.cartesianToCanvasCoordinates(e);if(!t)return;h.style.left=t.x+"px",h.style.top=t.y-h.offsetHeight+"px"}c.position=e,c.update&&"function"==typeof c.update&&c.update()},n.scene.preRender.addEventListener(l);let t,i,o,r;s.setInputAction(e=>{t={position:e.position,heading:c.heading,pitch:c.pitch}},Cesium.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(e=>{t=void 0},Cesium.ScreenSpaceEventType.LEFT_UP),s.setInputAction(e=>{t&&(i=e.endPosition,o=i.x-t.position.x,r=i.y-t.position.y,c.heading=t.heading+o/8,c.pitch=t.pitch-r/6)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(e=>{c.distance-=e*c.distance/1e3,c.distance{this.endTrackedEntity&&this.endTrackedEntity()},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.endTrackedEntity=()=>{s&&s.destroy(),n.trackedEntity=void 0,l&&n.scene.preRender.removeEventListener(l),h&&h.remove(),h=void 0,l=void 0,s=void 0,c.end&&"function"==typeof c.end&&c.end()},c.destroy=this.endTrackedEntity,c.updataTooltip=e=>{m.innerHTML=c.tooltip.innerHTML=e},c},v.prototype.getPointFromWindowPoint=function(e,t){return"EllipsoidTerrainProvider"==t.scene.terrainProvider.constructor.name?t.camera.pickEllipsoid(e,t.scene.globe.ellipsoid):(e=t.scene.camera.getPickRay(e),t.scene.globe.pick(e,t.scene))},v.prototype.isnull=function(e){return null==e||""===e},v.prototype.getuid=function(){return this.uuid(8,16)},v.prototype.extendgl=function(e,t,i){return null!=t?("string"==typeof t&&"["==t.charAt(0)&&"]"==t.charAt(t.length-1)&&(t=(t=t.substr(0,t.length-1)).substr(1),null!=e.properties[t]._value?t=e.properties[t]._value:null!=e.properties[t]&&(t=e.properties[t])),t):i},v.prototype.customGeometry=function(t){if(t.scale)for(let e=0;e{e.level>t&&(t=e.level)}),t},v.prototype.getViewRectangle=function(e){e=e.camera.computeViewRectangle();return this.toDegreesRectangle(e)},v.prototype.toDegreesRectangle=function(e){let t=new Cesium.Rectangle;return t.west=Cesium.Math.toDegrees(e.west),t.north=Cesium.Math.toDegrees(e.north),t.east=Cesium.Math.toDegrees(e.east),t.south=Cesium.Math.toDegrees(e.south),t},v.prototype.getCenterOfMass=function(e){let i=[],o=0;if(e[0].x){let t;e.forEach(e=>{t=this.toDegrees(e),i.push([t.lon,t.lat]),o+=t.height})}else e[0].lon?e.forEach(e=>{i.push([e.lon,e.lat]),o+=e.height||0}):Array.isArray(e[0])&&(i=e).forEach(e=>{o+=e[2]||0});var t=turf.polygon([i]);let r=turf.pointOnFeature(t);return o/=e.length,r.geometry.coordinates[2]=o,r.geometry.coordinates},v.prototype.addPickStage=function(e,t="rgba(255,0,0,0.6)"){let i=e.scene.postProcessStages.add(new Cesium.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 highlight;\nvoid main() {\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (czm_selected()) {\n vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n gl_FragColor = vec4(highlighted, 1.0);\n } else { \n gl_FragColor = color;\n }\n}\n",uniforms:{highlight:function(){return new Cesium.Color.fromCssColorString(t)}}}));return i.selected=[],{select(e){!e.color&&e.content?e=e.content.tile:e.id instanceof Cesium.Entity&&(e=e.id),i.selected=[e],this.changeOtherHighlight()},changeOtherHighlight(){let e=i.selected[0];e&&(e instanceof Cesium.Cesium3DTile?e.defaultColor?(e.color=e.defaultColor,e.defaultColor=null):(e.defaultColor=e.color&&e.color.clone(),e.color=Cesium.Color.RED):e instanceof Cesium.Entity||e.primitive instanceof Rt&&(e.primitive._selections.length?e.primitive.releaseSelection():e.primitive.setSelection(e.id)))},remove(){this.changeOtherHighlight(),i.selected=[]},destroy(){e.scene.postProcessStages.remove(i)}}},v.prototype.addLoading=function(e,t){let i=document.createElement("div"),o=(i.id="cesiumLoading",i.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;",document.createElement("img"));return o.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",o.src=t||window.SmartEarthRootUrl+I.loading,i.appendChild(o),e.appendChild(i),{isLoading(e){i.style.display=e?"block":"none"},remove(){i&&i.remove(),i=null}}},v.prototype.uuid=function(e,t){var i,o,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],n=[];if(t=t||r.length,e)for(i=0;i{let t=!0;var i;if(r&&(i=Cesium_turf.centerOfMass(e),t=Cesium_turf.booleanPointInPolygon(i,r)),t){var o=e.geometry.coordinates[0];let t=[],i=[];for(let e=0;e<3;e++)t.push([o[e][0],o[e][1]]),i.push(Cesium.Cartesian3.fromDegrees(o[e][0],o[e][1],o[e][2]));e.positions=i,n&&(e.area=this.getArea(t,i,!0),a+=e.area)}}),{tin:i,area:a}},v.prototype.getSpaceArea=function(i,e,t={}){var o=this.defaultValue(t.distance,50),r=this.defaultValue(t.onlyTerrain,!1);let n=this.defaultValue(t.isNum,!1),a=this.getPointsInPolygon(e,o,!0),s=Cesium_turf.polygon([e]),l=()=>{let{tin:e,area:t}=this.tinFromPoints(a,{getArea:!0,polygon:s});return n?{area:t,tin:e}:{area:t=t<1e6?t.toFixed(2)+"平方米":(t/1e6).toFixed(2)+"平方千米",tin:e}};if(r){let t=[];return a.features.forEach(e=>{e=e.geometry.coordinates;t.push(Cesium.Cartographic.fromDegrees(e[0],e[1]))}),this.getHeightsFromLonLat(i,t).then(o=>(a.features.forEach((e,t)=>{let i=e.geometry.coordinates;i[2]=o[t]||0}),l()))}return a.features.forEach(e=>{let t=e.geometry.coordinates;e=new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1])),e=i.scene.sampleHeight(e)||0;t[2]=e}),l()},v.prototype.starPositions=function(e,t,i){for(var o=Math.PI/e,r=[],n=0;n<2*e;n++){var a=n%2==0?t:i,a=new Cesium.Cartesian2(Math.cos(n*o)*a,Math.sin(n*o)*a);r.push(a)}return r},v.prototype.computeCircle=function(t){let i=Gt.get(t);if(i)return i;i=[];for(let e=0;e<360;e+=12){var o=Cesium.Math.toRadians(e);i.push(new Cesium.Cartesian2(t*Math.cos(o),t*Math.sin(o)))}return Gt.set(t,i),i},v.prototype.getArea=function(t,u,i){if(!(t.length<3)){let r=Array.concat(t,[t[0]]);var c=0,t=Cesium_turf.polygon([r]);let e;e=4===r.length?[t]:Cesium_turf.tesselate(t).features;let n,a,s,l;return(e.forEach(e=>{n=e.geometry.coordinates[0],a=r.findIndex(e=>e.toString()===n[0].toString()),s=r.findIndex(e=>e.toString()===n[1].toString()),l=r.findIndex(e=>e.toString()===n[2].toString());var e=this.getdistance(u[a],u[s]),t=this.getdistance(u[s],u[l]),i=this.getdistance(u[a],u[l]),o=(e+t+i)/2;c+=Math.sqrt((o-e)*(o-t)*(o-i)*o)}),i)?c:c=c<1e6?c.toFixed(2)+"平方米":(c/1e6).toFixed(2)+"平方千米"}},v.prototype.getdistance=function(e,t){var e=Cesium.Cartographic.fromCartesian(e),t=Cesium.Cartographic.fromCartesian(t),i=new Cesium.EllipsoidGeodesic,i=(i.setEndPoints(e,t),i.surfaceDistance);return Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))},v.prototype.Angle=function(e,t,i){e=this.Bearing(t,e)-this.Bearing(t,i);return e<0&&(e+=360),e},v.prototype.Bearing=function(e,t){var i=Math.PI/180,o=180/Math.PI,r=e.lat*i,e=e.lon*i,n=t.lat*i,t=t.lon*i,i=-Math.atan2(Math.sin(e-t)*Math.cos(n),Math.cos(r)*Math.sin(n)-Math.sin(r)*Math.cos(n)*Math.cos(e-t));return i<0&&(i+=2*Math.PI),i*=o},v.prototype.getHeight=function(e,t){try{var i;return 1{if(e){g=e;e=!1;for(!0!==r.scene.globe.depthTestAgainstTerrain&&(e=r.scene.globe.depthTestAgainstTerrain=!0),f=0;fparseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}e&&(r.scene.globe.depthTestAgainstTerrain=!1),""!=n&&null!=n&&"function"==typeof n&&n(a)}})},v.prototype.getPmfxPro=function(m,t,i,d,o,r){let n=this,a={gcs:[],min:99999,max:0,juli:0,cys:0},p=[],s=[];for(let e=0;e{s.forEach((e,t)=>{var i=m[t],o=m[t+1],i=d.Cartographic.fromCartesian(i),r=d.Math.toDegrees(i.longitude),n=d.Math.toDegrees(i.latitude),o=d.Cartographic.fromCartesian(o),a=d.Math.toDegrees(o.longitude),o=d.Math.toDegrees(o.latitude),s=e,l=d.Math.lerp(r,a,1/s)-r,u=d.Math.lerp(n,o,1/s)-n;0===t&&p.push(i);for(let e=0;e{if(e){i=e;e=o.scene.globe.depthTestAgainstTerrain;o.scene.globe.depthTestAgainstTerrain=!0;for(let e=0;eparseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}o.scene.globe.depthTestAgainstTerrain=e,r&&"function"==typeof r&&r(a)}})};1e3{layuiLayer.close(e),setTimeout(()=>{u()},10)},btn2:()=>{r&&"function"==typeof r&&r(a)}}):setTimeout(()=>{u()},10)},v.prototype.get3DTileOrPrimitivesHeights=function(e,t){return t.scene.sampleHeight(e)},v.prototype.getHeightsFromLonLat=function(i,o){var r=[];if(i.terrainProvider){if(i.terrainProvider instanceof Cesium.EllipsoidTerrainProvider)return new Promise(function(e,t){o.forEach(e=>{r.push(0)}),e(r)});{let e=Cesium.sampleTerrainMostDetailed(i.terrainProvider,o);return e.then(e=>(e.forEach(function(e){r.push(e.height)}),r),()=>(o.forEach(e=>{r.push(i.scene.globe.getHeight(e))}),r))}}return new Promise(function(e,t){o.forEach(e=>{r.push(i.scene.globe.getHeight(e))}),e(r)})},v.prototype.getColorRamp=function(e,i,t,o){var r,n=[],a=document.createElement("canvas"),s=(a.width=100,a.height=1,a.getContext("2d")),l=("elevation"===e?r=[0,.05,.2,.35,.5,.65,.8,.95,1]:"slope"===e?r=n:"aspect"===e&&(r=[0,0,.2,.4,.6,.8,.9,1,1]),i=i||["#0b0b88","#2747E0","#D33B7D","#D33038","#FF9742","#ffd700","#bbff00"],s.createLinearGradient(0,0,100,0));if("slope"===e){void 0===t&&(t=0),0==(t=void 0===o?90:t)?n.push(0):(n.push(t/90),l.addColorStop(0,"#000000"));var u=(o-t)/6;if(90==o){for(var c=1;c<=5;c++)n.push((t+c*u)/90);n.push(1),n.forEach(function(e,t){l.addColorStop(e,i[t])})}else{for(c=1;c<=5;c++)n.push((t+c*u)/90);n.push(o/90),n.forEach(function(e,t){l.addColorStop(e,i[t])}),l.addColorStop(1,"#000000")}}else l.addColorStop(r[0],"#000000"),l.addColorStop(r[1],i[0]),l.addColorStop(r[2],i[1]),l.addColorStop(r[3],i[2]),l.addColorStop(r[4],i[3]),l.addColorStop(r[5],i[4]),l.addColorStop(r[6],i[5]),l.addColorStop(r[7],i[6]),l.addColorStop(r[8],"#000000");return s.fillStyle=l,s.fillRect(0,0,100,1),a},v.prototype.Gauss_to_XY=function(e,t,i,o){var r,n,a=6356752.3142,a=Math.sqrt(272331606681.9453)/a,i=this.to_Radian(i),e=(t=this.to_Radian(t),(e=this.to_Radian(e))-i),i=Math.cos(t),s=(n=this.to_N(t))*Math.cos(t),l=(r=Math.tan(t),a=a*i,Math.pow(r,2)),u=Math.pow(r,4),c=Math.pow(a,2),h=Math.pow(a,4),m=Math.pow(i,3),d=Math.pow(i,5),t=this.to_Sm(t)+Math.pow(e,2)/2*s*i*r+Math.pow(e,4)/24*r*s*m*(5-l+9*c+4*h)+Math.pow(e,6)/720*r*s*d*(61-58*r*r+u+270*c-330*r*r*c),h=e*n*i+Math.pow(e,3)/6*n*m*(1-r*r+a*a)+Math.pow(e,5)/120*n*d*(5-18*r*r+u+14*c-58*c*l);return new o.Cartesian2(h,t)},v.prototype.to_Radian=function(e){return e*Math.PI/180},v.prototype.to_N=function(e){var t=6378137,i=6356752.3142,i=Math.sqrt(t*t-i*i)/t;return t/Math.sqrt(1-i*i*Math.sin(e)*Math.sin(e))},v.prototype.to_Sm=function(e){var t=6378137,i=6356752.3142,i=Math.sqrt(t*t-i*i)/t,o=1+i*i*3/4+45*Math.pow(i,4)/64+175*Math.pow(i,6)/256+11025*Math.pow(i,8)/16384,r=3*Math.pow(i,2)/4+15*Math.pow(i,4)/16+525*Math.pow(i,6)/512+2205*Math.pow(i,8)/2048,n=15*Math.pow(i,4)/64+105*Math.pow(i,6)/256+2205*Math.pow(i,8)/4096,a=35*Math.pow(i,6)/512+315*Math.pow(i,8)/2048,s=315*Math.pow(i,8)/16384;return t*(1-i*i)*(o*e-r/2*Math.sin(2*e)+n/4*Math.sin(4*e)-a/6*Math.sin(6*e)+s/8*Math.sin(8*e))},v.prototype.ElevationAngle=function(e,t,i){var o=i.Cartographic.fromCartesian(e),r=i.Cartographic.fromCartesian(t),r=(o.height,o.height,r.height,i.Cartesian3.fromDegrees(i.Math.toDegrees(r.longitude),i.Math.toDegrees(r.latitude),o.height)),o=parseFloat(function(e,t){for(var i=0,o=0;o=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}})),new Cesium.CircleScanMultiMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},v.prototype.getSectorScanMaterial=function(e,t){function i(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()}return Cesium.EllipsoidFadeMaterialProperty||(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(t=Cesium.defined(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}})),new Cesium.EllipsoidFadeMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,45))},v.prototype.getCircleScanMaterial=function(e,t){function i(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()}return Cesium.CircleScanMaterialProperty||(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(t=Cesium.defined(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}})),new Cesium.RadarScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},v.prototype.gradientColor=function(e,t,i){return new me(e,t,i)},v.prototype.xhr=function(e){var t=new XMLHttpRequest,i=!0,i=null==e.async||(null==e.async||e.async);if(t.open(e.type,e.url,i),e.headers)for(const o in e.headers)t.setRequestHeader(o,e.headers[o]);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)):200!==this.status&&e.error&&"function"==typeof e.error&&e.error(t),e.complete&&"function"==typeof e.complete&&e.complete()}};var jn,kt="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 m(e,t){this._viewer=e,this._cesium=t,this._core=new v}function Nt(e,t){this._viewer=e,this._cesium=t,this._core=new v}function jt(e){this._viewer=e,this.editType="Entity",this._core=new v,this.tooltip=this._core.CreateTooltip({id:"ModelEdit"})}v.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":kt(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},v.prototype.xml2json=_e,v.prototype.getBrowser=function(){var e,t=navigator.userAgent.toLowerCase(),i=(t.match(/firefox|chrome|safari|opera/g)||"other")[0],o=((t.match(/msie|trident/g)||[])[0]&&(i="msie"),""),r="",o="ontouchstart"in window||-1!==t.indexOf("touch")||-1!==t.indexOf("mobile")?-1!==t.indexOf("ipad")?"pad":-1!==t.indexOf("mobile")?"mobile":-1!==t.indexOf("android")?"androidPad":"pc":"pc";switch(i){case"chrome":case"safari":case"mobile":r="webkit";break;case"msie":r="ms";break;case"firefox":r="Moz";break;case"opera":r="O";break;default:r="webkit"}return e=0e.id&&e.id.id===i.id);if(r<0)return;r=this._viewer.scene.primitives.get(r).boundingSphere;t=r.radius,e=i.position.getValue(),i.heading||(i.heading=0),i.pitch||(i.pitch=0),i.roll||(i.roll=0)}this.model=i;var r=2*t/3.63,n=Cesium.Transforms.eastNorthUpToFixedFrame(e);return this.axis=this._viewer.scene.primitives.add(Cesium.Model.fromGltf({id:"modeEditAxis",modelMatrix:n,url:window.SmartEarthRootUrl+I.modelAxis,scale:r,minimumPixelSize:o.minimumPixelSize})),this.axis.readyPromise.then(()=>{!1===o.rotateX&&(this.axis._nodeCommands[1].show=!1),!1===o.rotateY&&(this.axis._nodeCommands[0].show=!1),!1===o.rotateZ&&(this.axis._nodeCommands[5].show=!1)}),this.initEvent(o),this}},jt.prototype.initEvent=function(i){this.editHandler&&this.editHandler.destroy(),this.editHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let o,r;this.editHandler.setInputAction(e=>{o?(r=e.position,"Entity"===this.editType?(this.originPosition=this.model.position.getValue(),this.originHeading=this.model.heading||0,this.originPitch=this.model.pitch||0,this.originRoll=this.model.roll||0):(this.originPosition=Cesium.Cartesian3.fromDegrees(this.model.modelEditData.lon,this.model.modelEditData.lat,this.model.modelEditData.height),this.originHeading=this.model.modelEditData.heading||0,this.originPitch=this.model.modelEditData.ritch||0,this.originRoll=this.model.modelEditData.roll||0),this.startPosition=this._viewer.scene.pickPosition(r),this.defaultEvent(!1),this.setMouseStyle("edit")):r=void 0},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(e=>{r=void 0,this.defaultEvent(!0),this.setMouseStyle("default")},Cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(r)return this.mouseTooltip(o,e),this.edit(o,r,e.endPosition),void(i.callback&&i.callback(o));var t=this._viewer.scene.pick(e.endPosition);o=t&&"modeEditAxis"===t.id?"XArrow_1"===(t=t.mesh?t.mesh.name:t.detail.node._name)?"y":"YArrow_1"===t?"x":"ZArrow_1"===t?"z":"ZAxis_1"===t?"heading":"XAxis_1"===t?"pitch":"YAxis_1"===t?"roll":void 0:void 0,this.mouseTooltip(o,e)},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},jt.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},jt.prototype.setMouseStyle=function(e){"edit"===e?(this.defaultMouseStyle=this._viewer.container.style.cursor,this._viewer.container.style.cursor="crosshair"):"default"===e&&(this._viewer.container.style.cursor=this.defaultMouseStyle||"default")},jt.prototype.edit=function(e,i,o){if(e){var r=this.originPosition,n=this.startPosition,a=this._viewer.scene.pickPosition(o);let t=this._core.toDegrees(r);var n=this._core.toDegrees(n),a=this._core.toDegrees(a),r=this._viewer.scene.cartesianToCanvasCoordinates(r),s=(o.x,i.x,o.y-i.y);if("x"===e){var l=n.lon-a.lon;t.lon-=l,this.setPosition(t)}else if("y"===e){l=n.lat-a.lat;t.lat-=l,this.setPosition(t)}else if("z"===e){a=n.height-t.height,l=s*Math.abs(a/(i.y-r.y));t.height-=l,this.setPosition(t)}else if("heading"===e){s=this.originHeading,a=this._core.arge(r,i,o,"+-",!0);this.setRotate("heading",s-=a)}else if("pitch"===e){l=(n.lon-t.lon)/(i.x-r.x);let e=this.originPitch;a=this._core.arge(r,i,o,"+-",!0);0"']/g,Ia=RegExp(xa.source),Aa=RegExp(Da.source),La=/<%-([\s\S]+?)%>/g,Ma=/<%([\s\S]+?)%>/g,Ra=/<%=([\s\S]+?)%>/g,Oa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ba=/^\w*$/,Fa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ha=/[\\^$.*+?()[\]{}|]/g,Va=RegExp(Ha.source),Ga=/^\s+/,zt=/\s/,ka=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Na=/\{\n\/\* \[wrapped with (.+)\] \*/,ja=/,? & /,za=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ua=/[()=,{}\[\]\/\s]/,Wa=/\\(\\)?/g,Ya=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ja=/\w*$/,Ka=/^[-+]0x[0-9a-f]+$/i,Qa=/^0b[01]+$/i,qa=/^\[object .+?Constructor\]$/,Xa=/^0o[0-7]+$/i,Za=/^(?:0|[1-9]\d*)$/,$a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,es=/($^)/,ts=/['\n\r\u2028\u2029\\]/g,Ut="\\ud800-\\udfff",Wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Yt="\\u2700-\\u27bf",Jt="a-z\\xdf-\\xf6\\xf8-\\xff",Kt="A-Z\\xc0-\\xd6\\xd8-\\xde",Qt="\\ufe0e\\ufe0f",qt="\\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",Xt="['’]",Zt="["+Ut+"]",$t="["+qt+"]",ei="["+Wt+"]",ti="["+Yt+"]",ii="["+Jt+"]",qt="[^"+Ut+qt+"\\d+"+Yt+Jt+Kt+"]",Yt="\\ud83c[\\udffb-\\udfff]",Jt="[^"+Ut+"]",oi="(?:\\ud83c[\\udde6-\\uddff]){2}",ri="[\\ud800-\\udbff][\\udc00-\\udfff]",Kt="["+Kt+"]",ni="\\u200d",ai="(?:"+ii+"|"+qt+")",qt="(?:"+Kt+"|"+qt+")",si="(?:['’](?:d|ll|m|re|s|t|ve))?",li="(?:['’](?:D|LL|M|RE|S|T|VE))?",ui="(?:"+ei+"|"+Yt+")"+"?",ci="["+Qt+"]?",ci=ci+ui+("(?:"+ni+"(?:"+[Jt,oi,ri].join("|")+")"+ci+ui+")*"),ui="(?:"+[ti,oi,ri].join("|")+")"+ci,ti="(?:"+[Jt+ei+"?",ei,oi,ri,Zt].join("|")+")",is=RegExp(Xt,"g"),os=RegExp(ei,"g"),hi=RegExp(Yt+"(?="+Yt+")|"+ti+ci,"g"),rs=RegExp([Kt+"?"+ii+"+"+si+"(?="+[$t,Kt,"$"].join("|")+")",qt+"+"+li+"(?="+[$t,Kt+ai,"$"].join("|")+")",Kt+"?"+ai+"+"+si,Kt+"+"+li,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",ui].join("|"),"g"),mi=RegExp("["+ni+Ut+Wt+Qt+"]"),ns=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,as=["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"],ss=-1,ls={},us=(ls[ga]=ls[fa]=ls[_a]=ls[Ca]=ls[ya]=ls[va]=ls[wa]=ls[ba]=ls[Ta]=!0,ls[Xn]=ls[Zn]=ls[da]=ls[$n]=ls[pa]=ls[ea]=ls[ta]=ls[ia]=ls[ra]=ls[na]=ls[aa]=ls[la]=ls[ua]=ls[ca]=ls[ma]=!1,{}),di=(us[Xn]=us[Zn]=us[da]=us[pa]=us[$n]=us[ea]=us[ga]=us[fa]=us[_a]=us[Ca]=us[ya]=us[ra]=us[na]=us[aa]=us[la]=us[ua]=us[ca]=us[ha]=us[va]=us[wa]=us[ba]=us[Ta]=!0,us[ta]=us[ia]=us[ma]=!1,{"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"}),cs=parseFloat,hs=parseInt,Jt="object"==typeof global&&global&&global.Object===Object&&global,oi="object"==typeof self&&self&&self.Object===Object&&self,ms=Jt||oi||Function("return this")(),ri="object"==typeof o&&o&&!o.nodeType&&o,pi=ri&&"object"==typeof module&&module&&!module.nodeType&&module,ds=pi&&pi.exports===ri,gi=ds&&Jt.process,Zt=function(){try{var e=pi&&pi.require&&pi.require("util").types;return e?e:gi&&gi.binding&&gi.binding("util")}catch(e){}}(),gs=Zt&&Zt.isArrayBuffer,fs=Zt&&Zt.isDate,_s=Zt&&Zt.isMap,Cs=Zt&&Zt.isRegExp,ys=Zt&&Zt.isSet,vs=Zt&&Zt.isTypedArray;function ws(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function bs(e,t,i,o){for(var r=-1,n=null==e?0:e.length;++r":">",'"':""","'":"'"});function Zs(e){return"\\"+di[e]}function $s(e){return mi.test(e)}function el(e){var i=-1,o=Array(e.size);return e.forEach(function(e,t){o[++i]=[t,e]}),o}function tl(t,i){return function(e){return t(i(e))}}function il(e,t){for(var i=-1,o=e.length,r=0,n=[];++i",""":'"',"'":"'"});var f=function r(e){var b=(e=null==e?ms:_.defaults(ms.Object(),e,_.pick(ms,as))).Array,n=e.Date,R=e.Error,O=e.Function,B=e.Math,g=e.Object,j=e.RegExp,z=e.String,C=e.TypeError,U=b.prototype,W=O.prototype,Y=g.prototype,J=e["__core-js_shared__"],K=W.toString,F=Y.hasOwnProperty,Q=0,q=(W=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",X=Y.toString,Z=K.call(g),$=ms._,ee=j("^"+K.call(F).replace(Ha,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=ds?e.Buffer:jn,t=e.Symbol,te=e.Uint8Array,ie=W?W.allocUnsafe:jn,oe=tl(g.getPrototypeOf,g),re=g.create,ne=Y.propertyIsEnumerable,ae=U.splice,se=t?t.isConcatSpreadable:jn,le=t?t.iterator:jn,ue=t?t.toStringTag:jn,ce=function(){try{var e=Zi(g,"defineProperty");return e({},"",{}),e}catch(e){}}(),he=e.clearTimeout!==ms.clearTimeout&&e.clearTimeout,me=n&&n.now!==ms.Date.now&&n.now,de=e.setTimeout!==ms.setTimeout&&e.setTimeout,pe=B.ceil,ge=B.floor,fe=g.getOwnPropertySymbols,W=W?W.isBuffer:jn,_e=e.isFinite,Ce=U.join,ye=tl(g.keys,g),y=B.max,T=B.min,ve=n.now,we=e.parseInt,be=B.random,Te=U.reverse,n=Zi(e,"DataView"),Ee=Zi(e,"Map"),Se=Zi(e,"Promise"),Pe=Zi(e,"Set"),e=Zi(e,"WeakMap"),xe=Zi(g,"create"),De=e&&new e,Ie={},Ae=Eo(n),Le=Eo(Ee),Me=Eo(Se),Re=Eo(Pe),Oe=Eo(e),t=t?t.prototype:jn,Be=t?t.valueOf:jn,Fe=t?t.toString:jn;function p(e){if(N(e)&&!k(e)&&!(e instanceof v)){if(e instanceof f)return e;if(F.call(e,"__wrapped__"))return So(e)}return new f(e)}var He=function(e){if(!P(e))return{};if(re)return re(e);Ve.prototype=e;e=new Ve;return Ve.prototype=jn,e};function Ve(){}function Ge(){}function f(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=jn}function v(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Qn,this.__views__=[]}function ke(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t>>0,t>>>=0,b(r));++o>>1,a=e[n];null!==a&&!x(a)&&(i?a<=t:a>>0)?(e=d(e))&&("string"==typeof t||null!=t&&!Dr(t))&&!(t=u(t))&&$s(e)?li(nl(e),0,i):e.split(t,i):[]},p.spread=function(i,o){if("function"!=typeof i)throw new C(zn);return o=null==o?0:y(D(o),0),a(function(e){var t=e[o],e=li(e,0,o);return t&&As(e,t),ws(i,this,e)})},p.tail=function(e){var t=null==e?0:e.length;return t?s(e,1,t):[]},p.take=function(e,t,i){return e&&e.length?s(e,0,(t=i||t===jn?1:D(t))<0?0:t):[]},p.takeRight=function(e,t,i){var o=null==e?0:e.length;return o?s(e,(t=o-(t=i||t===jn?1:D(t)))<0?0:t,o):[]},p.takeRightWhile=function(e,t){return e&&e.length?ei(e,h(t,3),!1,!0):[]},p.takeWhile=function(e,t){return e&&e.length?ei(e,h(t,3)):[]},p.tap=function(e,t){return t(e),e},p.throttle=function(e,t,i){var o=!0,r=!0;if("function"!=typeof e)throw new C(zn);return P(i)&&(o="leading"in i?!!i.leading:o,r="trailing"in i?!!i.trailing:r),ur(e,t,{leading:o,maxWait:t,trailing:r})},p.thru=Wo,p.toArray=Or,p.toPairs=tn,p.toPairsIn=on,p.toPath=function(e){return k(e)?Is(e,To):x(e)?[e]:E(bo(d(e)))},p.toPlainObject=Hr,p.transform=function(e,o,r){var t,i=k(e),n=i||vr(e)||Lr(e);return o=h(o,4),null==r&&(t=e&&e.constructor,r=n?i?new t:[]:P(e)&&br(t)?He(oe(e)):{}),(n?Ts:mt)(e,function(e,t,i){return o(r,e,t,i)}),r},p.unary=function(e){return nr(e,1)},p.union=Ro,p.unionBy=Oo,p.unionWith=Bo,p.uniq=function(e){return e&&e.length?Xt(e):[]},p.uniqBy=function(e,t){return e&&e.length?Xt(e,h(t,2)):[]},p.uniqWith=function(e,t){return t="function"==typeof t?t:jn,e&&e.length?Xt(e,jn,t):[]},p.unset=function(e,t){return null==e||Zt(e,t)},p.unzip=Fo,p.unzipWith=Ho,p.update=function(e,t,i){return null==e?e:$t(e,t,ni(i))},p.updateWith=function(e,t,i,o){return o="function"==typeof o?o:jn,null==e?e:$t(e,t,ni(i),o)},p.values=rn,p.valuesIn=function(e){return null==e?[]:Ys(e,L(e))},p.without=Vo,p.words=gn,p.wrap=function(e,t){return dr(ni(t),e)},p.xor=Go,p.xorBy=ko,p.xorWith=No,p.zip=jo,p.zipObject=function(e,t){return oi(e||[],t||[],Qe)},p.zipObjectDeep=function(e,t){return oi(e||[],t||[],zt)},p.zipWith=zo,p.entries=tn,p.entriesIn=on,p.extend=Gr,p.extendWith=kr,En(p,p),p.add=On,p.attempt=fn,p.camelCase=nn,p.capitalize=an,p.ceil=Bn,p.clamp=function(e,t,i){return i===jn&&(i=t,t=jn),i!==jn&&(i=(i=I(i))==i?i:0),t!==jn&&(t=(t=I(t))==t?t:0),tt(I(e),t,i)},p.clone=function(e){return w(e,4)},p.cloneDeep=function(e){return w(e,5)},p.cloneDeepWith=function(e,t){return w(e,5,t="function"==typeof t?t:jn)},p.cloneWith=function(e,t){return w(e,4,t="function"==typeof t?t:jn)},p.conformsTo=function(e,t){return null==t||it(e,t,A(t))},p.deburr=sn,p.defaultTo=function(e,t){return null==e||e!=e?t:e},p.divide=Fn,p.endsWith=function(e,t,i){e=d(e),t=u(t);var o=e.length,o=i=i===jn?o:tt(D(i),0,o);return 0<=(i-=t.length)&&e.slice(i,o)==t},p.eq=G,p.escape=function(e){return(e=d(e))&&Aa.test(e)?e.replace(Da,Xs):e},p.escapeRegExp=function(e){return(e=d(e))&&Va.test(e)?e.replace(Ha,"\\$&"):e},p.every=function(e,t,i){return(k(e)?Ss:st)(e,h(t=i&&m(e,t,i)?jn:t,3))},p.find=Ko,p.findIndex=Po,p.findKey=function(e,t){return Os(e,h(t,3),mt)},p.findLast=Qo,p.findLastIndex=xo,p.findLastKey=function(e,t){return Os(e,h(t,3),dt)},p.floor=Hn,p.forEach=qo,p.forEachRight=Xo,p.forIn=function(e,t){return null==e?e:ct(e,h(t,3),L)},p.forInRight=function(e,t){return null==e?e:ht(e,h(t,3),L)},p.forOwn=function(e,t){return e&&mt(e,h(t,3))},p.forOwnRight=function(e,t){return e&&dt(e,h(t,3))},p.get=Wr,p.gt=fr,p.gte=_r,p.has=function(e,t){return null!=e&&to(e,t,Ct)},p.hasIn=Yr,p.head=Io,p.identity=M,p.includes=function(e,t,i,o){return e=c(e)?e:rn(e),i=i&&!o?D(i):0,o=e.length,i<0&&(i=y(o+i,0)),Ar(e)?i<=o&&-1=T(t=t,i=i)&&ehttps://npms.io/search?q=ponyfill.");return St(e)},p.isNil=function(e){return null==e},p.isNull=function(e){return null===e},p.isNumber=Pr,p.isObject=P,p.isObjectLike=N,p.isPlainObject=xr,p.isRegExp=Dr,p.isSafeInteger=function(e){return Tr(e)&&-Jn<=e&&e<=Jn},p.isSet=Ir,p.isString=Ar,p.isSymbol=x,p.isTypedArray=Lr,p.isUndefined=function(e){return e===jn},p.isWeakMap=function(e){return N(e)&&V(e)==ma},p.isWeakSet=function(e){return N(e)&&"[object WeakSet]"==i(e)},p.join=function(e,t){return null==e?"":Ce.call(e,t)},p.kebabCase=ln,p.last=o,p.lastIndexOf=function(e,t,i){var o=null==e?0:e.length;if(!o)return-1;var r=o;if(i!==jn&&(r=(r=D(i))<0?y(o+r,0):T(r,o-1)),t!=t)return Bs(e,Vs,r,!0);for(var n=e,a=t,s=r+1;s--;)if(n[s]===a)return s;return s},p.lowerCase=un,p.lowerFirst=cn,p.lt=Mr,p.lte=Rr,p.max=function(e){return e&&e.length?lt(e,M,_t):jn},p.maxBy=function(e,t){return e&&e.length?lt(e,h(t,2),_t):jn},p.mean=function(e){return Gs(e,M)},p.meanBy=function(e,t){return Gs(e,h(t,2))},p.min=function(e){return e&&e.length?lt(e,M,It):jn},p.minBy=function(e,t){return e&&e.length?lt(e,h(t,2),It):jn},p.stubArray=Mn,p.stubFalse=Rn,p.stubObject=function(){return{}},p.stubString=function(){return""},p.stubTrue=function(){return!0},p.multiply=Gn,p.nth=function(e,t){return e&&e.length?Ot(e,D(t)):jn},p.noConflict=function(){return ms._===this&&(ms._=$),this},p.noop=Sn,p.now=rr,p.pad=function(e,t,i){e=d(e);var o=(t=D(t))?rl(e):0;return!t||t<=o?e:Li(ge(t=(t-o)/2),i)+e+Li(pe(t),i)},p.padEnd=function(e,t,i){e=d(e);var o=(t=D(t))?rl(e):0;return t&&o=this.__values__.length;return{done:e,value:e?jn:this.__values__[this.__index__++]}},p.prototype.plant=function(e){for(var t,i=this;i instanceof Ge;)var o=So(i),r=(o.__index__=0,o.__values__=jn,t?r.__wrapped__=o:t=o,o),i=i.__wrapped__;return r.__wrapped__=e,t},p.prototype.reverse=function(){var e=this.__wrapped__;return e instanceof v?(e=e,(e=(e=this.__actions__.length?new v(this):e).reverse()).__actions__.push({func:Wo,args:[Mo],thisArg:jn}),new f(e,this.__chain__)):this.thru(Mo)},p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},p.prototype.first=p.prototype.head,le&&(p.prototype[le]=function(){return this}),p}(),F={};function Ci(e){this._viewer=e,this._core=new v,this._tree=F}function C(e){this._viewer=e,this._cesium=Cesium,this._core=new v}function yi(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._tree=F}function vi(e,t){this._viewer=e,this._cesium=t,this._tree=F.getSource(),this._core=new v}F.Source=[],F.TempSource=[],F.entity=[],F.lastSelectEntity=null,F.pointsId=[],F.states=0,F.PointSelectSource=[],F.currentObj=null,F.selectedItem=null,F.setSource=function(e){this.Source=e},F.setTempSource=function(e){this.TempSource=e},F.setPointSelectSource=function(e){this.PointSelectSource=e},F.getSource=function(){return this.Source},F.getTempSource=function(){return this.TempSource},F.getPointSelectSource=function(){return this.PointSelectSource},F.push=function(e){this.Source.push(e)},F.pusTemSource=function(e){this.TempSource.push(e)},F.pusPointSelectSource=function(e){this.PointSelectSource.push(e)},F.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(F.Source,t);if(i){for(var o=0,r=this.TempSource.length;o{t+='
'+e+"
"}):t='
'+e+"
",i=`
${o.name}
${t}
`,$(this._viewer.container).append(i),r=document.getElementById(o.id),n&&r.querySelector(".divpoint-data-li").append(o.description),o.onclick&&(r.onclick=()=>{o.onclick(o)})}else i=`
${o.name}
`,$(this._viewer.container).append(i),r=document.getElementById(o.id),o.onclick&&(r.onclick=()=>{o.onclick(o)});else{let e=o.description;var a=this._core.isDOM(e);a&&(e=""),i=`
${e}
`,$(this._viewer.container).append(i),r=document.getElementById(o.id),a&&r.querySelector(".divpoint").append(o.description),o.onclick&&(r.onclick=()=>{o.onclick(o)})}}let e=i.x,t=i.y-r.offsetHeight;"c"===o.offset?e-=r.offsetWidth/2:"r"===o.offset?e-=r.offsetWidth:Array.isArray(o.offset)&&("c"===o.offset[0]?e-=r.offsetWidth/2:"r"===o.offset[0]?e-=r.offsetWidth:"number"==typeof o.offset[0]&&(e-=o.offset[0]),"number"==typeof o.offset[1]&&(t-=o.offset[1])),r.style.transform=`matrix(1, 0, 0, 1, ${e}, ${t})`}o.update&&o.update()}},Ci.prototype.updateDivPoint=function(t,i={}){if(this.item){Object.assign(this.item,i),this.item.name=t;let e=document.getElementById(this.item.id);e&&e.remove()}},Ci.prototype.deleteObject=function(){this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent,this);let e=document.getElementById(this.item.id);e&&e.remove()},Ci.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Ci.prototype.getVisibility=function(){return this.item&&this.item.show},Ci.prototype.setTreeobj=function(e){this.treeobj=e},C.prototype.getPosition=function(){return this._viewer.camera.position},C.prototype.getDegrees=function(){var e=this._viewer.camera.positionCartographic;return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},C.prototype.getMousePosition=function(e,t){var e=e.endPosition||e.position||e,i=(void 0===this.defaultDepthTest&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain),this._viewer.camera.getPickRay(e));t&&!Array.isArray(t)&&(t=[t]);let o=this._viewer.scene.pickPosition(e);o=o?{position:o}:(this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.pickFromRay(i,t));let r;if(r=o&&o.position&&this._viewer.scene.globe.depthTestAgainstTerrain?o.position:this._viewer.scene.globe.pick(i,this._viewer.scene),this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,r)return r;console.log("未拾取到坐标!")},C.prototype.getMouseDegrees=function(e,t){e=this.getMousePosition(e,t);if(e)return this._core.toDegrees(e)},yi.prototype.createPopupMessage=function(e){var t=document.createElement("div"),i=(t.className="kz",t.id="kzmb",t.style.position="absolute",t.style.width="200px",t.style.height="500px",t.style.padding="15px",t.style.background="rgba(0, 0, 0, 0.5)",t.style.color="#fff",t.style.top="0px",t.style.right="0px",t.style.border="solid 2px #358ABA",document.body.appendChild(t),document.createElement("div")),o=(t.id="bt",i.style.overflow="hidden",i.style.height="45px",i.style.height="100%",i.className="layui-form-item",i.style.borderBottom="solid 2px #358ABA",document.createElement("span"));o.textContent=e,i.appendChild(o),t.appendChild(i),this.getElement("bt","kzmb")},yi.prototype.createPlotting=function(e,t){var i=document.createElement("main"),o=(i.id="kzmb",i.style.position="absolute",i.style.cursor="auto",i.style.left="0px",i.style.top="0px;",i.className="mainView",document.body.appendChild(i),document.createElement("button")),o=(o.id="closeScene",o.setAttribute("aria-label","Close"),o.innerHTML="",o.onclick=closeScene,o.className="myModal-close",i.appendChild(o),document.createElement("input")),r=(o.id="objectTab1",o.type="radio",o.setAttribute("checked",""),o.name="objectTab",document.createElement("label")),o=(r.setAttribute("for","objectTab1"),r.id="objectLabel1",r.className="function-module-caption",r.innerHTML="二维",i.appendChild(o),i.appendChild(r),document.createElement("input")),r=(o.id="objectTab2",o.type="radio",o.name="objectTab",document.createElement("label")),o=(r.setAttribute("for","objectTab2"),r.id="objectLabel2",r.className="function-module-caption",r.innerHTML="三维",i.appendChild(o),i.appendChild(r),document.createElement("section")),r=(o.id="objectContent1",i.appendChild(o),this.getBh(o,[{title:"点",src:"../../static/image/point/points.png",onclick:"labelDraw()"},{title:"线",src:"../../static/image/point/polyline.png",onclick:"polylineDraw()"},{title:"多边形",src:"../../static/image/point/polygon_clampToGround.png",onclick:"polygonDraw()"},{title:"矩形",src:"../../static/image/point/rectangle.png",onclick:"rectangleDraw()"},{title:"圆",src:"../../static/image/point/Cricle.png",onclick:"circleDraw()"}]),document.createElement("section"));r.id="objectContent2",i.appendChild(r);this.getBh(r,[{title:"立方体",src:"../../static/image/point/extrudedRectangle.png",onclick:"boxDraw()"},{title:"圆柱体",src:"../../static/image/point/extrudedCircle.png",onclick:"cylinderDraw()"},{title:"圆锥体",src:"../../static/image/point/Cone.png",onclick:"coneDraw()"},{title:"球体",src:"../../static/image/point/ellipsoid.png",onclick:"circleDraw()"},{title:"多边体",src:"../../static/image/point/Multilateral.png",onclick:"multilateralDraw()"}]),this.getElement("kzmb","kzmb")},yi.prototype.getBh=function(e,t){for(var i="",i="
",o=0;o
";e.innerHTML=i+="
"},yi.prototype.createMeasurement=function(e,t){var i=document.createElement("div"),o=(i.className="kz",i.id="kzmb",i.style.position="absolute",i.style.width="330px",i.style.height="500px",i.style.padding="15px",i.style.background="rgba(0, 0, 0, 0.5)",i.style.color="#fff",i.style.top="0px",i.style.right="0px",i.style.border="solid 2px #358ABA",document.body.appendChild(i),document.createElement("div")),r=(o.id="bt",o.style.height="100%",o.style.overflow="hidden",o.style.height="25px",o.className="layui-form-item",o.style.borderBottom="solid 2px #358ABA",document.createElement("span")),e=(r.textContent=e,o.appendChild(r),i.appendChild(o),document.createElement("div")),r=(e.className="layui-tab-content",i.appendChild(e),document.createElement("div")),o=(r.className="layui-tab-item layui-show",e.appendChild(r),document.createElement("div")),i=(o.className="kind",r.appendChild(o),document.createElement("ul")),e=(o.appendChild(i),[{img:"../../img/bh/labels.png",text:"垂直高度",onclick:MeasurementVd},{img:"../../img/bh/labels.png",text:"海拔高度",onclick:MeasurementAltitude},{img:"../../img/bh/labels.png",text:"空间距离",onclick:MeasurementSpaceD},{img:"../../img/bh/labels.png",text:"水平距离",onclick:MeasurementHD},{img:"../../img/bh/labels.png",text:"三维面积",onclick:MeasurementThreeDSurfaceArea},{img:"../../img/bh/labels.png",text:"平面面积",onclick:MeasurementPlaneArea},{img:"../../img/bh/labels.png",text:"角度测量",onclick:MeasurementAngle}]);this.getLi(i,e),"function"==typeof t&&t(),this.getElement("bt","kzmb")},yi.prototype.getLi=function(e,t){for(var i=0;i

${t[i].text}

`,o.onclick=t[i].onclick,e.appendChild(o)}},yi.prototype.getElement=function(e,t){var r=0,n=0,e=document.getElementById(e),a=(e.style.cursor="move",document.getElementById(t)),s=!1;e.onmousedown=function(e){e=e||window.event;r=e.clientX-a.offsetLeft,n=e.clientY-a.offsetTop,s=!0},document.onmousemove=function(e){var t,i,o;s&&(t=(e=e||window.event).clientX-r,e=e.clientY-n,i=document.documentElement.clientWidth-a.offsetWidth,o=document.documentElement.clientHeight-a.offsetHeight,t<0?t=0:in.x?i.xMax:n.x,i.yMax=i.yMax>n.y?i.yMax:n.y}return i}}function S(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._color=new m(this._viewer,this._cesium),this._tree=F,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.models=0,this.entity=null,this.primitve=[],this.probj=[],this.PrimitiveData=[],this.loadFinishKey=[],this.loadAllKey=[],this.PrimitiveObj={key:"",data:{}},this.start=0,this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._primitiveCollection=new this._cesium.PrimitiveCollection,this.img=null,this._defaultStyle=null,this._canvas=null,this._context=null,this._cache=!1,this._forceRefreshPrvimitive=null}function Di(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t=t?function(e,t,i){for(var o=e,r=0;r<30;r++){if(o.level==t)return i.push({x:o.x,y:o.y,level:o.level});o=o.parent}}:function e(t,i,o){{if(t.level==i)return o.push({x:t.x,y:t.y,level:t.level}),!0;if(t.level>i)return!1;for(var r=0;r=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},y.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},y.prototype._loadTile=function(e){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2this._upperLevelLimit)return o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),void(e=[]);(e=2=n-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=r;var a=[],s=0,l=0;e.forEach(function(t){var e,i="z"+t.level+"x"+t.x+"y"+t.y;a.push(i),o._tileKeys.push(i),o._primitiveByTile[i]||(e=o._urlTemplate.replace(window.encodeURIComponent("{x}"),t.x).replace(window.encodeURIComponent("{y}"),t.y).replace(window.encodeURIComponent("{z}"),t.level),s++,o._fetch(e).then(function(e){if(o._isRemoved)throw new Error("DISCARD");if(o._isCameraMoving)throw new Error("DISCARD");if(r!==o._moveEndTimestamp)throw new Error("DISCARD");e=o._loadTile(e,t);o._primitiveCollection.add(e),o._primitiveByTile[i]=e,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}))})}},y.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{var i=t.position,o=c.scene.pick(i);if((!o||!o.id||o.id.treeID===u.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;u.isEditting||0!=F.states?(e!=h||"point"!==e.VectorType&&"billboard"!==e.VectorType&&"label"!==e.VectorType&&"model"!==e.VectorType)&&"_height_point"!=e.name&&"_edit_point"!=e.name&&"_move_point"!=e.name&&"_add_point"!=e.name&&"_size_point"!=e.name||(c.container.style.cursor="crosshair",u.defaultEvent(!1),"_height_point"==e.name?(d={windowPosition:i,originHeight:u._cesium.Cartographic.fromCartesian(e.position.getValue()).height},n="_height_point"):"_move_point"==e.name?n="_move_point":"point"===e.VectorType||"billboard"===e.VectorType||"label"===e.VectorType||"model"===e.VectorType?(u.tooltip.showAt(t.position,"释放后完成修改"),n="_move_point","model"===e.VectorType&&(e.show=!1)):"_edit_point"==e.name?n="_edit_point":"_add_point"==e.name?n="_add_point":"_size_point"==e.name&&(n="_size_point"),m=e):(r.callBack&&r.callBack.start&&r.callBack.start(e),p=e.VectorType,(h=u.createEditEntity(p,e.VectorStyle)).feature=e,h.treeID=u.treeID,u.getSimpleGraphicData(p,h),"point"===p||"billboard"===p||"label"===p||"model"===p?(u.isEditting=!0,u.tooltip.showAt(t.position,"拖拽修改位置")):(u.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(u.treeID)),u.setStatus(!0),F.editVector=!0,u._primitiveCollection.show=!1)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{var r=c.scene.pick(t.endPosition);if((!r||!r.id||r.id.treeID===u.treeID)&&(u._cesium.defined(r)?u.isEditting&&!m?"point"!==p&&"billboard"!==p&&"label"!==p&&"model"!==p||r.id!=h?r.id&&"_edit_point"===r.id.name&&h.pottingPoint?("polyline"===p||"wall"===p)&&2{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=l,t.y/=l,t.z/=l,F.editPointID.move&&(F.editPointID.move.position=t),"polyline"!==p&&"wall"!==p&&"polygon"!==p&&"rectangle"!==p||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===n){r=F.editPointID.height.indexOf(m.id);let e=c.entities.getById(F.editPointID.edit[r]),i=("ellipse"!==p&&"cylinder"!==p&&"box"!==p||(e=F.editPointID.move),u.toDegrees(e.position.getValue()));l=d.originHeight-i.height,r=c.scene.cartesianToCanvasCoordinates(e.position.getValue()),t=(d.windowPosition.y-t.endPosition.y)*l/Math.abs(r.y-d.windowPosition.y);let o=Math.abs(l+t);F.editPointID.height.forEach(e=>{let t=c.entities.getById(e);t&&(e=t.position.getValue(),e=u.toDegrees(e),t.position=u._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),h[p].extrudedHeight?h[p].extrudedHeight=o+i.height:"box"===p?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===p&&SmartEarthPopupData.editGraphic.setValue("length",o)}else if("_add_point"===n){var r=F.editPointID.add.indexOf(m.id),l=(c.entities.remove(m),c.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}})),t=(F.editPointID.edit.splice(r+1,0,l.id),h.pottingPoint.splice(r+1,0,i.clone()),Cesium.Cartesian3.midpoint(h.pottingPoint[r],h.pottingPoint[r+1],new Cesium.Cartesian3)),t=c.entities.add({name:"_add_point",position:t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),e=Cesium.Cartesian3.midpoint(h.pottingPoint[r+1],h.pottingPoint[r+2===h.pottingPoint.length?0:r+2],new Cesium.Cartesian3),e=c.entities.add({name:"_add_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r=(F.editPointID.add.splice(r,1,t.id,e.id),SmartEarthPopupData.editGraphic.setTreeID(u.treeID),m=l,n="_edit_point",h.pottingPoint.concat([]));if("polyline"===p||"polygon"===p)SmartEarthPopupData.editGraphic.setValue("positions",r);else if("wall"===p){SmartEarthPopupData.editGraphic.setValue("positions",r);let e=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),t=SmartEarthPopupData.editGraphic.getValue("maximumHeights");e.push(e[0]),t.push(t[0]),SmartEarthPopupData.editGraphic.setValue("minimumHeights",e),SmartEarthPopupData.editGraphic.setValue("maximumHeights",t)}}else if("_size_point"===n){t=F.editPointID.move.position.getValue(),e=u._cesium.Cartesian3.distance(t,i);"ellipse"===p||"cylinder"===p||"ellipsoid"===p&&h.isSphere?SmartEarthPopupData.editGraphic.setValue("radius",e):"box"===p&&(l=90===m.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(l,2*e))}else if("point"===p||"billboard"===p||"label"===p||"model"===p)m.position=i;else{r=u.toDegrees(i),t=(d=m.position.getValue(),u.toDegrees(d));let n=r.lon-t.lon,a=r.lat-t.lat,s=r.height-t.height;m.position=i,h[p].height&&(l=u.toDegrees(i).height,h[p].height=l,h.thisHeight=l),h.pottingPoint.forEach((e,t)=>{let i,o,r=c.entities.getById(F.editPointID.edit[t]);if(r=r||c.entities.getById(F.editPointID.size[t]),i=r?u.toDegrees(r.position.getValue()):u.toDegrees(e),o=u._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s),e.x=o.x,e.y=o.y,e.z=o.z,r&&(r.position=o),0{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?u.isEditting&&(a(),u.defaultEvent(!1)):(m&&"model"===m.VectorType&&(m.show=!0),m&&r.callBack&&r.callBack.updata&&r.callBack.updata(m.name,h),c.container.style.cursor="default",m=void 0,u.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{e=c.scene.pick(e.position);if((!e||!e.id||e.id.treeID===u.treeID)&&u._cesium.defined(e)&&0==F.states){e=e.id;if(!e.VectorType&&-1{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,F.editPointID.move&&(F.editPointID.move.position=t),h.pottingPoint.concat([]));if("polyline"===p||"polygon"===p)SmartEarthPopupData.editGraphic.setValue("positions",i);else if("wall"===p){SmartEarthPopupData.editGraphic.setValue("positions",i);let e=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),t=SmartEarthPopupData.editGraphic.getValue("maximumHeights");e.pop(),t.pop(),SmartEarthPopupData.editGraphic.setValue("minimumHeights",e),SmartEarthPopupData.editGraphic.setValue("maximumHeights",t)}u.tooltip.show(!1),r.callBack&&r.callBack.updata&&r.callBack.updata(m&&m.name,h)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),a(),{endThisEdit:a,getEditData:function(){return{entity:h}}};function a(){u.defaultEvent(!0),F.editPointID.edit.forEach(e=>{c.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{c.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{c.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{c.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&c.entities.remove(F.editPointID.move),F.editPointID.move=void 0,h&&c.entities.remove(h),p=h=void 0,SmartEarthPopupData.editGraphic={},u.isEditting=!1,u.setStatus(!1),F.editVector=!1,u._primitiveCollection.show=!0,u.delButton(!1)}}else a()},y.prototype.createEditEntity=function(e,i){let o;var r=this;let n=this._viewer;if("polygon"===e){let e=i.positions;var a=r._core.defaultValue(i.height,void 0);let t;t=i.hierarchy||(e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),new r._cesium.PolygonHierarchy(e)),(o=n.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return t},!1),extrudedHeight:r._core.defaultValue(i.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(i.image,null),repeat:r._core.defaultValue(i.repeat,new r._cesium.Cartesian2(1,1)),color:i.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}})).VectorType="polygon"}else if("polyline"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),(o=n.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return e},!1),clampToGround:r._core.defaultValue(i.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:i.material,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(i.width,3)}})).VectorType="polyline"}else if("wall"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),(o=n.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return e},!1),minimumHeights:i.minimumHeights,maximumHeights:i.maximumHeights,material:i.material,outline:!0,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:i.outlineColor}})).VectorType="wall"}else"label"===e?(o=n.entities.add({position:i.position,label:{text:i.text,font:i.font,scale:i.scale,style:i.style,fillColor:i.fillColor,outlineColor:i.outlineColor,outlineWidth:i.outlineWidth,showBackground:i.showBackground,backgroundColor:i.backgroundColor,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}})).VectorType="label":"billboard"===e&&((o=n.entities.add({position:i.position,billboard:{rotation:i.rotation,width:i.width,height:i.height,image:i.image,color:i.color,scale:i.scale,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}})).VectorType="billboard");return o},y.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||((e=document.createElement("button")).id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},y.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},y.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},y.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},y.prototype.getSimpleGraphicData=function(e,n){let a=this,s=this._viewer;var t,i;function o(e){SmartEarthPopupData.editGraphic.fillColor=l("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function r(e){SmartEarthPopupData.editGraphic.outlineColor=l("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function l(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");var o=(e=e.replace("(","").replace(")","")).split(",");let i="#";for(let t=0;t{let t=s.entities.getById(e);t&&(e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=F.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=a.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){F.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{s.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{s.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{s.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&s.entities.remove(F.editPointID.move),F.editPointID.move=void 0},setTreeID:function(i){F.editPointID.edit.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.height.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.add.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.size.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.move&&(F.editPointID.move.treeID=i)}},"billboard"===e||"point"===e||"label"===e||"model"===e?((i=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?o(i):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(i=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e&&((i=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(i=i,SmartEarthPopupData.editGraphic.backgroundColor=l("rgb("+255*i.red+","+255*i.green+","+255*i.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*i.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){let e=this.getValue("font");(e=e.split(" "))[0]=t,t=e.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var i=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(i);return e.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(e))}}this.graphic[e]=t}}):"polyline"===e?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?o(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),i.outlineColor?r(i.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"outlineWidth"===e?this.graphic.material[e]=t:"alpha"===e?this.graphic.material.color._value.alpha=t:"outlineAlpha"===e?this.graphic.material.outlineColor._value.alpha=t:this.graphic[e]="positions"===e?new Cesium.CallbackProperty(function(){return t},!1):t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e{let i=s.entities.getById(F.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}if("clampToGround"===e)return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{t(this.graphic,this.entity.pottingPoint,i)},100)):t(this.graphic,this.entity.pottingPoint,i),void(0{let t=s.entities.getById(e);t&&(t.point.heightReference=i?1:0)}));"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=a.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t,i=this.getValue("radius");let o=this.getValue("position");return"ellipse"===this.type||this.entity.isSphere?("ellipse"===this.type&&void 0!==this.getValue("height")&&(e=this.getValue("height"),t=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,e)),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o]):(e=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height-this.getValue("length")/2),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o])},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t=this.getPottingPoint();if(t){let e=s.entities.add({name:"_size_point",position:t[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});e.angle=90,F.editPointID.size.push(e.id),F.editPointID.move=s.entities.add({name:"_move_point",position:t[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"rectangle"===e?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}if("clampToGround"===e)return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=s.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=s.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let e=this.getPottingPoint();if(e){let o=new Cesium.Cartesian3;e.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"box"===e?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=F.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(F.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(F.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+i/2),this.changeHeightPoint(r.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=a.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=a.GetPositionFromA_D(t,e.x/2,90),e=a.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=s.entities.add({name:"_size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t=(e.angle=90,s.entities.add({name:"_size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}));t.angle=180,F.editPointID.size.push(e.id),F.editPointID.size.push(t.id),F.editPointID.move=s.entities.add({name:"_move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"corridor"===e||"ellipsoid"===e&&!n.isSphere||"path"===e||"plane"===e||"polylineVolume"===e||"wall"!==e||((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(e=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(e):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"alpha"===e?this.graphic.material.color._value.alpha=t:"outlineAlpha"===e?this.graphic.outlineColor._value.alpha=t:this.graphic[e]="positions"===e?new Cesium.CallbackProperty(function(){return t},!1):t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let i=new Cesium.Cartesian3,o=this.getValue("minimumHeights");t.forEach((e,t)=>{e=Cesium.Cartographic.fromCartesian(e),e=Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,o[t]),t=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(t.id),i.x+=e.x,i.y+=e.y,i.z+=e.z}),i.x/=t.length,i.y/=t.length,i.z/=t.length,F.editPointID.move=s.entities.add({name:"_move_point",position:i,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e{this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0},this.drawHandler.setInputAction(function(e){this.tooltip.showAt(e.endPosition,"点击绘制点")}.bind(this),n.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPointBuff=function(e,t){var i=Cesium_turf.point(this.positions),i=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i,t),this.buffs.push(this.this_buff.buff))},Si.prototype.DrawPolyline=function(e,t){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var i=this._viewer,o=this._cesium;let r,n;"number"==typeof e?(r=e,n={}):"object"==typeof e&&(n=e,r=n.radius),this.num=r||this.num;var a=0;return this.drawHandler=new o.ScreenSpaceEventHandler(i.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polyline",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(function(e){var t,e=this._getPosition.getMouseDegrees(e);e&&(t=e.lon,e=e.lat,this.positions.push(t,e),0===a&&(this.positions.push(t,e),this.this_buff.entity=i.entities.add({name:"新建缓冲线",polyline:{positions:o.Cartesian3.fromDegreesArray(this.positions),width:2,material:new o.ColorMaterialProperty(o.Color.YELLOW),clampToGround:!0,zIndex:1}}),this.this_buff.entity.polyline.positions=new o.CallbackProperty(function(){return o.Cartesian3.fromDegreesArray(this.positions)}.bind(this),!1)),a++)}.bind(this),o.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),o.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{return this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,"cancel"===e?(i.entities.remove(this.this_buff.entity),void(this.this_buff=void 0)):(this.positions.length<=4?(window.layuiLayer&&window.layuiLayer.msg("当前点数小于两点,请重新绘制"),i.entities.remove(this.this_buff.entity),this.this_buff=void 0):(this.positions.pop(),this.positions.pop(),this.this_buff.entity.polyline.positions=o.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.setPolylineBuff(this.num,n)),void(t&&"function"==typeof t&&t(this)))},this.drawHandler.setInputAction(function(e){var t;0===a?this.tooltip.showAt(e.endPosition,"点击开始绘制折线"):(1===a?this.tooltip.showAt(e.endPosition,"点击绘制折线"):this.tooltip.showAt(e.endPosition,"右击结束绘制"),(e=this._getPosition.getMouseDegrees(e))&&(t=e.lon,e=e.lat,this.positions.splice(this.positions.length-2,2),this.positions.push(t,e)))}.bind(this),o.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPolylineBuff=function(e,t){var i=Cesium_turf.lineString(this.positions),i=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i,t),this.buffs.push(this.this_buff.buff))},Si.prototype.DrawPolygon=function(e,t){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var i=this._viewer,o=this._cesium;let r,n;"number"==typeof e?(r=e,n={}):"object"==typeof e&&(n=e,r=n.radius),this.num=r||this.num;var a=0;this.drawHandler=new o.ScreenSpaceEventHandler(i.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polygon",this.positions=[];let s=this;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(function(e){var t,e=this._getPosition.getMouseDegrees(e);e&&(t=e.lon,e=e.lat,this.positions.push(t,e),0===a?(this.positions.push(t,e),this.this_buff.entity=i.entities.add({name:"临时线",polyline:{positions:new o.CallbackProperty(function(){return o.Cartesian3.fromDegreesArray(s.positions)},!1),clampToGround:!0,material:new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)),width:3}})):1===a&&(this.this_buff.entity&&i.entities.remove(this.this_buff.entity),this.this_buff.entity=i.entities.add({name:"新建缓冲面",polygon:{hierarchy:new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this.positions)),material:new o.ColorMaterialProperty(o.Color.YELLOW.withAlpha(.5)),zIndex:1}}),this.this_buff.entity.polygon.hierarchy=new o.CallbackProperty(function(){return new o.PolygonHierarchy(o.Cartesian3.fromDegreesArray(this.positions))}.bind(this),!1)),a++)}.bind(this),o.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),o.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>(this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,"cancel"===e?(i.entities.remove(this.this_buff.entity),void(this.this_buff=void 0)):(this.positions.length<=6?(window.layuiLayer&&window.layuiLayer.msg("当前点数小于三点,请重新绘制"),i.entities.remove(this.this_buff.entity),this.this_buff=void 0):(this.positions.pop(),this.positions.pop(),this.this_buff.entity.polygon.hierarchy=o.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.positions.push(this.positions[0]),this.setPolygonBuff(this.num,n)),void(t&&"function"==typeof t&&t(this)))),this.drawHandler.setInputAction(function(e){var t;0===a?this.tooltip.showAt(e.endPosition,"点击开始绘制多边形"):(a<3?this.tooltip.showAt(e.endPosition,"点击绘制多边形"):this.tooltip.showAt(e.endPosition,"右击结束绘制"),(e=this._getPosition.getMouseDegrees(e))&&(t=e.lon,e=e.lat,this.positions.splice(this.positions.length-2,2),this.positions.push(t,e)))}.bind(this),o.ScreenSpaceEventType.MOUSE_MOVE),this},Si.prototype.setPolygonBuff=function(e,t){var i=Cesium_turf.polygon([this.positions]),i=this.getBuff(i,e);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(i,t),this.buffs.push(this.this_buff.buff))},Si.prototype.getBuff=function(e,t,i={}){var o=Cesium_turf.buffer(e,t,{units:"meters",...i}).geometry.coordinates,r=this.pointsToDegreesArray(o[0]);let n={positions:Cesium.Cartesian3.fromDegreesArray(r)};if(1{t.push(e[0]),t.push(e[1])}),t},Si.prototype.degreesArrayToPoints=function(t){let i=[];for(let e=0;e{o.push(new Cesium.PolygonHierarchy(e))})),this._viewer.entities.add({polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i,o)},!1),material:Cesium.Color.RED.withAlpha(.6),outline:!0,outlineColor:Cesium.Color.YELLOW,outlineWidth:10,zIndex:0,...t}})},Si.prototype.clearBuff=function(){var t=this._viewer;0=l&&h.Level<=a&&!h.item.show?h.item.show=!0:(h.Levela)&&(h.item.show=!1))})),c.then(function(e){for(var t=(h.item=e).entities.values,i=0;i{m=this.option;var t=this.dataSourceItem.entities.values;let o=this._core.extend(d,m,!0);var e=parseFloat(o.near),i=parseFloat(o.far),r=new Cesium.DistanceDisplayCondition(e,i);this.item.removeAll();let n=new Map,a,s,l,u=[];for(let e=0,i;e{this.item.add(new Cesium.ModelInstanceCollection({url:t,instances:e,color:o.color}))})},this.item=new Cesium.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),n.then(e=>{this.dataSourceItem=e,this.loadGeosjonData(),o||this.setVisibility(!1),"function"==typeof r&&r(e)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),{id:m.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:m,treeData:{name:e,geoOptions:t,styleOption:m,GroupID:i,checked:o,disFnc:r}});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},w.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,a,i,s){var o={semiMajorAxis:1,semiMinorAxis:1,height:0,heightReference:this._cesium.HeightReference.NONE,extrudedHeight:0,extrudedHeightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},l=(this._core.isnull(a)||this._core.isnull(a.outlineColor)||"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(this._core.isHtmlColor(a.outlineColor)?a.outlineColor=this._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=this._color.rgbaStringToRgbaObj(a.outlineColor)),1{l=this.option;var i=this.item.entities.values;let o=this._core.extend(c,l,!0);h._core.isnull(o.font_size)&&(o.font_size="30px"),h._core.isnull(o.font_family)&&(o.font_family=" sans-serif"),-1==o.font_size.toString().indexOf("px")?o.font=o.font_size+"px "+o.font_family:o.font=o.font_size+" "+o.font_family,o.bold&&(o.font="bold "+o.font),o.italic&&(o.font="italic "+o.font),h.Legend=[];for(let t=0;t{s=this.option;var o=this.item.entities.values;let r=this._core.extend(u,s,!0);c.Legend=[];for(let i=0;i{s=this.option,d._core.isnull(s.near)&&(s.near=0),d._core.isnull(s.far)&&(s.far=999999999),s.near=parseFloat(s.near),s.far=parseFloat(s.far),p.removeAll();var o=this.dataSourceItem.entities.values;d.Legend=[];for(let e=0,t,i;e{e=new d._cesium.GeometryInstance({id:d._core.getEntityProp(t),geometry:e,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(o.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near,o.far)}});u.push(e)}),g.geometryInstances=u,p.add(new Cesium.Primitive(g))}(e,t,o),"material:"+255*o.material.red+","+255*o.material.green+","+255*o.material.blue);d.Legend.push(r)}}(i,t)}d._viewer.scene.primitives.add(p)},d.item=p,n.then(function(e){d.dataSourceItem=e,d.loadGeosjonData(),o||d.setVisibility(!1),"function"==typeof r&&r(p)}),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+s.id);e={id:s.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(i)?0:i),this},w.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=Cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},w.prototype.createWallGeoFeatureLayer=function(e,t,u,i,c,h){var m,o={positions:[],minimumHeights:[],maximumHeights:[],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,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},d=(this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),r=new this._cesium.CesiumTerrainProvider(t);return this._viewer.terrainProvider=r,this.item=r,"function"==typeof o&&o(dataSource),this._core.isnull(t.id)&&(t.id=this._core.getuid()),this._tree.insertGroupId({id:t.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this},this._core.isnull(i)?0:i),this},w.prototype.createPolygonGeoJsonFeatureLayers=function(e,t,s,i,o,l){var r={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0},u=(this._core.isnull(s)||this._core.isnull(s.material)||"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||"("==s.material.toString().charAt(0)&&")"==s.material.toString().charAt(s.material.length-1)||(this._core.isHtmlColor(s.material)?s.material=this._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=this._color.rgbaStringToRgbaObj(s.material)),1{l=this.option;var i=this.item.entities.values;let o=this._core.extend(c,l,!0);h._core.isnull(l.near)&&(l.near=0),h._core.isnull(l.far)&&(l.far=999999999);var e=parseFloat(l.near),t=parseFloat(l.far),r=new h._cesium.DistanceDisplayCondition(e,t);o.distanceDisplayCondition=r,o.text&&(o.font_family||(o.font_family="微软雅黑"),o.font_size||(o.font_size="18px"),o.font=o.font_size+" "+o.font_family,o.bold&&(o.font="bold "+o.font),o.italic&&(o.font="italic "+o.font),o.labelNearFar=new Cesium.DistanceDisplayCondition(o.labelNear||e,o.labelFar||t)),h.Legend=[];let n=[];h.primitivePolygon&&h._viewer.scene.primitives.remove(h.primitivePolygon),h.primitivePolygon=null;for(let t=0;t{this.loadGeosjonData()},100))},w.prototype.getType=function(){var e;if(this.item.entities.values)return null!=(e=this.item.entities.values[0]).label&&e.label.show?{label:"文本标签",value:"labelLayer"}:null!=e.model&&e.model.show?{label:"模型",value:"modelLayer"}:null!=e.billboard&&e.billboard.show?{label:"图片标签",value:"billboardLayer"}:null!=e.ellipse&&e.ellipse.show?{label:"圆",value:"circleLayer"}:/^polygon.fid/.test(e._id)||null!=e.polygon?{label:"面",value:"polygonLayer"}:/^line.fid/.test(e._id)||null!=e.polyline?{label:"线",value:"polylineLayer"}:null!=e.polylineVolume&&e.polylineVolume.show?{label:"扫掠体",value:"polylineVolume"}:null!=e.wall&&null!=e.wall?{label:"墙",value:"polylineWall"}:{label:"点标签",value:"pointLayer"}},w.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},w.prototype.getFirstDataSourceItem=function(){if(this.item.entities.values)return this.item.entities.values[0]},w.prototype.setTreeobj=function(e){this.treeobj=e},w.prototype.setItem=function(e){this.item=e},Object.defineProperties(w.prototype,{labelText:{set:f.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities.values;if(i&&0{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{var i=t.position,o=c.scene.pick(i);if((!o||!o.id||o.id.treeID===u.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;u.isEditting||0!=F.states?(e!=h||"point"!==e.VectorType&&"billboard"!==e.VectorType&&"label"!==e.VectorType&&"model"!==e.VectorType)&&"_height_point"!=e.name&&"_edit_point"!=e.name&&"_move_point"!=e.name&&"_add_point"!=e.name&&"_size_point"!=e.name||(c.container.style.cursor="crosshair",u.defaultEvent(!1),"_height_point"==e.name?(d={windowPosition:i,originHeight:u._cesium.Cartographic.fromCartesian(e.position.getValue()).height},n="_height_point"):"_move_point"==e.name?n="_move_point":"point"===e.VectorType||"billboard"===e.VectorType||"label"===e.VectorType||"model"===e.VectorType?(u.tooltip.showAt(t.position,"释放后完成修改"),n="_move_point","model"===e.VectorType&&(e.show=!1)):"_edit_point"==e.name?n="_edit_point":"_add_point"==e.name?n="_add_point":"_size_point"==e.name&&(n="_size_point"),m=e):(r.callBack&&r.callBack.start&&r.callBack.start(e),p=e.VectorType,(h=u.createEditEntity(p,e.VectorStyle)).feature=e,h.treeID=u.treeID,u.getSimpleGraphicData(p,h),"point"===p||"billboard"===p||"label"===p||"model"===p?(u.isEditting=!0,u.tooltip.showAt(t.position,"拖拽修改位置")):(u.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(u.treeID)),u.setStatus(!1),F.editVector=!0)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{var r=c.scene.pick(t.endPosition);if((!r||!r.id||r.id.treeID===u.treeID)&&(u._cesium.defined(r)?u.isEditting&&!m?"point"!==p&&"billboard"!==p&&"label"!==p&&"model"!==p||r.id!=h?r.id&&"_edit_point"===r.id.name&&h.pottingPoint?"polyline"===p&&2{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=l,t.y/=l,t.z/=l,F.editPointID.move&&(F.editPointID.move.position=t),"polyline"!==p&&"polygon"!==p&&"rectangle"!==p||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===n){r=F.editPointID.height.indexOf(m.id);let e=c.entities.getById(F.editPointID.edit[r]),i=("ellipse"!==p&&"cylinder"!==p&&"box"!==p||(e=F.editPointID.move),u.toDegrees(e.position.getValue()));l=d.originHeight-i.height,r=c.scene.cartesianToCanvasCoordinates(e.position.getValue()),t=(d.windowPosition.y-t.endPosition.y)*l/Math.abs(r.y-d.windowPosition.y);let o=Math.abs(l+t);F.editPointID.height.forEach(e=>{let t=c.entities.getById(e);t&&(e=t.position.getValue(),e=u.toDegrees(e),t.position=u._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),h[p].extrudedHeight?h[p].extrudedHeight=o+i.height:"box"===p?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===p&&SmartEarthPopupData.editGraphic.setValue("length",o)}else if("_add_point"===n){var r=F.editPointID.add.indexOf(m.id),l=(c.entities.remove(m),c.entities.add({name:"_edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}})),t=(F.editPointID.edit.splice(r+1,0,l.id),h.pottingPoint.splice(r+1,0,i.clone()),Cesium.Cartesian3.midpoint(h.pottingPoint[r],h.pottingPoint[r+1],new Cesium.Cartesian3)),t=c.entities.add({name:"_add_point",position:t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),e=Cesium.Cartesian3.midpoint(h.pottingPoint[r+1],h.pottingPoint[r+2===h.pottingPoint.length?0:r+2],new Cesium.Cartesian3),e=c.entities.add({name:"_add_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r=(F.editPointID.add.splice(r,1,t.id,e.id),SmartEarthPopupData.editGraphic.setTreeID(u.treeID),m=l,n="_edit_point",h.pottingPoint.concat([]));"polyline"!==p&&"polygon"!==p||SmartEarthPopupData.editGraphic.setValue("positions",r)}else if("_size_point"===n){t=F.editPointID.move.position.getValue(),e=u._cesium.Cartesian3.distance(t,i);"ellipse"===p||"cylinder"===p||"ellipsoid"===p&&h.isSphere?SmartEarthPopupData.editGraphic.setValue("radius",e):"box"===p&&(l=90===m.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(l,2*e))}else if("point"===p||"billboard"===p||"label"===p||"model"===p)m.position=i;else{r=u.toDegrees(i),t=(d=m.position.getValue(),u.toDegrees(d));let n=r.lon-t.lon,a=r.lat-t.lat,s=r.height-t.height;m.position=i,h[p].height&&(l=u.toDegrees(i).height,h[p].height=l,h.thisHeight=l),h.pottingPoint.forEach((e,t)=>{let i,o,r=c.entities.getById(F.editPointID.edit[t]);if(r=r||c.entities.getById(F.editPointID.size[t]),i=r?u.toDegrees(r.position.getValue()):u.toDegrees(e),o=u._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s),e.x=o.x,e.y=o.y,e.z=o.z,r&&(r.position=o),0{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?u.isEditting&&(a(),u.defaultEvent(!1)):(m&&"model"===m.VectorType&&(m.show=!0),m&&r.callBack&&r.callBack.updata&&r.callBack.updata(m.name,h),c.container.style.cursor="default",m=void 0,u.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(a(),u.defaultEvent(!1));else{e=c.scene.pick(e.position);if((!e||!e.id||e.id.treeID===u.treeID)&&u._cesium.defined(e)&&0==F.states){e=e.id;if(!e.VectorType&&-1{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,F.editPointID.move&&(F.editPointID.move.position=t),h.pottingPoint.concat([]));"polyline"!==p&&"polygon"!==p||SmartEarthPopupData.editGraphic.setValue("positions",i),u.tooltip.show(!1),r.callBack&&r.callBack.updata&&r.callBack.updata(m&&m.name,h)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),a(),{endThisEdit:a,getEditData:function(){return{entity:h}}};function a(){u.defaultEvent(!0),F.editPointID.edit.forEach(e=>{c.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{c.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{c.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{c.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&c.entities.remove(F.editPointID.move),F.editPointID.move=void 0,h&&c.entities.remove(h),p=h=void 0,SmartEarthPopupData.editGraphic={},u.isEditting=!1,u.setStatus(!0),F.editVector=!1,u.delButton(!1)}}else a()},T.prototype.createEditEntity=function(e,i){let o;var r=this;let n=this._viewer;if("polygon"===e){let e=i.positions;var a=r._core.defaultValue(i.height,void 0);let t;t=i.hierarchy||(e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),new r._cesium.PolygonHierarchy(e)),(o=n.entities.add({polygon:{hierarchy:new r._cesium.CallbackProperty(function(){return t},!1),extrudedHeight:r._core.defaultValue(i.extrudedHeight,void 0),height:a,material:new r._cesium.ImageMaterialProperty({image:r._core.defaultValue(i.image,null),repeat:r._core.defaultValue(i.repeat,new r._cesium.Cartesian2(1,1)),color:i.material}),shadows:r._cesium.ShadowMode.ENABLED,fill:!0}})).VectorType="polygon"}else if("polyline"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),(o=n.entities.add({polyline:{positions:new r._cesium.CallbackProperty(function(){return e},!1),clampToGround:r._core.defaultValue(i.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:i.material,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}),width:r._core.defaultValue(i.width,3)}})).VectorType="polyline"}else if("wall"===e){let e=i.positions;e=i.haveZ?r._cesium.Cartesian3.fromDegreesArrayHeights(e):r._cesium.Cartesian3.fromDegreesArray(e),(o=n.entities.add({wall:{positions:new r._cesium.CallbackProperty(function(){return e},!1),minimumHeights:i.minimumHeights,maximumHeights:i.maximumHeights,material:i.material,outline:!0,outlineWidth:r._core.defaultValue(i.outlineWidth,0),outlineColor:i.outlineColor}})).VectorType="wall"}else"label"===e?(o=n.entities.add({position:i.position,label:{text:i.text,font:i.font,scale:i.scale,style:i.style,fillColor:i.fillColor,outlineColor:i.outlineColor,outlineWidth:i.outlineWidth,showBackground:i.showBackground,backgroundColor:i.backgroundColor,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}})).VectorType="label":"billboard"===e?(o=n.entities.add({position:i.position,billboard:{rotation:i.rotation,width:i.width,height:i.height,image:i.image,color:i.color,scale:i.scale,heightReference:i.heightReference,horizontalOrigin:i.horizontalOrigin,verticalOrigin:i.verticalOrigin,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}})).VectorType="billboard":"point"===e&&((o=n.entities.add({position:i.position,point:{pixelSize:i.pixelSize,color:i.color,outlineWidth:i.outlineWidth,outlineColor:i.outlineColor,heightReference:i.heightReference,scaleByDistance:i.scaleByDistance,distanceDisplayCondition:i.distanceDisplayCondition}})).VectorType="point");return o},T.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||((e=document.createElement("button")).id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},T.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},T.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},T.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},T.prototype.getSimpleGraphicData=function(e,n){let a=this,s=this._viewer;var t,i;function o(e){SmartEarthPopupData.editGraphic.fillColor=l("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function r(e){SmartEarthPopupData.editGraphic.outlineColor=l("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function l(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");var o=(e=e.replace("(","").replace(")","")).split(",");let i="#";for(let t=0;t{let t=s.entities.getById(e);t&&(e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=F.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=a.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){F.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{s.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{s.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{s.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&s.entities.remove(F.editPointID.move),F.editPointID.move=void 0},setTreeID:function(i){F.editPointID.edit.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.height.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.add.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.size.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),F.editPointID.move&&(F.editPointID.move.treeID=i)}},"billboard"===e||"point"===e||"label"===e||"model"===e?((i=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?o(i):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(i=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===e&&((i=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(i=i,SmartEarthPopupData.editGraphic.backgroundColor=l("rgb("+255*i.red+","+255*i.green+","+255*i.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*i.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("position"===e||"name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e||"backgroundColor"===e||"fillColor"===e)t=Cesium.Color.fromCssColorString(t);else if("fontSize"===e){let e=this.getValue("font");(e=e.split(" "))[0]=t,t=e.join(" ")}else{if("alpha"===e)return void("label"===this.type?this.graphic.fillColor._value.alpha=t:this.graphic.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.graphic.backgroundColor._value.alpha=t);if("pHeight"===e&&this.getValue("position")){var i=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(i);return e.height=t,void(this.entity.position=Cesium.Cartographic.toCartesian(e))}}this.graphic[e]=t}}):"polyline"===e?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?o(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),i.outlineColor?r(i.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e)return t=Cesium.Color.fromCssColorString(t),void(this.graphic.material[e]=t);"outlineWidth"===e?this.graphic.material[e]=t:"alpha"===e?this.graphic.material.color._value.alpha=t:"outlineAlpha"===e?this.graphic.material.outlineColor._value.alpha=t:this.graphic[e]="positions"===e?new Cesium.CallbackProperty(function(){return t},!1):t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("positions");return this.entity.pottingPoint=e},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e{let i=s.entities.getById(F.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}if("clampToGround"===e)return this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{t(this.graphic,this.entity.pottingPoint,i)},100)):t(this.graphic,this.entity.pottingPoint,i),void(0{let t=s.entities.getById(e);t&&(t.point.heightReference=i?1:0)}));"extrudedHeight"===e?this.changeHeightPoint(i):"height"===e&&this.changeEditPoint(i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=a.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let o=new Cesium.Cartesian3;t.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=t.length,o.y/=t.length,o.z/=t.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let e=0;e{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t,i=this.getValue("radius");let o=this.getValue("position");return"ellipse"===this.type||this.entity.isSphere?("ellipse"===this.type&&void 0!==this.getValue("height")&&(e=this.getValue("height"),t=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,e)),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o]):(e=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height-this.getValue("length")/2),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o])},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t=this.getPottingPoint();if(t){let e=s.entities.add({name:"_size_point",position:t[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});e.angle=90,F.editPointID.size.push(e.id),F.editPointID.move=s.entities.add({name:"_move_point",position:t[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"rectangle"===e?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}if("clampToGround"===e)return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=s.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=s.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let e=this.getPottingPoint();if(e){let o=new Cesium.Cartesian3;e.forEach((e,t)=>{var i=s.entities.add({name:"_edit_point",position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});F.editPointID.edit.push(i.id),o.x+=e.x,o.y+=e.y,o.z+=e.z}),o.x/=e.length,o.y/=e.length,o.z/=e.length,F.editPointID.move=s.entities.add({name:"_move_point",position:o,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"box"===e?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?r(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=F.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(F.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(F.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+i/2),this.changeHeightPoint(r.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=a.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=a.GetPositionFromA_D(t,e.x/2,90),e=a.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=s.entities.add({name:"_size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t=(e.angle=90,s.entities.add({name:"_size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}));t.angle=180,F.editPointID.size.push(e.id),F.editPointID.size.push(t.id),F.editPointID.move=s.entities.add({name:"_move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}):"corridor"!==e&&"ellipsoid"===e&&n.isSphere},E.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,s,i,l){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),u=this,o=(o.then(function(e){for(var t={Name:"",text:"",font:" 30px sans-serif",stylet:u._cesium.LabelStyle.OUTLINE,fillColor:u._cesium.Color.WHITE,outlineColor:u._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new u._cesium.Color(.165,.165,.165,.8),backgroundPadding:new u._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,eyeOffset:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,heightReference:u._cesium.HeightReference.NONE,scaleByDistance:new u._cesium.NearFarScalar(0,0,1,1)},i=(s.material,u._core.isnull(s)||u._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(u._core.isHtmlColor(s.fillColor)?s.fillColor=u._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=u._color.rgbaStringToRgbaObj(s.fillColor)),1=o.level_min&&i.level=s.level_min&&a.level{this.initThisProvider=void 0,this._Provider.loadTile=function(e,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=c.level_min&&i.level<=c.level_max&&h.item.show))return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void(h._Provider.EntityCollection.show=!1);if(m&&(i.reverseY=h._Provider.tilingScheme.getNumberOfYTilesAtLevel(i.level)-i.y-1),h.TileMatrixLimits){var t=h.TileMatrixLimits[i.level];if(!t||i.x>t.maxCol||i.xt.maxRow||i.y{f=h._core.extend({},c,!0)},this.restoreVector=()=>{if(f&&(c=f,h._Provider._normalTile=c.level_max,h._Provider&&h._Provider.EntityCollection)){var e=p();let r=h._core.extend(e,c,!0),n,a;r.image&&!r.text?a=!0:n=(!r.image&&r.text||r.image&&r.text&&(a=!0),!0),h._Provider.EntityCollection.values.forEach(t=>{var e=t.feature;void 0!==r.pointHeight&&(t.position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],r.pointHeight));let i;"string"==typeof r.text&&/^\[/.test(r.text)&&/\]$/.test(r.text)?(i=r.text.replace(/\[/,"").replace(/\]/,""),i=e.properties[i]):"object"==typeof r.text&&(i=d(e,r.text));let o;if("string"==typeof r.image&&/^\[/.test(r.image)&&/\]$/.test(r.image)?(o=r.image.replace(/\[/,"").replace(/\]/,""),o=e.properties[o]):"object"==typeof r.image&&(o=d(e,r.image)),n){let e=Object.assign({},r);i&&(e.text=i),r.labelData&&(e=Object.assign(e,r.labelData)),(r.offsetX||r.offsetY)&&(e.pixelOffset=new Cesium.Cartesian2(r.offsetX||0,r.offsetY||0)),t.label=e}else t.label=void 0;if(a){let e=Object.assign({},r);o&&(e.image=o),r.imageData&&(e=Object.assign(e,r.imageData)),t.billboard=e}else t.billboard=void 0})}f=void 0},this.updataVector=(a={})=>{var e;(a.color||a.fillColor||a.outlineColor||a.backgroundColor)&&(a.color&&(a.color=Cesium.Color.fromCssColorString(a.color)),a.fillColor&&(a.fillColor=Cesium.Color.fromCssColorString(a.fillColor)),a.outlineColor&&(a.outlineColor=Cesium.Color.fromCssColorString(a.outlineColor)),a.backgroundColor&&(a.backgroundColor=Cesium.Color.fromCssColorString(a.backgroundColor))),void 0===a.near&&void 0===a.far||(void 0!==a.near&&(s=parseFloat(a.near)),void 0!==a.far&&(l=parseFloat(a.far)),e=new Cesium.DistanceDisplayCondition(s,l),a.distanceDisplayCondition=e),void 0===a.minimumLevel&&void 0===a.maximumLevel||(void 0!==a.minimumLevel&&(a.level_min=a.minimumLevel),void 0!==a.maximumLevel&&(a.level_max=a.maximumLevel)),c=h._core.extend(c,a,!0),h._Provider._normalTile=c.level_max,c.font=c.font_size+" "+c.font_family,c.bold&&(c.font="bold "+c.font),c.italic&&(c.font="italic "+c.font),a.font=c.font,h._Provider&&h._Provider.EntityCollection&&(clearTimeout(g),g=setTimeout(()=>{let o,r,n;h._Provider.EntityCollection.values.forEach(e=>{o=e.label,r=e.billboard,n=e.feature,void 0!==a.height&&(e.position=new Cesium.Cartesian3.fromDegrees(n.geometry.coordinates[0],n.geometry.coordinates[1],a.height));let t;"string"==typeof a.text&&/^\[/.test(a.text)&&/\]$/.test(a.text)?(t=a.text.replace(/\[/,"").replace(/\]/,""),t=n.properties[t]):"object"==typeof a.text&&(t=d(n,a.text));let i;"string"==typeof a.image&&/^\[/.test(a.image)&&/\]$/.test(a.image)?(i=a.image.replace(/\[/,"").replace(/\]/,""),i=n.properties[i]):"object"==typeof a.image&&(i=d(n,a.image)),o?((a.offsetX||a.offsetY)&&(a.pixelOffset=new Cesium.Cartesian2(c.offsetX||0,c.offsetY||0)),Object.assign(o,a),t&&(o.text=t),void 0!==a.text&&(o.show=!!a.text)):a.text&&(e.label={...c},t&&(e.label.text=t)),void 0!==a.image&&(r?(r.image=a.image,r.show=!!a.image,i&&(r.image=i)):a.image&&(e.billboard={image:i||a.image,disableDepthTestDistance:c.disableDepthTestDistance,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0)}))})},100))},this._Provider.EntityCollection=new Cesium.EntityCollection,this._Provider.EntityCollection.isShow=!0,this._Provider.EntityCollection.childrenCollection={},_.prototype.update=function(){clearTimeout(this._time),this.setVisibility(!0),this._time=setTimeout(()=>{this.setVisibility(!1)},500)},_.prototype.add=function(e){this.isDestroy||(this.viewer&&this.viewer.entities.add(e),this.collection&&this.collection.add(e),this.values.push(e.id))},_.prototype.setVisibility=function(i){this.show=i,this.values.forEach(e=>{let t=this.viewer.entities.getById(e);t&&(t.show=i)})},_.prototype.destroy=function(){this.isDestroy=!0,this.add=()=>{},this.update=()=>{},this.values.forEach(e=>{this.viewer&&this.viewer.entities.removeById(e),this.collection&&this.collection.removeById(e)}),delete this.collection.childrenCollection[this.key],this.collection=void 0,this.values=[],this.viewer=void 0,Cesium.destroyObject(this)};let C;function y(){h._Provider.EntityCollection.show&&(clearTimeout(C),C=setTimeout(function(){if(h._Provider.quadtree&&h._Provider.quadtree._tilesToRender&&h._Provider.quadtree._tilesToRender.length){let t=[];for(var e in h._Provider.quadtree._tilesToRender.forEach(e=>{t.push(e.level+"-"+e.x+"-"+e.y)}),h._Provider.EntityCollection.childrenCollection)t.indexOf(e)<0&&h._Provider.EntityCollection.childrenCollection[e].setVisibility(!1)}},500))}this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});u=this._viewer.scene.primitives,c&&c.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:c.time.start?h._cesium.JulianDate.fromDate(new Date(c.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?h._cesium.JulianDate.fromDate(new Date(c.time.end)):h._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),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:m},e=>{h.item.boundingSphere=e.boundingSphere,h.TileMatrixLimits=e.TileMatrixLimits,h.initThisProvider()}),o||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,a={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=c.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},E.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,c,i,o,r){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},h=this,a=(c.material,{Name:"",text:"",font:" 30px sans-serif",style:h._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:h._cesium.Color.WHITE,outlineColor:h._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new h._cesium.Color(.165,.165,.165,.8),backgroundPadding:new h._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:h._cesium.HorizontalOrigin.CENTER,verticalOrigin:h._cesium.VerticalOrigin.CENTER,eyeOffset:h._cesium.Cartesian3.ZERO,pixelOffset:h._cesium.Cartesian2.ZERO,heightReference:h._cesium.HeightReference.NONE,scaleByDistance:new h._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0}),s=(this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams),t.url+"?"+this._core._serialize(n.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=21,this._Provider._minimumHeight=parseFloat(c.height)||0,this._Provider.loadTile=function(i,o){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=c.level_min&&o.level","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){u.fillColor=n.Value,h._core.isHtmlColor(u.fillColor)?u.fillColor=h._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=h._color.rgbaStringToRgbaObj(u.fillColor)),1","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){u.outlineColor=a.Value,h._core.isHtmlColor(u.outlineColor)?u.outlineColor=h._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=h._color.rgbaStringToRgbaObj(u.outlineColor)),1","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){u.backgroundColor=getSGColor(a.Value),h._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=h._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=h._color.rgbaStringToRgbaObj(u.backgroundColor)),1","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]&&(u.scale=n.Value);else c.scale&&"{}"!=c.scale.Class.toString()?u.scale=c.scale.Value:c.scale&&"[object Object]"!=c.scale.toString()&&"{}"!=c.scale.toString()&&(u.scale=c.scale);if(/^\[/.test(c.text)&&/\]$/.test(c.text)||c.textTe?c.textTe?c.text.Class instanceof Object?(t=c.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[t]):(i=(c.text&&c.text.Class&&"{}"!=c.text.Class.toString()?c.text.Class.Value:c.text).replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[i]):c.text&&"[object Object]"!=c.text.toString()&&"{}"!=c.text.toString()?u.text=c.text:(i=c.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.text=e.properties[i]):c.text&&"[object Object]"!=c.text.toString()&&"{}"!=c.text.toString()&&(u.text=c.text),(u=u.labelData?h._core.extend(u,u.labelData,!0):u).verticalOrigin=Cesium.VerticalOrigin.CENTER,u.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,s&&s.add(u),c.image&&c.image.Class instanceof Array){for(var n,a,r=0;r","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){u.image=n.Value;break}}else c.image&&c.image.Class&&"{}"!=c.image.Class.toString()?(i=c.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),u.image=e.properties[i]):c.image&&"[object Object]"!=c.image.toString()&&"{}"!=c.image.toString()&&(u.image=c.image);o=f.cloneDeep(u);o.verticalOrigin=Cesium.VerticalOrigin.CENTER,o.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,l&&l.add(o)}),0==e.features.length&&(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0),o.data.geometryPrimitive=t||l||s,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0)},error:function(){o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0}}),o.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene.primitives,c&&c.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:c.time.start?h._cesium.JulianDate.fromDate(new Date(c.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?h._cesium.JulianDate.fromDate(new Date(c.time.end)):h._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)}),n.add(this._primitive),o||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,n={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:c,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=c.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){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,u=(s.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}),c=(s.width&&(u.width=s.width),s.height&&(u.height=s.height),s.image&&(u.image=s.image),this._urlTemplate=t.url+"?"+this._core._serialize(n.urlParams),t.url+"?"+this._core._serialize(n.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=s.level_max-1,this._Provider._minimumHeight=parseFloat(s.height)||0,this._Provider.loadTile=function(n,a){if(a.state===Cesium.QuadtreeTileLoadState.START){if(a.data={lines:[],geometryPrimitive:void 0},!(a.level>=s.level_min&&a.level<=s.level_max&&l.item.show))return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var e=c.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return a.state=Cesium.QuadtreeTileLoadState.DONE,void(a.renderable=!0);var t;if(a.level==parseInt(s.level_max)-1)"function"==typeof initSXTData&&(t=initSXTData(e));else{t=new Cesium.BillboardCollection;for(var i of e.features){var o=i.geometry.coordinates[0],i=i.geometry.coordinates[1],r=s.pointHeight?parseFloat(s.pointHeight):0;u.position=Cesium.Cartesian3.fromDegrees(o,i,r),t.add(u)}}0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=t,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof a.data.geometryPrimitive.update?(a.data.geometryPrimitive.update(n,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):(a.data.geometryPrimitive.destroy=function(){},a.data.geometryPrimitive.update=function(){})},error:function(){null==a.count&&(a.count=0),a.count+=1,2<=a.count?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):a.state=Cesium.QuadtreeTileLoadState.START}}),a.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene.primitives,s&&s.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:s.time.start?l._cesium.JulianDate.fromDate(new Date(s.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?l._cesium.JulianDate.fromDate(new Date(s.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)}),n.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,n={id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,r,i,o,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=(r.material,l._cesium.Cartesian3.ZERO,l._cesium.Cartesian2.ZERO,l._cesium.Cartesian3.ZERO,l._cesium.HeightReference.NONE,l._cesium.HorizontalOrigin.CENTER,l._cesium.VerticalOrigin.CENTER,l._cesium.Color.WHITE,l._cesium.Cartesian3.ZERO,r.width&&r.width,r.height&&r.height,r.image&&r.image,this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams),t.url+"?"+this._core._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=parseFloat(r.height)||0,this._Provider.loadTile=function(i,o){if(o.state===Cesium.QuadtreeTileLoadState.START){if(o.data={lines:[],geometryPrimitive:void 0},!(o.level>=r.level_min&&o.level<=r.level_max&&l.item.show))return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var e=u.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);l._cache&&(e+="&"+l._core.getuid()),l._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);var t;"function"==typeof n&&(t=n(e)),0==e.features.length&&(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0),o.data.geometryPrimitive=t,o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&"function"==typeof o.data.geometryPrimitive.update?(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):(o.data.geometryPrimitive.destroy=function(){},o.data.geometryPrimitive.update=function(){})},error:function(){null==o.count&&(o.count=0),o.count+=1,2<=o.count?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):o.state=Cesium.QuadtreeTileLoadState.START}}),o.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});s=this._viewer.scene.primitives,r&&r.time&&(this._Provider._availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:r.time.start?l._cesium.JulianDate.fromDate(new Date(r.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:r.time.end?l._cesium.JulianDate.fromDate(new Date(r.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)}),s.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(r.id)&&(r.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+r.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,s={id:r.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r,treeData:{name:e,geoOptions:t,styleOption:r,GroupID:i,checked:o,disFnc:a}};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof a&&a(this.item),this},E.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,h,i,m,d){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),p=(this._viewer.dataSources.add(o),this),g=new this._cesium.PointPrimitiveCollection,o=(p.optiontext=[],o.then(function(e){for(var t,i=(p.item=e).entities.values,o=0;o\n
'+p.optiontext[i]+"
\n
",$(".cesium-viewer").append(t),l=document.getElementById(e.id)),e.description?l.style.transform="matrix(1, 0, 0, 1, "+u.x+", "+(u.y-157)+")":l.style.transform="matrix(1, 0, 0, 1, "+u.x+", "+(u.y-134)+")",l&&(l.style.display=p.pointPrimitive.show?"block":"none")}c&&(m||p.setVisibility(!1),c=!1)},"function"==typeof d&&d(e)}),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"),{id:h.id,name:e,checked:m,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:h,treeData:{name:e,geoOptions:t,styleOption:h,GroupID:i,checked:m,disFnc:d}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},E.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,s,i,l,o){var r={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},u=this,r=new y(this._viewer,this._cesium,r),r=((this._Provider=r)._loadTile=function(e){var o,r,n=new u._cesium.PointPrimitiveCollection,a=(u.optiontext=[],e.features.forEach(function(e){var t,i=options.pointHeight,i=(null!=e.properties.height&&(i=parseFloat(e.properties.height)+i),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)&&(t=options.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),s.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(t=s.text.replace(/\[/,"").replace(/\]/,""),s.text=e.properties[t]),u._core.getuid());n.add({id:"DivPoint"+i,position:Cartesian3,color:u._cesium.Color.YELLOW,description:s.text}),u.optiontext.push(option.text)}),u.pointPrimitive=u._viewer.scene.primitives.add(n),!0);return u.pointPrimitive.update=function(){for(var e,t,i=0;i\n
'+u.optiontext[i]+"
\n
",$(".cesium-viewer").append(t),o=document.getElementById(e.id)),e.description?o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.y-157)+")":o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.y-134)+")"}a&&(l||u.setVisibility(!1),a=!1)},u.item=n,""},r.addTo(this._viewer),l||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:s,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:o}});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},E.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,s,i,o,r){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,Cesium:this._cesium},l=this,u=(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=s.level_min&&a.level=s.level_min&&a.level":{},"<":{}}},g.color.forEach(e=>{var t;e.value.indexOf&&-1")?(t=e.value.split(">"),f.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)):e.value.indexOf&&-1=r.level_min&&o.level{let t=e.entities.values;if(!t||!t.length)return o.state=Cesium.QuadtreeTileLoadState.DONE,void(o.renderable=!0);let h=new Cesium.PrimitiveCollection;t.forEach(e=>{var t=e.properties.getValue();let i=g.height;t&&"string"==typeof g.height&&/^\[/.test(g.height)&&/\]$/.test(g.height)&&(o=g.height.replace(/\[/,"").replace(/\]/,""),i=t[o]||100);var o=i*g.scale;let r;if(t&&"string"==typeof g.color&&/^\[/.test(g.color)&&/\]$/.test(g.color)){var n=t[g.color.replace(/\[/,"").replace(/\]/,"")]||g.defaultColor;r=Cesium.Color.fromCssColorString(n).withAlpha(g.alpha)}else if(f&&t[f.name]){var a=t[f.name];if(f.value[a])r=f.value[a];else{for(var s in f.value[">"])if(a>s){r=f.value[">"][s];break}if(!r)for(var l in f.value["<"])if(a{null==o.count&&(o.count=0),o.count+=1,2<=o.count?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):o.state=Cesium.QuadtreeTileLoadState.START})}o.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(g.id)&&(g.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+g.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:r,treeData:{name:e,geoOptions:t,styleOption:r,GroupID:i,checked:o,disFnc:n}};return this._Provider.treeID=a.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},S.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a={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};let c=this._core.extend({type:"2D",height:100,scale:1,defaultColor:"#ffffff",alpha:.5,level_max:20,level_min:10},i,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");let h,m=(Array.isArray(c.color)&&(h={name:c.color[0].name,value:{">":{},"<":{}}},c.color.forEach(e=>{var t;e.value.indexOf&&-1")?(t=e.value.split(">"),h.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(c.alpha)):e.value.indexOf&&-1=i.level_min&&r.level{let t=e.entities.values;if(!t||!t.length)return r.state=Cesium.QuadtreeTileLoadState.DONE,void(r.renderable=!0);t.forEach(e=>{var t=e.properties.getValue();let i,o;"3D"===c.type&&(i=c.height,t&&"string"==typeof c.height&&/^\[/.test(c.height)&&/\]$/.test(c.height)&&(n=c.height.replace(/\[/,"").replace(/\]/,""),i=t[n]||100),o=i*c.scale);let r;if(t&&"string"==typeof c.color&&/^\[/.test(c.color)&&/\]$/.test(c.color)){var n=t[c.color.replace(/\[/,"").replace(/\]/,"")]||c.defaultColor;r=Cesium.Color.fromCssColorString(n).withAlpha(c.alpha)}else if(h&&t[h.name]){var a=t[h.name];if(h.value[a])r=h.value[a];else{for(var s in h.value[">"])if(a>s){r=h.value[">"][s];break}if(!r)for(var l in h.value["<"])if(a{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 Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});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;a={id:c.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:n}};return this._Provider.treeID=a.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},S.prototype.createVector3DTilesFeatureLayer=function(e,t,a,i,o,r){var n={color:"#ffffff",level_max:20,level_min:10,tilingScheme:new Cesium.WebMercatorTilingScheme},s=(t.url,t._x||0),l=t._y||0;t.upperLevelLimit,t.lowerLevelLimit;let u=this._core.extend(n,a,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var c=this,h=(this._urlTemplate=t.url,t.url);this._Provider=new T(this._viewer,this._cesium,u.tilingScheme),this._Provider._normalTile=a.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(i,e){var o=i,r=e,n=c;if(r.state===Cesium.QuadtreeTileLoadState.START){if(r.data={lines:[],geometryPrimitive:void 0},!(r.level>=a.level_min&&r.level=a.level_min&&r.level=i.level_min&&c.level=l.level_min&&t.level=a.level_min&&t.level=m.level_min&&t.level=p.tilesLength&&(p.returnCount=0,p.tilesLength=0,p.Primitivekey=[])},error:function(){s=f.remove(s,function(e){return e.x==h.x&&e.y==h.y&&e.level==h.level})},complete:function(e,t){h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive&&(h.state=Cesium.QuadtreeTileLoadState.DONE),h.renderable=!0)}}))}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}var h},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene.primitives,m&&m.time&&(this._Provider._availability=new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:m.time.start?Cesium.JulianDate.fromDate(new Date(m.time.start)):Cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?Cesium.JulianDate.fromDate(new Date(m.time.end)):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)}),n.add(this._primitive),o||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,a={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:m,treeData:{name:e,geoOptions:t,styleOption:m,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=d.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},S.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2=function(e,t,i,o,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},h=(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&&u.level=i.level_min&&c.level=n.level_min&&t.level=l.level_min&&t.level=i.level_min&&c.level=i.level_min&&h.level=a.level_min&&o.level{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var c=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=d.level_min&&h.leveli.maxCol||h.xi.maxRow||h.y{h=l._core.extend({},d,!0)},this.restoreVector=()=>{h&&(d=h,l._option=l._core.extend({...a},d,!0),l._Provider._normalTile=d.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[])),h=void 0},this.updataVector=(e={})=>{(e.material||e.outlineColor)&&(e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),e.outlineColor&&(e.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor))),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),d=l._core.extend(d,e,!0),l._option=l._core.extend(l._option,d,!0),l._Provider._normalTile=d.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(clearTimeout(c),c=setTimeout(()=>{l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[]},100))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});s=this._viewer.scene.primitives,d&&d.time&&(this._Provider._availability=new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:d.time.start?Cesium.JulianDate.fromDate(new Date(d.time.start)):Cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?Cesium.JulianDate.fromDate(new Date(d.time.end)):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)}),s.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:u},e=>{l.item.boundingSphere=e.boundingSphere,l.TileMatrixLimits=e.TileMatrixLimits,l.initThisProvider()}),o||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,s={id:p.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:d,treeData:{name:e,geoOptions:t,styleOption:d,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=s.id,this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this},S.prototype.createModelGeoJsonFeatureLayerProvider0825=function(e,t,o,i,r,n){var a=this,s={url:"",color:Cesium.Color.DARKSALMON,scale:2},l={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},u=(a._core.isnull(o)||a._core.isnull(o.color)||/^\[/.test(o.color)&&"["==o.color.toString().charAt(0)&&"]"==o.color.toString().charAt(o.color.length-1)||(a._core.isHtmlColor(o.color)?o.color=a._color.colorFromHtmlColor(o.color):(/^rgb/.test(o.color)&&(o.color=a._color.rgbaStringToRgbaObj(o.color)),1=o.level_min&&i.level{this.initThisProvider=void 0,this._Provider.loadTile=function(t,i){if(i.state===Cesium.QuadtreeTileLoadState.START){if(i.data={lines:[],geometryPrimitive:void 0},!(i.level>=o.level_min&&i.levele.maxCol||i.xe.maxRow||i.y{g=s._core.extend({},o,!0)},this.restoreVector=()=>{g&&(o=g,c=s._core.extend({...l},o,!0),s._Provider._normalTile=o.level_max-1,s._primitive&&s._primitive._tilesToRender&&s._primitive._tilesToRender.length&&(s._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights=[],s._primitive._tilesToRender=[])),g=void 0},this.updataVector=(e={})=>{(e.color||e.material)&&(e.color=Cesium.Color.fromCssColorString(e.color||e.material)),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),o=s._core.extend(o,e,!0),c=s._core.extend(c,o,!0),s._Provider._normalTile=o.level_max-1,s._primitive&&s._primitive._tilesToRender&&s._primitive._tilesToRender.length&&(clearTimeout(p),p=setTimeout(()=>{s._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),s._primitive._tileToUpdateHeights=[],s._primitive._tilesToRender=[]},100))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});m=this._viewer.scene.primitives,o&&o.time&&(this._Provider._availability=new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:o.time.start?Cesium.JulianDate.fromDate(new Date(o.time.start)):Cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?Cesium.JulianDate.fromDate(new Date(o.time.end)):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)}),m.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:d},e=>{s.item.boundingSphere=e.boundingSphere,s.TileMatrixLimits=e.TileMatrixLimits,s.initThisProvider()}),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,h={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o,treeData:{name:e,geoOptions:t,styleOption:o,GroupID:i,checked:r,disFnc:n}};return this.setTreeobj(h),this._tree.insertGroupId(h,this._core.isnull(i)?0:i),this},S.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1=function(e,t,u,i,o,r){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.DISABLED,level_max:20,level_min:10},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},c=(this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1u.level_max+2&&0=u.level_min&&t.levell.level_max+2&&0=l.level_min&&t.level{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var c=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=o.level_min&&h.leveli.maxCol||h.xi.maxRow||h.y{l.item.boundingSphere=e.boundingSphere,l.TileMatrixLimits=e.TileMatrixLimits,l.initThisProvider()}),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;s={id:d.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o,treeData:{name:e,geoOptions:t,styleOption:o,GroupID:i,checked:r,disFnc:n}};return this._Provider.treeID=s.id,this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},S.prototype.createGeojsonImage=function(e){let o=eval;Cesium.loadText("http://36.7.136.132:8090/geoserver/swagger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=swagger%3A_20200410153959_JZ11&maxFeatures=50&outputFormat=application%2Fjson").then(function(e){e=o("("+e+")");for(var t=0;to)&&this._viewer.scene.primitives.remove(n.data)&&(-1<(c=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(r,1),this.loadFinishKey.splice(r,1))}var a=[],t=e.parent,s=(t&&t.parent&&(t=t.parent,a.push(t)),e.children);a=a.concat(s);for(r=0;ro)&&this._viewer.entities.remove(n.data)&&(-1<(c=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(c,1),this.PrimitiveData.splice(r,1),this.loadFinishKey.splice(r,1))}var a=[],t=e.parent,s=(t&&t.parent&&(t=t.parent,a.push(t)),e.children);a=a.concat(s);for(r=0;r{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var c=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START){if(h.data={lines:[],geometryPrimitive:void 0},!(h.level>=d.level_min&&h.leveli.maxCol||h.xi.maxRow||h.y{h=l._core.extend({},d,!0)},this.restoreVector=()=>{h&&(d=h,p=l._core.extend({...a},d,!0),l._Provider._normalTile=d.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[])),h=void 0},this.updataVector=(e={})=>{(e.material||e.outlineColor||e.gapColor)&&(e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),e.outlineColor&&(e.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor)),e.gapColor&&(e.gapColor=Cesium.Color.fromCssColorString(e.gapColor))),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),d=l._core.extend(d,e,!0),p=l._core.extend(p,d,!0),l._Provider._normalTile=d.level_max-1,l._primitive&&l._primitive._tilesToRender&&l._primitive._tilesToRender.length&&(clearTimeout(c),c=setTimeout(()=>{l._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),l._primitive._tileToUpdateHeights=[],l._primitive._tilesToRender=[]},100))},this._forceRefreshProvider=this._Provider,this._primitive=new l._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});this._viewer.scene.primitives.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4326",gisserverTMS:u},e=>{l.item.boundingSphere=e.boundingSphere,l.TileMatrixLimits=e.TileMatrixLimits,l.initThisProvider()}),d&&d.time&&(geoJSONVectorTileProvider.availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:d.time.start?l._cesium.JulianDate.fromDate(new Date(d.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?l._cesium.JulianDate.fromDate(new Date(d.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})])),o||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;s={id:p.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:d};return this._Provider.treeID=p.id,this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),this},Ri.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete=function(e,t,u,i,o,r){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},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},c=(this._core.isnull(u)||this._core.isnull(u.material)||"["==u.material.toString().charAt(0)&&"]"==u.material.toString().charAt(u.material.length-1)||(this._core.isHtmlColor(u.material)?u.material=this._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=this._color.rgbaStringToRgbaObj(u.material)),1{t.add({id:e.modelId,url:c.url,modelMatrix:e.modelMatrix,color:c.color,lightColor:c.lightColor,scale:parseInt(c.scale),heightReference:parseInt(c.heightReference),distanceDisplayCondition:c.distanceDisplayCondition})})),s.add(t)}return s},u&&u.time&&(n.availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:u.time.start?h._cesium.JulianDate.fromDate(new Date(u.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?h._cesium.JulianDate.fromDate(new Date(u.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||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,{id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:u});return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ri.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,d,i,o,r){var n={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},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},p=(this.item.show=o,this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(this._core.isHtmlColor(d.material)?d.material=this._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=this._color.rgbaStringToRgbaObj(d.material)),1=d.level_min&&h.level{t.add({id:e.modelId,url:p.url,modelMatrix:e.modelMatrix,color:p.color,lightColor:p.lightColor,scale:parseInt(p.scale),heightReference:parseInt(p.heightReference),distanceDisplayCondition:p.distanceDisplayCondition})})),a.add(t)}h.data.geometryPrimitive=a},error:function(){null==h.count&&(h.count=0),h.count+=1,2<=h.count?(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0):h.state=Cesium.QuadtreeTileLoadState.START}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}},this._primitive=new s._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+p.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;n={id:p.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:d};return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ri.prototype.setPolylinemodels=function(e,t,i,o,r,n,a){for(var s=this._cesium,l=this._core.getSpaceDistancem(e,s),u=10,c=parseFloat(n.distance),l=(0!=c&&(u=parseInt(l/c)),e[0]),c=e[e.length-1],e=s.Cartographic.fromCartesian(l),h=s.Math.toDegrees(e.longitude),m=s.Math.toDegrees(e.latitude),l=s.Cartographic.fromCartesian(c),e=s.Math.toDegrees(l.longitude),c=s.Math.toDegrees(l.latitude),d=u,p=s.Math.lerp(h,e,1/d)-h,g=s.Math.lerp(m,c,1/d)-m,f=0;f{g.add({id:e.modelId,url:y.url,modelMatrix:e.modelMatrix,color:y.color,lightColor:y.lightColor,scale:parseInt(y.scale),heightReference:parseInt(y.heightReference),distanceDisplayCondition:y.distanceDisplayCondition})})),v._viewer.scene.primitives.add(g),v.model.push(g),_||v.setVisibility(!1),"function"==typeof C&&C(e)}),this._core.isnull(y.id)&&(y.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+y.id),{id:y.id,name:e,checked:_,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},P.prototype.createPointModel=function(e,c){var h=this,m=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),d=[],t=null,i=0,o=null,p=[],g=e.parameterd,f=(e.objid,e.cyjj),r=e.url,_=(this.modelurl=r,[]),n={point:h._cesium.Color.RED,polyline:h._cesium.Color.YELLOW},C=(0o[h+1]?c:o[h+1],l=lo[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},P.prototype.GetPositionFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]},P.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;lo[h+1]?c:o[h+1],l=lo[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},Oi.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;l>1,c=-7,h=i?r-1:0,m=i?-1:1,r=e[t+h];for(h+=m,n=r&(1<<-c)-1,r>>=-c,c+=s;0>=-c,c+=o;0>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=o?0:n-1,d=o?1:-1,n=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=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-a))<1&&(a--,o*=2),2<=(t+=1<=a+c?h/o:h*Math.pow(2,1-c))*o&&(a++,o/=2),u<=a+c?(s=0,a=u):1<=a+c?(s=(t*o-1)*Math.pow(2,r),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,r),a=0));8<=r;e[i+m]=255&s,m+=d,s/=256,r-=8);for(a=a<>>0):4294967296*(t>>>0)+(e>>>0)}function Ni(e,t,i){var o=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(o);for(var r=i.pos-1;e<=r;r--)i.buf[r+o]=i.buf[r]}function ji(e,t){for(var i=0;i>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function $i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function eo(e,t){this.x=e,this.y=t}function to(e,t,i,o,r){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=o,this._values=r,e.readFields(io,this,t)}function io(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var o=i,r=t,n=o.readVarint()+o.pos;o.pos>3;t=1==o?e.readString():2==o?e.readFloat():3==o?e.readDouble():4==o?e.readVarint64():5==o?e.readVarint():6==o?e.readSVarint():7==o?e.readBoolean():null}return t}(i))}function no(e,t){this.layers=e.readFields(ao,{},t)}function ao(e,t,i){3===e&&(e=new oo(i,i.readVarint()+i.pos)).length&&(t[e.name]=e)}function so(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._color=new m(this._viewer,this._cesium),this._tree=F,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=[]}Fi.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&o,e(r,t,this),this.pos===n&&this.skip(o)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Xi(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=$i(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Xi(this.buf,this.pos)+Xi(this.buf,this.pos+4)*Hi;return this.pos+=8,e},readSFixed64:function(){var e=Xi(this.buf,this.pos)+$i(this.buf,this.pos+4)*Hi;return this.pos+=8,e},readFloat:function(){var e=Bi.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Bi.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,i=t[this.pos++],o=127&i;if(i<128)return o;if(o|=(127&(i=t[this.pos++]))<<7,i<128)return o;if(o|=(127&(i=t[this.pos++]))<<14,i<128)return o;if(o|=(127&(i=t[this.pos++]))<<21,i<128)return o;var r,n,i=o|=(15&t[this.pos])<<28,t=e,o=this,e=o.buf;if(n=e[o.pos++],r=(112&n)>>4,n<128)return ki(i,r,t);if(n=e[o.pos++],r|=(127&n)<<3,n<128)return ki(i,r,t);if(n=e[o.pos++],r|=(127&n)<<10,n<128)return ki(i,r,t);if(n=e[o.pos++],r|=(127&n)<<17,n<128)return ki(i,r,t);if(n=e[o.pos++],r|=(127&n)<<24,n<128)return ki(i,r,t);if(n=e[o.pos++],r|=(1&n)<<31,n<128)return ki(i,r,t);throw new Error("Expected varint not more than 10 bytes")},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 o,r,n,a="",s=t;for(;s>>10&1023|55296),u=56320|1023&u),a+=String.fromCharCode(u),s+=c}return a}(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=Gi(this);for(e=e||[];this.pos>>=7,o.buf[o.pos++]=127&t|128,t>>>=7,o.buf[o.pos++]=127&t|128,t>>>=7,o.buf[o.pos++]=127&t|128,t>>>=7,o.buf[o.pos]=127&t,r),r=i,i=(7&t)<<4;return r.buf[r.pos++]|=i|((t>>>=3)?128:0),void(t&&(r.buf[r.pos++]=127&t|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=127&t|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=127&t|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=127&t|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=127&t))))))}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,e=(this.pos=function(e,t,i){for(var o,r,n=0;n>6|192:(o<65536?e[i++]=o>>12|224:(e[i++]=o>>18|240,e[i++]=o>>12&63|128),e[i++]=o>>6&63|128),e[i++]=63&o|128)}return i}(this.buf,e,this.pos),this.pos-t);128<=e&&Ni(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),Bi.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Bi.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),n--,1===r||2===r)a+=i.readSVarint(),s+=i.readSVarint(),1===r&&(e&&l.push(e),e=[]),e.push(new eo(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}return e&&l.push(e),l},to.prototype.bbox=function(){for(var e,t=this._pbf,i=(t.pos=this._geometry,t.readVarint()+t.pos),o=1,r=0,n=0,a=0,s=1/0,l=-1/0,u=1/0,c=-1/0;t.pos>3),r--,1===o||2===o)(n+=t.readSVarint())=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];e=this._pbf.readVarint()+this._pbf.pos;return new to(this._pbf,e,this.extent,this._keys,this._values)};var lo="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 uo(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._color=new m(this._viewer,this._cesium),this._tree=F,this._VectorTileProvider=new T(this._viewer,this._cesium),this._primitive=void 0,this._Provider=void 0,this.Legend=[]}function x(e){this._viewer=e,this._cesium=Cesium,this._core=new v,this._tree=F,this._getPosition=new C(this._viewer,this._cesium),this._ModelEdit=new jt(this._viewer),this._popupmessage=new yi(this._viewer,this._cesium),this._createGroup=new vi(this._viewer,this._cesium),this._billboardGeoJsonFeatureLayer=new Ei(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new w(this._viewer,this._cesium),this._LabelGeoJsonFeatureLayercopy=new E(this._viewer,this._cesium),this._VectorGeoJsonFeatureLayer=new S(this._viewer,this._cesium),this._PolylineGeoJsonFeatureLayer=new Ri(this._viewer,this._cesium),this._PointModel=new P(this._viewer,this._cesium),this._PolygonGeoJsonFeatureLayer=new Oi(this._viewer,this._cesium),this._PolygonVectorTileLayerArcgis=new so(this._viewer,this._cesium),this._WallGeoFeatureLayer=new uo(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.objectsToExclude=[],this.SimpleGraphicObj=[],F.editPointID||(F.editPointID={edit:[],size:[],move:void 0,height:[],add:[]}),this.editProp=!1,this.PrimitiveCollection=new Cesium.PrimitiveCollection,e.scene.primitives.add(this.PrimitiveCollection),this.SizeData=[],this.featuresPlotting=[],this.openEdit=!0}so.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":lo(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},so.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,S,i,o){var r={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},P=(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(S)||this._core.isnull(S.fill)||"["==S.fill.toString().charAt(0)&&"]"==S.fill.toString().charAt(S.fill.length-1)||(this._core.isHtmlColor(S.fill)?S.fill=this._color.colorFromHtmlColor(S.fill):(/^rgb/.test(S.fill)&&(S.fill=this._color.rgbaStringToRgbaObj(S.fill)),1http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json",type:"get",dataType:"json",success:function(e){var T=[],E=e.layers;Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){function i(e){for(var t=0;t=o.level_min&&t.levelhttp://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){var t,i=new no(new Fi(e)),o=(b.labelCollections=new b._cesium.PointPrimitiveCollection,[]),r=[];for(t in i.layers)for(var n=i.layers[t],a=0;a=s&&t.level{e&&i.removeEdit&&this.SimpleGraphicObj.pop(),i.propData&&this.setPropData(e,i.propData),e.deleteObject=()=>{this.remove(e.id),this._viewer.entities.removeById(e.id)},this.defaultEdit(),o&&o(e,t)};switch(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),e){case"point":t=this.createPoint(i,r);break;case"billboard":t=this.createBillboard(i,r);break;case"label":t=this.createLabel(i,r);break;case"model":t=this.createModel(i,r);break;case"polyline":t=this.createPolyline(i,r);break;case"polygon":t=this.createPolygon(i,r);break;case"triangle":t=this.createTriangle(i,r);break;case"polygon-rectangle":t=this.createPolygonRectangle(i,r);break;case"rectangle":t=this.createRectangle(i,r);break;case"circle":t=this.createCircle(i,r);break;case"ellipse":t=this.createEllipse(i,r);break;case"box":t=this.createBox(i,r);break;case"cylinder":t=this.createCylinder(i,r);break;case"cone":t=this.createCone(i,r);break;case"sphere":t=this.createSphere(i,r);break;case"polyhedron":t=this.createPolyhedron(i,r)}return t},x.prototype.addSimpleGraphic=function(t,i={},e){let o=null;switch(t){case"point":o=this.addPoint(i);break;case"billboard":o=this.addBillboard(i);break;case"label":o=this.addLabel(i);break;case"model":o=this.addModel(i);break;case"polyline":o=this.addPolyline(i);break;case"polylinePrimitive":o=this.addPolylinePrimitive(i);break;case"polygon":o=this.addPolygon(i);break;case"polygonPrimitive":o=this.addPolygonPrimitive(i);break;case"rectangle":o=this.addRectangle(i);break;case"circle":o=this.addCircle(i);break;case"ellipse":o=this.addEllipse(i);break;case"box":o=this.addBox(i);break;case"cylinder":o=this.addCylinder(i);break;case"cone":o=this.addCone(i);break;case"sphere":case"ellipsoid":o=this.addSphere(i);break;case"polyhedron":o=this.addPolyhedron(i)}if(o&&i.removeEdit&&this.SimpleGraphicObj.pop(),i.propData&&this.setPropData(o,i.propData),this.defaultEdit(),o.deleteObject=()=>{this.remove(o.id),this._viewer.entities.removeById(o.id)},e&&(i.GroupID=e.pId,i.id=e.id,i.name=e.name),void 0!==i.GroupID){let e={id:o.id,name:o.name,pId:i.GroupID,type:t,item:{item:o,setVisibility:e=>{o.show=e}}};-1{var e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Point",position:e,point:{pixelSize:16,heightReference:0,color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"#0000ff")),outlineWidth:o._core.defaultValue(t.outlineWidth,2),outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.outlineColor,"rgba(255,255,255,0.6)")),disableDepthTestDistance:o._core.defaultValue(t.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8))}}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},x.prototype.addPoint=function(e={}){var t=this;let i=this._viewer;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Point"),position:e.position,point:{pixelSize:t._core.defaultValue(e.pixelSize,16),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#0000ff")),outlineWidth:t._core.defaultValue(e.outlineWidth,2),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),heightReference:t._core.defaultValue(e.heightReference,0),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createBillboard=function(t={},i){let o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,t.image=this._core.getGifImageProperty(t.image),this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Billboard",position:e,billboard:{horizontalOrigin:o._cesium.HorizontalOrigin.CENTER,verticalOrigin:o._cesium.VerticalOrigin.BOTTOM,heightReference:0,scale:o._core.defaultValue(t.scale,1),width:o._core.defaultValue(t.width,t.image?void 0:32),height:o._core.defaultValue(t.height,t.image?void 0:44),image:o._core.defaultValue(t.image,window.SmartEarthRootUrl+I.mark),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"#ffffff")),disableDepthTestDistance:o._core.defaultValue(t.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8))},label:this.getDefaultLabelStyle(t)}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制图标")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},x.prototype.addBillboard=function(e={}){var t=this;let i=this._viewer;e.image=this._core.getGifImageProperty(e.image);e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Billboard"),position:e.position,billboard:{horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.BOTTOM),scale:t._core.defaultValue(e.scale,1),rotation:t._core.defaultValue(e.rotation,0),width:t._core.defaultValue(e.width,void 0),height:t._core.defaultValue(e.height,void 0),image:t._core.defaultValue(e.image,window.SmartEarthRootUrl+I.mark),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),heightReference:t._core.defaultValue(e.heightReference,0),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))},label:this.getDefaultLabelStyle(e)});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createLabel=function(t={},i){let o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e);e&&(e=r.entities.add({id:o._core.getuid(),name:"Label",position:e,label:{text:"新建文本",font:"24px 宋体",fillColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.fillColor,"#ffffff")),heightReference:0,scale:1,style:2,outlineColor:o._cesium.Color.BLACK,outlineWidth:0,showBackground:!1,backgroundColor:new o._cesium.Color(.165,.165,.165,.8),horizontalOrigin:o._cesium.HorizontalOrigin.CENTER,verticalOrigin:o._cesium.VerticalOrigin.CENTER,distanceDisplayCondition:o._core.defaultValue(t.distanceDisplayCondition,new o._cesium.DistanceDisplayCondition(0,1e8)),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),o.SimpleGraphicObj.push(e.id),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{o.tooltip.showAt(e.endPosition,"点击绘制文本")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0")},this},x.prototype.addLabel=function(e={}){var t=this;let i=this._viewer;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Label"),position:e.position,label:{text:t._core.defaultValue(e.text,"新建文本"),font:t._core.defaultValue(e.font,"24px 宋体"),scale:t._core.defaultValue(e.scale,1),style:t._core.defaultValue(e.style,2),fillColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.fillColor,"#ffffff")),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"#000000")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),showBackground:t._core.defaultValue(e.showBackground,!1),backgroundColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.backgroundColor,"rgba(42,42,42,0.8)")),heightReference:t._core.defaultValue(e.heightReference,0),horizontalOrigin:t._core.defaultValue(e.horizontalOrigin,t._cesium.HorizontalOrigin.CENTER),verticalOrigin:t._core.defaultValue(e.verticalOrigin,t._cesium.VerticalOrigin.CENTER),scaleByDistance:t._core.defaultValue(e.scaleByDistance,void 0),pixelOffset:t._core.defaultValue(e.pixelOffset,void 0),disableDepthTestDistance:t._core.defaultValue(e.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createModel=function(o={},t){let r=this,n=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),F.states=1;let a;var e=Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(r._core.defaultValue(o.heading,0))),i=Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(r._core.defaultValue(o.pitch,0))),s=Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(r._core.defaultValue(o.roll,0)));let l=Cesium.Matrix4.fromRotationTranslation(e),u=Cesium.Matrix4.fromRotationTranslation(i),c=Cesium.Matrix4.fromRotationTranslation(s),h=(this.drawHandler.setInputAction(e=>{e=r._getPosition.getMousePosition(e,a);e&&(a&&n.scene.primitives.remove(a),(a=n.entities.add({id:r._core.getuid(),name:r._core.defaultValue(o.name,"Model"),position:e,orientation:Cesium.Transforms.headingPitchRollQuaternion(e,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(r._core.defaultValue(o.heading,0)),Cesium.Math.toRadians(r._core.defaultValue(o.pitch,0)),Cesium.Math.toRadians(r._core.defaultValue(o.roll,0)))),model:{uri:r._core.defaultValue(o.url,window.SmartEarthRootUrl+I.testModel),scale:r._core.defaultValue(o.scale,1),minimumPixelSize:0,runAnimations:!0,colorBlendMode:r._core.defaultValue(o.colorBlendMode,void 0),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(o.color,"#ffffff")),distanceDisplayCondition:r._core.defaultValue(o.distanceDisplayCondition,new r._cesium.DistanceDisplayCondition(0,1e8))}})).heading=r._core.defaultValue(o.heading,0),a.pitch=r._core.defaultValue(o.pitch,0),a.roll=r._core.defaultValue(o.roll,0),r.SimpleGraphicObj.push(a.id),r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),setTimeout(function(){F.states=0},100),r._core.mouse(r._viewer.container,0,"0"),t&&"function"==typeof t&&t(a))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),!1);return this.drawHandler.setInputAction(e=>{var t,i=r._getPosition.getMousePosition(e,a);a?(t=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(t,l,t),Cesium.Matrix4.multiply(t,u,t),Cesium.Matrix4.multiply(t,c,t),a.modelMatrix=t):i&&(t=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(t,l,t),Cesium.Matrix4.multiply(t,u,t),Cesium.Matrix4.multiply(t,c,t),(a=n.scene.primitives.add(Cesium.Model.fromGltf({modelMatrix:t,url:r._core.defaultValue(o.url,window.SmartEarthRootUrl+I.testModel),scale:r._core.defaultValue(o.scale,1),minimumPixelSize:0,colorBlendMode:r._core.defaultValue(o.colorBlendMode,void 0),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(o.color,"#ffffff")).withAlpha(.5),distanceDisplayCondition:r._core.defaultValue(o.distanceDisplayCondition,new r._cesium.DistanceDisplayCondition(0,1e8)),allowPicking:!1}))).readyPromise.then(()=>{h=!0})),h?r.tooltip.showAt(e.endPosition,"点击绘制模型"):r.tooltip.showAt(e.endPosition,"加载模型中...")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),setTimeout(function(){F.states=0},100),r._core.mouse(r._viewer.container,0,"0")},this},x.prototype.addModel=function(e={}){var t=this;let i=this._viewer,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"Model"),position:e.position,orientation:Cesium.Transforms.headingPitchRollQuaternion(e.position,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(t._core.defaultValue(e.heading,0)),Cesium.Math.toRadians(t._core.defaultValue(e.pitch,0)),Cesium.Math.toRadians(t._core.defaultValue(e.roll,0)))),model:{scale:t._core.defaultValue(e.scale,1),uri:t._core.defaultValue(e.url,window.SmartEarthRootUrl+I.testModel),minimumPixelSize:t._core.defaultValue(e.minimumPixelSize,0),runAnimations:t._core.defaultValue(e.runAnimations,!0),colorBlendMode:t._core.defaultValue(e.colorBlendMode,void 0),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"#ffffff")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return o.heading=t._core.defaultValue(e.heading,0),o.pitch=t._core.defaultValue(e.pitch,0),o.roll=t._core.defaultValue(e.roll,0),t.SimpleGraphicObj.push(o.id),o},x.prototype.createPolyline=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(0===n.length&&n.push(t.clone()),n.push(t),i.toPoint&&3===n.length&&(n.pop(),o.end()),a||(a=r.entities.add({id:o._core.getuid(),name:o._core.defaultValue(i.name,"新建线"),polyline:{positions:new o._cesium.CallbackProperty(function(){return n},!1),clampToGround:o._core.defaultValue(i.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),depthFailMaterial:i.depthFailColor&&new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(i.depthFailColor),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),width:o._core.defaultValue(i.width,3),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.SimpleGraphicObj.push(a.id)),i.showSize&&o.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===n.length?o.tooltip.showAt(e.endPosition,"点击开始绘制"):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(e),i.showSize&&(o.clearLastSizeData(),o.showSizeData("polyline",[n[n.length-2],n[n.length-1]]))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0),o.end=void 0,"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a,n)},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},x.prototype.addPolyline=function(e={}){var t=this;let i=this._viewer;var o=e.positions,o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建线"),polyline:{positions:o,clampToGround:t._core.defaultValue(e.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),outlineWidth:t._core.defaultValue(e.outlineWidth,0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)"))}),depthFailMaterial:e.depthFailColor&&new Cesium.PolylineOutlineMaterialProperty({color:t._cesium.Color.fromCssColorString(e.depthFailColor),outlineWidth:0,outlineColor:t._cesium.Color.WHITE.withAlpha(.6)}),width:t._core.defaultValue(e.width,3),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},x.prototype.addPolylinePrimitive=function(e={}){var t=this,i=(this._viewer,e.positions);let o;o=e.clampToGround?new t._cesium.GroundPolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)}):(i=new Cesium.PolylineGeometry({positions:i,width:t._core.defaultValue(e.width,3)}),Cesium.PolylineGeometry.createGeometry(i));i=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),i=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:o,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(i)}});let r;var n=new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0});return r=new(e.clampToGround?t._cesium.GroundPolylinePrimitive:t._cesium.Primitive)({geometryInstances:i,appearance:n}),this.PrimitiveCollection.add(r),r},x.prototype.createPolygon=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,[s,a]);t&&(0===n.length&&n.push(t.clone()),n.push(t),2!==n.length||s||(i.clampToGround=o._core.defaultValue(i.clampToGround,!0),s=r.entities.add({name:"临时线",polyline:{positions:new o._cesium.CallbackProperty(function(){return n},!1),clampToGround:o._core.defaultValue(i.clampToGround,!0),material:new Cesium.PolylineOutlineMaterialProperty({color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6)}),width:3}})),3!==n.length||a||(s&&r.entities.remove(s),a=r.entities.add({id:o._core.getuid(),name:o._core.defaultValue(i.name,"新建面"),polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0===n.length?o.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===n.length?(o.tooltip.showAt(e.endPosition,"点击添加第二个点"),(t=o._getPosition.getMousePosition(e,[s,a]))&&(n.pop(),n.push(t))):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(t=o._getPosition.getMousePosition(e,[s,a]))&&(n.pop(),n.push(t),i.showSize&&(o.clearLastSizeData(),e=o.showSizeData("polygon",n),a&&(a.sizeData=e))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),s&&r.entities.remove(s),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a,n)},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},x.prototype.createTriangle=function(t={},i){let h=this,o=this._viewer,r=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(o.scene.canvas),F.states=1,[]),n,a;function s(e,t){let i=[];var o,r,n,a,e=h.toDegrees(e),t=h.toDegrees(t),s=(o=e.lat,c=e.lon,r=t.lat,n=t.lon,s=p(o),l=p(r),a=p(r)-p(o),u=p(n)-p(c),a=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(s)*Math.cos(l)*Math.pow(Math.sin(u/2),2))),a*=m,a=Math.round(1e4*a)/1e4,{angle:h._core.TwoPointAzimuth(c,o,n,r),distance:a}),l=s.angle,u=s.distance,c=(i.push(t.lon,t.lat),d(e.lat,e.lon,u,l+120));return i.push(c[0],c[1]),c=d(e.lat,e.lon,u,l-120),i.push(c[0],c[1]),Cesium.Cartesian3.fromDegreesArray(i)}this.drawHandler.setInputAction(e=>{e=h._getPosition.getMousePosition(e,a);e&&(n?(r=s(n,e),this.end()):(n=e,r=[e,e,e]),r.length&&!a&&(t.clampToGround=h._core.defaultValue(t.clampToGround,!0),a=o.entities.add({id:h._core.getuid(),name:"新建三角形",polygon:{hierarchy:new h._cesium.CallbackProperty(function(){return new h._cesium.PolygonHierarchy(r)},!1),material:new h._cesium.ImageMaterialProperty({image:null,repeat:new h._cesium.Cartesian2(1,1),color:h._cesium.Color.fromCssColorString(h._core.defaultValue(t.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!h._core.defaultValue(t.clampToGround,!1),heightReference:t.clampToGround?1:0,outline:h._core.defaultValue(t.outline,!1),outlineColor:h._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new h._cesium.DistanceDisplayCondition(0,1e8)}}),h.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;n?(h.tooltip.showAt(e.endPosition,"再次点击结束绘制"),(t=h._getPosition.getMousePosition(e,a))&&(r=s(n,t))):h.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){h.drawHandler.destroy(),h.drawHandler=void 0,h.tooltip.show(!1),setTimeout(function(){F.states=0},100),h._core.mouse(h._viewer.container,0),h.end=void 0,"cancel"===e?a&&(o.entities.remove(a),h.SimpleGraphicObj.pop()):i&&"function"==typeof i&&i(a)},this.drawHandler.setInputAction(e=>{h.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);let m=6378137,l=6356725;function d(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=l+(m-l)*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]}function p(e){return e*Math.PI/180}return this},x.prototype.createPolygonRectangle=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s,l;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(n.length?o.end():(s=e.position,n.push(t.clone(),t.clone(),t.clone(),t.clone())),a||(i.clampToGround=o._core.defaultValue(i.clampToGround,!0),a=r.entities.add({id:o._core.getuid(),name:"新建面",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!o._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:o._core.defaultValue(i.outline,!1),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(t=>{if(0===n.length)o.tooltip.showAt(t.endPosition,"点击开始绘制");else{o.tooltip.showAt(t.endPosition,"点击结束绘制"),s=Viewer.scene.cartesianToCanvasCoordinates(n[0]),l=t.endPosition;var t={x:s.x,y:l.y},i={x:l.x,y:s.y};let e=o._getPosition.getMousePosition(t,a);e&&(n[1]=e),(e=o._getPosition.getMousePosition(l,a))&&(n[2]=e),(e=o._getPosition.getMousePosition(i,a))&&(n[3]=e)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"===e?a&&r.entities.remove(a):t&&"function"==typeof t&&t(a,s,l)},this},x.prototype.addPolygon=function(e={}){var t=this;let i=this._viewer;var o=e.positions;let r;r=e.hierarchy||new t._cesium.PolygonHierarchy(o),e.clampToGround=t._core.defaultValue(e.clampToGround,!0);o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建面"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),outline:t._core.defaultValue(e.outline,!1),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),perPositionHeight:!t._core.defaultValue(e.clampToGround,!1),heightReference:e.clampToGround?1:0,distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},x.prototype.addPolygonPrimitive=function(e={}){var t=this,i=(this._viewer,e.positions);let o;o=e.hierarchy||new t._cesium.PolygonHierarchy(i);let r;var i=new t._cesium.PolygonGeometry({height:t._core.defaultValue(e.height,void 0),extrudedHeight:t._core.defaultValue(e.extrudedHeight,void 0),polygonHierarchy:o,vertexFormat:e.water?Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT:void 0}),i=t._cesium.PolygonGeometry.createGeometry(i),n=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)")),i=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:i,attributes:e.water?void 0:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(n)}});let a;return e.water?a=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:e.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:e.url,frequency:e.frequency||1e3,animationSpeed:e.watherSpeed||.01,amplitude:e.amplitude||10}}})}),show:!0}):(a=new t._cesium.Primitive({geometryInstances:i,appearance:new t._cesium.PerInstanceColorAppearance({translucent:!0}),shadows:e.shadows}),e.extrudedHeight&&(r=new Cesium.PrimitiveCollection,n=new Cesium.PolygonOutlineGeometry({height:t._core.defaultValue(e.height,void 0),polygonHierarchy:o,extrudedHeight:e.extrudedHeight}),i=Cesium.PolygonOutlineGeometry.createGeometry(n),n=t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),e=new Cesium.GeometryInstance({id:t._core.defaultValue(e.id,t._core.getuid()),geometry:i,attributes:{color:new t._cesium.ColorGeometryInstanceAttribute.fromColor(n)}}),i=new t._cesium.Primitive({geometryInstances:e,appearance:new t._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),r.add(a),r.add(i))),r=r||a,this.PrimitiveCollection.add(r),r},x.prototype.createRectangle=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a;return this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n.pop(),n.push(e),o.end()),a||(e=o.toDegrees(n[0]),i.clampToGround=o._core.defaultValue(i.clampToGround,!0),(a=r.entities.add({id:o._core.getuid(),name:"新建矩形",rectangle:{coordinates:new o._cesium.CallbackProperty(function(){return o._cesium.Rectangle.fromCartesianArray(n)},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),height:i.clampToGround?void 0:e.height,heightReference:i.clampToGround?1:0,outline:!0,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),outlineWidth:1,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a)},this},x.prototype.addRectangle=function(e={}){var t=this;let i=this._viewer;var o=e.positions;let r;r=e.coordinates||t._cesium.Rectangle.fromCartesianArray(o);o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建矩形"),rectangle:{coordinates:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),rotation:t._core.defaultValue(e.rotation,0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},x.prototype.createCircle=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s=0;return this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(n[1]),i.clampToGround=o._core.defaultValue(i.clampToGround,!0),(a=r.entities.add({id:o._core.getuid(),name:"新建圆",position:n[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return s},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),height:i.clampToGround?void 0:e.height,heightReference:i.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a,{distance:s,positions:n})},this},x.prototype.addCircle=function(e={}){var t=this;let i=this._viewer,o=e.radius;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return o},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),transparent:!0,color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,e.image?"#ffffff":"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,e.height?0:1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,rotation:e.rotation,stRotation:e.outline,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createEllipse=function(t={},i){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s=0;return this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(n[1]),t.clampToGround=o._core.defaultValue(t.clampToGround,!0),(a=r.entities.add({id:o._core.getuid(),name:"新建椭圆",position:n[1],ellipse:{semiMajorAxis:new o._cesium.CallbackProperty(function(){return s},!1),semiMinorAxis:new o._cesium.CallbackProperty(function(){return s/2},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(t.color,"rgba(0,255,0,0.6)"))}),height:t.clampToGround?void 0:e.height,heightReference:t.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:o._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}})).thisHeight=e.height,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):i&&"function"==typeof i&&i(a)},this},x.prototype.addEllipse=function(e={}){var t=this;let i=this._viewer,o=e.semiMajorAxis,r=e.semiMinorAxis;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆"),position:e.position,ellipse:{semiMajorAxis:new t._cesium.CallbackProperty(function(){return o},!1),semiMinorAxis:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),height:t._core.defaultValue(e.height,void 0),heightReference:t._core.defaultValue(e.heightReference,1),outline:t._core.defaultValue(e.outline,!1),outlineWidth:1,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createBox=function(n={},t){let a=this,r=this._viewer,s=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),l,u=[0,0,200];return this.drawHandler.setInputAction(e=>{let t=a._getPosition.getMouseDegrees(e,l);var i,o;t&&(0===s.length?s.push(t,t):(t.height=s[0].height,s[1]=t,e=a.Cdcl(s[0].lat,s[0].lon,s[0].lat,s[1].lon),i=a.Cdcl(s[0].lat,s[0].lon,s[1].lat,s[0].lon),o={lon:(s[0].lon+s[1].lon)/2,lat:(s[0].lat+s[1].lat)/2},u&&(u[0]=e,u[1]=i),l.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s[0].height+u[2]/2),a.end()),l||(l=r.entities.add({id:a._core.getuid(),name:"新建立方体",position:a._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),box:{dimensions:new a._cesium.CallbackProperty(function(){return a._cesium.Cartesian3.fromArray(u)},!1),material:new a._cesium.ImageMaterialProperty({image:null,repeat:new a._cesium.Cartesian2(1,1),color:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:!0,outlineColor:a._cesium.Color.fromCssColorString(a._core.defaultValue(n.outlineColor,"rgba(255,255,255,0.6)")),shadows:a._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new a._cesium.DistanceDisplayCondition(0,1e8)}}),a.SimpleGraphicObj.push(l.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(t=>{if(0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,a.drawHandler.destroy(),a.drawHandler=void 0,a.tooltip.show(!1),a.clearAllSizeData(),setTimeout(function(){F.states=0},100),a._core.mouse(a._viewer.container,0,"0"),"cancel"===e?l&&(r.entities.remove(l),a.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(l)},this},x.prototype.addBox=function(e={}){var t=this;let i=this._viewer,o=e.dimensions;e=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建立方体"),position:e.position,box:{dimensions:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(e.id),e},x.prototype.createCylinder=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s=0;return this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(e),(a=r.entities.add({id:o._core.getuid(),name:"新建圆柱体",position:o._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+100),cylinder:{length:200,topRadius:new o._cesium.CallbackProperty(function(){return s},!1),bottomRadius:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}})).changeTop=!0,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a)},this},x.prototype.addCylinder=function(e={}){var t=this;let i=this._viewer,o=e.radius,r=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆柱体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:new t._cesium.CallbackProperty(function(){return o},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return r.changeTop=!0,t.SimpleGraphicObj.push(r.id),r},x.prototype.createCone=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a,s=0;return this.drawHandler.setInputAction(e=>{var e=o._getPosition.getMousePosition(e,a);e&&(0===n.length?n.push(e,e):(n[0]=e,s=o._cesium.Cartesian3.distance(n[0],n[1]),o.end()),a||(e=o.toDegrees(e),(a=r.entities.add({id:o._core.getuid(),name:"新建圆锥体",position:o._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+100),cylinder:{length:200,topRadius:0,bottomRadius:new o._cesium.CallbackProperty(function(){return s},!1),material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}})).changeTop=!1,o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{this.end=void 0,o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a)},this},x.prototype.addCone=function(e={}){var t=this;let i=this._viewer,o=e.bottomRadius,r=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建圆锥体"),position:e.position,cylinder:{length:t._core.defaultValue(e.length,200),topRadius:t._core.defaultValue(e.topRadius,0),bottomRadius:new t._cesium.CallbackProperty(function(){return o},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return r.changeTop=!1,t.SimpleGraphicObj.push(r.id),r},x.prototype.createSphere=function(i={},o){let r=this,n=this._viewer,a=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(n.scene.canvas),F.states=1,[]),s,l=0;return this.drawHandler.setInputAction(e=>{let t=r._getPosition.getMousePosition(e,s);t&&(0===a.length?a.push(t,t):(a[0]=t,l=r._cesium.Cartesian3.distance(a[0],a[1]),r.end()),s||((s=n.entities.add({id:r._core.getuid(),name:"新建球体",position:t.clone(),ellipsoid:{radii:new r._cesium.CallbackProperty(function(){return new Cesium.Cartesian3(l,l,l)},!1),material:new r._cesium.ImageMaterialProperty({image:null,repeat:new r._cesium.Cartesian2(1,1),color:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:r._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new r._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:r._cesium.Color.fromCssColorString(r._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}})).isSphere=!0,r.SimpleGraphicObj.push(s.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=t=>{if(this.end=void 0,r.drawHandler.destroy(),r.drawHandler=void 0,r.tooltip.show(!1),r.clearAllSizeData(),setTimeout(function(){F.states=0},100),r._core.mouse(r._viewer.container,0,"0"),"cancel"===t)s&&(n.entities.remove(s),r.SimpleGraphicObj.pop());else{let e=r.toDegrees(a[0]);t=r.toDegrees(a[1]);e.height=t.height,a[0]=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),o&&"function"==typeof o&&o(s)}},this},x.prototype.addSphere=function(e={}){var t=this;let i=this._viewer;var o=e.radius;let r,n=(r=e.radii||new Cesium.Cartesian3(o,o,o),i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建球体"),position:e.position,ellipsoid:{radii:new t._cesium.CallbackProperty(function(){return r},!1),material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:t._core.defaultValue(e.outline,!0),shadows:t._cesium.ShadowMode.ENABLED,outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}}));return n.isSphere=!0,t.SimpleGraphicObj.push(n.id),n},x.prototype.createPolyhedron=function(i={},t){let o=this,r=this._viewer,n=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,[]),a;return this.drawHandler.setInputAction(e=>{let t=o._getPosition.getMousePosition(e,a);t&&(1===n.length&&n.push(t.clone()),n.push(t),3!==n.length||a||(e=o.toDegrees(n[0]),a=r.entities.add({id:o._core.getuid(),name:"新建多边体",polygon:{hierarchy:new o._cesium.CallbackProperty(function(){return new o._cesium.PolygonHierarchy(n)},!1),extrudedHeight:e.height+200,height:e.height,material:new o._cesium.ImageMaterialProperty({image:null,repeat:new o._cesium.Cartesian2(1,1),color:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:o._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:o._cesium.Color.fromCssColorString(o._core.defaultValue(i.outlineColor,"rgba(255,255,255,0.6)"))}}),o.SimpleGraphicObj.push(a.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===n.length?o.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===n.length?o.tooltip.showAt(e.endPosition,"点击添加第二个点"):(o.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(e),i.showSize&&(o.clearLastSizeData(),o.showSizeData("polyhedron",n,0,200))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),o.clearAllSizeData(),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),o.end=void 0,"cancel"===e?a&&(r.entities.remove(a),o.SimpleGraphicObj.pop()):t&&"function"==typeof t&&t(a)},this.drawHandler.setInputAction(e=>{o.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},x.prototype.addPolyhedron=function(e={}){var t=this;let i=this._viewer;var o=e.positions,r=t._core.defaultValue(e.height,0);let n;n=e.hierarchy||new t._cesium.PolygonHierarchy(o);o=i.entities.add({id:t._core.defaultValue(e.id,t._core.getuid()),name:t._core.defaultValue(e.name,"新建多边体"),polygon:{hierarchy:new t._cesium.CallbackProperty(function(){return n},!1),extrudedHeight:t._core.defaultValue(e.extrudedHeight,r+200),height:r,material:new t._cesium.ImageMaterialProperty({image:t._core.defaultValue(e.image,null),repeat:t._core.defaultValue(e.repeat,new t._cesium.Cartesian2(1,1)),color:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.color,"rgba(0,255,0,0.6)"))}),shadows:t._cesium.ShadowMode.ENABLED,fill:!0,outline:t._core.defaultValue(e.outline,!0),outlineColor:t._cesium.Color.fromCssColorString(t._core.defaultValue(e.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:t._core.defaultValue(e.distanceDisplayCondition,new t._cesium.DistanceDisplayCondition(0,1e8))}});return t.SimpleGraphicObj.push(o.id),o},x.prototype.toDegrees=function(e){e=this._cesium.Cartographic.fromCartesian(e);return{lon:this._cesium.Math.toDegrees(e.longitude),lat:this._cesium.Math.toDegrees(e.latitude),height:e.height}},x.prototype.showSizeData=function(o,r,n,a){let s="",l;switch(o){case"polyline":let e=Cesium.Cartesian3.distance(r[0],r[1]);s=1e3<=e?(e/=1e3).toFixed(2)+"千米":e.toFixed(2)+"米",l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"polygon":var u=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);u.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=this._core.getArea(u,r);break;case"rectangle":var c=this.toDegrees(r[0]),h=this.toDegrees(r[1]),h=Cesium.Cartesian3.distance(r[0],Cesium.Cartesian3.fromDegrees(c.lon,h.lat,c.height))*Cesium.Cartesian3.distance(r[1],Cesium.Cartesian3.fromDegrees(c.lon,h.lat,c.height));s=1e6<=h?(h/=1e6).toFixed(2)+"平方千米":h.toFixed(2)+"平方米",l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"circle":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米":"半径:"+n.toFixed(2)+"米";break;case"box":let t=[],i=(n[0]{1e3<=e?(e/=1e3,s+=i[t]+e.toFixed(2)+"千米"):s+=i[t]+e.toFixed(2)+"米"}),l=r;break;case"cylinder":case"cone":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米\n":"半径:"+n.toFixed(2)+"米\n",1e3<=a?(a/=1e3,s+="高度:"+a.toFixed(2)+"千米"):s+="高度:"+a.toFixed(2)+"米";break;case"sphere":l=r,s=1e3<=n?"半径:"+(n/=1e3).toFixed(2)+"千米":"半径:"+n.toFixed(2)+"米";break;case"polyhedron":u=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);u.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=1e3<=a?"高度:"+(a/=1e3).toFixed(2)+"千米":"高度:"+a.toFixed(2)+"米",s+="\n面积:"+this._core.getArea(u,r)}o=this._viewer.entities.add({position:l,label:{text:s,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return this.SizeData.push(o.id),s},x.prototype.clearLastSizeData=function(){var e;this.SizeData.length&&(e=this.SizeData.pop(),this._viewer.entities.removeById(e))},x.prototype.clearAllSizeData=function(){this.SizeData.forEach(e=>{this._viewer.entities.removeById(e)}),this.SizeData=[]},x.prototype.Cdcl=function(e,t,i,o){let r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))},x.prototype.setEdit=function(e,t){this.openEdit=e=void 0===e?!0:e,t&&(this.editOption=t),this.defaultEdit()},x.prototype.openEditProp=function(e,i){i=i||this.editOption||{editPropData:{}},void 0===e.GeoType&&(t=this.getEntityTypeAndObject(e),e.GeoType=t.type);var t=e.GeoType;SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.entity||(this.getSimpleGraphicData(t,e),"point"===t||"billboard"===t||"label"===t||"model"===t?(this.isEditting=!0,"model"===t&&this._ModelEdit.start(e)):(this.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint())),i.editPropData||(i.editPropData={}),this._popupmessage.createPopupProp("属性编辑",{width:i.editPropData.width||360,height:i.editPropData.height||"90%",url:"Workers/prop/jdtx_prop.html",shade:i.editPropData.shade,offset:i.editPropData.offset,type:t,fn:{success:(e,t)=>{i.editPropData.success&&i.editPropData.success(e,t),SmartEarthPopupData.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:()=>{this.setPropData(e),i.callBack&&i.callBack.end&&i.callBack.end(e),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0,this.endThisEdit&&this.endThisEdit()}}})},x.prototype.setPropData=function(i,e){if(e&&(i.propData=e),Array.isArray(i.propData)){let t={};i.propData.forEach(e=>{e.key&&(t[e.key]=e.value)}),i.propData=t}if(i.propData){i.properties=new Cesium.PropertyBag(i.propData),i.description='';for(let e=0;e`}i.description+="
${t}${o}
"}},x.prototype.getPropData=function(e){let t=e.properties,i=(t=t||new Cesium.PropertyBag,{});for(let e=0;e{c.defaultEvent(!0),F.editPointID.edit.forEach(e=>{h.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{h.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{h.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{h.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&h.entities.remove(F.editPointID.move),F.editPointID.move=void 0,g=m=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},c.isEditting=!1,c.tooltip.show(!1),c.delButton(!1),c._ModelEdit.end()},this.endThisEdit(),e&&(this.editHandler=new this._cesium.ScreenSpaceEventHandler(h.scene.canvas),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(c.endThisEdit(),c.defaultEvent(!1));else if(!F.editVector){var i=t.position,o=h.scene.pick(i);if(c._cesium.defined(o)&&o.id instanceof Cesium.Entity){let e=o.id;c.isEditting||0!=F.states?e==m&&("point"===e.GeoType||"billboard"===e.GeoType||"label"===e.GeoType)||"height_point"==e.name||"edit_point"==e.name||"move_point"==e.name||"add_point"==e.name||"size_point"==e.name?(h.container.style.cursor="crosshair",c.defaultEvent(!1),"height_point"==e.name?(p={windowPosition:i,originHeight:c._cesium.Cartographic.fromCartesian(e.position.getValue()).height},l="height_point"):"move_point"==e.name?l="move_point":"point"===e.GeoType||"billboard"===e.GeoType||"label"===e.GeoType?(c.tooltip.showAt(t.position,"释放后完成修改"),l="move_point"):"edit_point"==e.name?l="edit_point":"add_point"==e.name?l="add_point":"size_point"==e.name&&(l="size_point"),d=e):m&&e.id===m.id||c.endThisEdit():-1!==c.SimpleGraphicObj.indexOf(e.id)&&(void 0===(m=e).GeoType&&(i=c.getEntityTypeAndObject(m),m.GeoType=i.type),g=m.GeoType,c.getSimpleGraphicData(g,m),"point"===g||"billboard"===g||"label"===g||"model"===g?(c.isEditting=!0,"model"===g?c._ModelEdit.start(m):c.tooltip.showAt(t.position,"拖拽修改位置")):(c.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint()),this.editProp&&c.openEditProp(m,a))}else o&&"modeEditAxis"===o.id||c.endThisEdit()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(c.endThisEdit(),c.defaultEvent(!1));else if(!F.editVector){let e=h.scene.pick(t.endPosition);if(c._cesium.defined(e))if(c.isEditting&&!d){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(c.isEditting&&(c.endThisEdit(),c.defaultEvent(!1)));"point"!==g&&"billboard"!==g&&"label"!==g&&"model"!==g||e.id!=m?e.id&&"edit_point"===e.id.name&&m.pottingPoint?"polyline"===g&&2{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=n,t.y/=n,t.z/=n,F.editPointID.move&&(F.editPointID.move.position=t),"polyline"!==g&&"polygon"!==g&&"rectangle"!==g||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("height_point"===l){var u=F.editPointID.height.indexOf(d.id);let e=h.entities.getById(F.editPointID.edit[u]),i=("ellipse"!==g&&"cylinder"!==g&&"box"!==g||(e=F.editPointID.move),c.toDegrees(e.position.getValue()));r=p.originHeight-i.height,n=h.scene.cartesianToCanvasCoordinates(e.position.getValue()),u=(p.windowPosition.y-t.endPosition.y)*r/Math.abs(n.y-p.windowPosition.y);let o=Math.abs(r+u);F.editPointID.height.forEach(e=>{let t=h.entities.getById(e);t&&(e=t.position.getValue(),e=c.toDegrees(e),t.position=c._cesium.Cartesian3.fromDegrees(e.lon,e.lat,o+i.height))}),m[g].extrudedHeight?m[g].extrudedHeight=new c._cesium.CallbackProperty(function(){return o+i.height},!1):"box"===g?SmartEarthPopupData.editGraphic.setValue("height",o):"cylinder"===g&&SmartEarthPopupData.editGraphic.setValue("length",o),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.box input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="height"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]').value=parseFloat(o).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]').value=parseFloat(o).toFixed(2)))}else if("add_point"===l){t=F.editPointID.add.indexOf(d.id),n=(h.entities.remove(d),h.entities.add({name:"edit_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}));if(F.editPointID.edit.splice(t+1,0,n.id),m.pottingPoint.splice(t+1,0,i.clone()),0{let i,o,r,n=h.entities.getById(F.editPointID.edit[t]);if(n=n||h.entities.getById(F.editPointID.size[t]),i=n?c.toDegrees(n.position.getValue()):c.toDegrees(e),r=c._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l),e.x=r.x,e.y=r.y,e.z=r.z,n&&(n.position=r),0{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?c.isEditting&&(c.endThisEdit(),c.defaultEvent(!1)):F.editVector||(d&&a.callBack&&a.callBack.update&&a.callBack.update(d.name,m),h.container.style.cursor="default",d=void 0,c.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(e=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(c.endThisEdit(),c.defaultEvent(!1));else if(!F.editVector){var o=h.scene.pick(e.position);if(c._cesium.defined(o)&&0==F.states){let i=o.id;if(-1{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,F.editPointID.move&&(F.editPointID.move.position=t),m.pottingPoint.concat([]));"polyline"!==g&&"polygon"!==g||SmartEarthPopupData.editGraphic.setValue("positions",o),c.tooltip.show(!1),a.callBack&&a.callBack.update&&a.callBack.update(d&&d.name,m)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN))},x.prototype.delButton=function(e,t,i){if(e){let e=document.getElementById("DeleteMilitaryStandardDelete");e||((e=document.createElement("button")).id="DeleteMilitaryStandardDelete",e.innerText="删除对象",e.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(e)),e.style.display="block",e.style.top=t.y+"px",e.style.left=t.x+"px",e.onclick=i}else{let e=document.getElementById("DeleteMilitaryStandardDelete");e&&(e.style.display="none",e.onclick=null)}},x.prototype.defaultEvent=function(e){let t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},x.prototype.GetDegreesFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-t)/90;return[180*(r/(o*Math.cos(t*Math.PI/180))+e*Math.PI/180)/Math.PI,180*(i/o+t*Math.PI/180)/Math.PI]},x.prototype.isClampToGround=function(e){return e.heightReference&&1===e.heightReference.getValue()},x.prototype.getClampToGroundPosition=function(e,t){let i=Cesium.Cartographic.fromCartesian(e);e=this._viewer.scene.sampleHeight(i,t);return i.height=e,Cesium.Cartographic.toCartesian(i)},x.prototype.GetPositionFromA_D=function(e,t,i){e=this.toDegrees(e),t=this.GetDegreesFromA_D(e.lon,e.lat,t,i);return this._cesium.Cartesian3.fromDegrees(t[0],t[1],e.height)},x.prototype.getEntityTypeAndObject=function(e){let t={type:"",object:null};return e&&(e.billboard?(t.type="billboard",t.object=e.billboard):e.box?(t.type="box",t.object=e.box):e.corridor?(t.type="corridor",t.object=e.corridor):e.cylinder?(t.type="cylinder",t.object=e.cylinder):e.ellipse?(t.type="ellipse",t.object=e.ellipse):e.ellipsoid?(t.type="ellipsoid",t.object=e.ellipsoid):e.label?e.billboard?(t.type="billboard",t.object=e.billboard):(t.type="label",t.object=e.label):e.model?(t.type="model",t.object=e.model):e.path?(t.type="path",t.object=e.path):e.plane?(t.type="plane",t.object=e.plane):e.point?(t.type="point",t.object=e.point):e.polygon?(t.type="polygon",t.object=e.polygon):e.polyline?(t.type="polyline",t.object=e.polyline):e.polylineVolume?(t.type="polylineVolume",t.object=e.polylineVolume):e.rectangle?(t.type="rectangle",t.object=e.rectangle):e.wall&&(t.type="wall",t.object=e.wall)),t},x.prototype.getSimpleGraphicData=function(r,n){let a=this,s=this._viewer;var e,t,i;function o(e){SmartEarthPopupData.editGraphic.fillColor=u("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function l(e){SmartEarthPopupData.editGraphic.outlineColor=u("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function u(e){let t=e;if(/^(rgb|RGB)/.test(t)){let e=t.replace(/(rgb|RGB)*/g,"");var o=(e=e.replace("(","").replace(")","")).split(",");let i="#";for(let t=0;t{let t=s.entities.getById(e);t&&(e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i))})},changeEditPoint:function(i){0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))}),0{let t=s.entities.getById(e);t&&("clampToGround"===i?t.point.heightReference=1:(t.point.heightReference=0,e=t.position.getValue(),e=a.toDegrees(e),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,i)))});let e=F.editPointID.move;var t;e&&("clampToGround"===i?e.point.heightReference=1:(e.point.heightReference=0,t=e.position.getValue(),t=a.toDegrees(t),e.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i)))},clearAllEditPoint:function(){F.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{s.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{s.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{s.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&s.entities.remove(F.editPointID.move),F.editPointID.move=void 0}},"billboard"===r&&((e=SmartEarthPopupData.editGraphic.getValue("label_fillColor"))?(e=e,SmartEarthPopupData.editGraphic.label_fillColor=u("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.label_alpha=100*e.alpha):(SmartEarthPopupData.editGraphic.lable_fillColor="#00ff00",SmartEarthPopupData.editGraphic.label_alpha=60),(e=SmartEarthPopupData.editGraphic.getValue("label_outlineColor"))?(e=e,SmartEarthPopupData.editGraphic.label_outlineColor=u("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.label_outlineAlpha=100*e.alpha):(SmartEarthPopupData.editGraphic.label_outlineColor="#ffffff",SmartEarthPopupData.editGraphic.label_outlineAlpha=60),(e=SmartEarthPopupData.editGraphic.getValue("label_backgroundColor"))?(e=e,SmartEarthPopupData.editGraphic.label_backgroundColor=u("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.label_backgroundAlpha=100*e.alpha):(SmartEarthPopupData.editGraphic.label_backgroundColor="#000000",SmartEarthPopupData.editGraphic.label_backgroundAlpha=80)),"billboard"===r||"point"===r||"label"===r||"model"===r?((e=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor"))?o(e):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(i=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?l(i):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),"label"===r&&((i=SmartEarthPopupData.editGraphic.getValue("backgroundColor"))?(i=i,SmartEarthPopupData.editGraphic.backgroundColor=u("rgb("+255*i.red+","+255*i.green+","+255*i.blue+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=100*i.alpha):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)),SmartEarthPopupData.editGraphic.setValue=function(e,t){var i;if("showLabel"===e)this.labelGraphic.show=t;else if("position"===e&&this.entity.offset?(this.entity.oP=t,o=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),i=new Cesium.Cartesian3(0,0,0),Cesium.Matrix4.multiplyByPoint(o,this.entity.offset,i),t=i):"offset"===e&&(this.entity.oP||(this.entity.oP=this.getValue("position")),this.entity.offset=t,o=Cesium.Transforms.eastNorthUpToFixedFrame(this.entity.oP),i=new Cesium.Cartesian3(0,0,0),Cesium.Matrix4.multiplyByPoint(o,this.entity.offset,i),t=i,e="position"),"position"===e||"name"===e)this.entity[e]=t;else if("autoRotate"===e&&"model"===this.type)void 0===this.entity.heading&&(this.entity.heading=0,this.entity.pitch=0,this.entity.roll=0),"number"==typeof t?(this.entity.orientation=new Cesium.CallbackProperty(()=>(this.entity.heading+=t,360{let o=s.entities.add({name:"edit_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(F.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}i=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});F.editPointID.height.push(i.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,F.editPointID.move=s.entities.add({name:"move_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let e=0;e{let i=s.entities.getById(F.editPointID.edit[t]);i&&(t=i.position.getValue(),e.x=t.x,e.y=t.y,e.z=t.z)}),e.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}if("clampToGround"===e)return void(this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{i(this.graphic,this.entity.pottingPoint,t)},100)):i(this.graphic,this.entity.pottingPoint,t));"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&this.changeEditPoint(t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let e=this.getValue("hierarchy"),t=e.positions.concat([]);if(void 0!==this.getValue("height")){let i=this.getValue("height");t.forEach(e=>{var t=a.toDegrees(e),t=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,i);e.x=t.x,e.y=t.y,e.z=t.z})}return this.entity.pottingPoint=t},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let e=new Cesium.Cartesian3;t.forEach((t,i)=>{let o=s.entities.add({name:"edit_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(F.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}i=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});F.editPointID.height.push(i.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,F.editPointID.move=s.entities.add({name:"move_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let e=0;e{t(this.entity,this.graphic,i)},100)):t(this.entity,this.graphic,i),void(i?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"ellipse"===this.type&&"extrudedHeight"===e?this.changeHeightPoint(i):"ellipse"===this.type&&"height"===e&&(this.changeEditPoint(i),this.entity.thisHeight=i)}this.graphic[e]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e,t,i=this.getValue("radius");let o=this.getValue("position");return"ellipse"===this.type||this.entity.isSphere?("ellipse"===this.type&&void 0!==this.getValue("height")&&(e=this.getValue("height"),t=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,e)),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o]):(e=a.toDegrees(o),o=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height-this.getValue("length")/2),t=a.GetPositionFromA_D(o,i,90),this.entity.pottingPoint=[t,o],[t,o])},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var t,i=this.getPottingPoint();if(i){let e=s.entities.add({name:"size_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(i[0]):i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(e.angle=90,F.editPointID.size.push(e.id),void 0!==this.getValue("extrudedHeight")){let e=a.toDegrees(i[1]);e.height=this.getValue("extrudedHeight");var o=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});F.editPointID.height.push(o.id)}else"cylinder"===r&&(o=a.toDegrees(i[1]),t=this.getValue("length"),o=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+t),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),F.editPointID.height.push(void 0,o.id));F.editPointID.move=s.entities.add({name:"move_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(i[1]):i[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"rectangle"===r?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?l(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){if("name"===e)this.entity[e]=t;else{if("color"===e||"outlineColor"===e){if(t=Cesium.Color.fromCssColorString(t),"color"===e)return void(this.graphic.material.color=t)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=t);if("alpha"===e)return void(this.graphic.material.color._value.alpha=t);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=t);if("positions"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(t)},!1));if("coordinates"===e)return void(this.graphic.coordinates=new Cesium.CallbackProperty(function(){return t},!1));function i(e,t,i){i?(void 0===e.thisHeight&&(e.thisHeight=t.height&&t.height.getValue()),t.height=void 0,t.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(t.height=e.thisHeight,t.heightReference=Cesium.HeightReference.NONE);let o=t.coordinates.getValue();t.coordinates=new Cesium.CallbackProperty(function(){return o},!1)}if("clampToGround"===e)return this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{i(this.entity,this.graphic,t)},100)):i(this.entity,this.graphic,t),void(t?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight));"extrudedHeight"===e?this.changeHeightPoint(t):"height"===e&&(this.changeEditPoint(t),this.entity.thisHeight=t)}this.graphic[e]=t}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("coordinates");let t,i,o=this.getValue("height");return i=(void 0!==o?t=Cesium.Cartesian3.fromRadians(e.west,e.north,o):(o=s.scene.sampleHeight(new Cesium.Cartographic(e.west,e.north,0),[this.entity]),t=Cesium.Cartesian3.fromRadians(e.west,e.north,o),o=s.scene.sampleHeight(new Cesium.Cartographic(e.east,e.south,0),[this.entity])),Cesium.Cartesian3.fromRadians(e.east,e.south,o)),this.entity.pottingPoint=[t,i],[t,i]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let t=this.getPottingPoint();if(t){let e=new Cesium.Cartesian3;t.forEach((t,i)=>{let o=s.entities.add({name:"edit_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(t):t,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(F.editPointID.edit.push(o.id),void 0!==this.getValue("extrudedHeight")){var r=Cesium.Cartographic.fromCartesian(t),r={lon:Cesium.Math.toDegrees(r.longitude),lat:Cesium.Math.toDegrees(r.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let e=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,this.getValue("height"));t.x=e.x,t.y=e.y,t.z=e.z,o.position=e,this.entity.pottingPoint[i]=e.clone()}i=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});F.editPointID.height.push(i.id)}e.x+=t.x,e.y+=t.y,e.z+=t.z}),e.x/=t.length,e.y/=t.length,e.z/=t.length,F.editPointID.move=s.entities.add({name:"move_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(e):e,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"box"===r?((t=SmartEarthPopupData.editGraphic.getValue("material")).color?o(t.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),(t=SmartEarthPopupData.editGraphic.getValue("outlineColor"))?l(t):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(t,i){if("name"===t)this.entity[t]=i;else{if("color"===t||"outlineColor"===t){if(i=Cesium.Color.fromCssColorString(i),"color"===t)return void(this.graphic.material.color=i)}else{if("image"===t||"repeat"===t)return void(this.graphic.material[t]=i);if("alpha"===t)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===t)return void(this.graphic.outlineColor._value.alpha=i);if("long"===t||"width"===t||"height"===t){let e=this.getValue("dimensions");if("long"===t?e.x=i:"width"===t?e.y=i:e.z=i,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return e},!1),"long"===t||"width"===t){var o="long"===t?90:180,r="long"===t?0:1,n=F.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(F.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(F.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+i/2),this.changeHeightPoint(r.height+i)}return}if("dimensions"===t)return void(this.graphic.dimensions=new Cesium.CallbackProperty(function(){return i},!1))}this.graphic[t]=i}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){var e=this.getValue("dimensions"),t=this.getValue("position"),i=a.toDegrees(t),t=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height-e.z/2),i=a.GetPositionFromA_D(t,e.x/2,90),e=a.GetPositionFromA_D(t,e.y/2,180);return this.entity.pottingPoint=[i,e,t],[i,e,t]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();var i=this.getPottingPoint();if(i){let e=s.entities.add({name:"size_point",position:i[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t=(e.angle=90,s.entities.add({name:"size_point",position:i[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}}));t.angle=180,F.editPointID.size.push(e.id),F.editPointID.size.push(t.id);var o=a.toDegrees(i[2]),r=this.getValue("dimensions"),o=s.entities.add({name:"height_point",position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+r.z),point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});F.editPointID.height.push(void 0,void 0,o.id),F.editPointID.move=s.entities.add({name:"move_point",position:i[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}):"corridor"!==r&&"ellipsoid"===r&&n.isSphere},x.prototype.getStyle=function(t){let e,i;i=this.getEntityTypeAndObject(t).type;var o=n("distanceDisplayCondition"),r=n("label_distanceDisplayCondition");function n(e){return"position"===e||"name"===e||"id"===e?t[e]&&(t[e].getValue?t[e].getValue():t[e]):"radius"===e?"ellipse"===i?t[i].semiMajorAxis.getValue():"ellipsoid"===i?t[i].radii.getValue().x:"cylinder"===i?t[i].bottomRadius.getValue():void 0:"repeat"===e?t[i].material[e]&&(t[i].material[e].getValue?t[i].material[e].getValue():t[i].material[e]):-1{e&&(e=this.addFeature(e))&&t.add(e)}),t},x.prototype.addFeature=function(e){if(("polygon"===e.type&&void 0!==e.style.extrudedHeight||"cylinder"===e.type&&!e.style.changeTop||"ellipsoid"===e.type&&e.style.isSphere)&&e.type,!(e.style&&e.style.id&&-1{t.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{t.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{t.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{t.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&t.entities.remove(F.editPointID.move),F.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={})),this.defaultEdit()},x.prototype.clear=function(){let t=this._viewer;this.SimpleGraphicObj.forEach(e=>{t.entities.removeById(e)}),this.SimpleGraphicObj=[],this.PrimitiveCollection.removeAll(),F.editPointID.edit.forEach(e=>{t.entities.removeById(e)}),F.editPointID.edit=[],F.editPointID.height.forEach(e=>{t.entities.removeById(e)}),F.editPointID.height=[],F.editPointID.add.forEach(e=>{t.entities.removeById(e)}),F.editPointID.add=[],F.editPointID.size.forEach(e=>{t.entities.removeById(e)}),F.editPointID.size=[],F.editPointID.move&&t.entities.remove(F.editPointID.move),F.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},this.defaultEdit()},x.prototype.save=function(e){let i=this._viewer,o={type:"FeatureCollection",features:[]},r,n=this;this.SimpleGraphicObj.forEach(e=>{var t,e=i.entities.getById(e);e&&(t=n.getStyle(e),r={id:e.id,name:e.name,type:t.type,style:t}),o.features.push(r)});var t=JSON.stringify(o),t=new Blob([t],{type:"text/plain;charset=utf-8"});this._core.saveAs(t,e?e+".json":"标绘.json")},x.prototype.setRichtext=function(e,t){var i=e.position.getValue();this._viewer.entities.removeById(e.id);let o="0",r=(e.treeobj&&(F.delete(e.treeobj.id,this._viewer,this._cesium),o=e.treeobj.pId),new Ci(this._viewer));return r.createDivPoint(e.name,i,{id:e.id,description:t,GroupID:o}),r},x.prototype.forceEndHanlder=function(){if(this.editHandler)try{this.editHandler.destroy(),this.editHandler=void 0}catch(e){}if(this.drawHandler)try{this.drawHandler.destroy(),this.drawHandler=void 0}catch(e){}},po.prototype.createSightLine=function(n={}){return"circle"===n.type?this._SimpleGraphic.createCircle({},(e,t)=>{let{distance:i,positions:o}=t;this._SimpleGraphic.remove(e.id);t=this._core.toDegrees(o[1]),o[1]=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height+(n.height||1.8)),this.createPoint(o[1],"观察点"),e=[t.lon,t.lat];let r=Cesium_turf.circle(e,i,{steps:n.steps||64,units:"meters"});r.geometry.coordinates[0].forEach(e=>{var t=this._viewer.scene.globe.getHeight(Cesium.Cartographic.fromDegrees(e[0],e[1])),e=Cesium.Cartesian3.fromDegrees(e[0],e[1],t),t=this._viewer.scene.clampToHeight(e);this.createLine([o[1],t||e])})}):this._SimpleGraphic.createPolyline({toPoint:!0,clampToGround:!1},(e,t)=>{this._SimpleGraphic.remove(e.id);e=this._core.toDegrees(t[0]);t[0]=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+(n.height||1.8)),this.createLine(t),this.createPoint(t[0],"观察点"),this.createPoint(t[1],"目标点")}),this},po.prototype.createLine=async function(e,t){t=this._core.pickFromRay(this._viewer,e[0],e[1],t);t&&t.position?(this._SimpleGraphic.addPolyline({positions:[e[0],t.position],color:"#00ff00",clampToGround:!1}),this._SimpleGraphic.addPolyline({positions:[t.position,e[1]],color:"#ff0000",depthFailColor:"#ff00c6",clampToGround:!1})):this._SimpleGraphic.addPolyline({positions:e,color:"#00ff00",clampToGround:!1})},po.prototype.createPoint=function(e,t){this._SimpleGraphic.addPoint({position:e,pixelSize:8,heightReference:0}),t&&this._SimpleGraphic.addLabel({text:t,position:e,font:"bold 18px 宋体",outlineWidth:2,verticalOrigin:1,pixelOffset:new Cesium.Cartesian2(0,-18),heightReference:0})},po.prototype.setVisibility=function(e){},po.prototype.deleteObject=function(){this._SimpleGraphic.clear()};let go;function fo(e){this._viewer=e,this.left=[],this.right=[]}function _o(){window.removeEventListener("mousemove",yo,!1),window.removeEventListener("mouseup",_o,!1)}function Co(e){go.dragStartX=e.clientX-go.slider.offsetLeft,window.addEventListener("mousemove",yo,!1),window.addEventListener("mouseup",_o,!1)}function yo(e){e=(e.clientX-go.dragStartX)/go.slider.parentElement.offsetWidth;go.slider.style.left=100*e+"%",go.scene.splitPosition=e}function vo(e){this._core=new v,this._viewer=e,this.camera=this._viewer.camera,this.collision=!1,this.indoor_data={X_speedScale:1,Y_speedScale:.8,moveRate:.2,movementX:0,movementY:0,moveFactor:0,enable_looking:!1},this.flags={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1}}function wo(e,t){this._viewer=e,this._cesium=t}function bo(e,t){this._viewer=e,this._cesium=t,this._core=new v,this.Fireworks=[],this.Smog=[],this.Fountain=[],this.Flame=[],this.Blast=[]}function To(e){this._viewer=e,this._depth=100,this.show=!1}function Eo(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._tree=F,this.isStreetView=!1,this.StreetViewType=void 0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),this.defaultSkyAtmosphere=!0,this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null],this.StreetViewNavigation=[],this.StreetViewSphereIndex=0,this.URL={getInitImageByPosition:"",getInitImageInfoById:"",getInitImageById:"",getSecondImageById:"",getThirdImageById:"",getImageInfo:""},this.CallBack={getInitImageByPositionCallBack:void 0,getImageInfoByIdCallBack:void 0,getInitImageByIdCallBack:void 0,getSecondImageByIdCallBack:void 0,getThirdImageByIdCallBack:void 0,selectJoinsCallBack:void 0,setImageDataCallback:void 0},this.StreetViewData={name:"",radius:5,defaultFov:60,fov:110,alpha:1,speedScale:1.5,lon:void 0,lat:void 0,height:0,HeadingPitchRoll:null,getImageTileID:"",linkImagesData:[],isTwoTextures:!1,isThreeTextures:!1,_handler:null,navigation_handler:null},this.FirstImage=void 0}fo.prototype.createSlider=function(){this.close();let e=document.createElement("div");e.id="slider",e.style.position="absolute",e.style.cursor="e-resize",e.style.top=0,e.style.backgroundColor="#D3D3D3",e.style.width="8px",e.style.height="100%",e.style.zIndex="1000",e.style.left="50%",this._viewer.container.appendChild(e),this._viewer.scene.splitPosition=e.offsetLeft/e.parentElement.offsetWidth,e.addEventListener("mousedown",Co,!1),this.slider=e,go={dragStartX:0,slider:e,scene:this._viewer.scene}},fo.prototype.curtainContrast=function(e,t){this.createSlider();let i=this._viewer.imageryLayers.get(e),o=this._viewer.imageryLayers.get(t);this.left.push(i),this.right.push(o),i.splitDirection=-1,o.splitDirection=1},fo.prototype.curtainContrastPro=function(e){this.createSlider(),e.left.forEach(e=>{e.splitDirection=-1,e.item&&(e.item.splitDirection=-1)}),e.right.forEach(e=>{e.splitDirection=1,e.item&&(e.item.splitDirection=1)}),this.left.push(...e.left),this.right.push(...e.right)},fo.prototype.close=function(){this.slider&&(this._viewer.scene.splitPosition=0,this.slider.removeEventListener("mousedown",Co,!1),window.removeEventListener("mouseup",_o,!1),window.removeEventListener("mousemove",yo,!1),this.slider.remove(),this.slider=null,this.left.forEach(e=>{e.splitDirection=0,e.item&&(e.item.splitDirection=0)}),this.right.forEach(e=>{e.splitDirection=0,e.item&&(e.item.splitDirection=0)}),this.left=[],this.right=[],go=null)},vo.prototype.createIndoormode=function(e={}){let t=this._viewer.scene,i=this._viewer.canvas;if(i.setAttribute("tabindex","0"),i.focus(),i.onclick=function(){i.focus()},t.screenSpaceCameraController.enableRotate=!1,t.screenSpaceCameraController.enableTranslate=!1,t.screenSpaceCameraController.enableZoom=!1,t.screenSpaceCameraController.enableTilt=!1,t.screenSpaceCameraController.enableLook=!1,this.bindEvent={pointerlockchange:this.pointerlockchange.bind(this),mousemove:this.mousemove.bind(this),keydown:this.keydown.bind(this),keyup:this.keyup.bind(this),mousewheel:this.mousewheel.bind(this),dblclick:this.dblclick.bind(this)},document.addEventListener("pointerlockchange",this.bindEvent.pointerlockchange,!1),document.addEventListener("mousemove",this.bindEvent.mousemove,!1),document.addEventListener("keydown",this.bindEvent.keydown,!1),document.addEventListener("keyup",this.bindEvent.keyup,!1),document.addEventListener("mousewheel",this.bindEvent.mousewheel,!1),document.addEventListener("dblclick",this.bindEvent.dblclick,!1),this._viewer.clock.onTick.addEventListener(this.onTick,this),this._viewer.container.requestPointerLock(),e.showHelp){var o,r=e.helpPosition||{left:"20px",bottom:"20px"};for(o in this.explainContainer=document.createElement("div"),this.explainContainer.id="IndoormodeExplainContainer",this.explainContainer.style.cssText=` position: absolute; padding: 10px; background-color: rgba(0, 0, 0, 0.6); border: 1px solid rgba(32, 160, 255, 0.6); color: rgb(255, 255, 255); font-size: 16px; font-family: 微软雅黑; border-radius: 5px; z-index: 999; `,r)this.explainContainer.style[o]=r[o];this.explainContainer.innerHTML="W:前;S:后;A:左;D:右
Q:上;E:下
双击:碰撞检测;滚轮:移动速度
鼠标移动:方向控制;Esc:退出",this._viewer.container.append(this.explainContainer)}return this},vo.prototype.dblclick=function(e){0===e.button&&(this.collision=!this.collision,layuiLayer.msg(this.collision?"开启碰撞检测":"关闭碰撞检测"))},vo.prototype.mousemove=function(t){if(this.indoor_data.enable_looking){this.indoor_data.movementX=t.movementX,this.indoor_data.movementY=t.movementY;var t=this._viewer.canvas.clientWidth,i=this._viewer.canvas.clientHeight,t=this.indoor_data.movementX/t;let e=-this.indoor_data.movementY/i;(!this.camera.roll&&this.camera.pitch<0&&e<0||!this.camera.roll&&0l.max||n.test1u.max||n.test2c.max||n.test3h.max||n.test4m.max||parseFloat(n.test1)d.max||parseFloat(n.test2)p.max||parseFloat(n.test3)g.max||parseFloat(n.test4)=a*a&&c.Cartesian3.clone(c.Cartesian3.ZERO,e.velocity)},modelMatrix:h,emitterModelMatrix:e}))}for(var a=[{minimumRed:.75,green:0,minimumBlue:.8,alpha:1},{red:0,minimumGreen:.75,minimumBlue:.8,alpha:1},{red:0,green:0,minimumBlue:.8,alpha:1},{minimumRed:.75,minimumGreen:.75,blue:0,alpha:1}],s=0;s{t.modelMatrix=n.computeModelMatrix(e,n._viewer.clock.currentTime)}});return o.scene.primitives.add(t)}(e));this.Blast.push(t),i&&"function"==typeof i&&i(this.Blast)},bo.prototype.computeModelMatrix=function(e,t){var i=this._cesium;return e instanceof i.Entity?e.computeModelMatrix(t,new i.Matrix4):e.x&&e.y?(t=e.x<=180&&-180<=e.x&&e.y<=90&&-90<=e.y?i.Cartesian3.fromDegrees(e.x,e.y,e.z||0):e,i.Transforms.eastNorthUpToFixedFrame(t)):void 0},bo.prototype.computeEmitterModelMatrix=function(e,t){var i=this._cesium,o=new i.TranslationRotationScale,r=i.HeadingPitchRoll.fromDegrees(0,0,0);return o.translation=i.defaultValue(e,i.Cartesian3.fromElements(0,0,0)),o.rotation=i.Quaternion.fromHeadingPitchRoll(i.defaultValue(t,r)),i.Matrix4.fromTranslationRotationScale(o)},To.prototype.refreshGridLines=function(){var e=this._relativeHeight<0&&this.show,t=this._viewer.camera,t=new Cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,t.positionCartographic.height-this._depth);this.item=this.UndergroundGridLines(t,e)},To.prototype.add=function(e){if(this.show=!0,this._depth=e||100,!this.item)return this._viewer.scene.primitives.add(this),this.refreshGridLines(),this},To.prototype.update=function(e){this.item&&this.show&&(this.getRelativeHeight(),this.item.show&&this.item.update(e))},To.prototype.destroy=function(){this.item&&(this._viewer.scene.primitives.remove(this),this.item=null)},To.prototype.UndergroundGridLines=function(e,t){let i=e;e instanceof Cesium.Cartesian3&&(i=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e));e=new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:Cesium.Cartesian3.fromRadians(i.longitude,i.latitude),height:i.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"});let o=Cesium.Material.fromType("Grid"),r=(o.uniforms.color=Cesium.Color.WHITE.withAlpha(.8),o.uniforms.cellAlpha=.01,o.uniforms.lineCount=new Cesium.Cartesian2(200,200),o.uniforms.lineThickness=new Cesium.Cartesian2(1,1),Cesium.Material.fromType("Color"));return r.uniforms.color=Cesium.Color.BLACK.withAlpha(.8),this.grid1&&this.grid1.destroy(),this.grid1=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.EllipsoidSurfaceAppearance({material:o}),asynchronous:!1}),this.grid2&&this.grid2.destroy(),this.grid2=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.EllipsoidSurfaceAppearance({material:r}),asynchronous:!1}),this.grid1.appearance.renderState.depthTest.enabled=!0,this.grid2.appearance.renderState.depthTest.enabled=!0,{show:t,destroy:()=>{this.grid1&&this.grid1.destroy(),this.grid2&&this.grid2.destroy(),this.grid1=this.grid2=null},update:e=>{this.grid1&&this.grid1.update(e),this.grid2&&this.grid2.update(e)}}},To.prototype.getRelativeHeight=function(){let e=this._viewer.camera;var t=this._viewer.scene.globe.getHeight(e.positionCartographic);this._groundHeightAtCameraPosition=t||this._groundHeightAtCameraPosition,this._relativeHeight=e.positionCartographic.height-this._groundHeightAtCameraPosition,this.oldCameraPosition||(this.oldCameraPosition=e.position.clone()),this.oldCameraHeight||(this.oldCameraHeight=e.positionCartographic.height),0this._depth/10||1e4r._cesium.Math.toRadians(45)||o.pitch{if(a.CallBack&&a.CallBack.getInitImageByPositionCallBack){"function"==typeof a.CallBack.getInitImageByPositionCallBack&&a.CallBack.getInitImageByPositionCallBack(a.StreetViewData,e);var e=a.getImageByIdURL("one",a.StreetViewData.getImageTileID),r=new Image;r.onload=function(){var e=r.width,t=r.height,i=("lide"===a.StreetViewType&&(e=512,t=256),document.createElement("canvas")),o=i.getContext("2d");i.height=t,i.width=e,o.translate(e,0),o.scale(-1,1),o.drawImage(r,0,0,e,t,0,0,e,t),"function"==typeof n&&n(i)},r.setAttribute("crossOrigin","Anonymous");try{r.src=e}catch(e){r.src=""}a.FirstImage=r}else console.log("the getInitImageByPositionCallBack is undefined!")},error:function(e,t,i){}})},Eo.prototype.getInitImage=function(e,r){var e=this.getImageByIdURL("one",e),n=new Image,a=this;n.onload=function(){var e=n.width,t=n.height,i=("lide"===a.StreetViewType&&(e=512,t=256),document.createElement("canvas")),o=i.getContext("2d");i.height=t,i.width=e,o.translate(e,0),o.scale(-1,1),o.drawImage(n,0,0,e,t,0,0,e,t),"function"==typeof r&&r(i)},n.setAttribute("crossOrigin","Anonymous");try{n.src=e}catch(e){n.src=""}a.FirstImage=n},Eo.prototype.getSecondTexturesFromAtlasFile=function(e,o){var r,n,a,s,l=this.StreetViewSphereIndex,t=this.getImageByIdURL("two",e),u=null,c=null,h=0,m=[];let d=4,p=8,i="{row}-{col}",g=1/0,f=1/0;"lide"===this.StreetViewType&&(i="&row={row}&col={col}",d=this.StreetViewData.row,p=this.StreetViewData.col,g=this.StreetViewData.maxWidth,f=this.StreetViewData.maxHeight);for(var _=()=>{if(++h==d*p){null==u&&(u=document.createElement("canvas"),c=u.getContext("2d"),u.height=s>f?f:s,u.width=a>g?g:a,c.translate(u.width,0),c.scale(-1,1));var e=r,t=n;"lide"===this.StreetViewType&&(e=512,t=256),c.drawImage(this.FirstImage,0,0,e,t,0,0,u.width,u.height);for(var i=0;i 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}",l.Material._materialCache.addMaterial(l.Material.EllipsoidFadeType,{fabric:{type:l.Material.EllipsoidFadeType,uniforms:{color:new l.Color(1,0,0,1),angle:90},source:l.Material.EllipsoidFadeSource},translucent:function(e){return!0}})),e={name:"EllipsoidFade",position:e,ellipse:{height:a?void 0:u,semiMinorAxis:t,semiMajorAxis:t,stRotation:r*Math.PI/180,material:new l.EllipsoidFadeMaterialProperty(i,o,n)}},s.entities.add(e)},Ho.prototype.AddCircleScanPostStage=function(e,t,i,o,r){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);function l(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime()}a.CircleScanMaterialProperty||(Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"CircleScan"},l.prototype.getValue=function(e,t){return(t=a.defined(t)?t:{}).color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMaterialProperty=l,a.Material.CircleScanType="CircleScan",a.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=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},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.CircleScanMultiMaterialProperty=l,a.Material.CircleScanMultiType="CircleScanMulti",a.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 }",a.Material._materialCache.addMaterial(a.Material.CircleScanMultiType,{fabric:{type:a.Material.CircleScanMultiType,uniforms:{color:new a.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:a.Material.CircleScanMultiSource},translucent:function(e){return!0}}));e={name:"CircleScanMulti",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMultiMaterialProperty(i,o)}};return n.entities.add(e)},Ho.prototype.AddRadarScanPostStage=function(e,t,i,o,r){var n=this._viewer,a=this._cesium,s=this._core.defaultValue(this._position.height,0);function l(e,t){this._definitionChanged=new a.Event,this._color=void 0,this._angle=60,this.range=360,this._colorSubscription=void 0,this.color=e,this.duration=t,this.isReturn=!1,this.isGradient=!0,this._time=(new Date).getTime()}a.RadarScanMaterialProperty||(Object.defineProperties(l.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a.createPropertyDescriptor("color")}),l.prototype.getType=function(e){return"RadarScan"},l.prototype.getValue=function(e,t){return(t=a.defined(t)?t:{}).color=a.Property.getValueOrClonedDefault(this._color,e,a.Color.WHITE,t.color),t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t._angle=this._angle,t.range=this.range,t.gradient=this.isGradient,this.isReturn?(void 0===this.old&&(this.old=t.time),.5this._angle&&(t._angle=this._angle),t.angle1=t.angle2-t._angle,t.angle1<0&&(t._angle=t.angle2,t.angle1=0)):(t.angle1=this.range*t.time,t._angle=t.angle1,t._angle>this._angle&&(t._angle=this._angle),t.angle2=t.angle1+t._angle,t.angle2>this.range&&(t.angle2=this.range)):(t.range=this.range-this._angle,t.angle1=t.range*(t.inverse?1-t.time:t.time),t.angle2=t.angle1+this._angle)):(t.inverse=!1,t.angle1=this.range*t.time,t.angle2=t.angle1+this._angle,t.angle2>this.range&&(t.angle2=t.angle2-this.range)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.Property.equals(this._color,e._color)},a.RadarScanMaterialProperty=l,a.Material.RadarScanType="RadarScan",a.Material.RadarScanSource="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 }\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 if(gradient){\n f = (nowAngle - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else if(nowAngle < range && nowAngle > angle1 && angle2 < _angle){\n if(gradient){\n f = (nowAngle - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < _angle){\n if(gradient){\n f = (nowAngle + range - angle1) / _angle;\n material.alpha = f;\n if(inverse){\n material.alpha = 1.0 - material.alpha;\n }\n }else{\n material.alpha = 1.0;\n }\n }else{\n material.alpha = 0.0;\n discard;\n }\n return material;\n }",a.Material._materialCache.addMaterial(a.Material.RadarScanType,{fabric:{type:a.Material.RadarScanType,uniforms:{color:new a.Color(1,0,0,1),time:0,angle2:0,angle1:0,_angle:60,range:360,inverse:!1,gradient:!0},source:a.Material.RadarScanSource},translucent:function(e){return!0}}));e={name:"RadarScan",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.RadarScanMaterialProperty(i,o)}};return n.entities.add(e)},Ho.prototype.setRadius=function(e){this.item&&(this.item.ellipse.semiMinorAxis=parseFloat(e),this.item.ellipse.semiMajorAxis=parseFloat(e))},Ho.prototype.setTime=function(e){this.item&&(this.item.ellipse.material.duration=parseFloat(e))},Ho.prototype.setRadarAngle=function(e){var t;this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(t=this.item.ellipse.material.range,this.item.ellipse.material._angle=t{this.end=void 0,D.scene.preRender.removeEventListener(this.onPreFrame,this);try{D.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)}},No.prototype.close=function(){D.scene.preRender.removeEventListener(this.onPreFrame,this);try{D.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch(e){}this._eventListener&&this._eventListener.destroy(),this._viewshedPrimitive&&(D.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null);var e,t=D.scene,i={context:D.scene.context,lightCamera:t._sunCamera},i=(t.shadowMap.destroy(),t.shadowMap=new Cesium.ShadowMap(i),t.shadowMap);this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default&&(e=this._currentObject.viewshedObjOptions.color.default,i._color=new Cesium.Cartesian3(e.r,e.g,e.b)),i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,D.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),D.scene.globe.show=!0,t.skyAtmosphere.show=!0,D.scene.shadowMap=this._normalShadowMap,this._startPositionCartesian=null,this.resetAllVariables(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)},No.prototype.setVisibility=function(e){this._viewshedPrimitive.show=e,D.shadowMap.enabled=e},No.prototype.reset=function(){var e,t=D.scene,i={context:D.scene.context,lightCamera:t._sunCamera},i=(t.shadowMap.destroy(),t.shadowMap=new Cesium.ShadowMap(i),t.shadowMap);this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default&&(e=this._currentObject.viewshedObjOptions.color.default,i._color=new Cesium.Cartesian3(e.r,e.g,e.b)),i.enabled=!0,i.debugShow=!1,i.guid=void 0,i.show=!0,i.maximumDistance=1e4,i.debugCreateRenderStates(),i.dirty=!0,D.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),D.scene.globe.show=!0,t.skyAtmosphere.show=!0,D.scene.shadowMap=this._normalShadowMap},No.prototype.addViewshed=function(e={}){this._viewshedPrimitive&&this.close();var t=new Cesium.HeadingPitchRange(e.heading,e.pitch,.01),i=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);this._currentRadius=e.distance||1e3,this._isSpherical=e.isSpherical,this._currentObject=this.CreateViewshed(i,this._currentRadius,t,e),this._isSpherical?this.createViewshedSpherePrimitive(i):this.createViewshedCameraPrimitive(i,this._currentObject.viewshedMap._lightCamera)},No.prototype.CreateViewshed=function(e,t,i,o){var r=D.scene,n=new Cesium.Camera(r),a=D.scene.context,a=(n.frustum.fov=53*Math.PI/180,n.frustum.aspectRatio=1,n.frustum.near=1,n.frustum.far=t,n.lookAt(e,i),{context:a,lightCamera:n,cascadesEnabled:!1,isPointLight:this._isSpherical,pointLightRadius:t}),n=(r.shadowMap=new Cesium.ShadowMap(a),r.shadowMap),a=(o.color&&(n._viewshed_Back=new Cesium.Cartesian3(o.color.Back.r,o.color.Back.g,o.color.Back.b),n._viewshed_Fore=new Cesium.Cartesian3(o.color.Fore.r,o.color.Fore.g,o.color.Fore.b)),n.enabled=!0,n.debugShow=!1,n.guid=Cesium.createGuid(),n.show=!0,n.maximumDistance=1e4,n._pointLightRadius=t,n.debugCreateRenderStates(),n._distance=t,n.dirty=!0,D.scene.globe.shadows=Cesium.ShadowMode.fromCastReceive(!0,!0),D.scene.globe.show=!0,r.skyAtmosphere.show=!0,{});return a.position=e,a.distance=t,a.direction=i,a.viewshedObjOptions=o,a.guid=this._cesium.createGuid(),a.viewshedObjOptions.originalDirection=i,a.type="viewshed",a.viewshedMap=n,a},No.prototype.resetAllVariables=function(){this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._setNewPosition=!1,this._currentObject=void 0,this._viewshedMap=void 0,this._canEnlarge=!1,this._zAxisNewPosition=void 0,this._viewshedDirection=null},No.prototype.setViewshedPosition=function(e){var i,t,o;this._setNewPosition||(this._canEnlarge&&null!=this._viewshedPrimitive?(this._canEnlarge=!1,this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),null!=this._viewshedMap&&null!=this._viewshedPrimitive&&(t=this._viewshedPrimitive._camera,this._currentObject.viewshedObjOptions.initialHeading=t.heading,this._currentObject.viewshedObjOptions.initialPitch=t.pitch,this._currentObject.viewshedObjOptions.initialRoll=t.roll,this._currentObject.viewshedObjOptions.altitudeMethod=Cesium.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2),o={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:t.frustum.fov,vFOV:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},t=this.CreateViewshed(t.position,Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new Cesium.HeadingPitchRange(t.heading,t.pitch,.01),o),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),-1!=t&&(this.resetAllVariables(),this._currentObject=t,o=D.scene.primitives._primitives,$.grep(o,function(e){return!0===e.isViewshed}),i=[],o.forEach(function(e,t){e.isViewshed&&i.push(t)}),1{var e,i,o,r,n,a,t=u._getPosition.getMousePosition(t);if(t){if(0===h.length){if(s.height){let e=u._core.toDegrees(t);e.height+=s.height,h.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height))}else h.push(t);h.push(t)}else u.drawHandler.destroy(),u.drawHandler=void 0,u.tooltip.show(!1),setTimeout(function(){F.states=0},100),u._core.mouse(u._viewer.container,0,"0"),l&&"function"==typeof l&&l(u.item,h);u.item||(u.viewConeCamera=new Cesium.Camera(c.scene),t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1],h[0],new Cesium.Cartesian3),new Cesium.Cartesian3),u.viewConeCamera.position=h[0],u.viewConeCamera.direction=t,u.viewConeCamera.frustum.fov=Cesium.Math.toRadians(s.fov),u.viewConeCamera.frustum.near=s.near,u.viewConeCamera.frustum.far=1,n=new Cesium.Cartesian3,a=new Cesium.Matrix3,e=new Cesium.Quaternion,i=u.viewConeCamera.positionWC,o=u.viewConeCamera.upWC,r=u.viewConeCamera.rightWC,r=Cesium.Cartesian3.negate(r,n),n=a,Cesium.Matrix3.setColumn(n,0,r,n),Cesium.Matrix3.setColumn(n,1,o,n),Cesium.Matrix3.setColumn(n,2,t,n),a=Cesium.Quaternion.fromRotationMatrix(n,e),s.fill&&(u._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:i,orientation:a,frustum:u.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(s.fillColor))},id:s.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),u._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:i,orientation:a,frustum:u.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(s.outlineColor))},id:s.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),u.item=new Cesium.PrimitiveCollection,u._viewer.scene.primitives.add(u.item),u._outlinePrimitive&&u.item.add(u._outlinePrimitive),u._planesPrimitive&&u.item.add(u._planesPrimitive))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0{this.ShadowPostProcess=new Ko(this._viewer,{cameraPosition:t[0],position:t[1],far:Cesium.Cartesian3.distance(t[0],t[1]),showFarScale:6,viewshed:{visible:i.visible,unvisible:i.unvisible},...i}),o.destroy(),o=null}),this},qo.prototype.addViewshed=function(e={}){return e.alpha=this._core.defaultValue(e.alpha,.5),e.horizonAngle=this._core.defaultValue(e.horizonAngle,60),e.verticalAngle=this._core.defaultValue(e.verticalAngle,60),this.ShadowPostProcess=new Ko(this._viewer,{showFarScale:6,viewshed:{visible:e.visible,unvisible:e.unvisible},...e}),this},qo.prototype.updateViewshed=function(e){this.ShadowPostProcess.updatePost(e)},qo.prototype.destroy=function(){this.ShadowPostProcess&&this.ShadowPostProcess.destroy(),this.ShadowPostProcess=null},qo.prototype.changeHorizonAngle=function(e){this.ShadowPostProcess&&this.ShadowPostProcess.changeHorizonAngle(e)},qo.prototype.changeVerticalAngle=function(e){this.ShadowPostProcess&&this.ShadowPostProcess.changeVerticalAngle(e)},Xo.prototype.createSkylineAnalysis=function(e={}){this.clear();let t;t="string"==typeof e?{color:e,scale:2}:{color:e.color||"#ff0000",scale:e.scale||2};e=Cesium.Color.fromCssColorString(t.color);let i=Viewer.scene.postProcessStages;var o=Cesium.createGuid(),o=new Cesium.PostProcessStage({name:"czm_edge_detection_"+o,fragmentShader:"uniform sampler2D depthTexture;\n uniform float length;\n uniform vec4 color;\n varying vec2 v_textureCoordinates;\n void main(void)\n {\n float directions[3];\n directions[0] = -1.0;\n directions[1] = 0.0;\n directions[2] = 1.0;\n float scalars[3];\n scalars[0] = 3.0;\n scalars[1] = 10.0;\n scalars[2] = 3.0;\n float padx = czm_pixelRatio / czm_viewport.z;\n float pady = czm_pixelRatio / czm_viewport.w;\n float horizEdge = 0.0;\n float vertEdge = 0.0;\n for (int i = 0; i < 3; ++i)\n {\n float dir = directions[i];\n float scale = scalars[i];\n horizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\n horizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\n vertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\n vertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n }\n float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\n gl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n }\n ",uniforms:{length:.25,color:Cesium.Color.clone(Cesium.Color.BLACK)}}),r=new Cesium.PostProcessStage({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;varying vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){gl_FragColor = color;}else{gl_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),n=new Cesium.PostProcessStage({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;varying vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture2D(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);vec4 color = texture2D(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0&&silhouetteColor.a>0.0){gl_FragColor = vec4(1.0,0.0,0.0,1.0);}else{gl_FragColor = vec4(0.0,0.0,0.0,1.0);;}}",uniforms:{redTexture:r.name,silhouetteTexture:o.name,length:.25}}),e=new Cesium.PostProcessStage({name:"czm_skylinebold",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform float scale;uniform vec4 skylineColor;varying vec2 v_textureCoordinates;void main(void){float padx = czm_pixelRatio / czm_viewport.z;float pady = czm_pixelRatio / czm_viewport.w;vec4 color = texture2D(colorTexture, v_textureCoordinates);gl_FragColor = color;float scaleB = 3.0;int search = 0;for(float i=0.0;i<10.0;i++){for(float j=0.0;j<10.0;j++){vec2 redCoordi = v_textureCoordinates + vec2(i*padx,j*pady);vec4 redcolor=texture2D(redTexture, redCoordi);if(redcolor.r == 1.0){gl_FragColor = skylineColor;search = 1;break;}if(j>=scale)break;}if(i>=scale||search>0)break;}}",uniforms:{redTexture:n.name,skylineColor:e,scale:t.scale}});this.postProccessStage=new Cesium.PostProcessStageComposite({name:"czm_skyline",stages:[o,r,n,e],inputPreviousStageTexture:!1,uniforms:o.uniforms}),i.add(this.postProccessStage)},Xo.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage)};const $o=` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1) const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1) const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; // tidy overflow return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } // NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } // NOTE: https://twitter.com/gonnavis/status/1377183786949959682 float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } `,er="uniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nuniform float czm_selectedIdTextureWidth; \nbool czm_selected(vec4 id) \n{ \n bool selected = false;\n for (int i = 0; i < 1024000; i++) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n if(float(i)>czm_selectedIdTextureWidth)break;\n } \n return false; \n} \n\n";function tr(e){const{defaultValue:r,BoundingRectangle:i,Pass:V,Sampler:n,DrawCommand:G,Color:h,ShaderSource:y,defined:v,ClearCommand:t,RenderState:m,Texture:d,PixelDatatype:a,PixelFormat:s,Framebuffer:k}=Cesium;this._selectedIdTexture=null;let{name:N,vertexShader:w,fragmentShader:b,uniforms:p,renderStateProcess:g,beforeUpdate:f,renderType:_,textureScale:o,pixelFormat:j,pixelDatatype:z,sampler:U,viewportScale:l,shaderRedefine:T,overrideViewport:u}=e,E="renderPass_"+N.replace(/[\.\\\/\-]/g,"_"),S=`czm_non_${E}_main`,P=`czm_${E}_main`,C="_cache_"+E,x=E+"Command",D=null,c=null,I=null,A=null,L,M=new t({color:h.TRANSPARENT,depth:1}),R=new i,O=this;if(u&&i.clone(u,R),T=T||"add",_=_||"all",(o=o||1)<0||80.0000001; if(!isSelected){ isSelected= czm_selected(${o}); } return isSelected; } `,er+` varying float me_isSelected; bool czm_selected(){ return czm_selected(${o}); } `),d=!1,p=!1;if(/attribute\s?vec3\s?normal\s?;/.test(u)||/\n\s?vec3\s?normal\s?;/.test(u)?d=!0:/varying\s?vec3\s?v_normal\s?;/.test(u)&&(p=!0),b){var g=!1;for(_=0;_0.)gl_FragColor=vec4( vOutlineNormal ,gl_FragColor.a); } `,sampler:new r({minificationFilter:a.LINEAR,magnificationFilter:n.LINEAR}),renderType:"all"});var e=new i({name:t+"Mask",uniforms:{outlineWidth(){return s},devicePixelRatio:devicePixelRatio,thresholdAngle:function(){return l},useSingleColor:function(){return u},showOutlineOnly:function(){return c},visibleEdgeColor:function(){return h},hiddenEdgeColor:function(){return m},maskTexture(){return _.texture},maskDepthTexture(){return _.depthTexture}},fragmentShader:` uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform sampler2D depthTexture; uniform sampler2D maskTexture; uniform sampler2D maskDepthTexture; uniform float thresholdAngle; uniform bool showOutlineOnly; uniform float outlineWidth; uniform float devicePixelRatio; uniform vec3 visibleEdgeColor; uniform vec3 hiddenEdgeColor; uniform bool useSingleColor; varying vec2 v_textureCoordinates; float lengthSq(vec3 v){ return v.x * v.x + v.y * v.y + v.z * v.z; } float normal_angleTo(vec3 a,vec3 b){ float denominator = sqrt( lengthSq(a) * lengthSq(b) ); if ( denominator == 0. ) return czm_pi / 2.; float theta = dot(a, b ) / denominator; // clamp, to handle numerical problems return acos( clamp( theta, - 1., 1. ) ); } float compareNormal(vec4 n1,vec4 n2){ if( abs ( normal_angleTo( n1.xyz , n2.xyz ) ) < thresholdAngle ){ return 0.; }else{ return 1.; } } float compareDepth(const in vec2 uv){ float maskDepth = czm_readDepth( maskDepthTexture, uv); float nonDepth = czm_readDepth( depthTexture, uv); return maskDepth>nonDepth?1.:0.; } void main(){ vec2 vUv=v_textureCoordinates; // vec4 color = texture2D( colorTexture, vUv); vec4 maskColor = texture2D( maskTexture, vUv); if( maskColor.a < 0.0001){ // gl_FragColor =color; discard; return; } vec2 invSize = outlineWidth / colorTextureDimensions; vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize); vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy); vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy); vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw); vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw); float d; if(showOutlineOnly){ float diff1 = (c1.a - c2.a)*0.5; float diff2 = (c3.a - c4.a)*0.5; d = length( vec2(diff1, diff2) ); } else{ float diff1 = compareNormal(c1,c2)*0.5; float diff2 = compareNormal(c3,c4)*0.5; d = length( vec2(diff1, diff2) ); } if(useSingleColor==false){ float dp1 = compareDepth( vUv + uvOffset.xy); float dp2 = compareDepth( vUv - uvOffset.xy); float dp3 = compareDepth( vUv + uvOffset.yw); float dp4 = compareDepth( vUv - uvOffset.yw); float a1 = min(dp1, dp2); float a2 = min(dp3, dp4); float visibilityFactor = min(a1, a2); vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor; // gl_FragColor =color+ vec4( edgeColor , 1. ) * vec4(d); gl_FragColor = vec4( edgeColor , 1. ) * vec4(d); //gl_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); }else{ // gl_FragColor =color+ vec4( visibleEdgeColor , 1. ) * vec4(d); gl_FragColor = vec4( visibleEdgeColor , 1. ) * vec4(d); //gl_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); } } `}),C=(_.stage=e,this.createBlurStage(t+"Blur1",4,1,.75)),y=this.createBlurStage(t+"Blur2",4,4,.5),y=new o({name:t+"BlurComposite",stages:[e,C,y],inputPreviousStageTexture:!0}),e=new i({name:t+"Additive",uniforms:{showGlow:function(){return d},edgeGlow:function(){return p},edgeStrength:function(){return g},edgeOnly(){return f},maskTexture(){return _.texture},lineTexture:e.name,edgeTexture1:C.name,edgeTexture2:y.name},fragmentShader:` uniform sampler2D colorTexture; uniform sampler2D edgeTexture1; uniform sampler2D edgeTexture2; uniform sampler2D lineTexture; uniform sampler2D maskTexture; uniform bool showGlow; uniform float edgeGlow; uniform bool edgeOnly; uniform float edgeStrength; varying vec2 v_textureCoordinates; void main(){ vec2 vUv =v_textureCoordinates; vec4 edgeColor=texture2D( lineTexture, vUv); vec4 color=texture2D( colorTexture, vUv); float opacity=1.; if(edgeOnly){ vec4 maskColor=texture2D( maskTexture, vUv); opacity=1.-maskColor.a; gl_FragColor = maskColor; return; } if(showGlow){ float visFactor= 1.;//czm_selected()?1.:0.; vec4 edgeValue1 = texture2D(edgeTexture1, vUv); vec4 edgeValue2 = texture2D(edgeTexture2, vUv); vec4 glowColor = edgeValue1 + edgeValue2 * edgeGlow; gl_FragColor = opacity * color + edgeColor + edgeStrength * (1. - edgeColor.r) * glowColor; } else{ gl_FragColor = opacity * color + edgeColor; } } `});const v=new o({name:t+"Composite",stages:[y,e],inputPreviousStageTexture:!1});function w(e){Object.defineProperties(e,{showGlow:{get(){return d},set(e){d=e}},edgeGlow:{get(){return p},set(e){p=e}},edgeStrength:{get(){return g},set(e){g=e}},thresholdAngle:{get(){return l},set(e){l=e}},showOutlineOnly:{get(){return c},set(e){c=e}},edgeOnly:{get(){return f},set(e){f=e}},useSingleColor:{get(){return u},set(e){u=e}},outlineWidth:{get(){return s},set(e){s=e}},visibleEdgeColor:{get(){return h},set(e){h=e}},hiddenEdgeColor:{get(){return m},set(e){m=e}}})}return w(v),v._uniforms=v._uniforms||{},w(v._uniforms),v.selected=[1],v.enabled=!0,this._viewer.postProcessStages.add(v),this.postProccessStage=v,this},ir.prototype.createBlurStage=function(e,t,i,o){const{Cartesian2:r,PostProcessStage:n,PostProcessStageComposite:a,PostProcessStageSampleMode:s}=Cesium;var l=new r(1,0),u=new r(0,1),t={defines:{MAX_RADIUS:t},fragmentShader:"\n varying vec2 v_textureCoordinates;\n uniform sampler2D colorTexture;\n uniform vec2 colorTextureDimensions;\n uniform vec2 direction;\n uniform float kernelRadius;\n \n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() { vec2 vUv=v_textureCoordinates;\n vec2 invSize = 1.0 / colorTextureDimensions; float weightSum = gaussianPdf(0.0, kernelRadius); vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS); vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec4 sample1 = texture2D( colorTexture, vUv + uvOffset); vec4 sample2 = texture2D( colorTexture, vUv - uvOffset); diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } gl_FragColor = diffuseSum/weightSum; }"},l=(this.parseDefines(t),new n({name:e+"_x_direction",fragmentShader:t.fragmentShader,textureScale:o,forcePowerOfTwo:!0,uniforms:{kernelRadius:i,direction:l},sampleMode:s.LINEAR})),t=new n({name:e+"_y_direction",fragmentShader:t.fragmentShader,textureScale:o,forcePowerOfTwo:!0,uniforms:{kernelRadius:i,direction:u},sampleMode:s.LINEAR});return new a({name:e,stages:[l,t],inputPreviousStageTexture:!0})},ir.prototype.parseDefines=function(e){let t=[];for(const o in e.defines){var i;e.defines.hasOwnProperty(o)&&(i=e.defines[o],t.push("#define "+o+" "+i))}return t=t.join("\n")+"\n",e.fragmentShader&&(e.fragmentShader=t+e.fragmentShader),e.vertexShader&&(e.vertexShader=t+e.vertexShader),e},ir.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage),this.postProccessStage=void 0},or.prototype.draw=function(e=100,i={},o){if(!this.FlattenIsDraw){if(this.deepth=e||this.deepth,this.showWall=this._core.defaultValue(i.showWall,!0),this.showBottom=this._core.defaultValue(i.showBottom,!0),i.positions)return this.create(i.positions),"function"==typeof o&&o(),this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.FlattenIsDraw=!0;var r,n,a=this._viewer,s=this._cesium,l=(this.clear(),[]),u=[],c=0,h=(this.drawHandler=new s.ScreenSpaceEventHandler(a.scene.canvas),this.tooltip);let t;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(e=>{n=this._getPosition.getMousePosition(e.position);e=this._core.toDegrees(n);l.push(n),u.push(e.lon,e.lat,e.height),0===c?(l.push(n),u.push(e.lon,e.lat,e.height),t=a.entities.add({name:"临时线",polyline:{positions:new s.CallbackProperty(()=>l,!1),clampToGround:!0,material:new s.ColorMaterialProperty(s.Color.YELLOW.withAlpha(.3)),width:3}})):1===c&&(t&&a.entities.remove(t),r=a.entities.add({name:null,polygon:{hierarchy:new s.CallbackProperty(function(){return new s.PolygonHierarchy(s.Cartesian3.fromDegreesArrayHeights(u))},!1),material:s.Color.YELLOW.withAlpha(.3)}})),c++},s.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===c?h.showAt(e.endPosition,"左键点击开始绘制点"):(1===c?h.showAt(e.endPosition,"点击添加第二个点"):h.showAt(e.endPosition,"右键结束绘制"),n=this._getPosition.getMousePosition(e.endPosition),e=this._core.toDegrees(n),u.splice(u.length-3,3),l.splice(l.length-1,1),l.push(n),u.push(e.lon,e.lat,e.height))},s.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),s.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{h.show(!1),this._core.mouse(this._viewer.container,0),this.drawHandler.destroy(),this.drawHandler=null,t&&a.entities.remove(t),r&&a.entities.remove(r),this.FlattenIsDraw=!1,this.end=void 0,"cancel"===e||l.length<3||(c<2?c=0:(c=0,this.create(u),"function"==typeof o&&o(u)))},this}},or.prototype.create=function(t){let i=Cesium.Cartesian3.fromDegreesArrayHeights(t);if(this.boundingSphere=Cesium.BoundingSphere.fromPoints(i),i.push(i[0]),this.showWall||this.showBottom){this.originHeight=1e5;for(let e=2;et[e]&&(this.originHeight=t[e]);var e,o,r;if(this.showBottom&&(e=this._viewer.entities.add({name:"地形开挖底面",polygon:{hierarchy:new Cesium.PolygonHierarchy(i),material:new Cesium.ImageMaterialProperty({image:this._core.defaultValue(this.bottomImg),repeat:new Cesium.Cartesian2(1,1)}),height:this.originHeight-this.deepth}}),this.FlattenPolygon.push(e)),this.showWall)for(let e=0;e{if(e){for(r=e,c=0;c{let t=e.wall.minimumHeights.getValue();(t=Array(t.length)).fill(this.originHeight-i),e.wall.minimumHeights.setValue(t)})},or.prototype.setVisibility=function(t){var i=this._viewer;if(this.wallArr.forEach(e=>{e.show=t}),i.scene.globe.multiClippingPlanes&&this.clippingPlane){let e=i.scene.globe.multiClippingPlanes;t&&!e.contains(this.clippingPlane)?e.add(this.clippingPlane):!t&&e.contains(this.clippingPlane)&&e.remove(this.clippingPlane,!1)}this.FlattenPolygon.forEach(e=>{e.show=t})},or.prototype.deleteObject=or.prototype.clear=function(){var t=this._viewer;this.wallArr.forEach(e=>{t.entities.remove(e)}),this.wallArr=[],t.scene.globe.multiClippingPlanes&&this.clippingPlane&&(t.scene.globe.multiClippingPlanes.remove(this.clippingPlane),this.clippingPlane=void 0),this.FlattenPolygon.forEach(e=>{t.entities.remove(e)}),this.FlattenPolygon=[],this.FlattenIsDraw=!1},rr.prototype.createAnalysis=function(){return this.shadows=!0,this.currentSpeed=1,this.currentPlayMode="1",this.Forword(),this},rr.prototype.setCurrentTime=function(e){e=new Date(e),e=this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=e.clone()},rr.prototype.getCurrentTime=function(e){this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),clearInterval(this.timer),timer=null,timer=setInterval(function(){this.currentTime=function(e,t){var i=(e=e.replace(/January|Jan/,"01").replace(/February|Feb/,"02").replace(/March|Mar/,"03").replace(/April|Apr/,"04").replace(/May/,"05").replace(/June|Jun/,"06").replace(/July|Jul/,"07").replace(/August|Aug/,"08").replace(/September|Sept/,"09").replace(/October|Oct/,"10").replace(/November|Nov/,"11").replace(/December|Dec/,"12")).split(" ");e=i[2]+"-"+i[0]+"-"+i[1];t=t.split(" ")[0];i=new Date(Date.parse(e+" "+t));return i=i.getTime()/1e3+28800,new Date(1e3*parseInt(i)).toLocaleString("chinese",{hour12:!1}).replace(/年|月|\//g,"-").replace(/日/g," ")}(this._viewer.animation.viewModel.dateLabel,this._viewer.animation.viewModel.timeLabel),e&&"function"==typeof e&&e(this.currentTime)},1e3)},rr.prototype.SpeedIncress=function(e){this._viewer.animation.viewModel.faster(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},rr.prototype.SpeedDecress=function(e){this._viewer.animation.viewModel.slower(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),e&&"function"==typeof e&&e(this.currentSpeed)},rr.prototype.Forword=function(e){this._viewer.animation.viewModel.playForwardViewModel.command(),this.currentPlayMode="1","-"==this.currentSpeed[0]&&(this.currentSpeed=this.currentSpeed.slice(1)),e&&"function"==typeof e&&e(this.currentSpeed)},rr.prototype.Bacword=function(e){this._viewer.animation.viewModel.playReverseViewModel.command(),this.currentPlayMode="2","-"!==this.currentSpeed[0]&&(this.currentSpeed="-"+this.currentSpeed),e&&"function"==typeof e&&e(this.currentSpeed)},rr.prototype.Pause=function(){this._viewer.animation.viewModel.pauseViewModel.command()},Object.defineProperties(rr.prototype,{shadows:{get:function(){return this._viewer.shadows},set:function(e){this._viewer.shadows=e}},currentSpeed:{get:function(){return $(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html()},set:function(e){e=e.toString().replace("x",""),this._viewer.clock.multiplier=parseFloat(e)}}}),nr.prototype.createScreenshot=function(e="png"){var t=this._viewer.scene.canvas.toDataURL("image/"+e),i=document.createElement("a");i.download="截图."+e,i.href=t,i.click()},nr.prototype.createScreenshotCompared=function(e,t){var i=this._viewer.scene.canvas,o=i.toDataURL("image/png");(t||layuiLayer).open({title:e||"截图对比",type:1,skin:"other-class",shade:0,shadeClose:!0,resize:!1,moveOut:!0,area:[.7*i.width+"px",.7*i.height+42+"px"],content:''})},ar.prototype.setPointFly=function(i={}){let t=this._core.CreateTooltip(),o=this._viewer,r=this,n=!1,a,s;i.pitch&&(i.pitch=Cesium.Math.toRadians(i.pitch));let l,u;var e=i.limitTime?i.limitAngel:360;let c=i.time||30,h=(e||360)/c,m=function(){var e=Cesium.JulianDate.secondsDifference(o.clock.currentTime,o.clock.startTime);i.limitTime&&e>c?r.end&&r.end():(e=Cesium.Math.toRadians(e*h)+l,o.scene.camera.setView({destination:u,orientation:{heading:e,pitch:r.pitch}}),o.scene.camera.moveBackward(r.distance),0<=Cesium.JulianDate.compare(o.clock.currentTime,o.clock.stopTime)&&o.clock.onTick.removeEventListener(m))},d=e=>{u=e,r.pitch=i.pitch||o.camera.pitch,r.distance=i.distance,r.distance||(r.distance=Cesium.Cartesian3.distance(o.camera.position,e)),l=o.camera.heading;let t=Cesium.JulianDate.fromDate(new Date);o.clock.startTime=t.clone(),o.clock.currentTime=t.clone(),o.clock.clockRange=Cesium.ClockRange.CLAMPED,o.clock.clockStep=Cesium.ClockStep.SYSTEM_CLOCK,o.clock.onTick.addEventListener(m),i.hideImage||(a=r._viewer.entities.add({id:r._core.getuid(),name:"定点",position:u,billboard:{horizontalOrigin:r._cesium.HorizontalOrigin.CENTER,verticalOrigin:r._cesium.VerticalOrigin.BOTTOM,scale:r._core.defaultValue(i.scale,1),image:r._core.defaultValue(i.image,window.SmartEarthRootUrl+I.mark),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))};return i.position?d(i.position):(this.drawHandler&&this.drawHandler.destroy(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),(s=new Cesium.ScreenSpaceEventHandler(o.scene.canvas)).setInputAction(function(e){n?r.end&&r.end():(t.showAt(e.position,"点击结束绕飞"),n=!0,e=r._getPosition.getMouseDegrees(e),e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),d(e))},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){n||t.showAt(e.endPosition,"点击选择定位点"),n&&t.showAt(e.endPosition,"点击结束绕飞")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(e){r.distance-=e*r.distance/2e3,r.distance<1&&(r.distance=1)},Cesium.ScreenSpaceEventType.WHEEL),this.drawHandler=s),this.end=e=>{this.end=void 0,t.show(!1),s&&s.destroy(),a&&r._viewer.entities.remove(a),a=void 0,r._core.mouse(r._viewer.container,0),o.clock.onTick.removeEventListener(m),i.end&&i.end()},this},sr.prototype.PointSunshineAnalysis=function(e,t){if(this._viewer.entities.remove(this._viewer.entities.getById("1")),this._viewer.entities.remove(this._viewer.entities.getById("point")),null==e)throw"无效参数";if("Cartesian3"!=e.constructor.name)throw"传入参数必须是三维坐标";this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);var i=this._viewer.scene.context.uniformState.sunPositionWC,i=new Cesium.Cartesian3(i.x-e.x,i.y-e.y,i.z-e.z),o=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z),i=new Cesium.Cartesian3(i.x/o,i.y/o,i.z/o),o=new Cesium.Cartesian3(e.x+200*i.x,e.y+200*i.y,e.z+200*i.z);this.pickFromRay(e,o,t)},sr.prototype.sunshineAnalysisPoint=function(t,i){t=t||{},this.sunshineOption=t;var o=this,r=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas),F.states=1,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(function(e){var e=o._getPosition.getMousePosition(e);o.PointSunshineAnalysis(e),e&&(e=r.entities.add({id:o._core.getuid(),name:"Point",position:e,point:{pixelSize:16,color:o._cesium.Color.BLUE,outlineWidth:o._core.defaultValue(t.outlineWidth,2),outlineColor:o._cesium.Color.WHITE.withAlpha(.6),heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new o._cesium.DistanceDisplayCondition(0,1e8)}}),o.drawHandler.destroy(),o.drawHandler=void 0,o.tooltip.show(!1),setTimeout(function(){F.states=0},100),o._core.mouse(o._viewer.container,0,"0"),i&&"function"==typeof i&&i(e))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){o.tooltip.showAt(e.endPosition,"点击绘制点")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},sr.prototype.sunshineAnalysisPolygon=function(i,t){i=i||{},this.sunshineOption=i;var o,r,n=this,a=this._viewer,s=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.loading||this.addLoading(),this.remove(),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(a.scene.canvas),F.states=1,[]);return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(function(e){var t,e=n._getPosition.getMousePosition(e);e&&(s.length||(t=Cesium.Cartographic.fromCartesian(e),n.sunshineOption.defaultHeight=t.height,s.push(e)),s.push(e),2!==s.length||r||(r=a.entities.add({name:"临时线",polyline:{positions:new n._cesium.CallbackProperty(function(){return s},!1),clampToGround:!0,material:n._cesium.Color.LIME.withAlpha(.6),width:3}})),3!==s.length||o||(r&&a.entities.remove(r),i.clampToGround=n._core.defaultValue(i.clampToGround,!0),o=a.entities.add({id:n._core.getuid(),name:"新建面",polygon:{hierarchy:new n._cesium.CallbackProperty(function(){return new n._cesium.PolygonHierarchy(s)},!1),material:new n._cesium.ImageMaterialProperty({image:null,repeat:new n._cesium.Cartesian2(1,1),color:n._cesium.Color.LIME.withAlpha(.6)}),perPositionHeight:!n._core.defaultValue(i.clampToGround,!1),heightReference:i.clampToGround?1:0,outline:n._core.defaultValue(i.outline,!1),outlineColor:n._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new n._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){0===s.length?n.tooltip.showAt(e.endPosition,"点击添加第一个点"):1===s.length?n.tooltip.showAt(e.endPosition,"点击添加第二个点"):(n.tooltip.showAt(e.endPosition,"点击添加点,右键结束绘制"),(e=n._getPosition.getMousePosition(e))&&(s.pop(),s.push(e)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(e){n.drawHandler.destroy(),n.drawHandler=void 0,n.tooltip.show(!1),n.end=void 0,setTimeout(function(){F.states=0},100),n._core.mouse(n._viewer.container,0,"0"),r&&a.entities.remove(r),o&&a.entities.remove(o),"cancel"===e||s.length<3||setTimeout(()=>{n.analysis(o,i.start||"2019-09-17 13:00",i.end||"2019-09-17 15:00",i.interval||60,t)},100)},this.drawHandler.setInputAction(function(e){n.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},sr.prototype.analysis=function(e,t,i,o,r){var n=new Date(t),a=new Date(i),s=0,l=this,t=this.sunshineOption.startHeight||this.sunshineOption.defaultHeight,u=l.getPoint(e,this.sunshineOption.spacing||10,t,t+l._core.defaultValue(this.sunshineOption.addHeight,30));this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);let c=this._viewer.clock.currentTime.clone();function h(){var t,e=n.getTime()+6e4*o*s,e=new Date(e);a{var e=l._viewer.scene.context.uniformState.sunPositionWC;t(e)},100))}1500<(a-n)/(6e4*o)*u.length?window.layuiLayer&&window.layuiLayer.msg("当前分析时间过长,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:e=>{layuiLayer.close(e),l.isLoading(!0),h()},btn2:()=>{r&&"function"==typeof r&&r(u)}}):(l.isLoading(!0),h())},sr.prototype.createPoint=function(e){this.ResultPoint=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);for(var t=0;t{var e=i._viewer.scene.pick(t.endPosition);e&&e.id&&e.id.isshowderData?i.tooltip.showAt(t.endPosition,e.id.data):i.tooltip.show(!1)},50)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},sr.prototype.getPoint=function(e,t,i,o){for(var r=[],n=e.polygon.hierarchy.getValue().positions,a=0;ao[h+1]?c:o[h+1],l=lo[h]?u:o[h];var i=this.GetPositionFromA_D(e.lat,e.lon,i,0),m=this.GetPositionFromA_D(e.lat,e.lon,t,90)[0]-e.lon,d=i[1]-e.lat;for(s.push({lon:e.lon,lat:e.lat}),(a={lon:e.lon,lat:e.lat}).lat+=d;a.lat<=c;a.lat+=d){for(r={lon:a.lon-m,lat:a.lat},n={lon:a.lon+m,lat:a.lat},this.IsInPolygon(a.lon,a.lat,o)&&s.push({lon:a.lon,lat:a.lat});r.lon>=l;r.lon-=m)this.IsInPolygon(r.lon,r.lat,o)&&s.push({lon:r.lon,lat:r.lat});for(;n.lon<=u;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},sr.prototype.GetPositionFromA_D=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=6356725+21412*(90-e)/90;return[180*(r/(o*Math.cos(e*Math.PI/180))+t*Math.PI/180)/Math.PI,180*(i/o+e*Math.PI/180)/Math.PI]},sr.prototype.IsInPolygon=function(e,t,i){var o,r,n,a,s=0;if(i.length<6)return!1;i.push(i[0],i[1]);for(var l=0;la.czheight&&(i=!0)}return i},sr.prototype.pickFromRay=function(e,t){t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),new Cesium.Cartesian3),e=new Cesium.Ray(e,t),t=this._viewer.scene.pickFromRay(e,[]);let i=!1;return i=t&&t.object?!0:i},sr.prototype.remove=function(){this.ResultPoint&&this._viewer.scene.primitives.remove(this.ResultPoint),this.ResultPoint=void 0,this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),this.showResultTooltip(!1)},sr.prototype.addLoading=function(){var e=document.createElement("div"),t=(e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;",document.createElement("img"));t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},sr.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},sr.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var lr,ur="void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)\n{\nif(u_snow){\nvec3 normalEC = fsInput.attributes.normalEC;\nvec3 normalMC = czm_inverseNormal * normalEC;\nvec3 color = material.diffuse;\nvec3 white = vec3(1.0,1.0,1.0);\nfloat m = dot(normalMC, u_snowDirection);\nm = pow(m,5.0);\nmaterial.diffuse = mix(color, white, clamp(m,0.0,1.0) * u_snowAlpha);\n}\nif(u_effects){\nfloat vtxf_a11 = fract(czm_frameNumber / 240.0) * 3.14159265 * 2.0;\nfloat vtxf_a12 = fsInput.attributes.positionMC.z / (u_effectsMaxHeight / 2.0) + sin(vtxf_a11) * 0.1;\nmaterial.diffuse *= vec3(vtxf_a12);\nfloat vtxf_a13 = fract(czm_frameNumber / 240.0);\nfloat vtxf_h = clamp(fsInput.attributes.positionMC.z / u_effectsMaxHeight, 0.0, 1.0);\nvtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\nfloat vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13));\nmaterial.diffuse.rgb += material.diffuse.rgb * (1.0 - vtxf_diff);\n}\n}\n",cr="void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\nif(u_flatten){\nvec3 positionMC = vsOutput.positionMC.xyz;\nvec4 northEast = czm_inverseModel * vec4(u_flattenNorthEast, 1.0);\nvec4 southWest = czm_inverseModel * vec4(u_flattenSouthWest, 1.0);\nif(positionMC.x>=southWest.x && positionMC.x<=northEast.x && positionMC.y>=southWest.y && positionMC.y<=northEast.y){\nvec2 st;\nst.x = (positionMC.x - southWest.x)/(northEast.x - southWest.x);\nst.y = (positionMC.y - southWest.y)/(northEast.y - southWest.y);\nvec4 rgba_depth = texture2D(u_flattenTexture, st.xy);\nif(rgba_depth.r > 0.0)\n{\nvsOutput.positionMC.z = u_flattenHeight;\n}\n}\n}\n}\n";function A(e){this._viewer=e,this._cesium=Cesium,this._core=new v,this._tree=F,this._color=new m(this._viewer,this._cesium),this._ModelEdit=new jt(this._viewer),this.modelEditData={lon:0,lat:0,height:0,scale:1,heading:0,pitch:0,roll:0,rotate:!1,rootTransform:void 0},this.flattenData=new Map}function hr(e){this._viewer=e,this.tiltModel={start:void 0,end:[]}}function L(e,t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this._viewer=e,this._cesium=t,this._core=new v(e),this._getPosition=new C(this._viewer,this._cesium),this._tree=F,this.modifyPoint=null,this._color=new m(this._viewer,this._cesium),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._position=void 0,this._points=[],this._listeners={},this._point=null}function M(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new v(e),this._getPosition=new C(this._viewer,this._cesium),this._tree=F,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a"}function mr(e,t,i,o){var r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))}function R(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new v(e),this._getPosition=new C(this._viewer,this._cesium),this._tree=F,this._points=[],this._polylines=[]}function dr(e){this._viewer=e,this._scene=e.scene,this._core=new v(e),this._tooltip=this._core.CreateTooltip(),this._getPosition=new C(this._viewer),this._drawColor={point:Cesium.Color.BLUE,polyline:Cesium.Color.YELLOW,polygon:Cesium.Color.YELLOW.withAlpha(.5)},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=window.SmartEarthRootUrl+I.loading}function pr(e){this._viewer=e,this._core=new v,this.measureData=new Map}function gr(e,t){var i=Math.PI/180,o=180/Math.PI,r=e.y*i,e=e.x*i,n=t.y*i,t=t.x*i,i=-Math.atan2(Math.sin(e-t)*Math.cos(n),Math.cos(r)*Math.sin(n)-Math.sin(r)*Math.cos(n)*Math.cos(e-t));return i<0&&(i+=2*Math.PI),i*=o}function fr(e,t,i){e=gr(t,e)-gr(t,i);return e<0&&(e+=360),e}function _r(e){if(!e||e.length<3)return 0;for(var t=Math.PI/180,i=0,o=0;ol.Level&&!l.show?l.show=!0:u.Level{o._viewer.entities.remove(e)}),o.planeEntities=[]),t.direction||"z"),n=(o.planeEntities=[],this.targetY||(t.start?this.targetY=t.start:this.targetY=0),this.clippingPlanes||(this.clippingPlanes=new this._cesium.ClippingPlaneCollection({planes:[],edgeWidth:1}),this.item.clippingPlanes=this.clippingPlanes),this.clippingPlanes.removeAll(),"z"===e?this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,0,-1),0)):"x"===e?this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(-1,0,0),0)):"y"===e&&this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,-1,0),0)),this.boundingSphereCenter||this.getCenter(),this.item.boundingSphere),a=this.boundingSphereRadius;this._cesium.Matrix4.equals(this.item.root.transform,this._cesium.Matrix4.IDENTITY)||(e=this._cesium.Matrix4.getTranslation(this.item.root.transform,new Cesium.Cartesian3),e=this._cesium.Cartographic.fromCartesian(e),e=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).height-e.height,this.clippingPlanes.modelMatrix=this._cesium.Matrix4.fromTranslation(new this._cesium.Cartesian3(0,0,e)));for(var s=0;s{var t;Cesium.defined(i)?(t=e.startPosition.y-e.endPosition.y,this.targetY+=t*a*.001,u.showAt(e.endPosition,"移动鼠标平移裁切面")):u.showAt(e.endPosition,"长按左键上下拖动裁切面,右键取消")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.clippingHandler.setInputAction(e=>{Cesium.defined(i)&&(i.material=Cesium.Color.WHITE.withAlpha(.1),i.outlineColor=Cesium.Color.WHITE,i=void 0),r.scene.screenSpaceCameraController.enableInputs=!0},this._cesium.ScreenSpaceEventType.LEFT_UP),this.clippingHandler.setInputAction(e=>{o.endClipping(),t.end&&t.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.endClipping=()=>{o.clippingHandler.destroy(),u.show(!1),o.planeEntities&&o.planeEntities.forEach(e=>{o._viewer.entities.remove(e)}),o.planeEntities=[],o.item.enableModelExperimental=o.enableModelExperimental}},A.prototype.setFlatten=function(e,c={}){if(this.flatten=e,this.updateModelExperimental(),e){let t=c.positions||[];if(t[0]&&t[0].lon&&t[0].lat)for(let e=0;e{this.showFlattenById(i,e)},deleteObject:()=>{this.removeFlattenById(i)}}),o=Cesium.Rectangle.fromCartesianArray(t),this.flattenRectangle?this.flattenRectangle=Cesium.Rectangle.union(this.flattenRectangle,o):this.flattenRectangle=o),o=this.flattenRectangle;let r,n,a,s=o.east-o.west,l=o.north-o.south,e=document.createElement("canvas"),u=(e.width=1024,e.height=1024,e.getContext("2d"));u.fillStyle="#000",u.fillRect(0,0,1024,1024);for(var h of this.flattenData.values())if(h.show){let t=[];h.positions.forEach(e=>{r=Cesium.Cartographic.fromCartesian(e),n=(r.longitude-o.west)/s*1024,a=1024-(r.latitude-o.south)/l*1024,t.push([n,a])}),u.moveTo(t[0][0],t[0][1]);for(let e=0;e{var o=e.entities.values;let r=[];for(let i=0;i{this.getModelMinMaxTime(e),this.setModelStyle("start",e)});i=(o=new A(this._viewer)).create3DTilesets("重建模型",t,{},{groundCenter:this.endPosition},"0",!0,e=>{this.getModelMinMaxTime(e),this.setModelStyle("end",e)});this.tiltModel.end.push(i)}else{i=t.start;o=new A(this._viewer),i&&(this.tiltModel.start=o.create3DTilesets("拆迁模型",i.urls,{},{groundCenter:i.Center,heading:i.heading,pitch:i.pitch,roll:i.roll},"0",!0,e=>{this.getModelMinMaxTime(e),this.setModelStyle("start",e)}));let e=t.end;if(e){let t;e.forEach(e=>{o=new A(this._viewer),t=o.create3DTilesets("重建模型",e.urls,{id:e.id},{groundCenter:e.Center,heading:e.heading,pitch:e.pitch,roll:e.roll},"0",!0,e=>{this.getModelMinMaxTime(e),this.setModelStyle("end",e)}),this.tiltModel.end.push(t)})}}return this},hr.prototype.getModelMinMaxTime=function(e){var t=e.item.properties;e.startTime=t[this.attr[0]].minimum-1,e.endTime=t[this.attr[1]].maximum,e.allTime=e.endTime-e.startTime},hr.prototype.useColor=function(e=!1){this._useColor=e,this.currentProgress(this.progress)},hr.prototype.getCurrentProgressStyle=function(e){this.progress=e,"time"===this.palyType&&(e=parseInt(e*this.time+this.start),this.setTime(e))},hr.prototype.setModelProgressStyle=function(e,t){let i,o;i=.5 "+o,this.colors[0]],["${"+this.attr[1]+"} <= "+o,this.colors[2]],["true",this.colors[1]]]:[["${"+this.attr[1]+"} <= "+o,"rgba(255, 255, 255, 1)"],["true","rgba(255, 255, 255, 0)"]]):"end"===e?this._useColor?[["true",this.colors[0]]]:[["true","rgba(255, 255, 255, 0)"]]:(o=parseInt(2*this.progress*t.allTime+t.startTime),this._useColor?[["${"+this.attr[0]+"} > "+o,this.colors[0]],["${"+this.attr[1]+"} <= "+o,this.colors[3]],["true",this.colors[1]]]:[["${"+this.attr[1]+"} <= "+o,"rgba(255, 255, 255, 0)"],["true","rgba(255, 255, 255, 1)"]]),t.item.style=new Cesium.Cesium3DTileStyle({color:{conditions:i}})},hr.prototype.setTime=function(e){let t=[],i=[];i=this._useColor?(t=[["${"+this.attr[0]+"} > "+e,this.colors[0]],["${"+this.attr[1]+"} <= "+e,this.colors[3]],["true",this.colors[1]]],[["${"+this.attr[0]+"} > "+e,this.colors[0]],["${"+this.attr[1]+"} <= "+e,this.colors[2]],["true",this.colors[1]]]):(t=[["${"+this.attr[1]+"} <= "+e,"rgba(255, 255, 255, 0)"],["true","rgba(255, 255, 255, 1)"]],[["${"+this.attr[1]+"} <= "+e,"rgba(255, 255, 255, 1)"],["true","rgba(255, 255, 255, 0)"]]),this.startStyle=new Cesium.Cesium3DTileStyle({color:{conditions:t}}),this.endStyle=new Cesium.Cesium3DTileStyle({color:{conditions:i}})},hr.prototype.currentProgress=function(e){this.getCurrentProgressStyle(e),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(e=>{this.setModelStyle("end",e)})},hr.prototype.currentTime=function(e){this.setTime(e),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(e=>{this.setModelStyle("end",e)})},hr.prototype.setModelStyle=function(e,t){t&&("time"===this.palyType?t.item.style="start"===e?this.startStyle:this.endStyle:this.setModelProgressStyle(e,t))},hr.prototype.setVisibility=function(t){this.tiltModel.start&&this.tiltModel.start.setVisibility(t),this.tiltModel.end.forEach(e=>{e.setVisibility(t)})},hr.prototype.deleteObject=function(){this.tiltModel.start&&this.tiltModel.start.deleteObject(),this.tiltModel.end.forEach(e=>{e.deleteObject()})},Object.defineProperties(hr.prototype,{time:{get(){return this.end-this.start}}}),L.prototype.createPoint=function(e,t,i,o,r,n){var a={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,clampToGround:!0},o=(a=this._core.extend(a,o=o||{},!0),i&&(this._core.isHtmlColor(i)?i=this._color.colorFromHtmlColor(i):(1<(i=/^rgb/.test(i)?this._Color.rgbaStringToRgbaObj(i):i).r&&(i.r=i.r/255),1$/.test(m)?(a='http://www.w3.org/2000/svg" width="'+c+'" height="60">'+m+"",e=window.URL||window.webkitURL||window,t=document.createElement("img"),a=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),i=e.createObjectURL(a),t.crossOrigin="Anonymous",t.src=i,t.onload=function(){u.drawImage(t,0,0,t.width,t.height),e.revokeObjectURL(i)}):(u.fillStyle=p||"#fff",u.font=d+"px Calibri,sans-serif",m.length*d>c?(a=m.substring(0,Math.ceil(m.length/2)),o=m.substring(Math.floor(m.length/2),m.length),r=(s=(h-100-2*d)/2)+d,n=(c-a.length*d)/2,u.fillText(a,n,s),u.fillText(o,n,r)):(a=(h-100-d)/2,s=(c-m.length*d)/2,u.fillText(m,s,a))),g(l)},{id:n,name:"新建富文本点"+n,pId:r._core.isnull(e)?0:e,type:"Imagelabel",item:r});return r.setTreeobj(l),r._tree.insertGroupId(l,r._core.isnull(e)?0:e),this},L.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},i=this._core.extend(i,e,!0),e=(this._core.isnull(text)||(i.text=text),this._position=position,this.item=this._viewer.entities.add({name:name,position:this._cesium.Cartesian3.fromDegrees(position[0],position[1]),point:i}),{id:this.item.id,name:i.text,pId:this._core.isnull(t)?0:t,type:"Point",item:this});return this.setTreeobj(e),this._tree.insertGroupId(e,this._core.isnull(t)?0:t),this},L.prototype.createLocations=function(e,t,i){var o={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},t=(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:o}),{id:o.id,name:e,pId:this._core.isnull(i)?0:i,type:"Location",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},L.prototype.createLocation=function(t,e,i){var o={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},r={destination:e.position,orientation:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll}},n=(this._position=e,this._core.isnull(t)&&(t="新建兴趣点"),this._core.getuid()),a=(this.item=this._viewer.entities.add({name:t,position:e.position,point:o}),this.item.originalCameraLocation=r,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},L.prototype.createPointOptimization=function(e,t){var i=this,o=[],r=this._core.StyleContrastGeoJson(e,this._cesium);return this.handler.setInputAction(function(e){var t,e=i._viewer.scene.camera.getPickRay(e.position);(t=e?i._viewer.scene.globe.pick(e,i._viewer.scene):t)&&(e=i._cesium.Ellipsoid.WGS84.cartesianToCartographic(t),t=i._viewer.scene.globe.getHeight(e),i._point=i._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,t),r.position=new i._cesium.CallbackProperty(function(){return i._point},!1),i.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),(e=i._viewer.entities.add(r)).objId=i.objId,e.obj=i,o.push({point:e}),i.state=1,i.handler.destroy(),"function"==typeof method&&method(o),i.item=e)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),this},L.prototype.startModify=function(){var o,r="拖动修改位置";2!=this.state&&1!=this.state||(this._tree.starttemporaryItem(this._viewer),this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),(o=this).modifyHandler.setInputAction(function(e){e=o._viewer.scene.pick(e.position);o._cesium.defined(e)&&e.id&&o._cesium.defined(e)&&e.id&&e.id.objId&&e.id.objId==o.objId&&(o.modifyPoint=e.id,r="释放后完成修改",o.forbidDrawWorld(!0)),o.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i=o._viewer.scene.pick(e.endPosition);o._core.CreateTooltip(r,e.endPosition,!1),o.modifyPoint?o.modifyPoint&&((t=o.getCatesian3FromPX(e.endPosition,o._viewer,[o.modifyPoint]))&&(o._point=t,o.modifyPoint.position=t),o._core.CreateTooltip(r,e.endPosition,!0)):o._cesium.defined(i)&&i.id&&i.id.objId&&o._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){e=o.getCatesian3FromPX(e.position,o._viewer,[o.modifyPoint]);o.modifyPoint&&(e&&(o._point=e),o.modifyPoint.position=e,o.modifyPoint=null,o.forbidDrawWorld(!1),r="拖动修改位置")},this._cesium.ScreenSpaceEventType.LEFT_UP))},L.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(0{a.push(e.x,e.y)}),n=Cesium.Cartesian3.fromDegreesArray(a),i=this._core.defaultValue(e.alpha,.6),this.item=this._viewer.entities.add({id:e.id,name:r,polygon:{hierarchy:new Cesium.PolygonHierarchy(n),material:Cesium.Color.fromCssColorString(e.color||"#f00").withAlpha(i),heightReference:void 0!==e.height?0:1,height:e.height,perPositionHeight:!1,outline:!!e.outlineWidth,outlineWidth:e.outlineWidth,outlineColor:Cesium.Color.fromCssColorString(e.outlineColor||"#f00")}}),this.item.objectType="polygon");t={id:this.item.id,name:r||"新建面"+this._core.getuid(),pId:this._core.isnull(o)?0:o,type:"polygon",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},M.prototype.getstyles=function(){var e={};return e.show=!this.item.polygon.show||this.item.polygon.show._value,e.hierarchy=this.item.polygon.hierarchy?this.item.polygon.hierarchy.getValue().positions.toString():null,e.height=this.item.polygon.height?this.item.polygon.height._value:null,e.heightReference=this.item.polygon.heightReference?this.item.polygon.heightReference._value:null,e.extrudedHeight=this.item.polygon.extrudedHeight?this.item.polygon.extrudedHeight.getValue():null,e.extrudedHeightReference=this.item.polygon.extrudedHeightReference?this.item.polygon.extrudedHeightReference.toString():null,e.stRotation=this.item.polygon.stRotation?this.item.polygon.stRotation._value:null,e.granularity=this.item.polygon.granularity?this.item.polygon.granularity._value:null,e.fill=this.item.polygon.fill?this.item.polygon.fill._value:null,e.material={},e.material.color=this.item.polygon.material&&this.item.polygon.material.color&&this.item.polygon.material.color._value?"rgba"+this.item.polygon.material.color.toString():null,e.material.image=this.item.polygon.material&&this.item.polygon.material.image?this.item.polygon.material.image._value:null,e.material.repeat=this.item.polygon.material&&this.item.polygon.material.repeat&&this.item.polygon.material.repeat._value?this.item.polygon.material.repeat._value:null,e.outline=this.item.polygon.outline?this.item.polygon.outline._value:null,e.outlineWidth=this.item.polygon.outlineWidth?this.item.polygon.outlineWidth._value:null,e.outlineColor=this.item.polygon.outlineColor&&this.item.polygon.outlineColor._value?"rgba"+this.item.polygon.outlineColor.toString():null,e.perPositionHeight=this.item.polygon.perPositionHeight?this.item.polygon.perPositionHeight.toString():null,e.closeTop=this.item.polygon.closeTop?this.item.polygon.closeTop.toString():null,e.closeBottom=this.item.polygon.closeBottom?this.item.polygon.closeBottom.toString():null,e.arcType=this.item.polygon.arcType?this.item.polygon.arcType.toString():null,e.classificationType=this.item.polygon.classificationType?this.item.polygon.classificationType.toString():null,e.near=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.near:null,e.far=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.far:null,e},M.prototype.createCloudMap=function(e,t,i,o){var r=[],n=this,t=(r.push(t.minx,t.miny),r.push(t.maxx,t.miny),r.push(t.maxx,t.maxy),r.push(t.minx,t.maxy),this._cesium.Cartesian3.fromDegreesArray(r)),a=(o=this._core.defaultValue(o,1),0),s=0,r=(this.item=this._viewer.entities.add({name:e,polygon:{hierarchy:new this._cesium.PolygonHierarchy(t),material:new Cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return 30<(s+=o)&&(s=0,++a>i.length-1&&(a=0)),i[a]},!1),color:new this._cesium.CallbackProperty(function(){return n._cesium.Color.WHITE.withAlpha(s<15?.5+s/30:1.5-s/30)},!1),repeat:new n._cesium.Cartesian2(1,1)})}}),{id:this.item.id,name:e,pId:0,type:"polygon",item:this});return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},M.prototype.createSector=function(e,t,c,i,o){var r={fillColor:this._cesium.Color.YELLOW.withAlpha(.5),outlineColor:this._cesium.Color.YELLOW},o=2*Math.PI/360*o,n=Math.sin(o)*t,i=function(e,t,i){var o={a:6378137,b:6356752.3142,f:1/298.257223563};function r(e){return e*Math.PI/180}function n(e){return 180*e/Math.PI}var a=o.a,s=o.b,o=o.f,l=+e.lon,e=+e.lat,u=i,i=r(t),t=Math.sin(i),i=Math.cos(i),e=(1-o)*Math.tan(r(e)),c=1/Math.sqrt(1+e*e),h=e*c,m=Math.atan2(e,i),e=c*t,d=1-e*e,a=d*(a*a-s*s)/(s*s),p=1+a/16384*(4096+a*(a*(320-175*a)-768)),g=a/1024*(256+a*(a*(74-47*a)-128)),f=u/(s*p),_=2*Math.PI;for(;1e-12{l._tree.handler.destroy(),l._tree.handler=null,h.show(!1),l._core.mouse(l._viewer.container,0,"0"),this.end=void 0,"cancel"===e?l.item&&r.entities.remove(l.item):(l.item&&(l.item.polygon.hierarchy=new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(c))),"function"==typeof t&&t(l.item,{position:i,angle:n,distance:a}))},this._tree.handler.setInputAction(function(e){e=l._getPosition.getMouseDegrees(e);0===s?(i={lon:e.lon,lat:e.lat,height:e.height},s++):l.end&&l.end()},l._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){l.end&&l.end("cancel")},l._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){0===s?h.showAt(e.endPosition,"点击开始绘制"):(h.showAt(e.endPosition,"再次点击结束绘制,右键取消"),o=l._getPosition.getMouseDegrees(e),c=function(e,t){var i=[],t=function(e,t,i,o){var r=p(e),n=p(i),a=p(i)-p(e),s=p(o)-p(t);return a=(a=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(s/2),2))))*m,a=Math.round(1e4*a)/1e4,{angle:l._core.TwoPointAzimuth(t,e,o,i),distance:a}}(e.lat,e.lon,t.lat,t.lon);n=t.angle,a=t.distance,i.push(e.lon,e.lat);for(var o=n-30,r=null;o'),n=document.getElementById("videoToolbar")),''),m=($(n).append(h),document.getElementById("video"+c));m.style.transform="rotate("+t.angle+"deg)";let d;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.handler.setInputAction(function(e){e=s._getPosition.getMousePosition(e);if(0==l.length&&l.push(e.clone()),l.push(e),2!==l.length||d||(d=s._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>l,!1),clampToGround:!0,material:new Cesium.ColorMaterialProperty(Cesium.Color.YELLOW.withAlpha(.5)),width:3}})),3<=l.length&&!r)return d&&s._viewer.entities.remove(d),o=new s._cesium.PolygonHierarchy(l),void(r=new i(o));o=new s._cesium.PolygonHierarchy(l)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===l.length?u.showAt(e.endPosition,"左键开始绘制!"):l.length<=2?u.showAt(e.endPosition,"点击继续绘制!"):u.showAt(e.endPosition,"右键结束绘制!"),2<=l.length&&((e=s._getPosition.getMousePosition(e))&&(l.pop(),l.push(e),o=new s._cesium.PolygonHierarchy(l)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){s.end&&s.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(s._tree.endtemporaryItem(),s._tree.handler.destroy(),u.show(!1),s._core.mouse(s._viewer.container,0,"0"),this.end=void 0,d&&s._viewer.entities.remove(d),"cancel"===e||l.length<3)s.item&&s._viewer.entities.remove(s.item);else{m.play(),s.item.polygon.material=m;for(var e={polygon:{},positions:[],area:[]},t=(e.polygon=s.item,[]),i=0;i'),n=document.getElementById("videoToolbar")),this._core.getuid()),s='',n=($(n).append(s),document.getElementById("video"+a)),s=(n.play(),this._core.defaultValue(t.heightReference,1)),a=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:n,color:Cesium.Color.fromCssColorString(a)}),heightReference:s,perPositionHeight:1!==s,stRotation:Cesium.Math.toRadians(t.angle||0),rotation:Cesium.Math.toRadians(t.rotation||0)}}),this},M.prototype.addVideoPlane=function(e,t){e instanceof Array?i=this._cesium.Cartesian3.fromDegrees(...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 i,e=document.getElementById("videoToolbar"),o=(e||($(".cesium-viewer").append('
'),e=document.getElementById("videoToolbar")),this._core.getuid()),r='',e=($(e).append(r),document.getElementById("video"+o)),r=(e.play(),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))),plane:{plane:new Cesium.Plane(Cesium.Cartesian3.UNIT_Y,0),dimensions:new Cesium.Cartesian2(t.width||12.8,t.height||7.2),material:new Cesium.ImageMaterialProperty({image:e,color:Cesium.Color.fromCssColorString(r)}),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(t.near,t.far||100*(t.width||12.8))}}),this},M.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),0{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*g)}}),n._tree.temporaryItem.obj.push(r),d.label=r))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t,i;(h=n._getPosition.getMousePosition(e))&&(g=g||n._core.getPointToCameraDistance(n._viewer,h),e=n._core.getArea(u,s),i=n._cesium.Cartographic.fromCartesian(h),t=n._cesium.Math.toDegrees(i.longitude),i=n._cesium.Math.toDegrees(i.latitude),0==s.length&&(s.push(h.clone()),u.push([t,i])),s.push(h),u.push([t,i]),l=new n._cesium.PolygonHierarchy(s),2===s.length&&(p=n._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>s,!1),clampToGround:!1,material:m.polygon,width:3}})),3<=s.length&&(p&&n._viewer.entities.remove(p),n._cesium.defined(c)||(l=new n._cesium.PolygonHierarchy(s),c=new f(l)),n._viewer.entities.remove(r),r=n._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return s.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*g),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(r),d.label=r))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){n.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){a.show(!1),n._viewer.entities.remove(r),n._tree.handler.destroy(),n.end=void 0,n._core.mouse(n._viewer.container,0,"0"),p&&n._viewer.entities.remove(p),"cancel"===e||s.length<3?n.item&&n._viewer.entities.remove(n.item):(e=n._core.getArea(u,s),o=e,e=n._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return s.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*g),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.endtemporaryItem(),n._points.push(e),n._lable=e,d.mj=o,d.label=e,""!=t&&null!=t&&"function"==typeof t&&t(d))};_.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new n._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=n._viewer.entities.add(this.options),n.item=this.polygon,n._entity=this.polygon,n._tree.temporaryItem.obj.push(this.polygon),d.polygon=this.polygon};var f=_;function _(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:m.polygon,classificationType:n._cesium.ClassificationType.BOTH}},this.hierarchy=e,this._init()}return this},M.prototype.executePolygonym=function(i){var e,t,o=this,r=(this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._tree.handler=new o._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas),[]),n={},a=null,s=null,l=(this._tree.handler.setInputAction(function(e){e=o._viewer.camera.getPickRay(e.endPosition);s=o._viewer.scene.globe.pick(e,o._viewer.scene),2<=r.length&&(o._cesium.defined(a)?(r.pop(),r.push(s),n=new o._cesium.PolygonHierarchy(r)):(n=new o._cesium.PolygonHierarchy(r),a=new l(n)))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=o._viewer.camera.getPickRay(e.position),s=o._viewer.scene.globe.pick(e,o._viewer.scene),0==r.length&&(r.push(s.clone()),n=new o._cesium.PolygonHierarchy(r)),r.push(s),n=new o._cesium.PolygonHierarchy(r),e=o._cesium.Cartographic.fromCartesian(r[r.length-1]),o._cesium.Math.toDegrees(e.longitude),o._cesium.Math.toDegrees(e.latitude),e.height,e=o._viewer.entities.add({name:"多边形面积",position:r[r.length-1],point:{pixelSize:5,color:o._cesium.Color.RED.withAlpha(.5),outlineColor:o._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}});o._tree.temporaryItem.obj.push(e),o._points.push(e)},o._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){o._tree.handler.destroy(),o._tree.endtemporaryItem(),r.pop(),n=new o._cesium.PolygonHierarchy(r);var t=o._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return r.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,r.length,new Cesium.Cartesian3)},!1),label:{text:"平方千米",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:o._cesium.HeightReference.CLAMP_TO_GROUND}});o._tree.temporaryItem.obj.push(t),o._points.push(t),""!=i&&null!=i&&"function"==typeof i&&i(a)},o._cesium.ScreenSpaceEventType.RIGHT_CLICK),u.prototype._init=function(){var e=this,t=(this.options.polygon.hierarchy=new o._cesium.CallbackProperty(function(){return e.hierarchy},!1),o._viewer.entities.add(this.options));o._tree.temporaryItem.obj.push(t),o.item=t},e=0,o._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(e=F.selectedItem.id),t={id:t=o._core.getuid(),name:"新建面"+t,pId:o._core.isnull(e)?0:e,type:"polygon",item:o},o.setTreeobj(t),F.insertGroupId(t,o._core.isnull(e)?0:e),u);function u(e){this.options={name:"多边形",polygon:{hierarchy:[],perPositionHeight:!0,material:o._cesium.Color.SKYBLUE.withAlpha(.4),extrudedHeight:0}},this.hierarchy=e,this._init()}return this},M.prototype.executePolygonymsd=function(f={},i){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var h,_=this,C=(this._tree.handler=new _._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._core.CreateTooltip()),y={},v=[],w=null,m=null,o="0",b=0,T=1e3,r=10,E=!1,S=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw);let P,x;function D(){_.end();let t=r/20;_.waterTimer=setInterval(function(){var e;b不允许出现交叉面!';break}}else if(u==S.length-1){if(Cesium_turf.lineIntersect(a,c).features.length){l=!1,C.innerHTML='不允许出现交叉面!';break}}else{if(Cesium_turf.lineIntersect(a,c).features.length)return l=!1,void(C.innerHTML='不允许出现交叉面!');if(Cesium_turf.lineIntersect(s,c).features.length){l=!1,C.innerHTML='不允许出现交叉面!';break}}}if(!l)return;v.pop(),v.push(h),y=new _._cesium.PolygonHierarchy(v)}else y=new _._cesium.PolygonHierarchy(v),w=new d(y);m||(m=_._viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return v.concat([v[0]])},!1),clampToGround:!0,width:3}}),_._points.push(m))}}},_._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=_._getPosition.getMousePosition(e);if(e)if(E){var t=_._cesium.Cartographic.fromCartesian(e);if(void 0===b)b=t.height;else if(void 0===T){if((T=t.height)不允许出现交叉面!';break}}else if(p==S.length-1){if(Cesium_turf.lineIntersect(h,g).features.length){d=!1,C.innerHTML='不允许出现交叉面!';break}}else{if(Cesium_turf.lineIntersect(h,g).features.length)return d=!1,void(C.innerHTML='不允许出现交叉面!');if(Cesium_turf.lineIntersect(m,g).features.length){d=!1,C.innerHTML='不允许出现交叉面!';break}}}if(!d)return}i=v[v.length-2],o=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),s=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),l=Cesium.Math.toDegrees(s.latitude),u=Cesium.Math.toDegrees(s.longitude),c=Cesium_turf.lineString([[n,r],[u,l]]);S.push(c)}v.push(e),y=new _._cesium.PolygonHierarchy(v),f.rectangle&&(P?(x=_._core.toDegrees(e),v=[Cesium.Cartesian3.fromDegrees(P.lon,P.lat),Cesium.Cartesian3.fromDegrees(P.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,x.lat),Cesium.Cartesian3.fromDegrees(x.lon,P.lat)],y=new _._cesium.PolygonHierarchy(v),w.hierarchy=y,f.pointSelect?E=!(T=b=void 0):D()):P=_._core.toDegrees(e));t=_._cesium.Cartographic.fromCartesian(v[v.length-1]),a=(_._cesium.Math.toDegrees(t.longitude),_._cesium.Math.toDegrees(t.latitude),t.height,_._viewer.entities.add({name:"多边形",position:e,point:{pixelSize:5,color:_._cesium.Color.RED.withAlpha(.5),outlineColor:_._cesium.Color.WHITE.withAlpha(.5),outlineWidth:1,heightReference:_._cesium.HeightReference.CLAMP_TO_GROUND}}));_._tree.temporaryItem.obj.push(a),_._points.push(a)}},_._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){E||v.length<=3||(C.show(!1),v.pop(),y=new _._cesium.PolygonHierarchy(v),f.pointSelect?E=!(T=b=void 0):D())},_._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(C.show(!1),_._core.mouse(_._viewer.container,0),_._tree.handler.destroy(),_._tree.endtemporaryItem(),_.end=void 0,"cancel"===e&&!this.waterTimer&&(_.item&&_._viewer.entities.remove(_.item),0{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:d,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}}),r._tree.temporaryItem.obj.push(o),r._points.push(o),n.label=o))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE);let g;this._tree.handler.setInputAction(function(e){var e=r._getPosition.getMousePosition(e,[n.polygon,n.label]);e&&(p=p||r._core.getPointToCameraDistance(r._viewer,e),a&&(s.length||s.push(e.clone()),s.push(e),i=new r._cesium.PolygonHierarchy(s),o&&(r._viewer.entities.remove(o),o=void 0),2===s.length&&(g=r._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>s,!1),clampToGround:!0,material:h.polygon,width:3}})),3<=s.length&&!r._cesium.defined(l)&&(g&&r._viewer.entities.remove(g),l=new y(i,r._cesium)),3<=s.length&&(e=(e=String(f(l.path.positions))).substr(0,e.indexOf(".",0)),d=e.length<6?e+"平方米":(e=(e=String(e/1e6)).substr(0,e.indexOf(".",0)+3))+"平方千米",n.mj=d,o=r._viewer.entities.add({name:"多边形面积",position:new Cesium.CallbackProperty(function(){let t=new Cesium.Cartesian3;return s.forEach(e=>{Cesium.Cartesian3.add(t,e,t)}),Cesium.Cartesian3.divideByScalar(t,s.length,new Cesium.Cartesian3)},!1),label:{text:d,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}}),r._tree.temporaryItem.obj.push(o),r._points.push(o),n.label=o)))},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){r.end&&r.end()},r._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){r._tree.handler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK),r._tree.handler.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),r._cesium.trackedEntity=void 0,r.end=void 0,r._tree.endtemporaryItem(),a=!1,m.show(!1),r._tree.handler.destroy(),r._core.mouse(r._viewer.container,0,"0"),g&&r._viewer.entities.remove(g),"cancel"===e?r.deleteObject():(s.length<3&&r.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(n))};var f=function(e){for(var t=new Array(e.length),i=0;i{0===s.length?t.showAt(e.endPosition,"左键开始绘制!"):s.length<=2?t.showAt(e.endPosition,"点击继续绘制!"):t.showAt(e.endPosition,"右键结束绘制!"),!h||(e=this._getPosition.getMousePosition(e,[a.polygon,a.label]))&&(s.pop(),s.push(e))},Cesium.ScreenSpaceEventType.MOUSE_MOVE);let d;this._tree.handler.setInputAction(e=>{h=!0;let t=this._getPosition.getMousePosition(e,[a.polygon,a.label]);t&&(m=m||o._core.getPointToCameraDistance(o._viewer,t),s.length||s.push(t.clone()),s.push(t),e=this._core.toDegrees(t),l.push([e.lon,e.lat,e.height]),i=new o._cesium.PolygonHierarchy(s),2===s.length&&(d=this._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(()=>s,!1),clampToGround:!0,material:c.polygon,width:3}})),3<=s.length&&!Cesium.defined(u)&&(d&&this._viewer.entities.remove(d),u=new p(i)))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(()=>{o.end&&o.end()},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=i=>{if(this.end=void 0,h=!1,t.show(!1),o._tree.handler.destroy(),o._core.mouse(o._viewer.container,0,"0"),d&&o._viewer.entities.remove(d),"cancel"===i)this.deleteObject();else if(s.pop(),s.length<3&&this.deleteObject(),2{let{area:t,tin:i}=e,o=(a.mj=t,new Cesium.Cartesian3);l.forEach(e=>{Cesium.Cartesian3.add(o,{x:e[0],y:e[1],z:e[2]},o)});e=Cesium.Cartesian3.divideByScalar(o,l.length,new Cesium.Cartesian3),e=this._viewer.entities.add({name:"多边形面积",position:Cesium.Cartesian3.fromDegrees(e.x,e.y,e.z),label:{text:t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*m),disableDepthTestDistance:Number.POSITIVE_INFINITY}});this._points.push(e),r.tin&&(this._viewer.entities.remove(a.polygon),i.features.forEach(e=>{e.positions&&(e=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:c.polygon,perPositionHeight:!0,outline:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*m),outlineColor:Cesium.Color.YELLOW}}),this._points.push(e))})),a.label=e,n&&"function"==typeof n&&n(a)};r.onlyTerrain?e.then(e=>{t(e)}):t(e)}};g.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new Cesium.CallbackProperty(function(){return e.path},!1),this.polygonEntity=o._viewer.entities.add(this.options),o.item=this.polygonEntity,o._tree.temporaryItem.obj.push(this.polygonEntity),a.polygon=this.polygonEntity,o._entity=this.polygonEntity};var p=g;function g(e){if(!Cesium.defined(e))throw new Cesium.DeveloperError("positions is required!");if(e.length<3)throw new Cesium.DeveloperError("positions 的长度必须大于等于3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:Cesium.ClassificationType.BOTH,material:c.polygon}},this.path=e,this._init()}return this},M.prototype.setVisibility=function(e){if(0{n.push(Cesium.Cartesian3.fromDegrees(e.x,e.y,e.z))}),this.item=this._viewer.entities.add({id:e.id,polyline:{positions:n,width:e.width||4,material:Cesium.Color.fromCssColorString(e.color||"#f00").withAlpha(t),clampToGround:e.clampToGround}}),this.item.objectType="polyline");i={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"polyline",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},R.prototype.getstyles=function(){var e={};return e.show=!this.item.polyline.show||this.item.polyline.show.getValue(),e.positions=this.item.polyline.positions.getValue().toString(),e.width=this.item.polyline.width.toString(),e.granularity=this.item.polyline.granularity?this.item.polyline.granularity.toString():null,e.material={},e.material.color=this.item.polyline.material&&this.item.polyline.material.color&&this.item.polyline.material.color._value?"rgba"+this.item.polyline.material.color.toString():null,e.material.outlineColor=this.item.polyline.material.outlineColor&&this.item.polyline.material.outlineColor._value?"rgba"+this.item.polyline.material.outlineColor.toString():null,e.material.outlineWidth=this.item.polyline.material.outlineWidth&&this.item.polyline.material.outlineWidth._value?this.item.polyline.material.outlineWidth.toString():null,e.classificationType=this.item.polyline.classificationType?this.item.polyline.classificationType.toString():null,e.near=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.near:null,e.far=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.far:null,e},R.prototype.createLink=function(e,t,i){i=i||{};var o,r,n,a,s=[],l=[],u=(e.lon&&e.lat?void 0!==e.height?(s.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),s.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),l.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(s.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),s.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),l.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?(s.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),s.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(s.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),s.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),l.push(e,t)):2===e.length?(s.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),s.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),l.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(s.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),s.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),l.push({x:e[0],y:e[1],z:e[2]},{x:t[0],y:t[1],z:t[2]})),1===i.lineType?i.material=new this._cesium.PolylineDashMaterialProperty({color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE)}):2===i.lineType?i.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.3,color:this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.BLUE)}):i.material=this._core.defaultValue(i.lineColor&&this._cesium.Color.fromCssColorString(i.lineColor),this._cesium.Color.AQUAMARINE),i.cylinder&&(e=l[1].z-l[0].z,t=Cesium.Cartesian3.fromDegrees(l[0].x,l[0].y,0),n=Cesium.Cartesian3.fromDegrees(l[1].x,l[0].y,0),n=this._core.getSpaceDistancem([t,n],this._cesium),o=0==e?Math.PI/2:Math.atan(n/e),r=this._core.getSpaceDistancem(s,this._cesium),v=Cesium.Cartesian3.fromDegrees(l[0].x,l[1].y,0),n=this._core.getSpaceDistancem([t,v],this._cesium),t=Math.asin(n/r),l[0].x>l[1].x&&l[0].y>l[1].y?t=e<0?-t:t:l[0].x>l[1].x&&l[0].yl[1].y&&(t=e<0?-t:t,o=-o),a=new Cesium.HeadingPitchRoll(0,o,t)),s[0]),c=(this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return u},!1),orientation:i.cylinder?new this._cesium.CallbackProperty(function(){return Cesium.Transforms.headingPitchRollQuaternion(u,a)},!1):void 0,polyline:{positions:s,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)}}),this._core.defaultValue(i.num,200)),h=this._cesium.Math.lerp(l[0].x,l[1].x,1/c)-l[0].x,m=this._cesium.Math.lerp(l[0].y,l[1].y,1/c)-l[0].y,d=this._cesium.Math.lerp(l[0].z,l[1].z,1/c)-l[0].z,p=[];p.push(s[0]);for(let e=0;e=p.length-1&&0a._points.length&&r.pop(),r.push(i)):n=new c(r)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){a._viewer.camera.getPickRay(e.position),(i=a._getPosition.getMousePosition(e))&&(0!=r.length&&r.length>a._points.length?(r.pop(),r.push(i)):r.push(i,i),2<=r.length&&(a._cesium.defined(n)||(n=new c(r)),t=a._core.getSpaceDistance(r,a._cesium)),s="总长:"+t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{var t,i;l.show(!1),a._tree&&a._tree.handler.destroy(),a._core.mouse(a._viewer.container,0,"0"),a.end=void 0,n&&(t={width:4,lineColor:"#0000ff"},i=n.positions,a._tree&&a._tree.endtemporaryItem(),a._points[a._points.length-1]&&(a._points[a._points.length-1].label.text=s),a._viewer.entities.remove(a.item),"cancel"===e||r.length<2||(a.item=a._viewer.entities.add({name:"新建链路",polyline:{positions:i,width:a._core.defaultValue(t.width,2),material:a._core.getLinkMaterial(t.lineColor,t.pointColor,t.time),clampToGround:!0}}),o&&o(a.item)))},e.prototype._init=function(){var e=this,t=(this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positions},!1),a._viewer.entities.add(this.options));a.item=t,a._tree.temporaryItem.obj.push(t),a._core.getuid()},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:u.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return this},R.prototype.createLandingLine=function(e,t={}){var i=[],e=(e.lon&&e.lat?(i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,0))):Array.isArray(e)?(i.push(Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),i.push(Cesium.Cartesian3.fromDegrees(e[0],e[1],0))):e instanceof Cesium.Cartesian3&&(i.push(e),e=this._core.toDegrees(e),i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,0))),this.item=this._viewer.entities.add({name:"新建接地线",polyline:{positions:new Cesium.CallbackProperty(function(){return i},!1),width:this._core.defaultValue(t.width,2),material:Cesium.Color.fromCssColorString(t.color||"#fff")}}),this.positions={get value(){return i},set value(e){i[0]=e;let t=Cesium.Cartographic.fromCartesian(e);t.height=0,i[1]=Cesium.Cartographic.toCartesian(t)}},{id:this.item.id,name:"新建接地线",pId:0,type:"polyline",item:this});return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},R.prototype.createLinkPro=function(e,t,i){i=i||{};var o=[],r=[],r=(e.lon&&e.lat?void 0!==e.height?(o.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)),o.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),r.push({x:e.lon,y:e.lat,z:e.height},{x:t.lon,y:t.lat,z:t.height})):(o.push(this._cesium.Cartesian3.fromDegrees(e.lon,e.lat)),o.push(this._cesium.Cartesian3.fromDegrees(t.lon,t.lat)),r.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?(o.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y,e.z)),o.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y,t.z))):(o.push(this._cesium.Cartesian3.fromDegrees(e.x,e.y)),o.push(this._cesium.Cartesian3.fromDegrees(t.x,t.y)),e.z=0,t.z=0),r.push(e,t)):2===e.length?(o.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1])),o.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1])),r.push({x:e[0],y:e[1],z:0},{x:t[0],y:t[1],z:0})):3===e.length&&(o.push(this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2])),o.push(this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])),r.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:o,width:this._core.defaultValue(i.width,2),material:this._core.getLinkMaterial(i.lineColor,i.pointColor,i.time),clampToGround:i.clampToGround}}),{id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this});return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},R.prototype.executePolyline=function(t,l){var u=this,i=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new u._cesium.CallbackProperty(function(){return e.positions},!1),this.polyline=u._viewer.entities.add(this.options),u.item=this.polyline},e);function e(e){this.options={polyline:{show:!0,positions:[],material:new u._cesium.PolylineOutlineMaterialProperty({color:u._core.defaultValue(t.color,u._cesium.Color.YELLOW)}),clampToGround:u._core.defaultValue(t.clampToGround,!0),width:u._core.defaultValue(t.width,3)}},this.positions=e,this._init()}var c=new u._cesium.ScreenSpaceEventHandler(u._viewer.scene.canvas),h=[],m=void 0,d=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),c.setInputAction(function(e){e=u._getPosition.getMousePosition(e);0==h.length&&h.push(e.clone()),h.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){0===h.length?d.showAt(e.endPosition,"左键开始绘制!"):d.showAt(e.endPosition,"右键结束绘制!");e=u._getPosition.getMousePosition(e);2<=h.length&&(u._cesium.defined(m)?null!=e&&(h.pop(),e.y+=1+Math.random(),h.push(e)):m=new i(h))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(function(e){d.show(!1);var t={polyline:{},positions:[],positionsp:[],distance:[],setDistance:function(){alert("qq")}};c.destroy(),t.polyline=m;for(var i=[],o=0;ou._points.length&&n.pop(),n.push(l)):a=new g(n),s=u._core.getSpaceDistance(n,u._cesium)),r&&(u._viewer.entities.remove(r),r=void 0),r=u._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),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),u._tree.temporaryItem.obj.push(r))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){u._viewer.camera.getPickRay(e.position),(l=u._getPosition.getMousePosition(e))&&(p=p||u._core.getPointToCameraDistance(u._viewer,l),0!=n.length&&n.length>u._points.length?(n.pop(),n.push(l)):n.push(l,l),2<=n.length&&(u._cesium.defined(a)||(a=new g(n)),s=u._core.getSpaceDistance(n,u._cesium)),r&&(u._viewer.entities.remove(r),r=void 0),c="总长:"+(e=s),o=u._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],point:{pixelSize:5,color:d.point.withAlpha(.5),outlineColor:u._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),outlineWidth:2,clampToGround:!0},label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),u._tree.temporaryItem.obj.push(o),u._points.push(o),m.spot.push(l),m.distance.push(s),m.label.push(o))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){u.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){h.show(!1),u._tree&&u._tree.endtemporaryItem(),u.end=void 0,r&&(u._viewer.entities.remove(r),r=void 0,n.pop()),u._points[u._points.length-1]&&(u._points[u._points.length-1].label.text=c),u._tree&&u._tree.handler.destroy(),u._core.mouse(u._viewer.container,0,"0"),"cancel"===e?u.deleteObject():(n.length<2&&u.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(m))};f.prototype._init=function(){var e=this,t=(this.options.polyline.positions=new u._cesium.CallbackProperty(function(){return e.positions},!1),u._viewer.entities.add(this.options)),t=(u.item=t,u._tree.temporaryItem.obj.push(t),m.ployline.push(t),u._core.getuid());m.name="新建空间距离"+t};var g=f;function f(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:d.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:3,clampToGround:!1}},this.positions=e,this._init()}return this},R.prototype.executeHorizontal=function(t,e){var i,o,c=this,r=(this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),n=null,a="0米",s=null,c=this,l="",u=this._core.CreateTooltip(),h={spot:[],distance:[],label:[],ployline:[]},m={point:c._cesium.Color.RED,polyline:c._cesium.Color.YELLOW};0{this._viewer.entities.remove(e)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)},dr.prototype.startDrawing=function(e={},t="auto",a){var s,i=this._scene,r=this._tooltip,l=[],u=[],c=[],h=(this._positions=u,this._degreesArr=c,this._drawColor.point=e.point||this._drawColor.point,this._drawColor.polyline=e.polyline||this._drawColor.polyline,this._drawColor.polygon=e.polygon||this._drawColor.polygon,this.loadingImg=e.loading||this.loadingImg,this.tin=this._core.defaultValue(e.tin,!0),this.onlyTerrain=this._core.defaultValue(e.onlyTerrain,!0),this.selectDatum=this._core.defaultValue(e.selectDatum,!0),this),e=(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),new Cesium.ScreenSpaceEventHandler(i.canvas));this._mouseHandler=e,this.cleanUp(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw);let m;function d(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(l))}return e.setInputAction(function(e){if(null!=e.position){var t=h._getPosition.getMousePosition(e);if(t){var i=Cesium.Cartographic.fromCartesian(t),o=Cesium.Math.toDegrees(i.longitude),i=Cesium.Math.toDegrees(i.latitude);if(0===l.length&&(l.push(o,i),c.push([o,i]),u.push(t),s=t),4<=u.length){var r=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,s);if(void 0!==r){var n=r.x-e.position.x,r=r.y-e.position.y;if(n*n+r*r<16)return l.splice(l.length-2,2),u.pop(),void this.stopDrawing(a)}}l.push(o,i),c.push([o,i]),u.push(t),2!==u.length||m||(m=this._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return u},!1),clampToGround:!0,material:h._drawColor.polygon,width:3}})),3===u.length&&(m&&this._viewer.entities.remove(m),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(l)),material:h._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Cesium.CallbackProperty(d,!1))}}}.bind(this),Cesium.ScreenSpaceEventType.LEFT_CLICK),e.setInputAction(function(e){var t,i,o=e.endPosition;null!=o&&(0===u.length?r.showAt(o,"点击开始绘制第一个点"):(e=h._getPosition.getMousePosition(e))&&(i=Cesium.Cartographic.fromCartesian(e),t=Cesium.Math.toDegrees(i.longitude),i=Cesium.Math.toDegrees(i.latitude),l.splice(l.length-2,2),c.pop(),u.pop(),l.push(t,i),c.push([t,i]),u.push(e),r.showAt(o,"右键结束绘制"),3<=u.length&&4<=u.length&&(void 0!==(t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,s))&&(i=t.x-o.x,e=t.y-o.y,document.body.style.cursor=i*i+e*e<16?"pointer":"default"))))}.bind(this),Cesium.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(function(e){this.end&&this.end()}.bind(this),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{void 0!==this._mouseHandler&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._core.mouse(this._viewer.container,0),this._tooltip.show(!1),m&&this._viewer.entities.remove(m),this.end=void 0,u.length<3||(this._prevEntity&&(this._prevEntity.polygon.hierarchy=Cesium.Cartesian3.fromDegreesArray(l)),"cancel"===e?this._prevEntity&&this._viewer.entities.remove(this._prevEntity):this.stopDrawing(t,a))},this},dr.prototype.stopDrawing=function(i,o){void 0!==this._mouseHandler&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),void 0!==this._volumeLabel&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),void 0!==this._volumeLabel1&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(e=>{this._viewer.entities.remove(e)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{var e=this.computeCutVolume(i,this.onlyTerrain);let t=i=>{var e=i.maxHeight,t=i.minHeight,t=(this._prevEntity.polygon.height=i.minHeight,this._prevEntity.polygon.heightReference=0,{id:this._core.getuid(),polygon:{hierarchy:{positions:this._positions},height:t,extrudedHeight:e,closeTop:!1,closeBottom:!1,material:Cesium.Color.CYAN.withAlpha(.2),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*this.viewDistance),outline:!0,outlineColor:Cesium.Color.RED,outlineWidth:2}});if(this._prevEntity1=this._viewer.entities.add(t),"function"==typeof o&&o(i),this.selectDatum){let t=()=>{this.addPoint(e=>{this.setDatum(e,e=>{"function"==typeof o&&o({...i,...e}),t()})})};t()}};this.onlyTerrain?e.then(e=>{t(e)}):t(e)},100)},dr.prototype.computeCentroidOfPolygon=function(e){for(var t=[],i=[],o=0,r=0,n=0;n{let e=this._core.tinFromPoints(m,{getArea:!0,polygon:d})["tin"],i=(this.tinData=e,{fill:0,dig:0}),o={fill:"立方米",dig:"立方米"};var r,n,a,s,l={fill:1,dig:1},t=(this.Triangulation=[],e.features.forEach(e=>{var t;e.positions&&(this.tin&&(t=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*this.viewDistance),outlineColor:Cesium.Color.YELLOW}}),this._volumeTin.push(t)),t=e.geometry.coordinates[0],a=t[0][2],r=t[1][2],n=t[2][2],s=e.area,this.Triangulation.push({bottomArea:s,height:[a,r,n]}),0<(a=(a-c+r-c+n-c)/3)?i.dig=i.dig+s*a*l.dig:i.fill=i.fill-s*a*l.fill,1e10{e=e.geometry.coordinates;t.push(Cesium.Cartographic.fromDegrees(e[0],e[1]))}),this._core.getHeightsFromLonLat(this._viewer,t).then(o=>(m.features.forEach((e,t)=>{let i=e.geometry.coordinates;i[2]=o[t]||0,hi[2]&&(c=i[2])}),i()))}return m.features.forEach(e=>{let t=e.geometry.coordinates;e=new Cesium.Cartographic(Cesium.Math.toRadians(t[0]),Cesium.Math.toRadians(t[1]));t[2]=Viewer.scene.sampleHeight(e)||0,ht[2]&&(c=t[2])}),i()},dr.prototype.addLoading=function(){var e=document.createElement("div"),t=(e.id="cesiumLoading",e.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;",document.createElement("img"));t.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",t.src=this.loadingImg,e.appendChild(t),this.loading=e,this._viewer.container.appendChild(e)},dr.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},dr.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0},dr.prototype.addPoint=function(i){if(this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1){this.addPointHandle=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(e){var t=this._viewer.scene.pick(e.position);t&&t.id&&t.id.id===this._prevEntity1.id&&((t=this._getPosition.getMousePosition(e))&&(e=Cesium.Cartographic.fromCartesian(t),this.addPointHandle.destroy(),this.addPointHandle=null,i&&"function"==typeof i&&i(e.height.toFixed(1))))}.bind(this),Cesium.ScreenSpaceEventType.LEFT_CLICK);let e;this.addPointHandle.setInputAction(function(t){clearTimeout(e),e=setTimeout(()=>{var e=this._viewer.scene.pick(t.endPosition);e&&e.id&&e.id.id===this._prevEntity1.id?this._tooltip.showAt(t.endPosition,"点击修改基准面高度"):this._tooltip.show(!1)},50)}.bind(this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)}},dr.prototype.showTin=function(e){this.tin=e,this._volumeTin.forEach(e=>{this._viewer.entities.remove(e)}),this._volumeTin=[],e&&this.tinData&&this.tinData.features.forEach(e=>{e.positions&&(e=this._viewer.entities.add({polygon:{hierarchy:new Cesium.PolygonHierarchy(e.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Cesium.Color.YELLOW}}),this._volumeTin.push(e))})},dr.prototype.setDatum=function(t,e){var i,o,r,n,a;this.Triangulation&&0{e.deleteObject&&e.deleteObject(),e.cleanUp&&e.cleanUp()}),this.measureData.clear()},pr.prototype.horizontalDistance=function(e={},t){let i=this.Polyline.horizontalDistance(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.spaceDistance=function(e={},t){let i=this.Polyline.spaceDistance(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.altitude=function(e={},t){let i=this.Point.altitude(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.verticalHeight=function(e={},t){let i=this.Polyline.verticalHeight(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.surfaceArea=function(e={},t){let i=this.Polygon.surfaceArea(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.planeArea=function(e={},t){let i=this.Polygon.planeArea(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.measureAngle=function(e={},t){let i=this.Polyline.measureAngle(e,e=>{e.id=this._core.getuid(),this.measureData.set(e.id,i),t&&"function"==typeof t&&t(e)})},pr.prototype.analysisVolume=function(e={},t){let i=new dr(this._viewer,Cesium);i.startDrawing(e,e.spacing||"auto",e=>{i.value||(e.id=this._core.getuid(),this.measureData.set(e.id,i)),i.value=`填方:${e.volume.fill.toFixed(4)+e.unit.fill}
挖方:`+(e.volume.dig.toFixed(4)+e.unit.dig),t&&"function"==typeof t&&t(e)})},Object.defineProperties(pr.prototype,{Point:{get:function(){return new L(this._viewer,Cesium)}},Polyline:{get:function(){return new R(this._viewer,Cesium)}},Polygon:{get:function(){return new M(this._viewer,Cesium)}}}),Cr.prototype.createTerrainProfile=function(e){for(var t=[],i=0;i{if(c.show(!1),this.end=void 0,a._core.mouse(a._viewer.container,0),a._tree.endtemporaryItem(),a._tree.handler.destroy(),"cancel"===e)for(var t=0;to._cesium.Math.toRadians(5)?(o._flags.vertical=!0,o._startMousePosition=e.position):o._flags.horizontally=!0,o._viewer.camera.positionCartographic,o._cameraHeight=o._viewer.camera.positionCartographic.height},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this._tree.handler.setInputAction(function(e){o._flags.move=!0,o._flags.rotate=!0},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._tree.handler.setInputAction(function(e){o._flags.vertical||(o._startMousePosition=e.startPosition),o._mousePosition=e.endPosition,o.mouseMoveEvent()},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){o._flags.move=!1,o._flags.horizontally=!1,o._flags.vertical=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this._tree.handler.setInputAction(function(e){o._flags.move=!1,o._flags.rotate=!1},this._cesium.ScreenSpaceEventType.MIDDLE_UP);this._tree.handler.setInputAction(function(e){var t=o._viewer.camera,i=500{e.deleteObject()}),this._Particle[e]=[])},O.prototype.demolition=function(e,t){let i=new hr(this._viewer);return i.play(e,t)},O.prototype.measureTerrainHeight=function(e){return this._Deprecated.measureTerrainHeight(e)},O.prototype.createindoormode=function(e){return this._createindoormode.createIndoormode(e)},O.prototype.Indoormodeclose=function(){return this._createindoormode.Indoormodeclose()},O.prototype.createIndoormode=function(){return this._createindoormode.createIndoormode()},O.prototype.closeIndoormode=function(){return this._createindoormode.close()},O.prototype.setTime=function(e=9){e=(new Date).setHours(e);this._viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(e))},O.prototype.terrainExaggeration=function(e){return this._viewer.scene.globe.terrainExaggeration=e},O.prototype.createCurtainContrast=function(e,t){return this._createcurtaincontrast.curtainContrast(e,t)},O.prototype.curtainContrast=function(e){return this._createcurtaincontrast.curtainContrastPro(e)},O.prototype.clearCurtainContrast=function(){return this._createcurtaincontrast.close()},O.prototype.measureTerrainArea=function(e){return this._Deprecated.measureTerrainArea(e)},O.prototype.measureTerrainkPerimeter=function(e){return this._Deprecated.measureTerrainkPerimeter(e)},O.prototype.createElevationContour=function(e,t,i){return this._elevationContour.createElevationContour(e,t,i)},O.prototype.createTerrainProfile=function(e){return this._Deprecated.createTerrainProfile(e)},O.prototype.create3DViewshed=function(e){return this._create3DViewshed.startDraw(e),this._create3DViewshed},O.prototype.set3DViewshedOptions=function(e){return this._create3DViewshed.setOptions(e),this._create3DViewshed},O.prototype.create3DViewshedPoss=function(e){let t=new qo(this._viewer,this._cesium);return t.createViewshed(e)},O.prototype.add3DViewshedPoss=function(e){let t=new qo(this._viewer,this._cesium);return t.addViewshed(e)},O.prototype.add3DViewshed=function(e){return this._create3DViewshed.addViewshed(e),this._create3DViewshed},O.prototype.close3DViewshed=function(){return this._create3DViewshed.close()},O.prototype.createlineOfSight=function(e,t){return new wr(this._viewer,this._cesium).createlineOfSight(e,t)},O.prototype.createSightLine=function(e){let t=new po(this._viewer);return t.createSightLine(e)},O.prototype.floodAnalysis=function(e,t){let i=new M(this._viewer,Cesium);return i.executePolygonymsd(e,t)},O.prototype.SunshineAnalysisPoint=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPoint(e,t)},O.prototype.SunshineAnalysisPolygon=function(e,t){return this._SunshineAnalysis.sunshineAnalysisPolygon(e,t)},Er.prototype.Highvolume=function(e=[]){var t=this._cesium.PostProcessStageLibrary.createEdgeDetectionStage();t.uniforms.color=this._cesium.Color.BLUE,t.uniforms.length=.01,t.selected=e,this._viewer.scene.postProcessStages.add(this._cesium.PostProcessStageLibrary.createSilhouetteStage([t]))},Sr.prototype.createCircleScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3)),e={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Sr.prototype.createMultiCircleScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddCircleScanMultiPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3)),e={id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Sr.prototype.createRadarScan=function(e,t,i,o){e=new this._cesium.Cartographic.fromDegrees(e.lon,e.lat),i=i?this._cesium.Color.fromCssColorString(i):new Cesium.Color(1,0,0,1),this.item=this.AddRadarScanPostStage(e,this._cesium.defaultValue(t,1500),i,this._cesium.defaultValue(o,4e3)),e={id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Sr.prototype.createSectorScan=function(e,t,i,o,r,n){this._viewer;var a=this._cesium,e=new a.Cartographic.fromDegrees(e.lon,e.lat),i=i?a.Color.fromCssColorString(i):new a.Color(1,0,0,1),e=(this.item=this.AddSectorScanPostStage(e,a.defaultValue(t,1500),i,o,r,a.defaultValue(n,4e3)),{id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this});return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Sr.prototype.AddSectorScanPostStage=function(e,t,i,o,r,n){var a=this._viewer,s=this._cesium,l=s.Cartographic.toCartesian(e),u=new s.Cartesian4(l.x,l.y,l.z,1),l=new s.Cartographic(e.longitude,e.latitude,e.height+500),e=s.Cartographic.toCartesian(l),c=new s.Cartesian4(e.x,e.y,e.z,1),h=((new Date).getTime(),new s.Cartesian4),m=new s.Cartesian4,d=new s.Cartesian3,l=new s.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nuniform float u_angle;\nuniform float u_yaw;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nfloat getAngle(in vec3 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 angle = atan(dv.x/dv.y) * 180.0 / 3.1415926;\n if(dv.x > 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n }\n if(dv.x <= 0.0)\n {\n if(dv.y < 0.0)\n {\n angle = 180.0 + angle;\n }\n if(dv.y > 0.0)\n {\n angle = 360.0 + angle;\n }\n }\n return angle;\n}\nfloat ripple(float dist, float rippleIntensity, float rippleScale) {\n return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity));\n}\nvoid main()\n{\n gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius)\n {\n vec3 worldCoordi = (czm_inverseView * vec4(prjOnPlane,1.0)).xyz - (czm_inverseView * u_scanCenterEC).xyz; \n float angle = getAngle(worldCoordi);\n float maxAngle = fract((u_yaw + (u_angle/2.0))/360.0)*360.0;\n float minAngle = fract((u_yaw - (u_angle/2.0) + 360.0)/360.0)*360.0;\n bool showPixel = false; \n if(minAngle < maxAngle)\n {\n showPixel = angle > minAngle && angle < maxAngle;\n }\n else\n {\n showPixel = angle > minAngle || angle < maxAngle;\n }\n if(showPixel)\n {\n float f = dis / u_radius;\n f = 1.0 - f;\n gl_FragColor = mix(gl_FragColor, u_scanColor, f);\n float intensity =step(0.001,ripple(dis + 0.1, 0.1, 15.0));\n gl_FragColor.rgb += gl_FragColor.rgb * intensity;\n }\n }\n}\n",uniforms:{u_scanCenterEC:function(){return s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,h)},u_scanPlaneNormalEC:function(){var e=s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,h),t=s.Matrix4.multiplyByVector(a.camera._viewMatrix,c,m);return d.x=t.x-e.x,d.y=t.y-e.y,d.z=t.z-e.z,s.Cartesian3.normalize(d,d),d},u_radius:function(){return t},u_angle:function(){return o},u_yaw:function(){return r+150},u_maxRadius:t,u_scanColor:i}});return a.scene.postProcessStages.add(l)},Sr.prototype.AddCircleScanPostStage=function(e,t,i,o){var r=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),a=new n.Cartographic(e.longitude,e.latitude,e.height+500),e=n.Cartographic.toCartesian(a),l=new n.Cartesian4(e.x,e.y,e.z,1),u=(new Date).getTime(),c=new n.Cartesian4,h=new n.Cartesian4,m=new n.Cartesian3,a=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius)\n{\nfloat f = 1.0 -abs(u_radius - dis) / u_radius;\nf = pow(f, 4.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,h);return m.x=t.x-e.x,m.y=t.y-e.y,m.z=t.z-e.z,n.Cartesian3.normalize(m,m),m},u_radius:function(){return t*(((new Date).getTime()-u)%o)/o},u_scanColor:i}});return r.scene.postProcessStages.add(a)},Sr.prototype.AddCircleScanMultiPostStage=function(e,t,i,o){var r=this._viewer,n=this._cesium,a=n.Cartographic.toCartesian(e),s=new n.Cartesian4(a.x,a.y,a.z,1),a=new n.Cartographic(e.longitude,e.latitude,e.height+500),e=n.Cartographic.toCartesian(a),l=new n.Cartesian4(e.x,e.y,e.z,1),u=(new Date).getTime(),c=new n.Cartesian4,h=new n.Cartesian4,m=new n.Cartesian3,d=0,p=0,g=0,a=new n.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec4 u_scanCenterEC;\nuniform vec3 u_scanPlaneNormalEC;\nuniform float u_radius1;\nuniform float u_radius2;\nuniform float u_radius3;\nuniform float u_maxRadius;\nuniform vec4 u_scanColor;\nvec4 toEye(in vec2 uv, in float depth)\n {\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nif(dis < u_radius1)\n{\nfloat f = dis / u_radius1;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius2){\nfloat f = dis / u_radius2;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}else if(dis < u_radius3){\nfloat f = dis / u_radius3;\nf = pow(f, 9.0);\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,c),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,h);return m.x=t.x-e.x,m.y=t.y-e.y,m.z=t.z-e.z,n.Cartesian3.normalize(m,m),m},u_radius1:function(){return d},u_radius2:function(){return p},u_radius3:function(){var e=t*(((new Date).getTime()-u)%o)/o;return e 0.5;\n}\nvec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)\n{\nvec3 v01 = point -planeOrigin;\nfloat d = dot(planeNormal, v01) ;\nreturn (point - planeNormal * d);\n}\nfloat distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\nreturn length(tempPt - ptOnLine);\n}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat depth = getDepth( texture2D(depthTexture, v_textureCoordinates));\nvec4 viewPos = toEye(v_textureCoordinates, depth);\nvec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\nfloat dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\nfloat twou_radius = u_radius * 2.0;\nif(dis < u_radius)\n{\nvec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\nfloat f = 0.0;\nif(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz))\n{\nfloat dis1= length(prjOnPlane.xyz - lineEndPt);\nf = abs(twou_radius -dis1) / twou_radius;\nf = pow(f, 3.0);\n}\ngl_FragColor = mix(gl_FragColor, u_scanColor, f);\n}\n}\n",uniforms:{u_scanCenterEC:function(){return n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,p);return f.x=t.x-e.x,f.y=t.y-e.y,f.z=t.z-e.z,n.Cartesian3.normalize(f,f),f},u_radius:t,u_scanLineNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,d),t=n.Matrix4.multiplyByVector(r.camera._viewMatrix,l,p),i=n.Matrix4.multiplyByVector(r.camera._viewMatrix,u,g),t=(f.x=t.x-e.x,f.y=t.y-e.y,f.z=t.z-e.z,n.Cartesian3.normalize(f,f),_.x=i.x-e.x,_.y=i.y-e.y,_.z=i.z-e.z,((new Date).getTime()-m)%o/o);return n.Quaternion.fromAxisAngle(f,t*n.Math.PI*2,c),n.Matrix3.fromQuaternion(c,h),n.Matrix3.multiplyByVector(h,_,_),n.Cartesian3.normalize(_,_),_},u_scanColor:i}});return r.scene.postProcessStages.add(a)},Sr.prototype.remove=function(){this._viewer.scene.postProcessStages.remove(this.item)},Sr.prototype.setTreeobj=function(e){this.treeobj=e},Sr.prototype.deleteObject=function(){this.item&&this._viewer.scene.postProcessStages.remove(this.item)},Sr.prototype.setVisibility=function(e){this.item&&(this.item.enabled=e)},B.prototype.createBox=function(e,t,i,o){var r={id:this._core.getuid(),dimensions:new this._cesium.Cartesian3(4e5,3e5,5e5),material:this._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:this._cesium.Color.BLACK},r=this._core.extend(r,t,!0),t=(this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),box:r}),{id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"box",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},B.prototype.getstyles=function(){var e={};return e.show=!this.item.box.show||this.item.box.show._value,e.heightReference=this.item.box.heightReference||void 0,e.fill=this.item.box.fill&&this.item.box.fill._value?this.item.box.fill._value:void 0,e.dimensions=this.item.box.dimensions?this.item.box.dimensions.getValue():void 0,e.shadows=this.item.box.shadows&&this.item.box.shadows._value?this.item.box.shadows._value:void 0,e.material={},e.material.color=this.item.box.material&&this.item.box.material.color._value?"rgba"+this.item.box.material.color.toString():void 0,e.material.image=this.item.box.material&&this.item.box.material.image._value?this.item.box.material.image._value:void 0,e.material.repeat=this.item.box.material&&this.item.box.material.repeat?this.item.box.material.repeat._value:void 0,e.outline=this.item.box.outline&&this.item.box.outline._value?this.item.box.outline._value:void 0,e.outlineColor=this.item.box.outlineColor&&this.item.box.outlineColor._value?"rgba"+this.item.box.outlineColor.toString():void 0,e.outlineWidth=this.item.box.outlineWidth&&this.item.box.outlineWidth._value?this.item.box.outlineWidth._value:void 0,e.near=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.near:void 0,e.far=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},B.prototype.executeBox=function(i){var o=this,r=(o.shape={tempPoints:[],button:0,position:{}},new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)),n=[];return r.setInputAction(function(e){var e=o._viewer.scene.camera.pickEllipsoid(e.position,o._viewer.scene.globe.ellipsoid),e=o._cesium.Cartographic.fromCartesian(e),t=o._cesium.Math.toDegrees(e.longitude),e=o._cesium.Math.toDegrees(e.latitude),t=(n.push({lon:t,lat:e}),0==o.shape.button&&(o.box=o._viewer.entities.add({name:"",position:o._cesium.Cartesian3.fromDegrees(n[0].lon,n[0].lat),box:{id:o._core.getuid(),dimensions:new o._cesium.Cartesian3(4e5,3e5,5e5),material:o._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:o._cesium.Color.RED}}),o.item=o.box),0),e=(o._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(t=F.selectedItem.id),o._core.getuid()),e={id:e,name:"新建立方体"+e,pId:o._core.isnull(t)?0:t,type:"box",item:o};o.setTreeobj(e),o._tree.insertGroupId(e,o._core.isnull(t)?0:t),"function"==typeof i&&i({polyline:{},positions:[],distance:[]}),r.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},B.prototype.executeExcavation=function(o,r){var n=this,a=(n.shape={tempPoints:[],button:0,position:{}},new this._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas)),s=[];return a.setInputAction(function(e){var e=n._viewer.scene.camera.pickEllipsoid(e.position,n._viewer.scene.globe.ellipsoid),e=n._cesium.Cartographic.fromCartesian(e),t=n._cesium.Math.toDegrees(e.longitude),e=n._cesium.Math.toDegrees(e.latitude),t=(s.push({lon:t,lat:e}),-o.z/2),e=(0==n.shape.button&&(n.box=n._viewer.entities.add({name:"",position:n._cesium.Cartesian3.fromDegrees(s[0].lon,s[0].lat,t),box:{id:n._core.getuid(),dimensions:new n._cesium.Cartesian3(o.x,o.y,o.z),material:n._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:n._cesium.Color.WHITE}}),n.item=n.box,e=n._viewer.scene.globe,t=-o.x/2,i=-o.y/2,e.depthTestAgainstTerrain=!0,e.clippingPlanes=new n._cesium.ClippingPlaneCollection({modelMatrix:n.box.computeModelMatrix(n._cesium.JulianDate.now()),planes:[new n._cesium.Plane(new n._cesium.Cartesian3(1,0,0),t),new n._cesium.Plane(new n._cesium.Cartesian3(-1,0,0),t),new n._cesium.Plane(new n._cesium.Cartesian3(0,1,0),i),new n._cesium.Plane(new n._cesium.Cartesian3(0,-1,0),i)],edgeWidth:1,edgeColor:n._cesium.Color.WHITE})),0),t=(n._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(e=F.selectedItem.id),n._core.getuid()),i={id:t,name:"新建立方体"+t,pId:n._core.isnull(e)?0:e,type:"box",item:n};n.setTreeobj(i),F.insertGroupId(i,n._core.isnull(e)?0:e),"function"==typeof r&&r({polyline:{},positions:[],distance:[]}),a.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this},B.prototype.executeBox1=function(e){var t,i=this,o=this,r=(i.shape={points:[],button:0,rect:null,entity:null},new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas));return r.setInputAction(function(e){t=o._core.getPointFromWindowPoint(e.position,o._viewer),2<=i.shape.button&&(r.removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK)),i.shape.button=i.shape.button+1,t&&(0==i.shape.points.length?(i.shape.points.push(o._viewer.scene.globe.ellipsoid.cartesianToCartographic(t)),i.shape.rect=o._cesium.Rectangle.fromCartographicArray(i.shape.points),i.shape.rect.east+=1e-6,i.shape.rect.north+=1e-6,i.shape.entity=o._viewer.entities.add({rectangle:{coordinates:i.shape.rect,material:o._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:o._cesium.Color.RED,height:0}}),i.bufferEntity=i.shape.entity):2!=i.shape.points.length&&(r.removeInputAction(o._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.removeInputAction(o._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){var t;0!=i.shape.points.length&&(t=o._core.getPointFromWindowPoint(e.endPosition,o._viewer))&&(e=o._viewer.camera.getPickRay(e.endPosition),e=o._viewer.scene.globe.pick(e,o._viewer.scene),i.shape.points[1]=o._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),i.shape.rect=o._cesium.Rectangle.fromCartographicArray(i.shape.points),2==i.shape.button?i.shape.entity.rectangle.extrudedHeight=e.z:(i.shape.rect.west==i.shape.rect.east&&(i.shape.rect.east+=1e-6),i.shape.rect.south==i.shape.rect.north&&(i.shape.rect.north+=1e-6),i.shape.entity.rectangle.coordinates=i.shape.rect))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},B.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.box.dimensions?void 0:this.item.box.dimensions.getValue(),i=null==this.item.box.fill?void 0:this.item.box.fill._value,o=this.item.box.material,r=(null!=o&&(o={color:null==o.color._value?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value}),null==this.item.box.outline?void 0:this.item.box.outline._value),n=null==this.item.box.outlineColor?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",a=null==this.item.box.outlineWidth?void 0:this.item.box.outlineWidth._value,s=this.item.box.distanceDisplayCondition,l=null==s?void 0:s._value.near,s=null==s?void 0:s._value.far,u=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(u.longitude),y:this._cesium.Math.toDegrees(u.latitude),z:this._cesium.Math.toDegrees(u.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,dimensions:t,fill:i,material:o,outline:r,outlineColor:n,outlineWidth:a,near:l,far:s}}},B.prototype.setTreeobj=function(e){this.treeobj=e},B.prototype.setVisibility=function(e){this.item.show=e},B.prototype.setShow=function(e){try{this.item._box.show=e}catch(e){console.log(e)}return this},B.prototype.getVolume=function(){try{var e=this.item._box.dimensions._value,t=e.x*e.y*e.z}catch(e){console.log(e)}return t},B.prototype.setBoxImage=function(e){try{this.item._box.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},B.prototype.setBoxRepeat=function(e,t){try{this.item._box.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},B.prototype.setHeightType=function(e){try{1==e?this.item._box.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._box.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._box.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},B.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._box.distanceDisplayCondition=e}catch(e){console.log(e)}return this},B.prototype.setFill=function(e){try{this.item._box.fill=e}catch(e){console.log(e)}return this},B.prototype.setMaterialAlpha=function(e){try{this.item._box.material.color._value.alpha=e,this.item._box.show=!0}catch(e){console.log(e)}return this},B.prototype.setOutlineColor=function(e){try{this.item._box.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},B.prototype.setMaterial=function(e){try{this.item._box.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},B.prototype.setItem=function(e){this.item=e},B.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(B.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+255*this.item._box.backgroundColor._value.red+","+255*this.item._box.backgroundColor._value.green+","+255*this.item._box.backgroundColor._value.blue+","+255*this.item._box.backgroundColor._value.alpha+")")}}}),B.prototype.CreateBox=function(e,t,i,o,r,n,a,s){this._postion=e;var l,o={dimensions:new this._cesium.Cartesian3(o,t,i),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED},t=(r&&""!==r&&(o.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(r)),n&&""!==n&&(o.material=new m(this._viewer,this._cesium).colorFromHtmlColor(n)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),box:o,orientation:l}),{id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"box",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(a)?0:a),this},Object.defineProperties(B.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),Pr.prototype.createEllipsoid=function(e,t,i,o){var r={radii:new this._cesium.Cartesian3(60,60,60),material:this._cesium.Color.YELLOW},r=this._core.extend(r,t,!0),t=(this.item=this._viewer.entities.add({name:i,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[1]),ellipsoid:r}),{id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"ellipsoid",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},Pr.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipsoid.show||this.item.ellipsoid.show._value,e.radii=this.item.ellipsoid.radii?this.item.ellipsoid.radii.getValue():void 0,e.innerRadii=this.item.ellipsoid.innerRadii?this.item.ellipsoid.innerRadii.getValue():void 0,e.minimumClock=this.item.ellipsoid.minimumClock?this.item.ellipsoid.minimumClock._value:void 0,e.maximumClock=this.item.ellipsoid.maximumClock?this.item.ellipsoid.maximumClock._value:void 0,e.minimumCone=this.item.ellipsoid.minimumCone?this.item.ellipsoid.minimumCone._value:void 0,e.maximumCone=this.item.ellipsoid.maximumCone?this.item.ellipsoid.maximumCone._value:void 0,e.heightReference=this.item.ellipsoid.heightReference&&this.item.ellipsoid.heightReference._value?this.item.ellipsoid.heightReference._value:null,e.fill=this.item.ellipsoid.fill?this.item.ellipsoid.fill._value:void 0,e.material={},e.material.color=this.item.ellipsoid.material&&this.item.ellipsoid.material.color&&this.item.ellipsoid.material.color._value?"rgba"+this.item.ellipsoid.material.color.toString():null,e.material.image=this.item.ellipsoid.material&&this.item.ellipsoid.material.image?this.item.ellipsoid.material.image._value:void 0,e.material.repeat=this.item.ellipsoid.material&&this.item.ellipsoid.material.repeat&&this.item.ellipsoid.material.repeat._value?this.item.ellipsoid.material.repeat._value:null,e.outline=this.item.ellipsoid.outline?this.item.ellipsoid.outline._value:void 0,e.outlineWidth=this.item.ellipsoid.outlineWidth&&this.item.ellipsoid.outlineWidth._value?this.item.ellipsoid.outlineWidth._value:void 0,e.outlineColor=this.item.ellipsoid.outlineColor&&this.item.ellipsoid.outlineColor._value?"rgba"+this.item.ellipsoid.outlineColor.toString():null,e.stackPartitions=this.item.ellipsoid.stackPartitions&&this.item.ellipsoid.stackPartitions._value?this.item.ellipsoid.stackPartitions._value:void 0,e.slicePartitions=this.item.ellipsoid.slicePartitions&&this.item.ellipsoid.slicePartitions._value?this.item.ellipsoid.slicePartitions._value:void 0,e.subdivisions=this.item.ellipsoid.subdivisions&&this.item.ellipsoid.subdivisions._value?this.item.ellipsoid.subdivisions._value:void 0,e.near=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},Pr.prototype.executeEllipsoid=function(o){var r=this,n=(r.shape={tempPoints:[],button:0,position:{}},new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)),a=[],s=[];return n.setInputAction(function(e){var e=r._viewer.scene.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid),t=r._cesium.Cartographic.fromCartesian(e),i=r._cesium.Math.toDegrees(t.longitude),t=r._cesium.Math.toDegrees(t.latitude),t=(s.push({lon:i,lat:t}),0==r.shape.button?(a.push(e.clone()),a.push(e),r.shape.position=e,r.ellipsoid=r._viewer.entities.add({name:"",position:r._cesium.Cartesian3.fromDegrees(s[0].lon,s[0].lat),ellipsoid:{radii:new r._cesium.Cartesian3(67500,67500,67500),material:r._cesium.Color.fromRandom({alpha:1})}}),r.item=r.ellipsoid):1==r.shape.button&&(i=mr(s[0].lat,s[0].lon,s[1].lat,s[1].lon),r.item.ellipsoid.radii=new r._cesium.Cartesian3(i,i,i),n.destroy()),0),e=(r._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(t=F.selectedItem.id),r._core.getuid()),i={id:e,name:"新建球"+e,pId:r._core.isnull(t)?0:t,type:"ellipsoid",item:r};r.setTreeobj(i),F.insertGroupId(i,r._core.isnull(t)?0:t),"function"==typeof o&&o({polyline:{},positions:[],distance:[]}),r.shape.button=r.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t;1==r.shape.button&&(e=r._viewer.camera.pickEllipsoid(e.endPosition,r._viewer.scene.globe.ellipsoid))&&(e=r._cesium.Cartographic.fromCartesian(e),t=r._cesium.Math.toDegrees(e.longitude),e=r._cesium.Math.toDegrees(e.latitude),Math.ceil(r._viewer.camera.positionCartographic.height),s.push({lon:t,lat:e}),t=mr(s[0].lat,s[0].lon,s[s.length-1].lat,s[s.length-1].lon),r.item.ellipsoid.radii=new r._cesium.Cartesian3(t,t,t))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},Pr.prototype.setMaterialColor=function(e){try{this.item._ellipsoid.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Pr.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.ellipsoid.radii?void 0:this.item.ellipsoid.radii.getValue(),i=null==this.item.ellipsoid.fill?void 0:this.item.ellipsoid.fill.getValue(),o=this.item.ellipsoid.material,r=(null!=o&&(o={color:null==o.color._value?void 0:"rgba("+o.color._value.red+","+o.color._value.green+","+o.color._value.blue+","+o.color._value.alpha+")",image:null==o.image?void 0:o.image._value,diffusemap:null==o.diffusemap?void 0:o.diffusemap._value,alphamap:null==o.alphamap?void 0:o.alphamap._value}),null==this.item.ellipsoid.outline?void 0:this.item.ellipsoid.outline._value),n=null==this.item.ellipsoid.outlineColor?void 0:"rgba("+this.item.ellipsoid.outlineColor._value.red+","+this.item.ellipsoid.outlineColor._value.green+","+this.item.ellipsoid.outlineColor._value.blue+","+this.item.ellipsoid.outlineColor._value.alpha+")",a=null==this.item.ellipsoid.outlineWidth?void 0:this.item.ellipsoid.outlineWidth.getValue(),s=this.item.ellipsoid.distanceDisplayCondition,l=null==s?void 0:s._value.near,s=null==s?void 0:s._value.far,u=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"ellipsoid",position:{x:this._cesium.Math.toDegrees(u.longitude),y:this._cesium.Math.toDegrees(u.latitude),z:this._cesium.Math.toDegrees(u.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,radii:t,fill:i,material:o,outline:r,outlineColor:n,outlineWidth:a,near:l,far:s}}},Pr.prototype.setTreeobj=function(e){this.treeobj=e},Pr.prototype.setVisibility=function(e){this.item.show=e},Pr.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Pr.prototype.setHeightType=function(e){try{1==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipsoid.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipsoid.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Pr.prototype.setEllipsoidAlpha=function(e){try{this.item._ellipsoid.material.color._value.alpha=e,this.item._ellipsoid.show=!0}catch(e){console.log(e)}return this},Pr.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipsoid.distanceDisplayCondition=e}catch(e){console.log(e)}return this},Pr.prototype.setEllipsoidImage=function(e){try{this.item._ellipsoid.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},Pr.prototype.setEllipsoidRepeat=function(e,t){try{this.item._ellipsoid.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},Pr.prototype.setMaterial=function(e){try{this.item._ellipsoid.show=e}catch(e){console.log(e)}return this},Pr.prototype.setRadii=function(e){try{this.item._ellipsoid.radii=new this._cesium.Cartesian3(e,e,e)}catch(e){console.log(e)}return this},Pr.prototype.setItem=function(e){this.item=e},Pr.prototype.CreateSphere=function(e,t,i,o,r,n,a,s){this._postion=e;var l,t={radii:this._cesium.defaultValue(new this._cesium.Cartesian3(t,t,t),new this._cesium.Cartesian3(60,60,60)),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0},o=(o&&""!==o&&(t.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(o),t.outline=!0),r&&""!==r&&(t.material=new m(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipsoid:t,orientation:l}),{id:this.item.id,name:name,pId:this._core.isnull(a)?0:a,type:"ellipsoid",item:this});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(a)?0:a),this},Object.defineProperties(Pr.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),H.prototype.createRectangle=function(o,r){var n,a=this,s=this,l=(this._tree.removeHandler(),o=o||{},a.shape={points:[],button:0,rect:null,entity:null},{fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED}),u=(o&&o.fillColor&&(l.fillColor=new m(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(l.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),null),e=(this._tree.handler.setInputAction(function(e){n=s._getPosition.getMousePosition(e,[a.shape.entity]);var t,i,e=s._getPosition.getMouseDegrees(e,[a.shape.entity]);1<=a.shape.button?(t={obj1:u,obj2:e},i={position:s._viewer.camera.position.clone(),orientation:{heading:s._viewer.camera.heading,pitch:s._viewer.camera.pitch,roll:s._viewer.camera.roll}},"function"==typeof r&&r({originalCameraLocation:i,pointes:t,terrainExaggeration:"5",zj:"true"}),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)):u=e,a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(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:l.fillColor,outline:!0,outlineWidth:2,outlineColor:l.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference}}),a.shape.entity.rectangle.coordinates=new s._cesium.CallbackProperty(function(){return a.shape.rect},!1),a.bufferEntity=a.shape.entity,s.item=a.shape.entity):(s._core.mouse(s._viewer.container,0,"0"),a.shape.entity.rectangle.coordinates=s._cesium.Rectangle.clone(a.shape.rect),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.MOUSE_MOVE),s._tree.handler.removeInputAction(s._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),s._tree.handler.setInputAction(function(e){0!=a.shape.points.length&&(e=s._getPosition.getMousePosition(e,[a.shape.entity]))&&(a.shape.points[1]=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),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),0),t=(s._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(e=F.selectedItem.id),s._core.getuid()),t={id:t,name:"新建矩形"+t,pId:s._core.isnull(e)?0:e,type:"rectangle",item:s};return s.setTreeobj(t),F.insertGroupId(t,s._core.isnull(e)?0:e),this},H.prototype.getstyles=function(){var e={};return e.show=!this.item.rectangle.show||this.item.rectangle.show._value,e.coordinates=this.item.rectangle.coordinates?{east:this.item.rectangle.coordinates.getValue().east,north:this.item.rectangle.coordinates.getValue().north,south:this.item.rectangle.coordinates.getValue().south,west:this.item.rectangle.coordinates.getValue().west}:[],e.height=this.item.rectangle.height?this.item.rectangle.height.toString():0,e.heightReference=this.item.rectangle.heightReference?this.item.rectangle.heightReference.toString():0,e.extrudedHeight=this.item.rectangle.extrudedHeight?this.item.rectangle.extrudedHeight.getValue().toString():0,e.extrudedHeightReference=this.item.rectangle.extrudedHeightReference?this.item.rectangle.extrudedHeightReference.toString():0,e.rotation=this.item.rectangle.rotation?this.item.rectangle.rotation.toString():0,e.stRotation=this.item.rectangle.stRotation?this.item.rectangle.stRotation.toString():0,e.granularity=this.item.rectangle.granularity&&this.item.rectangle.granularity._value?this.item.rectangle.granularity._value:void 0,e.fill=this.item.rectangle.fill?this.item.rectangle.fill._value:0,e.outline=this.item.rectangle.outline?this.item.rectangle.outline._value:0,e.outlineWidth=this.item.rectangle.outlineWidth&&this.item.rectangle.outlineWidth._value?this.item.rectangle.outlineWidth._value.toString():1,e.outlineColor=this.item.rectangle.outlineColor&&this.item.rectangle.outlineColor._value?"rgba"+this.item.rectangle.outlineColor.toString():null,e.material={},e.material.color=this.item.rectangle.material&&this.item.rectangle.material.color&&this.item.rectangle.material.color._value?"rgba"+this.item.rectangle.material.color.toString():null,e.material.image=this.item.rectangle.material&&this.item.rectangle.material.image&&this.item.rectangle.material.image._value?this.item.rectangle.material.image.toString():null,e.material.repeat=this.item.rectangle.material&&this.item.rectangle.material.repeat&&this.item.rectangle.material.repeat._value?this.item.rectangle.material.repeat._value:null,e.classificationType=this.item.rectangle.classificationType?this.item.rectangle.classificationType.toString():null,e.near=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.near:null,e.far=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.far:null,e},H.prototype.createRectangleOptimization=function(o,r){var n,a=this,s=(this._tree.removeHandler(),a.shape={points:[],button:0,rect:null,entity:null},{fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED}),l=(o&&o.fillColor&&(s.fillColor=new m(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(s.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this.handler=new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas),null),e=(this.handler.setInputAction(function(e){n=a._core.getPointFromWindowPoint(e.position,a._viewer);var t,i,e=a._viewer.camera.pickEllipsoid(e.position,a._viewer.scene.globe.ellipsoid);1<=a.shape.button?(t={obj1:l,obj2:e},i={position:a._viewer.camera.position.clone(),orientation:{heading:a._viewer.camera.heading,pitch:a._viewer.camera.pitch,roll:a._viewer.camera.roll}},"function"==typeof r&&r({originalCameraLocation:i,pointes:t,terrainExaggeration:"5",zj:"true"}),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)):l=e,a.shape.button=a.shape.button+1,n&&(0==a.shape.points.length?(a.shape.points.push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n)),a.shape.rect=a._cesium.Rectangle.fromCartographicArray(a.shape.points),a.shape.rect.east+=1e-6,a.shape.rect.north+=1e-6,a.shape.entity=a._viewer.entities.add({rectangle:{coordinates:a.shape.rect,material:s.fillColor,outline:!0,outlineWidth:2,outlineColor:s.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference||1}}),a.shape.entity.objId=a.objId,a.shape.entity.rectangle.coordinates=new a._cesium.CallbackProperty(function(){return a.shape.rect},!1),a.bufferEntity=a.shape.entity,a.item=a.shape.entity):(a.state=1,a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE),a.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)),(i=a.createPoint(n,!1)).wz=a.gonRectangleArr.length,a.gonRectangleArr.push(i),a.positions.push(n))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t;0!=a.shape.points.length&&(t=a._core.getPointFromWindowPoint(e.endPosition,a._viewer))&&(e=a._viewer.camera.getPickRay(e.endPosition),a._viewer.scene.globe.pick(e,a._viewer.scene),a.shape.points[1]=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),a.shape.rect=a._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),0),t=(a._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(e=F.selectedItem.id),a._core.getuid()),t={id:t,name:"新建矩形"+t,pId:a._core.isnull(e)?0:e,type:"rectangle",item:a};return a.setTreeobj(t),F.insertGroupId(t,a._core.isnull(e)?0:e),this},H.prototype.startModify=function(){var o="拖动修改位置,右击删除该点";if(1==this.state||2==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var r=this,e=0;ee[1].lon?(t=e[1].lon,e[0].lon):(t=e[0].lon,e[1].lon),e=e[0].lat>e[1].lat?(i=e[0].lat,e[1].lat):(i=e[1].lat,e[0].lat);return new this._cesium.Rectangle.fromDegrees(t,e,o,i)},H.prototype.createRectanglelbj=function(e,o){var r,n=this,a=this,t=(n.shape={points:[],button:0,rect:null,entity:null},this._tree.removeHandler(),this.closeBrowseBorder(),0),i=(null!=e&&null!=e.id&&(t=e.id),this._core.CreateTooltip()),s=(a._tree.handler=new this._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas),null),l=null,e=(a._tree.handler.setInputAction(function(e){r=a._core.getPointFromWindowPoint(e.position,a._viewer);var t,i,e=a._viewer.camera.pickEllipsoid(e.position,a._viewer.scene.globe.ellipsoid);1<=n.shape.button?(t={obj1:s,obj2:l=e},i={position:a._viewer.camera.position.clone(),orientation:{heading:a._viewer.camera.heading,pitch:a._viewer.camera.pitch,roll:a._viewer.camera.roll}},a.llbj({originalCameraLocation:i,pointes:t,terrainExaggeration:"5",zj:"true"},n.shape.entity),"function"==typeof o&&o(n.shape.entity),a._tree.handler.removeInputAction(a._cesium.ScreenSpaceEventType.LEFT_CLICK)):s=e,n.shape.button=n.shape.button+1,r&&(0==n.shape.points.length?(n.shape.points.push(a._viewer.scene.globe.ellipsoid.cartesianToCartographic(r)),n.shape.rect=a._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.east+=1e-6,n.shape.rect.north+=1e-6,n.shape.entity=a._viewer.entities.add({rectangle:{coordinates:n.shape.rect,material:a._cesium.Color.YELLOW.withAlpha(0),outline:!0,outlineWidth:10,outlineColor:a._cesium.Color.YELLOW,height:0}}),n.shape.entity.rectangle.coordinates=new a._cesium.CallbackProperty(function(){return n.shape.rect},!1),a.item=n.shape.entity):2!=n.shape.points.length&&a._tree.handler.removeInputAction(a._cesium.ScreenSpaceEventType.MOUSE_MOVE))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),a._tree.handler.setInputAction(function(e){var t;0==n.shape.points.length?i.showAt(e.endPosition,"点击左键在球面上绘制矩形!"):l&&i.showAt(e.endPosition,"请将视野缩放到范围内以开启边界浏览"),0==n.shape.points.length||l||(i.showAt(e.endPosition,"再次点击结束绘制!"),(t=a._core.getPointFromWindowPoint(e.endPosition,a._viewer))&&(e=a._viewer.camera.getPickRay(e.endPosition),a._viewer.scene.globe.pick(e,a._viewer.scene),n.shape.points[1]=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),n.shape.rect=a._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.west==n.shape.rect.east&&(n.shape.rect.east+=1e-6),n.shape.rect.south==n.shape.rect.north&&(n.shape.rect.north+=1e-6)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),a._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||F.selectedItem.id,a._core.getuid()),e={id:e,name:"新建浏览边界"+e,pId:a._core.isnull(t)?0:t,type:"rectangle",item:a};return a.setTreeobj(e),F.insertGroupId(e,a._core.isnull(t)?0:t),this},H.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,i=(null!=t&&(t={east:t.east,north:t.north,south:t.south,west:t.west}),null==this.item.rectangle.height?void 0:this.item.rectangle.height._value),o=null==this.item.rectangle.extrudedHeight?void 0:this.item.rectangle.extrudedHeight._value,r=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,l=(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}),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,m=null==h?void 0:h._value.near,h=null==h?void 0:h._value.far;return{type:"rectangle",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,coordinates:t,height:i,extrudedHeight:o,rotation:r,stRotation:n,fill:a,material:s,outline:l,outlineColor:u,outlineWidth:c,near:m,far:h}}},H.prototype.setTreeobj=function(e){this.treeobj=e},H.prototype.llbj=function(e,t){for(var i,o,r=document.getElementById("toolTip"),t=(r.innerHTML="请将视野缩放到范围内以开启边界浏览",t.rectangle),t=(t.height=void 0,t.heightReference=void 0,t.perPositionHeight=!1,e.pointes),n=[],a=(n.push(t.obj1),n.push(t.obj2),{}),s=0;sa.west?a.east=i:a.west=i,o>a.south?a.north=o:a.south=o);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 l=this._viewer.camera.heading,u=this._viewer.camera.pitch,c=this._viewer.camera.roll,h=this._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:u,roll:c},position:h},d=this;d.flyListener=function(){var e=d._viewer.camera.computeViewRectangle(),t=e.west/Math.PI*180,i=e.north/Math.PI*180,o=e.east/Math.PI*180,e=e.south/Math.PI*180;d.isInArea({west:t,north:i,east:o,south:e},a)?(d._tree.removeHandler(),r.style.left="50%",r.style.top="50%",r.innerHTML="边界浏览已开启,右键结束边界浏览",setTimeout(function(){r.style.display="none"},2e3),d._viewer.scene.camera.changed.removeEventListener(d.flyListener),d.flyListener=void 0,d._tree.handler=new d._cesium.ScreenSpaceEventHandler(d._viewer.scene.canvas),d._viewEvent=function(e){m=d.limitView(a,m)},d._viewer.scene.camera.percentageChanged=.001,d._viewer.scene.camera.changed.addEventListener(d._viewEvent),d._tree.handler.setInputAction(function(e){d.closeBrowseBorder()},d._cesium.ScreenSpaceEventType.RIGHT_CLICK)):(l=d._viewer.camera.heading,u=d._viewer.camera.pitch,c=d._viewer.camera.roll,h=d._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:u,roll:c},position:h})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(d.flyListener)},H.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")},H.prototype.limitView=function(e,t){var i=this._viewer.camera.computeViewRectangle(),o=i.west/Math.PI*180,r=i.north/Math.PI*180,n=i.east/Math.PI*180,i=i.south/Math.PI*180;return this.isInArea({west:o,north:r,east:n,south:i},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}),t},H.prototype.isInArea=function(e,t){var i=!1;return i=e.south>t.south&&e.eastt.west?!0:i},H.prototype.createRectangledxkz=function(i){var o,r=this,n=this,a=(n.shape={points:[],rect:null,entity:null},null),s=null,l=new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas);function u(e){return"EllipsoidTerrainProvider"==r._viewer.scene.terrainProvider.constructor.name?r._viewer.camera.pickEllipsoid(e,r._viewer.scene.globe.ellipsoid):(e=r._viewer.scene.camera.getPickRay(e),r._viewer.scene.globe.pick(e,r._viewer.scene))}return l.setInputAction(function(e){o=u(e.position);var t,e=r._viewer.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid);(a=null==a?e:a).x==e.x&&a.y==e.y&&a.z==e.z||(s=e),o&&(0==n.shape.points.length?(n.shape.points.push(r._viewer.scene.globe.ellipsoid.cartesianToCartographic(o)),n.shape.rect=r._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.east+=1e-6,n.shape.rect.north+=1e-6,n.shape.entity=r._viewer.entities.add({rectangle:{coordinates:n.shape.rect,material:r._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:r._cesium.Color.RED,height:0}}),n.bufferEntity=n.shape.entity):(l.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE),l.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK),e={obj1:a,obj2:s},t={position:r._viewer.camera.position.clone(),orientation:{heading:r._viewer.camera.heading,pitch:r._viewer.camera.pitch,roll:r._viewer.camera.roll}},""!=i&&null!=i&&"function"==typeof i&&i({pointes:e,originalCameraLocation:t})))},r._cesium.ScreenSpaceEventType.LEFT_CLICK),l.setInputAction(function(e){0!=n.shape.points.length&&(e=u(e.endPosition))&&(n.shape.points[1]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),n.shape.rect=r._cesium.Rectangle.fromCartographicArray(n.shape.points),n.shape.rect.west==n.shape.rect.east&&(n.shape.rect.east+=1e-6),n.shape.rect.south==n.shape.rect.north&&(n.shape.rect.north+=1e-6),n.shape.entity.rectangle.coordinates=n.shape.rect)},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},H.prototype.executeExcavation=function(e){var i,o=this,r=this,n=(o.shape={points:[],button:0,rect:null,entity:null},new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)),a=[],t=(n.setInputAction(function(e){var t;i=r._core.getPointFromWindowPoint(e.position,r._viewer),2<=o.shape.button&&(e=o._viewer.scene.globe,o.shape.box=r._viewer.entities.add({position:r._cesium.Cartesian3.fromDegrees(a[0].lon,a[0].lat,100),box:{dimensions:new r._cesium.Cartesian3(1e4,1e4,1e4),material:r._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:r._cesium.Color.WHITE}}),e.depthTestAgainstTerrain=!0,e.clippingPlanes=new o._cesium.ClippingPlaneCollection({modelMatrix:o.shape.box.computeModelMatrix(r._cesium.JulianDate.now()),planes:[new r._cesium.Plane(new r._cesium.Cartesian3(1,0,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(-1,0,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(0,1,0),-700),new r._cesium.Plane(new r._cesium.Cartesian3(0,-1,0),-700)],edgeWidth:1,edgeColor:r._cesium.Color.WHITE}),n.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK)),o.shape.button=o.shape.button+1,i&&(0==o.shape.points.length?(o.shape.points.push(r._viewer.scene.globe.ellipsoid.cartesianToCartographic(i)),e=r._viewer.scene.camera.pickEllipsoid(movement.position,r._viewer.scene.globe.ellipsoid),e=r._cesium.Cartographic.fromCartesian(e),t=r._cesium.Math.toDegrees(e.longitude),e=r._cesium.Math.toDegrees(e.latitude),a.push({lon:t,lat:e}),o.shape.rect=r._cesium.Rectangle.fromCartographicArray(o.shape.points),o.shape.rect.east+=1e-6,o.shape.rect.north+=1e-6,o.shape.entity=r._viewer.entities.add({rectangle:{coordinates:o.shape.rect,material:r._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:r._cesium.Color.RED,height:0}}),o.bufferEntity=o.shape.entity,r.item=o.shape.entity):2!=o.shape.points.length&&(n.removeInputAction(r._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.removeInputAction(r._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){var t;0!=o.shape.points.length&&(t=r._core.getPointFromWindowPoint(e.endPosition,r._viewer))&&(e=r._viewer.camera.getPickRay(e.endPosition),r._viewer.scene.globe.pick(e,r._viewer.scene),o.shape.points[1]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),o.shape.rect=r._cesium.Rectangle.fromCartographicArray(o.shape.points),o.shape.rect.west==o.shape.rect.east&&(o.shape.rect.east+=1e-6),o.shape.rect.south==o.shape.rect.north&&(o.shape.rect.north+=1e-6),o.shape.entity.rectangle.coordinates=o.shape.rect)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),0),s=(r._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(t=F.selectedItem.id),r._core.getuid()),s={id:s,name:"新建矩形"+s,pId:r._core.isnull(t)?0:t,type:"rectangle",item:r};return r.setTreeobj(s),F.insertGroupId(s,r._core.isnull(t)?0:t),"function"==typeof e&&e(ploylinejl),this},H.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),null!=this._viewEvent&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))},H.prototype.setVisibility=function(e){this.item.show=e},H.prototype.getVisibility=function(){return this.item.show},H.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=e}catch(e){console.log(e)}return this},H.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},H.prototype.setRectangleColor=function(e){try{this.item._rectangle.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},H.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._rectangle.distanceDisplayCondition=e}catch(e){console.log(e)}return this},H.prototype.setPolygonImage=function(e){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},H.prototype.setRectangleRepeat=function(e,t){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},H.prototype.setOutlineColor=function(e){try{this.item._rectangle.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},H.prototype.setOutline=function(e){try{this.item._rectangle.outline=e}catch(e){console.log(e)}return this},H.prototype.setExtrudedHeight=function(e){try{this.item._rectangle.extrudedHeight=e}catch(e){console.log(e)}return this},H.prototype.setHeight=function(e){try{this.item._rectangle.height=e}catch(e){console.log(e)}return this},Object.defineProperties(H.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),H.prototype.setItem=function(e){this.item=e},Object.defineProperties(H.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(H.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(H.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(H.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(H.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(H.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(H.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}}}}),V.prototype.createCircle=function(e,t,i,o){var r={id:this._core.getuid(),semiMinorAxis:3e5,semiMajorAxis:3e5,height:2e5,material:this._cesium.Color.GREEN,outline:!0},r=this._Core.extend(r,t,!0),t=(this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),name:i,ellipse:r}),{id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"circle",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),greenCircle},V.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height._value:void 0,e.semiMajorAxis=this.item.ellipse.semiMajorAxis&&this.item.ellipse.semiMajorAxis.getValue()?this.item.ellipse.semiMajorAxis.getValue():void 0,e.semiMinorAxis=this.item.ellipse.semiMinorAxis&&this.item.ellipse.semiMinorAxis.getValue()?this.item.ellipse.semiMinorAxis.getValue():void 0,e.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,e.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,e.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,e.rotation=this.item.ellipse.rotation&&this.item.ellipse.rotation._value?this.item.ellipse.rotation._value:void 0,e.stRotation=this.item.ellipse.stRotation&&this.item.ellipse.stRotation._value?this.item.ellipse.stRotation._value:void 0,e.granularity=this.item.ellipse.granularity&&this.item.ellipse.granularity._value?this.item.ellipse.granularity._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,e.material={},e.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?"rgba"+this.item.ellipse.material.color.toString():void 0,e.material.image=this.item.ellipse.material&&this.item.ellipse.material.image?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,e.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,e.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,e.numberOfVerticalLines=this.item.ellipse.numberOfVerticalLines&&this.item.ellipse.numberOfVerticalLines._value?this.item.ellipse.numberOfVerticalLines._value:void 0,e.classificationType=this.item.ellipse.classificationType&&this.item.ellipse.classificationType._value?this.item.ellipse.classificationType._value:void 0,e.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,e.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},V.prototype.createCircleOptimization=function(e,t){this.style=e;var s=this;this.handler.setInputAction(function(e){e=s.getCatesian3FromPX(e.position,s._viewer,[s.circle]),0==s.positions.length&&s.positions.push(e.clone()),s.positions.push(e),e=s.createPoint(e,!1);0\n
\n
'+e.description+"
\n ":'
\n
'+e.name+"
\n
",$(".cesium-viewer").append(t),document.getElementById(e.id)),e.description?o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.y-157)+")":o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.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,{id:this.item.id,name:name,pId:this._core.isnull(i)?0:i,type:"Point",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this.item},G.prototype.getVisibility=function(){return this.item.show},G.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},G.prototype.setText=function(e){try{this.item._label.text=e}catch(e){console.log(e)}return this},G.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},G.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},G.prototype.setFillColorRgba=function(e,t,i,o){try{this.item._label.fillColor=new m(this._viewer,this._cesium).createColor(e,t,i,o)}catch(e){console.log(e)}},G.prototype.setFillColorHtml=function(e){try{this.item._label.fillColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._label.fillColor}catch(e){console.log(e)}},G.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},G.prototype.setBackgroundColorRgba=function(e,t,i,o){try{this.item._label.backgroundColor=new m(this._viewer,this._cesium).createColor(e,t,i,o)}catch(e){console.log(e)}},G.prototype.setBackgroundColorHtml=function(e){try{this.item._label.backgroundColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},G.prototype.setBackgroundColorAlpha=function(e){try{this.item._label.backgroundColor._value.alpha=e}catch(e){console.log(e)}},G.prototype.setFontSize=function(e){try{this.item._label.font=parseFloat(e)+"px sans-serif"}catch(e){console.log(e)}},G.prototype.setFillColorAlpha=function(e){try{this.item._label.fillColor._value.alpha=e}catch(e){console.log(e)}},G.prototype.showBackground=function(e){try{this.item._label.showBackground=e}catch(e){console.log(e)}},G.prototype.setOutlineWidth=function(e){try{this.item._label.outlineWidth=e}catch(e){console.log(e)}},G.prototype.setOutlineColorRgba=function(e,t,i,o){try{this.item._label.outlineColor=new this._cesium.Color(e,t,i,o)}catch(e){console.log(e)}},G.prototype.setOutlineColorHtml=function(e){try{this.item._label.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}},G.prototype.setOutlineColorAlpha=function(e){try{this.item._label.outlineColor._value.alpha=e}catch(e){console.log(e)}},G.prototype.setStyle_LabelStyle_FILL=function(e){try{this.item._label.style=this.LabelStyle_FILL}catch(e){console.log(e)}},G.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_FILL_AND_OUTLINE}catch(e){console.log(e)}},G.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._label.distanceDisplayCondition=e}catch(e){console.log(e)}return this},G.prototype.setStyle_LabelStyle_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_OUTLINE}catch(e){console.log(e)}},G.prototype.setItem=function(e){this.item=e},G.prototype.CreateLabel=function(e,t,i,o,r,n){this._postion=e;var a={id:this._core.getuid(),text:t,backgroundColor:o.BackgroundColor,font:o.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,scale:o.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(o.MinViewingHeight,o.MaxViewingHeight)},e=(o.Italic&&(a.font="italic "+a.font),o.Bold&&(a.font="Bold "+a.font),this._core.isnull(o)||this._core.isnull(o.IconColor)||"["==o.IconColor.toString().charAt(0)&&"]"==o.IconColor.toString().charAt(o.IconColor.length-1)||(this._core.isHtmlColor(o.IconColor)?a.fillColor=this._Color.colorFromHtmlColor(o.IconColor):(/^rgb/.test(o.IconColor)&&(a.fillColor=this._Color.rgbaStringToRgbaObj(o.IconColor)),1{i.push(Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height))}):"number"==typeof e[0]&&(i=Cesium.Cartesian3.fromDegreesArrayHeights(e));e=this._core.getSpaceDistancem(i,Cesium);return this.setFlycesium({positions:i,distance:e},t)},k.prototype.setFlycesium=function(e,t){for(var i=[],o=0;o{let t=m.position.getValue(this._viewer.clock.currentTime.clone());if(a.offset){var i=m.orientation.getValue(this._viewer.clock.currentTime.clone());let e;i&&(i=Cesium.Matrix3.fromQuaternion(i),i=Cesium.Matrix4.fromRotationTranslation(i,t),e=Cesium.Transforms.fixedFrameToHeadingPitchRoll(i)),t=o._core.setPositionOffset(t,a.offset,e)}return t},!1),h=new Cesium.CallbackProperty(()=>m.orientation.getValue(this._viewer.clock.currentTime.clone()),!1)):c=Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),a.trackedEntity){let e,t,i,o,r,n=(u.maximumCone-u.minimumCone)/2;h=new Cesium.CallbackProperty(()=>(t=a.trackedEntity.position.getValue(this._viewer.clock.currentTime.clone()),e=c.getValue?c.getValue():c,r=this._core.twoPointsHeadingPitchRoll(this._viewer,e,t),s=r.radius,i=r.heading-Math.PI/2,o=r.pitch-n,Cesium.Transforms.headingPitchRollQuaternion(e,new Cesium.HeadingPitchRoll(i,o,0))),!1)}var d=0,p=this._core.defaultValue(a.scanAngle,15),g=(this._scan=this._viewer.entities.add({position:c,orientation:h,ellipsoid:{...u,minimumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(r+d)},!1),maximumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(r+d+p)},!1),outline:l,material:this._core.defaultValue(a.scanColor&&this._cesium.Color.fromCssColorString(a.scanColor),this._cesium.Color.RED.withAlpha(.5))}}),this.item=this._viewer.entities.add({position:c,orientation:h,ellipsoid:u}),this._core.defaultValue(u.speed,1));function f(){(d+=.1*g)<=0&&g<0?(d=0,g=-g):n-p<=d&&0{"yaw"===e?r=t:"angle"===e?n=360{let e=this._viewer;e.entities.remove(this.item),e.entities.remove(this._scan),this._viewer.clock.onTick.removeEventListener(f)};t={id:this.item.id,name:e,pId:this._core.isnull(i)?0:i,type:"ellipsoid",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},j.prototype.ConicSensor=function(t,i,e={}){var o=Cesium.Cartesian3.distance(t,i),r=(e.angle||10)/2,n={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(o,o,o)},!1),outline:e.outline,material:Cesium.Color.RED.withAlpha(.2),outlineColor:Cesium.Color.WHITE.withAlpha(.2),maximumCone:Cesium.Math.toRadians(-r),minimumCone:Cesium.Math.toRadians(r)};e.color&&(n.material=Cesium.Color.fromCssColorString(e.color)),e.outlineColor&&(n.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor));let a=this._core.toDegrees(t),s=this._core.toDegrees(i),l,u,c=0,h=(this.item=this._viewer.entities.add({position:t,ellipsoid:n}),()=>{l=this._core.TwoPointAzimuth(a.lon,a.lat,s.lon,s.lat)+90,u=Math.acos((s.height-a.height)/o),u=Cesium.Math.toDegrees(u),this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(t,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(l,0)),Cesium.Math.toRadians(this._core.defaultValue(u,0)),Cesium.Math.toRadians(this._core.defaultValue(c,0))))});h();e={id:this.item.id,name:"锥形传感器",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this.changeStart=e=>{t=e,a=this._core.toDegrees(t),this.item.position=t,o=Cesium.Cartesian3.distance(t,i),h()},this.changeEnd=e=>{i=e,s=this._core.toDegrees(i),o=Cesium.Cartesian3.distance(t,i),h()},this.changeAngle=e=>{r=e/2,this.item.ellipsoid.maximumCone=Cesium.Math.toRadians(-r),this.item.ellipsoid.minimumCone=Cesium.Math.toRadians(r)},this},j.prototype.createRadarMask=function(e,t,i,o){var r=this._core.defaultValue((i=i||{}).radius,100),n=this._core.defaultValue(i.yaw,0),a=this._core.defaultValue(i.angle,60),r={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new this._cesium.Cartesian3(r,r,r),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(i.minLat,75)),minimumClock:this._cesium.Math.toRadians(n),maximumClock:this._cesium.Math.toRadians(n+a),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!1,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},n=this._core.extend(r,i,!0),a=("string"==typeof i.color&&(n.material=this._cesium.Color.fromCssColorString(i.color)),"string"==typeof i.outlineColor&&(n.outlineColor=this._cesium.Color.fromCssColorString(i.outlineColor)),this.item=this._viewer.entities.add({position:t,ellipsoid:n}),{id:this.item.id,name:e,pId:this._core.isnull(o)?0:o,type:"ellipsoid",item:this});return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),this},j.prototype.createConeRadar=function(o,e){e=e||{};var r=this,t=(r.lon=o[0],r.lat=o[1],r.height=this._core.defaultValue(o[2],3e3),this.planePosition=null,this.halfLen=r.height/2,this.lengthl=r.height,this.geoD=new this._cesium.EllipsoidGeodesic,this.startPt=this._cesium.Cartographic.fromDegrees(r.lon,r.lat,0),this.changenum=0,this.curCanvas="a",this._viewer.scene.globe.getHeight(this.startPt)||0);this._cesium.Color.fromCssColorString(r._core.defaultValue(e.color,"#0000ff")),this.item=this._viewer.entities.add({name:"Red cone",position:e.rotate?new this._cesium.CallbackProperty(function(){return r.lon>o[0]+.01&&r.lato[1]+.005&&r.lon>o[0]?r.lon-=1e-5:r.lon<=o[0]&&r.lat>o[1]?r.lat-=1e-5:r.lon+=1e-5,r.planePosition=r._cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height/2),r.planePosition},!1):r._cesium.Cartesian3.fromDegrees(r.lon,r.lat,(r.height+t)/2),orientation:e.rotate?new this._cesium.CallbackProperty(function(){var e=Cesium.Cartographic.fromDegrees(r.lon,o[1],0),e=(r.geoD.setEndPoints(r.startPt,e),r.geoD.surfaceDistance),t=Math.atan(e/r.halfLen),i=Cesium.Cartographic.fromDegrees(r.lon,r.lat,0),i=(r.geoD.setEndPoints(r.startPt,i),e=r.geoD.surfaceDistance,r.lengthl=Math.sqrt(e*e+r.halfLen*r.halfLen),Cesium.Cartographic.fromDegrees(o[0],r.lat,0)),i=(r.geoD.setEndPoints(r.startPt,i),e=r.geoD.surfaceDistance,Math.asin(e/r.lengthl)),e=new Cesium.HeadingPitchRoll(0,t,i);return Cesium.Transforms.headingPitchRollQuaternion(r.planePosition,e)},!1):void 0,cylinder:{length:e.rotate?new r._cesium.CallbackProperty(function(){return 2*r.lengthl},!1):r.height-t,topRadius:0,bottomRadius:r._core.defaultValue(e.radius,300),bottomSurface:!1,material:r._core.getConeRadarMaterial(e.color)}});t={id:this._core.getuid(),name:"新建卫星雷达",pId:0,type:"ConeRadar",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},j.prototype.setLength=function(e){try{this.item._cylinder.length=e}catch(e){console.log(e)}return this},j.prototype.createCylinderOptimization=function(e,t){this.style=e;var s=this;this.handler.setInputAction(function(e){var e=s.getCatesian3FromPX(e.position,s._viewer,[s.circle]),t=(0==s.positions.length&&s.positions.push(e.clone()),s.positions.push(e),s.createPoint(e,!1)),e=(0{e.show=t})},j.prototype.getVolume=function(){try{var e=0,t=this.item._cylinder.bottomRadius,i=(this.item._cylinder.topRadius,this.item._cylinder.length),e=0==t?3.14159*t*t*i/3:3.14159*t*t*i}catch(e){console.log(e)}return e},j.prototype.executeCone=function(o){var r=this,n=(r.shape={tempPoints:[],button:0,position:{}},new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)),a=[],s=[];return n.setInputAction(function(e){var e=r._viewer.scene.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid),t=r._cesium.Cartographic.fromCartesian(e),i=r._cesium.Math.toDegrees(t.longitude),t=r._cesium.Math.toDegrees(t.latitude);s.push({lon:i,lat:t});0==r.shape.button?(a.push(e.clone()),a.push(e),r.shape.position=e,r.cylinder=r._viewer.entities.add({name:"",position:r._cesium.Cartesian3.fromDegrees(s[0].lon,s[0].lat),cylinder:{length:100,show:!0,fill:!0,topRadius:0,bottomRadius:100,material:r._cesium.Color.RED}}),r.item=r.cylinder):1==r.shape.button?(i=mr(s[0].lat,s[0].lon,s[1].lat,s[1].lon),r.item.cylinder.bottomRadius=i):2==r.shape.button&&(n.destroy(),t=0,r._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(t=F.selectedItem.id),i={id:e=r._core.getuid(),name:"新建圆锥"+e,pId:r._core.isnull(t)?0:t,type:"cylinder",item:r},this.setTreeobj(i),F.insertGroupId(i,r._core.isnull(t)?0:t),"function"==typeof o&&o({polyline:{},positions:[],distance:[]})),r.shape.button=r.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){2==r.shape.button&&(e=r._viewer.camera.getPickRay(e.endPosition),e=r._viewer.scene.globe.pick(e,r._viewer.scene),r.item.cylinder.length=e.z)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},j.prototype.executeCylinder=function(o){var r=this,n=(r.shape={tempPoints:[],button:0,position:{}},new this._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas)),a=[],s=[];return n.setInputAction(function(e){var e=r._viewer.scene.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid),t=r._cesium.Cartographic.fromCartesian(e),i=r._cesium.Math.toDegrees(t.longitude),t=r._cesium.Math.toDegrees(t.latitude);s.push({lon:i,lat:t});0==r.shape.button?(a.push(e.clone()),a.push(e),r.shape.position=e,r.cylinder=r._viewer.entities.add({name:"",position:r._cesium.Cartesian3.fromDegrees(s[0].lon,s[0].lat),cylinder:{length:100,topRadius:0,bottomRadius:100,material:r._cesium.Color.RED}}),r.item=r.cylinder):1==r.shape.button?(i=mr(s[0].lat,s[0].lon,s[1].lat,s[1].lon),r.item.cylinder.bottomRadius=i,r.item.cylinder.topRadius=i):2==r.shape.button&&(n.destroy(),t=0,r._core.isnull(F.selectedItem)||"group"!=F.selectedItem.type||(t=F.selectedItem.id),i={id:e=r._core.getuid(),name:"新建圆柱"+e,pId:r._core.isnull(t)?0:t,type:"cylinder",item:r},r.setTreeobj(i),F.insertGroupId(i,r._core.isnull(t)?0:t),"function"==typeof o&&o({polyline:{},positions:[],distance:[]})),r.shape.button=r.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){2==r.shape.button&&(e=r._viewer.camera.getPickRay(e.endPosition),e=r._viewer.scene.globe.pick(e,r._viewer.scene),r.item.cylinder.length=e.z)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},j.prototype.setTopRadius=function(e){try{this.item._cylinder.topRadius=e}catch(e){console.log(e)}return this},j.prototype.setHeight=function(e){try{var t=this._cesium.Cartesian3.fromDegrees(-94.74211811500844,37.34584317651723,e);this.item._position._value.z=t.z}catch(e){console.log(e)}return this},j.prototype.deleteObject=function(){let t=this._viewer;t.entities.remove(this.item),this.wall&&(this.wall.forEach(e=>{t.entities.remove(e)}),this.wall=[])},j.prototype.setHeightType=function(e){try{1==e?this.item._cylinder.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._cylinder.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._cylinder.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},j.prototype.setCylinderImage=function(e){try{this.item._cylinder.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},j.prototype.setCylinderRepeat=function(e,t){try{this.item._cylinder.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},j.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._cylinder.distanceDisplayCondition=e}catch(e){console.log(e)}return this},j.prototype.setBottomRadius=function(e){try{this.item._cylinder.bottomRadius=e}catch(e){console.log(e)}return this},j.prototype.setShow=function(e){try{this.item._cylinder.show=e}catch(e){console.log(e)}return this},j.prototype.setMaterial=function(e){try{this.item._cylinder.material=e}catch(e){console.log(e)}return this},j.prototype.setMaterial=function(e){try{this.item._cylinder.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},j.prototype.setMaterialAlpha=function(e){try{this.item._cylinder.material.color._value.alpha=e,this.item._cylinder.show=!0}catch(e){console.log(e)}return this},j.prototype.setItem=function(e){this.item=e},j.prototype.CreateCone=function(e,t,i,o,r,n,a,s){this._postion=e;var l,t={topRadius:0,bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0},i=(o&&""!==o&&(t.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(o),t.outline=!0),r&&""!==r&&(t.material=new m(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:t,orientation:l}),{id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(a)?0:a),this},j.prototype.CreateCylinder=function(e,t,i,o,r,n,a,s){this._postion=e;var l,t={topRadius:this._cesium.defaultValue(t,2e4),bottomRadius:this._cesium.defaultValue(t,2e4),length:this._cesium.defaultValue(i,4e4),slices:this._cesium.defaultValue(n,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0},i=(o&&""!==o&&(t.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(o),t.outline=!0),r&&""!==r&&(t.material=new m(this._viewer,this._cesium).colorFromHtmlColor(r)),(e.Yaw||e.Pitch||e.Roll)&&(l=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(e.Yaw),this._cesium.Math.toRadians(e.Pitch),this._cesium.Math.toRadians(e.Roll)))),this.item=this._viewer.entities.add({name:s,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),cylinder:t,orientation:l}),{id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"cylinder",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(a)?0:a),this},Object.defineProperties(j.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{this._postion.Altitude=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(e){try{this._postion.AltitudeType=e}catch(e){console.log(e)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(e){try{this._postion.Cartesian=e}catch(e){console.log(e)}}},Distance:{get:function(){return this._postion.Distance},set:function(e){try{this._postion.Distance=e}catch(e){console.log(e)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(e){try{this._postion.Pitch=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(e){console.log(e)}}}}}),Nr.prototype.execute=function(e,t,i={},o){var r=this._viewer,n=this._cesium;if(this._point=new L(r,n),this._polyline=new R(r,n),this._polygon=new M(r,n),this._core,0==e&&0==t)return this._polyline.executePolyline(i,o);if(4==e&&1==t)return this._elevationContour.executeContourMaterial(o);if(0==e&&1==t)return this._polygon.executePolygon(i,o);if(0==e&&11==t)return this._polygon.executePolygonvideo(o,i);if(1==e&&1==t)return this._box.executeBox(o);if(1==e&&2==t)return this._cone.executeCone(o);if(1==e&&3==t)return this._cone.executeCylinder(o);if(1==e&&4==t)return this._ellipsoid.executeEllipsoid(o);if(1==e&&5==t)return this._rectangle.createRectangle(i,o);if(1==e&&6==t)return this._circle.executeClircle(o);if(1==e&&7==t)return this._polygon.executeSector(o,i);if(1==e&&8==t)return this._box.executeExcavation(i,o);if(1==e&&9==t)return this._box.executeExcavation(i,o);if(1==e&&10==t)return this._circle.executeClirclews(o);if(1==e&&11==t)return this._point.executePoint(o,i);if(1==e&&12==t)return this._rectangle.createRectangledxkz(o);if(0==e&&2==t)return this._polyline.executeHorizontals(o,i);if(0==e&&3==t)return this._polygon.executePolygoncl(o,i);if(0==e&&4==t)return this._polyline.executeHorizontal(o,i);if(0==e&&10==t)return this._polyline.executePolyline1(o,i);if(0==e&&5==t)return this._polyline.executeHeightTe(o,i);if(0==e&&6==t)return this._polyline.executeAnge(o,i);if(0==e&&9==t)return this._polyline.executeAngeSd(o,i);if(0!=e||7!=t){if(0==e&&8==t)return this._polygon.surfaceArea(i,o);if(0==e&&12==t)return this._polyline.executeAngle(o,i);if(0==e&&13==t)this._point.executePointp(o,i);else{if(2==e&&0==t)return this._polyline.executeProfile(i,o);if(2==e&&1==t)return this._polygon.executePolygonym(o);if(2==e&&2==t){let e=new M(r,n);return e.executePolygonymsd(i,o)}if(2==e&&3==t)return this._dynamicObject.executeFlycesium(o);if(2==e&&4==t)return this._polygon.executePolygonymsdtt(i,o);if(2==e&&5==t)return this._rectangle.createRectanglelbj(i,o);if(2==e&&6==t)return this._polyline.executeProfilePro(i,o);if(3==e&&0==t)""!=i&&null!=i&&(o=new Date(i),o=n.JulianDate.fromDate(o),r.clock.currentTime=o.clone());else if(3==e&&1==t)this._viewer.animation.viewModel.faster();else if(3==e&&2==t)this._viewer.animation.viewModel.slower();else if(3==e&&3==t)this._viewer.animation.viewModel.playForwardViewModel.command();else if(3==e&&4==t)this._viewer.animation.viewModel.playReverseViewModel.command();else if(3==e&&5==t)this._viewer.animation.viewModel.pauseViewModel.command();else if(3==e&&6==t)return r=n.Cartographic.fromCartesian(i),{lon:n.Math.toDegrees(r.longitude),lat:n.Math.toDegrees(r.latitude),hei:r.height}}}},jr.prototype.execute=function(e,t,i,o){return this._execute.execute(e,t,i,o)};var zr=Object.freeze({L_Click:"OnLButtonClk",L_DBL_Click:"OnLButtonDblClk",L_Down:"OnLButtonDown",L_Up:"OnLButtonUp",M_Click:"OnMButtonClk",M_Down:"OnMButtonDown",M_Up:"OnMButtonUp",R_Click:"OnRButtonClk",R_Down:"OnRButtonDown",R_Up:"OnRButtonUp",Move:"OnFrame",Wheel:"OnMouseWheel"});function Ur(e,t={}){this._viewer=e,this.radius=this.defaultValue(t.radius,50),this.minRadius=this.defaultValue(t.minRadius,1),this.maxRadius=this.defaultValue(t.maxRadius,50),this.blur=this.defaultValue(t.blur,.85),this.alpha=this.defaultValue(t.alpha,1),this.rectangleHeight=t.height,this.is3D=t.type&&-1this.maxRadius?this.maxRadius:e)=this.minRadius&&this.changeRadius(e)}},Ur.prototype.changeRadius=async function(e){for(var t in this.radius=e,this.heatmapInstance._store._radi)for(var i in this.heatmapInstance._store._radi[t])this.heatmapInstance._store._radi[t][i]=e;this.heatmapInstance._coordinator.emit("renderall",this.heatmapInstance._store._getInternalData()),this.updateHeatmap()},Ur.prototype.drawHeatmapRect=function(t,i){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);t=this.convertCanvasToImage(t);if(this.is3D)Object.assign(this._3DOption,i),this.create3DHeatmap(t);else{let e=void 0===this.rectangleHeight?Cesium.GroundPrimitive:Cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new e({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromDegrees(i.xMin,i.yMin,i.xMax,i.yMax),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!0,material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:t.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}},Ur.prototype.create3DHeatmap=function(t){let e=document.createElement("canvas"),i=this._3DOption;var o=i.width+1,r=i.height+1;e.width=o,e.height=r,t.onload=()=>{var e=new Cesium.GeometryInstance({geometry:this.create3DGeometry(i)}),e=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:t.src}}})}),asynchronous:!1});this._worldRectangle=this._viewer.scene.primitives.add(e),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}},Ur.prototype.create3DGeometry=function(e){var t=this.construct3DRectangle(e);return new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t.positions}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t.st})},indices:t.indexs,primitiveType:e.grid?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(t.positions)})},Ur.prototype.construct3DRectangle=function(i){var o=i.xMax-i.xMin,r=i.yMax-i.yMin,e=i.width,t=i.height,n=o/e,a=r/t,s=e,l=t+1;let u=[],c=[],h=[];for(let t=0;t{var t=this._viewer.scene.pickPosition(e.endPosition);t?(t=this._core.toDegrees(t),void 0!==(t=this.getValueFromDegrees(t))?this.tooltip.showAt(e.endPosition,t):this.tooltip.show(!1)):this.tooltip.show(!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE)):(this.tooltip.show(!1),this.tooltipHandler&&this.tooltipHandler.destroy(),this.tooltipHandler=void 0)},Ur.prototype.updateHeatmap=function(){this.heatmapcanvas=this.heatmapInstance._renderer.canvas;var e=this.convertCanvasToImage(this.heatmapcanvas);this._worldRectangle.appearance.material.uniforms.image=e.src},Ur.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},Ur.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},Ur.prototype.config=function(e){this.heatmapInstance.configure(e),this.updateHeatmap()},Ur.prototype.convertCanvasToImage=function(e){let t=new Image;return t.src=e.toDataURL("image/png"),t},Wr.prototype.defaultValue=function(e,t){return Cesium.defaultValue(e,t)},Wr.prototype.create=function(e){this.setData(e),this.flyTo&&this.flyToBounding()},Wr.prototype.setData=function(e){let o=1e3,r=-1e3,n=1e3,a=-1e3,s=-1/0,l=1/0;e.forEach(e=>{var t=e.x,i=e.y;o=Math.min(t,o),n=Math.min(i,n),r=Math.max(t,r),a=Math.max(i,a),s=Math.max(e.value,s),l=Math.min(e.value,l)});var t=r-o,i=a-n;let u={xMin:o-t/10,yMin:n-i/10,xMax:r+t/10,yMax:a+i/10},c;if(this._heatmap)c=this._heatmap.canvas,this._heatmap.clear();else{c=document.createElement("canvas"),document.body.appendChild(c),c.width=1e3,c.height=parseInt(1e3/(u.xMax-u.xMin)*(u.yMax-u.yMin));try{this._heatmap=createWebGLHeatmap({canvas:c,intensityToAlpha:!0})}catch(e){console.error(e)}}this.datas=[];let h=s-l;e.forEach(e=>{var t=(e.x-u.xMin)/(u.xMax-u.xMin)*c.clientWidth,i=(-(e.y-u.yMin)/(u.yMax-u.yMin)+1)*c.clientHeight;this.datas.push({x:t,y:i,size:this.radius,intensity:(e.value-l)/h})}),this._heatmap.addPoints(this.datas),this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display(),this.drawHeatmapRect(c,u),this.rectangle=Cesium.Rectangle.fromDegrees(u.xMin,u.yMin,u.xMax,u.yMax);t=Cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=t.radius},Wr.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})},Wr.prototype.drawHeatmapRect=function(e,t){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);e=this.convertCanvasToImage(e);let i=void 0===this.rectangleHeight?Cesium.GroundPrimitive:Cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new i({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromDegrees(t.xMin,t.yMin,t.xMax,t.yMax),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new Cesium.EllipsoidSurfaceAppearance({aboveGround:!1,material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)},Wr.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this._heatmap.clear(),this._heatmap.canvas.remove()},Wr.prototype.dynamicAdjust=function(e){e?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)},Wr.prototype.dynamicAdjustEvent=function(){if(this._heatmap&&this._viewer){var t=this._viewer.camera.positionCartographic;let e=(t.height-this._viewer.scene.globe.getHeight(t))/this.boundingRadius*this.maxRadius;(e=(e=(e=e.toFixed(1))>this.maxRadius?this.maxRadius:e)=this.minRadius&&this.changeRadius(e)}},Wr.prototype.updateHeatmap=function(){this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display();var e=this.convertCanvasToImage(this._heatmap.canvas);this._worldRectangle.appearance.material.uniforms.image=e.src},Wr.prototype.multiply=function(e){this._heatmap.multiply(e),this.updateHeatmap()},Wr.prototype.changeRadius=function(t){this.radius=t,this.datas.forEach(e=>{e.size=t}),this._heatmap.clear(),this._heatmap.addPoints(this.datas),this.updateHeatmap()},Wr.prototype.clamp=function(e,t){this._heatmap.clamp(e,t),this.updateHeatmap()},Wr.prototype.blur=function(){this._heatmap.blur(),this.updateHeatmap()},Wr.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},Wr.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},Wr.prototype.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t};const Yr=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function Jr(e){return e>>1^-(1&e)}function Kr(e,t,i,o,r=!0){let n;if(n=new(2===o?Uint16Array:Uint32Array)(e,t,i),!r)return n;let a=0;for(let e=0;e{i.unshift({val:100*Math.cos(Cesium.Math.toRadians(o[t])),color:e})}),Cesium.ExpandBySmartEarth.SlopeMapPallete=i,Cesium.ExpandBySmartEarth.isSlopeDirty=!0},$r.prototype.setWidth=function(e){this.width=e,this.Contour&&this.Contour.setWidth(this.width)},$r.prototype.setSpacing=function(e){this.spacing=e,this.Contour&&this.Contour.setSpacing(this.spacing)},$r.prototype.setStartColor=function(e){this.startColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},$r.prototype.setEndColor=function(e){this.endColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},$r.prototype.setMin=function(e){this.min[this.type]=e,"elevation"===this.type?this.shadingUniforms.minimumHeight=this.min[this.type]:this.render()},$r.prototype.setMax=function(e){this.max[this.type]=e,"elevation"===this.type?this.shadingUniforms.maximumHeight=this.max[this.type]:this.render()},$r.prototype.reset=function(){this.contourColor="#ff0000",this.startColor="#0055ff",this.endColor="#ff0000",this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()};var z={version:"1.0.0"},en="doublearrow",tn=.25,on=.3,rn=.85,nn=.15,an={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},sn={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13},U=(z.algorithm={},z.algorithm.doubleArrow=function(e){this.connPoint=null;var t={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((n=(this.points=e).length)<2)){if(2==n)return e;var i=this.points[0],o=this.points[1],r=this.points[2],n=e.length,n=(this.tempPoint4=3==n?z.algorithm.getTempPoint4(i,o,r):this.points[3],this.connPoint=3==n||4==n?U.PlotUtils.mid(i,o):this.points[4],e=U.PlotUtils.isClockWise(i,o,r)?(u=z.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),z.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(u=z.algorithm.getArrowPoints(o,this.connPoint,r,!1),z.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),u.length),a=(n-5)/2,s=u.slice(0,a),l=u.slice(a,5+a),u=u.slice(5+a,n),c=e.slice(0,a),h=e.slice(a,5+a),e=e.slice(5+a,n),c=U.PlotUtils.getBezierPoints(c),a=U.PlotUtils.getBezierPoints(e.concat(s.slice(1))),u=U.PlotUtils.getBezierPoints(u),n=c.concat(h,a,l,u),e=z.algorithm.array2Dto1D(n);t.controlPoint=[i,o,r,this.tempPoint4,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},z.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(n=(this.points=e).length)){if(2==n)return e;var i=this.points[0],o=this.points[1],r=this.points[2],n=(3==(n=e.length)?(this.tempPoint4=z.algorithm.getTempPoint4(i,o,r),this.tempPoint5=U.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=n<6?U.PlotUtils.mid(i,o):this.points[5],e=U.PlotUtils.isClockWise(i,o,r)?(u=z.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),z.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(u=z.algorithm.getArrowPoints(o,this.connPoint,r,!1),z.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),u.length),a=(n-5)/2,s=u.slice(0,a),l=u.slice(a,5+a),u=u.slice(5+a,n),c=e.slice(0,a),h=e.slice(a,5+a),e=e.slice(5+a,n),c=U.PlotUtils.getBezierPoints(c),a=U.PlotUtils.getBezierPoints(e.concat(s.slice(1))),u=U.PlotUtils.getBezierPoints(u),n=c.concat(h,a,l,u),e=z.algorithm.array2Dto1D(n);t.controlPoint=[i,o,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},z.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},z.algorithm.getArrowPoints=function(e,t,i,o){this.type=en,this.headHeightFactor=tn,this.headWidthFactor=on,this.neckHeightFactor=rn,this.neckWidthFactor=nn;var r=U.PlotUtils.mid(e,t),n=U.PlotUtils.distance(r,i),a=U.PlotUtils.getThirdPoint(i,r,0,.3*n,!0),s=U.PlotUtils.getThirdPoint(i,r,0,.5*n,!0),a=[r,U.PlotUtils.getThirdPoint(r,a,U.Constants.HALF_PI,n/5,o),U.PlotUtils.getThirdPoint(r,s,U.Constants.HALF_PI,n/4,o),i],r=z.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=r[0],n=r[4],o=U.PlotUtils.distance(e,t)/U.PlotUtils.getBaseLength(a)/2,i=z.algorithm.getArrowBodyPoints(a,s,n,o),a=i.length,o=i.slice(0,a/2),i=i.slice(a/2,a);return o.push(s),i.push(n),(o=o.reverse()).push(t),(i=i.reverse()).push(e),o.reverse().concat(r,i)},z.algorithm.getArrowHeadPoints=function(e,t,i){this.type=en,this.headHeightFactor=tn,this.headWidthFactor=on,this.neckHeightFactor=rn,this.neckWidthFactor=nn;var o=U.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],t=(U.PlotUtils.distance(t,i),o*this.headWidthFactor),i=o*this.neckWidthFactor,n=o*this.neckHeightFactor,o=U.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),e=U.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),n=U.PlotUtils.getThirdPoint(r,o,U.Constants.HALF_PI,t,!1),o=U.PlotUtils.getThirdPoint(r,o,U.Constants.HALF_PI,t,!0);return[U.PlotUtils.getThirdPoint(r,e,U.Constants.HALF_PI,i,!1),n,r,o,U.PlotUtils.getThirdPoint(r,e,U.Constants.HALF_PI,i,!0)]},z.algorithm.getArrowBodyPoints=function(e,t,i,o){for(var r=U.PlotUtils.wholeDistance(e),n=U.PlotUtils.getBaseLength(e)*o,a=(n-U.PlotUtils.distance(t,i))/2,s=0,l=[],u=[],c=1;c=U.Constants.HALF_PI&&i=Math.PI&&i<1.5*Math.PI?(o=a*Math.sin(i-Math.PI),r=a*Math.cos(i-Math.PI),n=U.PlotUtils.getThirdPoint(e,t,U.Constants.HALF_PI,o,!0),U.PlotUtils.getThirdPoint(t,n,U.Constants.HALF_PI,r,!0)):(o=a*Math.sin(2*Math.PI-i),r=a*Math.cos(2*Math.PI-i),n=U.PlotUtils.getThirdPoint(e,t,U.Constants.HALF_PI,o,!0),U.PlotUtils.getThirdPoint(t,n,U.Constants.HALF_PI,r,!1));return a},z.algorithm.tailedAttackArrow=function(e){e=z.algorithm.dereplication(e),this.tailWidthFactor=an.tailWidthFactor,this.swallowTailFactor=an.swallowTailFactor,this.swallowTailPnt=an.swallowTailPnt;var t={controlPoint:null,polygonalPoint:null};if(!((t.controlPoint=e).length<2)){if(2==e.length)return t.polygonalPoint=e,t;var i=e[0],o=e[1];U.PlotUtils.isClockWise(e[0],e[1],e[2])&&(i=e[1],o=e[0]);var e=[U.PlotUtils.mid(i,o)].concat(e.slice(2)),r=z.algorithm.getAttackArrowHeadPoints(e,i,o,an),n=r[0],a=r[4],s=U.PlotUtils.distance(i,o),l=U.PlotUtils.getBaseLength(e),u=l*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=U.PlotUtils.getThirdPoint(e[1],e[0],0,u,!0);u=z.algorithm.getAttackArrowBodyPoints(e,n,a,s/l),e=u.length,s=[i].concat(u.slice(0,e/2)),l=(s.push(n),[o].concat(u.slice(e/2,e)));l.push(a),s=U.PlotUtils.getQBSplinePoints(s),l=U.PlotUtils.getQBSplinePoints(l),i=z.algorithm.array2Dto1D(s.concat(r,l.reverse(),[this.swallowTailPnt,s[0]])),t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(i)}return t},z.algorithm.getAttackArrowHeadPoints=function(e,t,i,o){this.headHeightFactor=o.headHeightFactor,this.headTailFactor=o.headTailFactor,this.headWidthFactor=o.headWidthFactor,this.neckWidthFactor=o.neckWidthFactor,this.neckHeightFactor=o.neckHeightFactor;var o=U.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],n=U.PlotUtils.distance(r,e[e.length-2]),t=U.PlotUtils.distance(t,i),i=(o=o>t*this.headTailFactor?t*this.headTailFactor:o)*this.headWidthFactor,t=o*this.neckWidthFactor,n=(o=n{hn({type:"get",url:i+"/licenseEncryption/getLicenseSecret",success(e){hn({type:"post",url:i+"/licenseEncryption/getLicenseDecrypt",headers:{"Content-Type":"application/json"},data:JSON.stringify({data:e.data}),success(e){t(e.data)},error(){t({success:!1,message:"暂无许可权限"})}})},error(){t({success:!1,message:"暂无许可权限"})}})})}function un(e){return e.replace(/\\x(\w{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})}function cn(i){setInterval(()=>{let t=document.getElementById("sdkwarning");if(!t){let e=document.getElementById(i);(t=document.createElement("div")).id="sdkwarning",t.style.cssText=` position: absolute; top: 0; width: 100%; height: 100%; z-index: 9999999; background: rgba(0,0,0,0.8); color: #f00; font-size: 30px; text-align: center; padding-top: ${e.offsetHeight/2-30}px; `,t.innerHTML="暂无许可权限!",e.append(t),setTimeout(console.log.bind(console,"暂无许可权限!"),0)}},100)}function hn(e){let t=new XMLHttpRequest,i=!0;if(i=null==e.async||(null==e.async||e.async),t.open(e.type,e.url,i),e.headers)for(const o in e.headers)t.setRequestHeader(o,e.headers[o]);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)):200!==this.status&&e.error&&"function"==typeof e.error&&e.error(t),e.complete&&"function"==typeof e.complete&&e.complete()}}function mn(e,t,i,o,r,n,a){var s=new Cesium.Credit("WMTS"),i=(r=Cesium.defaultValue(r,{}),this._7=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._3=256,this._4=256,this._10=Cesium.defaultValue(r.fileExtension,"jpg"),this._9=r.proxy,this._12=r.tileDiscardPolicy,this._2=i,this._1=o,this._8=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._5=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._6=!0,this.baseurl=e,this.needaddone=t,n&&(this._0=n,this.baseurl2=a),Cesium.defaultValue(r.credit,s));"string"==typeof i&&(i=new Cesium.Credit(i)),this._11=i}function dn(t=8,i=16){var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");let r=[];if(i=i||o.length,t)for(let e=0;ehttp://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}function gn(){this._core=new v,this.level=0,this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.tileLevel={},this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,gn.prototype.ready||Object.defineProperties(gn.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0=e[1]&&t[0]>=e[0]?i=o+Math.PI:t[1]>=e[1]&&t[0]=e[0]&&(i=Math.PI-o),i},U.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=U.PlotUtils.getAzimuth(t,e)-U.PlotUtils.getAzimuth(t,i);return e<0?e+U.Constants.TWO_PI:e},U.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},U.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},U.PlotUtils.getCubicValue=function(e,t,i,o,r){var n=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=n*n,u=l*n;return[u*t[0]+3*l*e*i[0]+3*n*a*o[0]+s*r[0],u*t[1]+3*l*e*i[1]+3*n*a*o[1]+s*r[1]]},U.PlotUtils.getThirdPoint=function(e,t,i,o,r){e=U.PlotUtils.getAzimuth(e,t),r=r?e+i:e-i,e=o*Math.cos(r),i=o*Math.sin(r);return[t[0]+e,t[1]+i]},U.PlotUtils.getArcPoints=function(e,t,i,o){for(var r=[],n=(n=o-i)<0?n+U.Constants.TWO_PI:n,a=0;a<=U.Constants.FITTING_COUNT;a++){var s=i+n*a/U.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},U.PlotUtils.getBisectorNormals=function(e,t,i,o){var r,n,a=U.PlotUtils.getNormal(t,i,o),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,a=a[1]/s,u=U.PlotUtils.distance(t,i),c=U.PlotUtils.distance(i,o),s=s>U.Constants.ZERO_TOLERANCE?U.PlotUtils.isClockWise(t,i,o)?(r=[i[0]-(n=e*u)*a,i[1]+n*l],[i[0]+(n=e*c)*a,i[1]-n*l]):(r=[i[0]+(n=e*u)*a,i[1]-n*l],[i[0]-(n=e*c)*a,i[1]+n*l]):(r=[i[0]+e*(t[0]-i[0]),i[1]+e*(t[1]-i[1])],[i[0]+e*(o[0]-i[0]),i[1]+e*(o[1]-i[1])]);return[r,s]},U.PlotUtils.getNormal=function(e,t,i){var o=e[0]-t[0],e=e[1]-t[1],r=Math.sqrt(o*o+e*e),r=(o/=r,e/=r,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(r*r+i*i);return[o+(r/=t),e+(i/=t)]},U.PlotUtils.getCurvePoints=function(e,t){for(var i=[U.PlotUtils.getLeftMostControlPoint(t)],o=0;oU.Constants.ZERO_TOLERANCE?(e=U.PlotUtils.mid(s,l),r=s[0]-e[0],i=s[1]-e[1],o=U.PlotUtils.distance(s,l),n=u[0]-e[0],u=u[1]-e[1],a=e[0]+((i=-(o=2/o)*i)*i-(o=o*r)*o)*n+(r=2*i*o)*u,e[1]+r*n+(o*o-i*i)*u):(a=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[a,e]},U.PlotUtils.getRightMostControlPoint=function(e){var i,o,r,n,a,s=e.length,l=e[s-3],u=e[s-2],e=e[s-1],s=U.PlotUtils.getBisectorNormals(0,l,u,e)[1],l=U.PlotUtils.getNormal(l,u,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>U.Constants.ZERO_TOLERANCE?(l=U.PlotUtils.mid(u,e),r=e[0]-l[0],i=e[1]-l[1],o=U.PlotUtils.distance(u,e),n=s[0]-l[0],s=s[1]-l[1],a=l[0]+((i=-(o=2/o)*i)*i-(o=o*r)*o)*n+(r=2*i*o)*s,l[1]+r*n+(o*o-i*i)*s):(a=e[0]+t*(u[0]-e[0]),e[1]+t*(u[1]-e[1]));return[a,l]},U.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,o=0;o<=1;o+=.01){for(var r=0,n=0,a=0;a<=i;a++){var s=U.PlotUtils.getBinomialFactor(i,a),l=Math.pow(o,a),u=Math.pow(1-o,i-a);r+=s*l*u*e[a][0],n+=s*l*u*e[a][1]}t.push([r,n])}return t.push(e[i]),t},U.PlotUtils.getBinomialFactor=function(e,t){return U.PlotUtils.getFactorial(e)/(U.PlotUtils.getFactorial(t)*U.PlotUtils.getFactorial(e-t))},U.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},U.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var o=0;o<=i;o++)for(var r=0;r<=1;r+=.05){for(var n=0,a=0,s=0;s<=2;s++){var l=U.PlotUtils.getQuadricBSplineFactor(s,r);n+=l*e[o+s][0],a+=l*e[o+s][1]}t.push([n,a])}return t.push(e[e.length-1]),t},U.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},U.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},Object.defineProperties(mn.prototype,{tileWidth:{get:function(){return this._3}},tileHeight:{get:function(){return this._4}},defaultAlpha:{get:function(){return 1}},hasAlphaChannel:{get:function(){return!0}},maximumLevel:{get:function(){return this._1}},minimumLevel:{get:function(){return this._2}},tilingScheme:{get:function(){return this._7}},extent:{get:function(){return this._8}},rectangle:{get:function(){return this._5}},ready:{get:function(){return this._6}},minimumTerrainLevel:{get:function(){return 0}},maximumTerrainLevel:{get:function(){return 17}}}),mn.prototype.requestImage=function(e,t,i){this.needaddone&&(e+=1,t+=1,i+=1);var o=this.baseurl,o=(o=this._0&&i>this._0?this.baseurl2:o).replace("{x}",e);return o=(o=(o=o.replace("{l}",t%8)).replace("{y}",t)).replace("{z}",i+1),Cesium.ImageryProvider.loadImage(this,o)},Object.defineProperties(pn.prototype,{featureName:{get:function(){return this._featureName},set:function(e){this._featureName=e}},extractAttributes:{get:function(){return this._extractAttributes},set:function(e){this._extractAttributes=e}},xy:{get:function(){return this._xy}}}),pn.prototype.getElementsByTagNameNS=function(e,t,i){var o=[];if(e.getElementsByTagNameNS)o=e.getElementsByTagNameNS(t,i);else for(var r,n,a=e.getElementsByTagName("*"),s=0,l=a.length;s{for(var t in e.data.wfsLayerData)o=e.data.wfsLayerData[t]&&e.data.wfsLayerData[t].primitive,i=this.tileLevel[t].level,o&&i&&this.tileLevel[t].visible&&(this.level<=i.max&&this.level>=i.min?o.show=!0:o.show=!1)}),this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)}));function xn(){}function Dn(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function In(t,e){for(var i=!1,o=0,r="",n=0;n]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},Mn.tokenize=function(e){var t=new Mn(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},Rn.prototype={constructor:Rn,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value,i=(this.readNextToken(),this.parseConditionExpression());void 0!==e.logic&&e.logic==t&&void 0!==e.terms?e.terms.push(i):e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e,t=this.parseBaseExpression();return"operator"==this.currentToken.type&&(e=this.currentToken.value,this.readNextToken(),"operator"==this.currentToken.type&&(e+=" "+this.currentToken.value,this.readNextToken()),t={operator:e,left:t,right:this.parseBaseExpression()}),t},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},Rn.parse=function(e){return new Rn(e).parseExpressionsRecursively()},xn.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+On(e.WHERE):""}var i,o,r,n,a;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(a=e).SELECT?"SELECT "+a.SELECT.map(function(e){return e.name}).join(", "):"")+(void 0!==(a=e).FROM?" FROM "+a.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+(void 0!==(a=e).JOIN?(n="",a.JOIN.forEach(function(e){n+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(n+=" AS "+e.as),n+=" ON "+On(e.cond)}),n):"")+t(e)+(void 0!==(a=e)["GROUP BY"]?" GROUP BY "+a["GROUP BY"].map(function(e){return e.column}).join(", "):"")+(void 0!==(a=e)["ORDER BY"]?" ORDER BY "+a["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", "):"")+(void 0!==(a=e).LIMIT&&void 0!==a.LIMIT.nb&&0{var t=this.getPropValue(i,e.substring(1,e.length-1));o=o.replace(e,t)}),o=o.replaceAll("\\n","\n")}return o},Fn.prototype.getPropValue=function(e,t){return e[t]||(t.includes(":")?e[t.split(":")[1]]:void 0)},Fn.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o=ll(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)o=cl(o,"["+name+"]",i[name]);else o=cl(o,t,i[e.attributeName]);return o}if(void 0!==e.classification)return o=ul(e.classification,i);var r=e.classificationArray;return void 0!==r&&$(Object.keys(r)).each(function(e,t){t=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return ll(e.value);var i=void 0;return i=!0===ul(e,t)?ll(e.value):i}}(r[t],i);t&&(o=t)}),o}},Fn.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=Nn(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,"string"==typeof(i=this.applyConditionalClassification(e.lineToGroundLength,t))&&-1]+)\>)/g,r=o.exec(e="undefined"==e?"":e);null!=r;){try{var n=r[r.length-1],a=(0,eval)(n);e=e.replace(r[0],a)}catch(e){}r=o.exec(e)}return e},Fn.prototype.getPolygonStyle=function(e){return $.extend(!0,{},gl.DEFAULT_POLYGON_STYLE,e)},Fn.prototype.getLinestringStyle=function(e){return $.extend(!0,{},gl.DEFAULT_POLYLINE_STYLE,e)},Fn.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},gl.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},gl.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},gl.DEFAULT_MODEL_STYLE,e):null!=e.point?$.extend(!0,{},gl.DEFAULT_POINT_STYLE,e):gl.DEFAULT_POINT_STYLE},Fn.prototype.sanitizePositions=function(e){for(var t=0;t=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function m(e){var t;for($.grep(c._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t]/i"));return null!=o?o[1]:null}catch(e){return!1}}(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$(o.geometryResponseData).find("schema").attr("xmlns:sfs")),0==(t=$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element")).length&&(t=$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],t.each(function(){var e,t=$(this),i=t.attr("name"),t=t.attr("type");null==t?t="string":(e=t.match(/.*[:](\w+)/))&&(t=e[1]),o.geomFields.push({name:i,type:t})})}})}function vl(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(gl,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED.withAlpha(.5),pixelSize:5,outlineColor:Cesium.Color.WHITE.withAlpha(.5),outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),Object.defineProperties(W.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},boundingSphere:{get:function(){return Cesium.BoundingSphere.fromRectangle3D(this._boundingBox)}},Statistics:{get:function(){return this._statistics}}});var wl,bl=180/Math.PI;function Tl(e){this.Viewer=e,this._core=new v,this.colorTool=this._core.gradientColor()}function El(e,t){this._viewer=e,this._cesium=t}W.prototype.getRequestMaxFeatures=function(){return 1e3},W.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},W.prototype.updateFeatures=function(e,o){var t,i,r,n,a,s;e.length<=0?o():(t=this,i=[],$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)}),r=" {wfs_updates}",n="",$(e).each(function(){var e=this,t=''.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+=""+this+""+e[this]+""}),t+='',n+=t+=""}),r=" {wfs_updates}".replace("{wfs_updates}",n),a="Failed to save changes to server",e=fl(this.cleanUrl(this._url),this._subdomains),s=Cesium.TrustedServers.contains(e),$.ajax({dataType:"xml",type:"POST",data:r,xhrFields:{withCredentials:s},url:encodeURI(e),success:function(e){null==(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?o(a):o()},error:function(e,t,i){o(a)},timeout:1e4}))},W.prototype.getFeatures=function(e,t,r){var i=this,o=[],n=($(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)})," {wfs_filter} "),a=(n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3),""),e=(""!=e.replace(/[ ]/g,"")&&(a=(a="")+function e(t,i){if(t.operator){var o="";switch(t.operator.toLowerCase()){case"=":o="PropertyIsEqualTo";break;case"<>":o="PropertyIsNotEqualTo";break;case">":o="PropertyIsGreaterThan";break;case">=":o="PropertyIsGreaterThanOrEqualTo";break;case"<":o="PropertyIsLessThan";break;case"<=":o="PropertyIsLessThanOrEqualTo";break;case"like":o="PropertyIsLike"}var r=-1!=i.indexOf(t.right)?t.right:t.left,n="";n+=""+r+"";var a=null==(r=(r=-1!=i.indexOf(t.right)?t.left:t.right).replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n=n+(""+(r="like"==t.operator.toLowerCase()&&a?"%"+r+"%":r))+""}a="and"==t.logic.toLowerCase()?"And":"Or",n="";return 2==t.terms.length?n+=e(t.terms[0],i):n+=e({logic:a,terms:t.terms.slice(0,t.terms.length-1)},i),n=n+e(t.terms[t.terms.length-1],i)+""}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o)+""),n=n.replace("{wfs_filter}",a),fl(this.cleanUrl(this._url),this._subdomains)),a=Cesium.TrustedServers.contains(e);t.xhr=$.ajax({url:encodeURI(e),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:a},success:function(e){var o,t;!function(t,i){if(null==t)return!1;try{let e=eval;return null!=(new XMLSerializer).serializeToString(null!=t.context?t.context:t).match(e("/[<](([a-z]+):)?"+i+"[^>]*[>]/i"))}catch(e){return!1}}($(e),"FeatureCollection")?r(null,TELang.i18n("layer_error_reading_features")):(e=e,o=[],(t=0==(t=$(e).find("gml\\:featureMember")).length?$(e).find("featureMember"):t).each(function(){var e={},t=$(this).children().first(),i=(e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1),e.fid.match(/[.]?(\d+)$$/));i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$(this).text())}),o.push(e)}),r(o))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},W.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element"),t=(0==e.length&&(e=$(this.geometryResponseData).find("sequence").find("element")),[]);return e.each(function(){var e=$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},W.prototype.refresh=function(e){let t=this._tileManager.getAllTiles();if(t){var i=t.length;for(let e=0;e=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},W.prototype.isDestroyed=function(){return!1},W.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0{let t=(e=e&&"string"==typeof e?JSON.parse(e):e).filter(e=>e.LayerName===n);var i,o;"point"===r?(e=t[0],(t=e.Point).Line_Color=this.getSGColor(t.Line_Color),t.Image_Color=this.getSGColor(t.Image_Color),t.Text_Color=this.getSGColor(t.Text_Color),t.Background_Color=this.getSGColor(t.Background_Color),i=this.colorTool.colorRgb(this._core.defaultValue(t.Text_Color,"#ffffff")),o=this.colorTool.colorRgb(this._core.defaultValue(t.Background_Color,"#010101")),a={label:{text:{defaultValue:this._core.defaultValue(t.Text.match(/(\S*)<\/Value>/)[1],t.Text.match(/(\S*)<\/DefaultValue>/)[1])},scaleMPP:{defaultValue:t.Scale},fillColor:{defaultValue:{red:i[0]/255,green:i[1]/255,blue:i[2]/255,alpha:1}},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},font:{defaultValue:t.Text_Size},family:{defaultValue:this._core.defaultValue(t.Font,"Arial")},backgroundColor:{defaultValue:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:1}},scale:this._core.defaultValue(t.TextScale,1.5),backgroundOpacity:{defaultValue:t.Background_Opacity},italic:{defaultValue:t.Italic},bold:{defaultValue:t.Bold},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Cesium.Cartesian2(this._core.defaultValue(t.offsetX,0),this._core.defaultValue(t.offsetY,t.Image_file?-10:0)),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.Line_Color,"#ffffff")),outlineWidth:this._core.defaultValue(t.outlineWidth,2),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM},lineToGround:{defaultValue:t.Line_to_Ground},lineToGroundLength:{defaultValue:t.Line_Length},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(t.clampToGround,!0),pointHeight:this._core.defaultValue(t.pointHeight,void 0),minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:e.position_x,position_y:e.position_y,position_z:0==e.position_z?1e4:e.position_z,urls:e.Server,layer:e.ServerName},t.Line_Color&&a.label&&(a.label.style=Cesium.LabelStyle.FILL_AND_OUTLINE),t.Image_file&&(a.billboard={image:t.Image_file,scale:this._core.defaultValue(t.ImageScale,1),scaleMPP:{defaultValue:t.Scale},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},verticalOrigin:Cesium.VerticalOrigin.BOTTOM})):"polyline"===r?(i=t[0],(t=i.Line).Line_Color=this.getSGColor(t.Line_Color),t.Line_Width&&(2===t.Line_Width.length?t.Line_Width/=10:3===t.Line_Width.length&&(t.Line_Width/=100)),o=this.colorTool.colorRgb(this._core.defaultValue(t.Line_Color,"#ff0000")),a={polyline:{material:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:1},lineOpacity:parseInt(this._core.defaultValue(t.Line_Opacity,1)),width:parseInt(this._core.defaultValue(t.Line_Width,4)),near:t.Near,far:t.Far,clampToGround:this._core.defaultValue(t.clampToGround,!0),classificationType:option.classificationType},minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:i.position_x,position_y:i.position_y,position_z:0==i.position_z?1e4:i.position_z,urls:i.Server,layer:i.ServerName}):"polygon"===r&&(e=t[0],(t=e.data).fill=Cesium.Color.fromCssColorString(t.fill),t.outlineColor=Cesium.Color.fromCssColorString(t.outlineColor),a={polygon:{outlineColor:{defaultValue:t.outlineColor},outlineWidth:t.outlineWidth,fill:{defaultValue:t.fill.alpha},extrudedHeight:t.extrudedHeight||0,height:t.height,outline:t.outline,material:{defaultValue:t.fill},clampToGround:!t.extrudedHeight,classificationType:option.classificationType,fromKml:!0},altitudeMethod:2,altitudeOffset:{defaultValue:"0"},minimumLevel:this._core.defaultValue(t.level_min,0),maximumLevel:this._core.defaultValue(t.level_max,22),position_x:e.position_x,position_y:e.position_y,position_z:0==e.position_z?1e4:e.position_z,urls:e.Server,layer:e.ServerName})},error:()=>{console.log("获取样式配置失败!")}}),a};Xt=function(e,t,i){return t&&Sl(e.prototype,t),i&&Sl(e,i),e};function Sl(e,t){for(var i=0;ihttp://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:new Cesium.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new Cesium.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal"}function xl(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._tree=F}function Dl(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._color=new m(this._viewer,this._cesium),this._tree=F}El.prototype.BaiduImageryProvider=(Xt(Pl,[{key:"getTileCredits",value:function(e,t,i){}},{key:"requestImage",value:function(e,t,i){if(!this.ready)throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.");var o=this._tilingScheme.getNumberOfXTilesAtLevel(i),r=this._tilingScheme.getNumberOfYTilesAtLevel(i),e=this._url.replace("{x}",e-o/2).replace("{y}",r/2-t-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style);return Cesium.ImageryProvider.loadImage(this,e)}},{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(this.ready)return this._tileWidth;throw new Cesium.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},{key:"tileHeight",get:function(){if(this.ready)return this._tileHeight;throw new Cesium.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},{key:"maximumLevel",get:function(){if(this.ready)return this._maximumLevel;throw new Cesium.DeveloperError("maximumLevel must not be called before the imagery provider is ready.")}},{key:"minimumLevel",get:function(){if(this.ready)return 0;throw new Cesium.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},{key:"tilingScheme",get:function(){if(this.ready)return this._tilingScheme;throw new Cesium.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},{key:"rectangle",get:function(){if(this.ready)return this._rectangle;throw new Cesium.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},{key:"ready",get:function(){return!!this._url}},{key:"credit",get:function(){return this._credit}}]),Pl),xl.prototype.createBillboard=function(e={}){var t=this._core.defaultValue(e.id,this._core.getuid()),i={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,scale:e.scale||1,image:e.image,color:this._cesium.Color.WHITE,disableDepthTestDistance:1/0,distanceDisplayCondition:e.distanceDisplayCondition};let o;if(e.text)switch(o={text:e.text,font:`${e.fontSize||12}px 微软雅黑`,pixelOffset:e.fontOffset,fillColor:Cesium.Color.fromCssColorString(e.fontColor||"#fff"),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:1/0,distanceDisplayCondition:e.distanceDisplayCondition},e.textLocation){case"left":o.horizontalOrigin=Cesium.HorizontalOrigin.LEFT;break;case"right":o.horizontalOrigin=Cesium.HorizontalOrigin.RIGHGT;break;case"up":o.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case"down":o.verticalOrigin=Cesium.VerticalOrigin.BOTTOM}return this.item=this._viewer.entities.add({id:t,show:e.visibility,position:Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),label:o,billboard:i}),this.item.objectType="Billboard",e.data&&(this.item.data=e.data),this},xl.prototype.createBillboardbatch=function(e){for(var t={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},i=0;i=r*i&&(o=String(e.length),"circle"===this.option.style?t.billboard.image=this._drawCircle(this.option.gradient[i],o):t.billboard.image=this._drawClustering(this.option.gradient[i],o))}},Xl.prototype.clear=function(){this.dataSource.entities.removeAll(),this._cache={}},Xl.prototype.setVisibility=function(e){this.dataSource&&(this.dataSource.show=e)},Xl.prototype.deleteObject=function(){this.clear(),this._viewer.dataSources.remove(this.dataSource),Cesium.destroyObject(this)},Object.defineProperties(Xl.prototype,{enableCluster:{set:function(e){this.dataSource.clustering.enabled=e},get:function(){return this.dataSource.clustering.enabled}}});var Zl="uniform sampler2D colorTexture;\nuniform float brightness;\nuniform float contrast;\nuniform float saturation;\nvarying vec2 v_textureCoordinates;\nvec3 lerp(vec3 from, vec3 to, float t)\n{\nvec3 tmp;\ntmp.r = from.r + ( to.r - from.r ) * t;\ntmp.g = from.g + ( to.g - from.g ) * t;\ntmp.b = from.b + ( to.b - from.b ) * t;\nreturn tmp;\n}\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 adjustment = rgb * brightness;\nfloat gray = 0.2125 * adjustment.r + 0.7154 * adjustment.g + 0.0721 * adjustment.b;\nvec3 grayColor = vec3(gray);\nadjustment = lerp(grayColor, adjustment, saturation);\nvec3 avgColor = vec3(0.5);\nadjustment = lerp(avgColor, adjustment, contrast);\ngl_FragColor = vec4(adjustment, 1.0);\n}\n";function $l(e){return e.scene.colorAdjustment||(this.item=new Cesium.PostProcessStage({name:"czm_colorAdjustment",fragmentShader:Zl,uniforms:{brightness:1,contrast:1,saturation:1}}),this.item.enabled=!0,e.scene.postProcessStages.add(this.item),e.scene.colorAdjustment=this)}function eu(e){this._viewer=e,this._core=new v,this._tree=F}function tu(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._tree=F}function iu(e,t,i,o){this._extractAttributes=e,this._featureName=t||"featureMember",this._xy=o,this._gmlns=i||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}function ou(){this._core=new v,this.level=0,this._quadtree=void 0,this._loadTileEvent=new Cesium.Event,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.tileLevel={},this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,ou.prototype.ready||Object.defineProperties(ou.prototype,{quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(e){this._pauseStreaming=e}},streamSpeed:{get:function(){return this._streamSpeed},set:function(e){this._streamSpeed=e}},bestLevelAvailable:{get:function(){for(var e=0,t=0;t<22;t++)null!=this._numTilesInLevel[t]&&0new Cesium.Cartesian3(this.radius,this.radius,this.radius),!1),outline:i.outline,material:Cesium.Color.RED.withAlpha(.2),outlineColor:Cesium.Color.WHITE.withAlpha(.2),maximumCone:new Cesium.CallbackProperty(()=>Cesium.Math.toRadians(-this.angle),!1),minimumCone:new Cesium.CallbackProperty(()=>Cesium.Math.toRadians(this.angle),!1)},r=(i.color&&(o.material=Cesium.Color.fromCssColorString(i.color)),i.outlineColor&&(o.outlineColor=Cesium.Color.fromCssColorString(i.outlineColor)),e instanceof Cesium.Entity?e:void 0),n=t instanceof Cesium.Entity?t:void 0;r?this.startPosition=r.position.getValue(this._viewer.clock.currentTime.clone()):this.startPosition=e,this.degrees1=this._core.toDegrees(this.startPosition),n?this.endPosition=n.position.getValue(this._viewer.clock.currentTime.clone()):this.endPosition=t,this.degrees2=this._core.toDegrees(this.endPosition),this.item=this._viewer.entities.add({position:new Cesium.CallbackProperty(()=>(r&&(this.startPosition=r.position.getValue(this._viewer.clock.currentTime.clone()),this.degrees1=this._core.toDegrees(this.startPosition)),n&&(this.endPosition=n.position.getValue(this._viewer.clock.currentTime.clone()),this.degrees2=this._core.toDegrees(this.endPosition)),(r||n)&&(this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()),this.startPosition),!1),ellipsoid:o}),this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation();i={id:this.item.id,name:"锥形传感器",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},eu.prototype.getOrientation=function(){var e=this._core.twoPointsHeadingPitchRoll(this._viewer,this.startPosition,this.endPosition);this.heading=Cesium.Math.toDegrees(e.heading)+90,this.pitch=90-Cesium.Math.toDegrees(e.pitch)},eu.prototype.updateOrientation=function(){this.getOrientation(),this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.startPosition,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(this.heading,0)),Cesium.Math.toRadians(this._core.defaultValue(this.pitch,0)),Cesium.Math.toRadians(this._core.defaultValue(this.roll,0))))},eu.prototype.changeStart=function(e){this.startPosition=e,this.degrees1=this._core.toDegrees(this.startPosition),this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()},eu.prototype.changeEnd=function(e){this.endPosition=e,this.degrees2=this._core.toDegrees(this.endPosition),this.radius=Cesium.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()},eu.prototype.changeAngle=function(e){this.angle=e/2},eu.prototype.setTreeobj=function(e){this.treeobj=e},eu.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},eu.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},tu.prototype.createCorridor=function(e,t,i,o){var r={show:!0,material:this._cesium.Color.RED.withAlpha(.5),width:1e3};if(!this._core.isnull(i)){i=this._core.extend(r,i,!0);var n=[];if(t[0].x||t[0].y)if(void 0!==t[0].z)for(a=0;a{for(var t in e.data.wfsLayerData)o=e.data.wfsLayerData[t]&&e.data.wfsLayerData[t].primitive,i=this.tileLevel[t].level,o&&i&&this.tileLevel[t].visible&&(this.level<=i.max&&this.level>=i.min?o.show=!0:o.show=!1)}),this._quadtree.beginFrame(e),this._quadtree.render(e),this._quadtree.endFrame(e)}));function gu(){}function fu(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function _u(t,e){for(var i=!1,o=0,r="",n=0;n]/.test(this.currentChar)?this.readOperator():""===this.currentChar?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var e="",t=0,i=!1;/./.test(this.currentChar);){if(!i&&/['"`]/.test(this.currentChar))i=this.currentChar;else if(i&&this.currentChar==i)i=!1;else{if(!i){if(")"==this.currentChar&&t<=0)break;if("("==this.currentChar?t++:")"==this.currentChar&&t--,/[!=<>]/.test(this.currentChar))break}if(" "==this.currentChar&&t<=0)break}e+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(e)?{type:"logic",value:e}:/^(IN|IS|NOT|LIKE)$/i.test(e)?{type:"operator",value:e}:{type:"word",value:e}},readString:function(){var e="",t=this.currentChar;for(e+=this.currentChar,this.readNextChar();this.currentChar!=t&&""!==this.currentChar;)e+=this.currentChar,this.readNextChar();return e+=this.currentChar,this.readNextChar(),"."==this.currentChar?(e+=this.currentChar,this.readNextChar(),{type:"word",value:e+=this.readString().value}):{type:"string",value:e}},readGroupSymbol:function(){var e=this.currentChar;return this.readNextChar(),{type:"group",value:e}},readOperator:function(){var e=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(e+=this.currentChar,this.readNextChar()),{type:"operator",value:e}}},vu.tokenize=function(e){var t=new vu(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},wu.prototype={constructor:wu,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();"empty"==this.currentToken.type;)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var e=this.parseConditionExpression();"logic"==this.currentToken.type;){var t=this.currentToken.value,i=(this.readNextToken(),this.parseConditionExpression());void 0!==e.logic&&e.logic==t&&void 0!==e.terms?e.terms.push(i):e={logic:t,terms:[e,i].slice(0)}}return e},parseConditionExpression:function(){var e,t=this.parseBaseExpression();return"operator"==this.currentToken.type&&(e=this.currentToken.value,this.readNextToken(),"operator"==this.currentToken.type&&(e+=" "+this.currentToken.value,this.readNextToken()),t={operator:e,left:t,right:this.parseBaseExpression()}),t},parseBaseExpression:function(){var e="";return"word"==this.currentToken.type||"string"==this.currentToken.type?(e=this.currentToken.value,this.readNextToken()):"group"==this.currentToken.type&&(this.readNextToken(),e=this.parseExpressionsRecursively(),this.readNextToken()),e}},wu.parse=function(e){return new wu(e).parseExpressionsRecursively()},gu.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+bu(e.WHERE):""}var i,o,r,n,a;return void 0!==e.SELECT&&void 0!==e.FROM?(void 0!==(a=e).SELECT?"SELECT "+a.SELECT.map(function(e){return e.name}).join(", "):"")+(void 0!==(a=e).FROM?" FROM "+a.FROM.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+(void 0!==(a=e).JOIN?(n="",a.JOIN.forEach(function(e){n+=" "+e.type.toUpperCase()+" JOIN "+e.table,""!==e.as&&(n+=" AS "+e.as),n+=" ON "+bu(e.cond)}),n):"")+t(e)+(void 0!==(a=e)["GROUP BY"]?" GROUP BY "+a["GROUP BY"].map(function(e){return e.column}).join(", "):"")+(void 0!==(a=e)["ORDER BY"]?" ORDER BY "+a["ORDER BY"].map(function(e){return e.column+" "+e.order}).join(", "):"")+(void 0!==(a=e).LIMIT&&void 0!==a.LIMIT.nb&&0{var t=this.getPropValue(i,e.substring(1,e.length-1));o=o.replace(e,t)}),o=o.replaceAll("\\n","\n")}return o},Eu.prototype.getPropValue=function(e,t){return e[t]||(t.includes(":")?e[t.split(":")[1]]:void 0)},Eu.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o=Au(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(o))return o;if(o instanceof Cesium.Color)return o}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(o===t)o=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)o=Mu(o,"["+name+"]",i[name]);else o=Mu(o,t,i[e.attributeName]);return o}if(void 0!==e.classification)return o=Lu(e.classification,i);var r=e.classificationArray;return void 0!==r&&$(Object.keys(r)).each(function(e,t){t=function(e,t){if(void 0!==e&&0!==e.condition.length){if(void 0===e.func)return Au(e.value);var i=void 0;return i=!0===Lu(e,t)?Au(e.value):i}}(r[t],i);t&&(o=t)}),o}},Eu.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=Iu(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,"string"==typeof(i=this.applyConditionalClassification(e.lineToGroundLength,t))&&-1]+)\>)/g,r=o.exec(e="undefined"==e?"":e);null!=r;){try{var n=r[r.length-1],a=(0,eval)(n);e=e.replace(r[0],a)}catch(e){}r=o.exec(e)}return e},Eu.prototype.getPolygonStyle=function(e){return $.extend(!0,{},Hu.DEFAULT_POLYGON_STYLE,e)},Eu.prototype.getLinestringStyle=function(e){return $.extend(!0,{},Hu.DEFAULT_POLYLINE_STYLE,e)},Eu.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},Hu.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},Hu.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},Hu.DEFAULT_MODEL_STYLE,e):null!=e.point?$.extend(!0,{},Hu.DEFAULT_POINT_STYLE,e):Hu.DEFAULT_POINT_STYLE},Eu.prototype.sanitizePositions=function(e){for(var t=0;t=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function m(e){var t;for($.grep(c._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t]/i"));return null!=o?o[1]:null}catch(e){return!1}}(o.geometryResponseData,"sequence"),null==o.wfsNamespace&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$(o.geometryResponseData).find("schema").attr("xmlns:sfs")),0==(t=$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element")).length&&(t=$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],t.each(function(){var e,t=$(this),i=t.attr("name"),t=t.attr("type");null==t?t="string":(e=t.match(/.*[:](\w+)/))&&(t=e[1]),o.geomFields.push({name:i,type:t})})}})}function ju(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(Hu,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:Cesium.Color.GREEN,outline:!0,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:Cesium.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:Cesium.Color.RED.withAlpha(.5),pixelSize:5,outlineColor:Cesium.Color.WHITE.withAlpha(.5),outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:Cesium.LabelStyle.FILL,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}}),Object.defineProperties(J.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(e){this.setVisibility(e)}},BoundingBox:{get:function(){return this._boundingBox}},boundingSphere:{get:function(){return Cesium.BoundingSphere.fromRectangle3D(this._boundingBox)}},Statistics:{get:function(){return this._statistics}}});var zu,Uu=180/Math.PI;function Wu(){this._quadtree=void 0,this._tilingScheme=new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._loadTileEvent=new Cesium.Event,this._levelZeroMaximumError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,128,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL}function Yu(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=ec.indexOf(t=t),t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(ec[e]._parentCollection),ec[e]=t):ec.push(t),!1})}function Ju(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function Ku(e,t,i){Cesium.when.all(e,function(){viewer.scene.primitives.remove(i)}),t._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Qu(e,t){Ku($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function qu(e,t){Ku($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function Xu(e,t){viewer.scene.primitives.remove(t)}function Zu(e,t){Ku([e.readyPromise],e,t)}J.prototype.getRequestMaxFeatures=function(){return 1e3},J.prototype.isAttributeField=function(e,t){return!(!t||!e||""==e.toLowerCase()||"fid"==e.toLowerCase())&&("string"==t.toLowerCase()||"integer"==t.toLowerCase()||"double"==t.toLowerCase())},J.prototype.updateFeatures=function(e,o){var t,i,r,n,a,s;e.length<=0?o():(t=this,i=[],$(this.geomFields).each(function(){t.isAttributeField(this.name,this.type)&&i.push(this.name)}),r=" {wfs_updates}",n="",$(e).each(function(){var e=this,t=''.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+=""+this+""+e[this]+""}),t+='',n+=t+=""}),r=" {wfs_updates}".replace("{wfs_updates}",n),a="Failed to save changes to server",e=Vu(this.cleanUrl(this._url),this._subdomains),s=Cesium.TrustedServers.contains(e),$.ajax({dataType:"xml",type:"POST",data:r,xhrFields:{withCredentials:s},url:encodeURI(e),success:function(e){null==(new XMLSerializer).serializeToString(e.documentElement).toLowerCase().match(/success\s*\//)?o(a):o()},error:function(e,t,i){o(a)},timeout:1e4}))},J.prototype.getFeatures=function(e,t,r){var i=this,o=[],n=($(this.geomFields).each(function(){i.isAttributeField(this.name,this.type)&&o.push(this.name)})," {wfs_filter} "),a=(n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3),""),e=(""!=e.replace(/[ ]/g,"")&&(a=(a="")+function e(t,i){if(t.operator){var o="";switch(t.operator.toLowerCase()){case"=":o="PropertyIsEqualTo";break;case"<>":o="PropertyIsNotEqualTo";break;case">":o="PropertyIsGreaterThan";break;case">=":o="PropertyIsGreaterThanOrEqualTo";break;case"<":o="PropertyIsLessThan";break;case"<=":o="PropertyIsLessThanOrEqualTo";break;case"like":o="PropertyIsLike"}var r=-1!=i.indexOf(t.right)?t.right:t.left,n="";n+=""+r+"";var a=null==(r=(r=-1!=i.indexOf(t.right)?t.left:t.right).replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n=n+(""+(r="like"==t.operator.toLowerCase()&&a?"%"+r+"%":r))+""}a="and"==t.logic.toLowerCase()?"And":"Or",n="";return 2==t.terms.length?n+=e(t.terms[0],i):n+=e({logic:a,terms:t.terms.slice(0,t.terms.length-1)},i),n=n+e(t.terms[t.terms.length-1],i)+""}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o)+""),n=n.replace("{wfs_filter}",a),Vu(this.cleanUrl(this._url),this._subdomains)),a=Cesium.TrustedServers.contains(e);t.xhr=$.ajax({url:encodeURI(e),type:"POST",data:n,dataType:"xml",xhrFields:{withCredentials:a},success:function(e){var o,t;!function(t,i){if(null==t)return!1;try{let e=eval;return null!=(new XMLSerializer).serializeToString(null!=t.context?t.context:t).match(e("/[<](([a-z]+):)?"+i+"[^>]*[>]/i"))}catch(e){return!1}}($(e),"FeatureCollection")?r(null,TELang.i18n("layer_error_reading_features")):(e=e,o=[],(t=0==(t=$(e).find("gml\\:featureMember")).length?$(e).find("featureMember"):t).each(function(){var e={},t=$(this).children().first(),i=(e.layerId=t[0].nodeName,e.originFid=t.attr("fid"),e.fid=t.attr("fid"),null==e.fid&&(e.fid=-1),e.fid.match(/[.]?(\d+)$$/));i&&(e.fid=i[1]),e.node=t[0],t.children().each(function(){e[this.nodeName]=this.innerHTML,null==e[this.nodeName]&&(e[this.nodeName]=$(this).text())}),o.push(e)}),r(o))},error:function(e,t,i){r(null,e.statusText)},timeout:1e4})},J.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element"),t=(0==e.length&&(e=$(this.geometryResponseData).find("sequence").find("element")),[]);return e.each(function(){var e=$(this);"geom"!=e.attr("name").toLowerCase()&&t.push(e.attr("name").toLowerCase())}),this.featureColumnNames=t,this.featureColumnNames},J.prototype.refresh=function(e){let t=this._tileManager.getAllTiles();if(t){var i=t.length;for(let e=0;e=this._level.min&&e.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(e))},J.prototype.isDestroyed=function(){return!1},J.prototype.destroy=function(){var e=this._tileManager.getAllTiles(),t=e.length;if(0{r.push(Cesium.Cartesian3.fromDegrees(e.x,e.y))}),this.item=this._viewer.entities.add({name:e.name,id:e.id||this._core.getuid(),wall:{positions:r,material:Cesium.Color.fromCssColorString(e.color||"#f00").withAlpha(n),minimumHeights:new Array(r.length).fill(e.bottomHeight),maximumHeights:new Array(r.length).fill(e.topHeight)}}),this.item.objectType="wall"}else{n={show:!0,minimumHeights:[100,100,100,100,100,100,100],maximumHeights:[2e3,2e3,2e3,2e3,2e3,2e3,2e3],material:this._cesium.Color.AQUA.withAlpha(1)};if(this._core.isnull(i))return void console.log("options is required");i=this._core.extend(n,i,!0);n=new v;if(i&&"ImageMaterialProperty"==i.material?i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,0,i.id):i&&"DrawCanvasColorUpdown"==i.material&&(i.material=n.setImageMaterialProperty("../../img/arrow.png",this._cesium,1,i.id)),e[0].x||e[0].y)if(void 0!==e[0].z)for(a=0;at.cacheMaxLevel?(a.show=!0,s.maximumTerrainLevel=e[1],s.show=!0):(a.show=!0,s.show=!1),e[0]>t.cacheMaxLevel?(a.show=!1,s.minimumTerrainLevel=e[0],s.show=!0):(a.show=!0,s.minimumTerrainLevel=t.cacheMaxLevel)):(e>t.cacheMaxLevel?(a.show=!1,s.minimumTerrainLevel=e):(a.show=!0,s.minimumTerrainLevel=t.cacheMaxLevel),s.show=!0)}else a.show=!0,s.minimumTerrainLevel=t.cacheMaxLevel,s.show=!0;this.availability=a.availability;a.show&&(l=new this._cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl(t.cacheUrl),fileExtension:t.fileExtension}),this.item=new this._cesium.ImageryLayer(l,a),this._viewer.imageryLayers.add(this.item,o)),this.items||(this.items=[]);s.show&&(t.minimumLevel=s.minimumTerrainLevel|t.cacheMaxLevel,s.maximumTerrainLevel&&(t.maximumLevel=s.maximumTerrainLevel),l=new this._cesium.WebMapServiceImageryProvider(t),this.item?(u=this.items.push(new this._cesium.ImageryLayer(l,s)),this._viewer.imageryLayers.add(this.items[u-1],o+1)):(this.item=new this._cesium.ImageryLayer(l,s),this._viewer.imageryLayers.add(this.item,o+1))),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item),this._core.isnull(t.id)&&(t.id=this._core.getuid());var l,u={id:t.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",checked:r,item:this};return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),this},hc.prototype.createPolylineImageryProviderer=function(e,t,i,o){var t=this._core.extend({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},t,!0),r=new this._cesium.WebMapTileServiceImageryProvider(t),r=(this.item=this._viewer.imageryLayers.addImageryProvider(r),"function"==typeof o&&o(this.item),this._core.isnull(t.id)&&(t.id=this._core.getuid()),{id:t.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",item:this});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},hc.prototype.createterrainProvider=function(e,t,i,o){var t=this._core.extend({url:""},t,!0),r=new this._cesium.CesiumTerrainProvider(t),r=(this._viewer.terrainProvider=r,this.item=this._viewer.terrainProvider,"function"==typeof o&&o(dataSource),this._core.isnull(t.id)&&(t.id=this._core.getuid()),{id:t.id,name:e,pId:this._core.isnull(i)?0:i,type:"terrainProvider",item:this});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},hc.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}}},hc.prototype.setTreeobj=function(e){this.treeobj=e},hc.prototype.getLevel=function(){var e,t,i,o=this._viewer.camera;try{i=o&&o.positionCartographic&&o.positionCartographic.height?(e=(e=this._viewer.scene.globe.getHeight(o.positionCartographic))||0,t=o.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(t/91610.74,7096758e-11))-40467.74)):0}catch(e){}return i},hc.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=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},gc.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},gc.prototype._loadTile=function(e,t){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2this._upperLevelLimit&&(t._tileKeys=[],t._removeObsoletePrimitives(t._primitiveByTile,[]),l=[]),(l=2=i-2}):l).sort(function(e,t){return-(e.level-t.level)}),l=l.filter(function(e){return t._isTileInRange(e)}),this._upperLevelLimit&&(l=this._refineTiles(l,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=n,this._viewer.scene.primitives.remove(this.dx),this.dx={},this._primitiveByTile={},o=[],r=0,s=this._viewer.camera.computeViewRectangle(),l=this._radianToDegree(s.west),n=this._radianToDegree(s.south),a=this._radianToDegree(s.east),s=this._radianToDegree(s.north),this.UrlData.area="RECT("+l+" "+n+","+a+" "+s+")",l="",e<=this.minLevel1||"Infinity"==e?(this.cluster="city",this.UrlData.cluster=this.cluster,l=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):e>this.minLevel1&&this.minLevel3>e?(this.cluster="county",this.UrlData.cluster=this.cluster,l=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):e>=this.minLevel3&&(this.cluster="",l=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),t._fetch(l).then(function(e){e=t._loadTile(e,t.cluster);t._primitiveCollection=e,0<=++r&&(t._tileKeys=o,t._removeObsoletePrimitives(t._primitiveByTile,o))}).catch(function(e){0<=++r&&(t._tileKeys=o,t._removeObsoletePrimitives(t._primitiveByTile,o)),e.message}))},gc.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level\n
'+d.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),s=document.getElementById(e.id)),e.description?s.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-157)+")":s.style.transform="matrix(1, 0, 0, 1, "+l.x+", "+(l.y-134)+")"}u&&(h||d.setVisibility(!1),u=!1)},"function"==typeof m&&m(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"),{id:c.id,name:e,checked:h,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:c});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},fc.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(e,t,s,i,l,o){var r={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},u=this,r=new y(this._viewer,this._cesium,r),r=((this._Provider=r)._loadTile=function(e){var o,r,n=new u._cesium.PointPrimitiveCollection,a=(u.optiontext=[],e.features.forEach(function(e){var t,i=options.pointHeight,i=(null!=e.properties.height&&(i=parseFloat(e.properties.height)+i),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)&&(t=options.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[t])),s.position=new u._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(t=s.text.replace(/\[/,"").replace(/\]/,""),s.text=e.properties[t]),u._core.getuid());n.add({id:"DivPoint"+i,position:Cartesian3,color:u._cesium.Color.YELLOW,description:s.text}),u.optiontext.push(option.text)}),u.pointPrimitive=u._viewer.scene.primitives.add(n),!0);return u.pointPrimitive.update=function(){for(var e,t,i=0;i\n
'+u.optiontext[i]+"
\n ",$(".cesium-viewer").append(t),o=document.getElementById(e.id)),e.description?o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.y-157)+")":o.style.transform="matrix(1, 0, 0, 1, "+r.x+", "+(r.y-134)+")"}a&&(l||u.setVisibility(!1),a=!1)},u.item=n,""},r.addTo(this._viewer),l||this.setVisibility(!1),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"+s.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t.url,style:s});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item),this},fc.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,n,i,o,r){var a={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,Cesium:this._cesium},s=this,a=(n.material,s._core.isnull(n)||s._core.isnull(n.color)||/^\[/.test(n.color)&&"["==n.color.toString().charAt(0)&&"]"==n.color.toString().charAt(n.color.length-1)||(s._core.isHtmlColor(n.color)?n.color=s._color.colorFromHtmlColor(n.color):(/^rgb/.test(n.color)&&(n.color=s._color.rgbaStringToRgbaObj(n.color)),1=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},bc.prototype.isT_Intersects_E=function(e,t){var i=e.west*Cesium.Math.RADIANS_PER_DEGREE,o=e.east*Cesium.Math.RADIANS_PER_DEGREE,r=e.south*Cesium.Math.RADIANS_PER_DEGREE,e=e.north*Cesium.Math.RADIANS_PER_DEGREE,i=new Cesium.Rectangle(i,r,o,e);return Cesium.Rectangle.intersection(i,t,new Cesium.Rectangle)},bc.prototype.sTag=function(e,t,i){if(null==this._subdomains)return"";e=(e+t+i)%this._subdomains.length;return this._subdomains[e]},bc.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==Cc.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},bc.prototype.findDirectParent=function(e,t){function a(e,t,i){if(e._rectangle.width<=t.width*(i?4.1:2.1)&&Cesium.Rectangle.contains(e._rectangle,Cesium.Rectangle.center(t)))return e;for(var o=e.children.length,r=0;r=a-s&&t._buffer[n]<=a+s?e._buffer[n]:t._buffer[n]*l+u:t._buffer[n]?t._buffer[n]*l+u:e._buffer[n];return this.arrayToHeightmapTerrainData(m,33,33,15)},bc.prototype.requestTileHeightBuffer=function(u,c,h,e,t,o){if(!isNaN(u+c+h)){var i,m,r,n,d,p,e=0==(e=Cesium.defined(e)&&!1!==e?e:new Cesium.Request({defer:!0})).defer,g=(t=Cesium.defaultValue(e,!1),Cesium.when.defer());if(void 0!==o?(o.getUrlFromSTag=function(e,t,i){return void 0===o.subdomains?o.url:o.subdomains[0]+"/SG"},i=this.getRequestElevationLayer(u,c,h).replace(this._options.url,o.getUrlFromSTag(u,c,h)+"/Elevation").replace(this._options.layerName,o.name),"mpt"===o.format&&(i=i.replace("image/png","image/mpt"))):(i=this.getRequestBaseTerrainUrl(u,c,h,e||t),m=Cc.terrainProvider.tilingScheme.tileXYToRectangle(u,c,h),e=Cc.terrainProvider._modifyTerrainObjects,r=Cesium.when.defer(),void 0!==e?(n=[],e.forEach(function(e){e.show&&null!=Cesium.Rectangle.intersection(m,e.rectangle,new Cesium.Rectangle)&&n.push(e)}),!(0n[0].modelFloorBestLevel?r.resolve("NoMerge"):(t=wc(n,m),Cesium.when(t,function(e){r.resolve(e)}).otherwise(function(e){console.log(e)}))):r.resolve("NoMerge"),d=Cesium.when.defer(),1===(e=$.grep([],function(e){return 0e[0].level?d.resolve("NoFloor"):(p=!1,e.forEach(function(e){if(e.ready&&e.show&&void 0!==e.rootFloorRectangle&&void 0!==Cesium.Rectangle.intersection(m,e.rootFloorRectangle)){for(var t=new Uint16Array(1024),i=m.west,o=(m.south,(m.east-m.west)/32),r=(m.north-m.south)/32,n=0;n<32;n++)for(var a=0;a<32;a++){var s=m.north-r*n-r/2,s=new Cesium.Cartographic(i+o*a+o/2,s),l=65535,u=e.getHRMTFP(e,s,!0);65535!==(l=null!=u&&u.content&&u.content._model&&u.content._model.floor?u.content._model.floor.getHeight(s.longitude,s.latitude):l)&&(l+=1.5),t[32*n+a]=l}p=!0,d.resolve(t)}}),p||d.resolve("NoFloor")),Cc.scene.globe.ellipsoid),!1===this._requestsCache.hasOwnProperty(i)){if(this._requestsCache[i]={},this._requestsCacheKeys.push(i),100u&&(u=e[g]),e[g]u&&(u=e[g]),e[g]this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var o=this._layers,r=o.length,n=0;nthis._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var o=this._layers,r=o.length,n=0;nZr(e)).catch(e=>(console.error("Decoding failed on tile "+this.getUrl(t,i,o)),console.error(e),this.generateDummyTile(t,i,o)))}requestTileGeometry(t,i,o){var e=this.getUrl(t,i,o);return window.fetch(e).then(e=>200!==e.status?this.generateDummyTile(t,i,o):this.decodeResponse(e,t,i,o)).then(e=>this.createQuantizedMeshData(e,t,i,o)).catch(e=>{console.error(e)})}getTileDataAvailable(e,t,i){return!0}getLevelMaximumGeometricError(e){return Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this.tilingScheme.ellipsoid,65,this.tilingScheme.getNumberOfXTilesAtLevel(0))/(1<=s&&t.level{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var C=e,y=t,v=a;if(y.state===Cesium.QuadtreeTileLoadState.START){if(y.data={lines:[],geometryPrimitive:void 0},!(y.level>=w.level_min&&y.leveli.maxCol||y.xi.maxRow||y.y=parseFloat(w.level_max)-8&&19=parseFloat(w.level_max)-4&&16=parseFloat(w.level_max)-4?(d=b.shape,m={polylinePositions:b.position,shapePositions:d,cornerType:b.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},new v._cesium.PolylineVolumeGeometry(m)):(d="",m={positions:b.position,width:1,vertexFormat:v._cesium.PolylineColorAppearance.VERTEX_FORMAT,colors:n},new v._cesium.PolylineGeometry(m)),new v._cesium.GeometryInstance({id:o,geometry:p,attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(b.material)}}));""==d&&(g=new v._cesium.GeometryInstance({id:o,geometry:p})),e.push(g)}var f="material:"+255*b.material.red+","+255*b.material.green+","+255*b.material.blue,_=(v.Legend.push(f),0==e.length&&(y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0),null),_=""==d?new v._cesium.Primitive({appearance:new v._cesium.PolylineColorAppearance,geometryInstances:e}):new v._cesium.Primitive({allowPicking:!0,appearance:new v._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:v._core.Shaders("vertexShaderSource"),fragmentShaderSource:v._core.Shaders("fragmentShaderSource")}),shadows:b.shadows,geometryInstances:e});y.data.geometryPrimitive=_,y.state=Cesium.QuadtreeTileLoadState.LOADING,y.state===Cesium.QuadtreeTileLoadState.LOADING&&(y.data.geometryPrimitive.update(C,[]),y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0)},error:function(){y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0}}),y.state=Cesium.QuadtreeTileLoadState.LOADING}},"function"==typeof r&&r(this.item)};let c,h;this.saveDefaultVectorData=()=>{h=a._core.extend({},w,!0)},this.restoreVector=()=>{h&&(w=h,b=a._core.extend({...s},w,!0),a._Provider._normalTile=w.level_max-1,a._primitive&&a._primitive._tilesToRender&&a._primitive._tilesToRender.length&&(a._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),a._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),a._primitive._tileToUpdateHeights=[],a._primitive._tilesToRender=[])),h=void 0},this.updataVector=(e={})=>{var t,i;e.material&&e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),void 0===e.minimumLevel&&void 0===e.maximumLevel||(void 0!==e.minimumLevel&&(e.level_min=e.minimumLevel),void 0!==e.maximumLevel&&(e.level_max=e.maximumLevel)),"string"==typeof e.radius&&-1{a._primitive._tilesToRender.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),a._primitive._tileToUpdateHeights.forEach(e=>{e.data.geomeitryPrimitive&&e.data.geomeitryPrimitive.destroy(),e.state=Cesium.QuadtreeTileLoadState.START}),a._primitive._tileToUpdateHeights=[],a._primitive._tilesToRender=[]},100))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var m=this._viewer.scene.primitives,d=(w&&w.time&&(this._Provider._availability=new a._cesium.TimeIntervalCollection([new a._cesium.TimeInterval({start:w.time.start?a._cesium.JulianDate.fromDate(new Date(w.time.start)):a._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?a._cesium.JulianDate.fromDate(new Date(w.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)}),m.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:u},e=>{a.item.boundingSphere=e.boundingSphere,a.TileMatrixLimits=e.TileMatrixLimits,a.initThisProvider()}),o||this.setVisibility(!1),this._core.isnull(b.id)&&(b.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+b.id),{id:b.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:w});return this.setTreeobj(d),this._tree.insertGroupId(d,this._core.isnull(i)?0:i),this};var Vc="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 Gc(e,t){this._viewer=e,this._cesium=t,this._core=new v,this._color=new m(this._viewer,this._cesium),this._tree=F,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._cache=!1,this._forceRefreshPrvimitive=null}Hc.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Vc(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Hc.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,h,i,o,r){var n,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.RECEIVE_ONLY},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},m=(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=a.level_min&&t.level=h.tilesLength&&(h.returnCount=0,h.tilesLength=0,h.Primitivekey=[])},error:function(){l=f.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)}}))}else t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}var n},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider});this._viewer.scene.primitives.add(this._primitive),o||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;n={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a};this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Gc.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},l=(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{this._viewer.container.style.backgroundImage="unset",this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!0),this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.scene.skyAtmosphere.show=!0},this},Nc.prototype.SkyBox=function(e,t){this.defaultSky||(this.defaultSky=this._viewer.scene.skyBox,this.defaultSky&&!this.defaultSky.show&&(this.defaultSky.show=!0)),this.NearGround=e;var i=this,o=this._viewer,r=this.getSkyBox(t);function n(){var e=o.camera.position;i._cesium.Cartographic.fromCartesian(e).height<23e4?(r&&(o.scene.skyBox=r),o.scene.skyAtmosphere.show=!1):(i.defaultSky&&(o.scene.skyBox=i.defaultSky),o.scene.skyAtmosphere.show=!0)}return this._SkyBox=r,o.scene.skyBox=r,e&&this._viewer.scene.postRender.addEventListener(n),this.clear=function(){i.defaultSky&&(i._viewer.scene.skyBox=i.defaultSky),i.defaultSky=void 0,i._viewer.scene.skyAtmosphere.show=!0,i.NearGround&&i._viewer.scene.postRender.removeEventListener(n),i.clear=void 0},this},Nc.prototype.getSkyBox=function(e){var s=this,e=new this._cesium.SkyBox({sources:e});return this.NearGround&&(e.update=function(e,t){var i=this;if(this.show&&(e.mode===s._cesium.SceneMode.SCENE3D||e.mode===s._cesium.SceneMode.MORPHING)&&e.passes.render){var o,r,n=e.context,a=(this._sources!==this.sources&&(this._sources=this.sources,"string"==typeof(r=this.sources).positiveX?s._cesium.loadCubeMap(n,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new s._cesium.CubeMap({context:n,source:r}))),this._command);if(s._cesium.defined(a.vertexArray)||(a.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return s.NearGround?(a.modelMatrix=s._cesium.Transforms.eastNorthUpToFixedFrame(e.camera._positionWC),s._cesium.Matrix4.getMatrix3(a.modelMatrix,new s._cesium.Matrix3)):s._cesium.Matrix3.IDENTITY}},r=s._cesium.BoxGeometry.createGeometry(s._cesium.BoxGeometry.fromDimensions({dimensions:new s._cesium.Cartesian3(2,2,2),vertexFormat:s._cesium.VertexFormat.POSITION_ONLY})),o=this._attributeLocations=s._cesium.GeometryPipeline.createAttributeLocations(r),a.vertexArray=s._cesium.VertexArray.fromGeometry({context:n,geometry:r,attributeLocations:o,bufferUsage:s._cesium.BufferUsage.STATIC_DRAW}),a.renderState=s._cesium.RenderState.fromCache({blending:s._cesium.BlendingState.ALPHA_BLEND})),s._cesium.defined(a.shaderProgram)&&this._useHdr===t||(r=new s._cesium.ShaderSource({defines:[t?"HDR":""],sources:[s.SkyBoxFS]}),a.shaderProgram=s._cesium.ShaderProgram.fromCache({context:n,vertexShaderSource:s.SkyBoxVS,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t),s._cesium.defined(this._cubeMap))return a}}),e},jc.prototype.createWindField=function(e,t){var i=this;return this.WindFieldOption={color:this._cesium.Color.WHITE,speed:.15,num:2e3,maxAge:10,brighten:1.5},(t=t||{}).color&&(t.color=this._cesium.Color.fromCssColorString(t.color)),this.WindFieldOption=this._core.extend(this.WindFieldOption,t,!1),this.destroy(),this.windData=void 0,this.windField=void 0,this.particles=[],this.lines=void 0,this.timer=void 0,this.primitives=this._viewer.scene.primitives,$.ajax({type:"get",async:!1,url:e,dataType:"json",success:function(e){i.windData=e,i._init(),i.timer=setInterval(function(){i.animate()},200)},error:function(e){console.log("请求风场数据失败!")}}),this},jc.prototype._init=function(){this.windField=this.createField();for(var e=0;e{this.addGroundLine(e)})},Yc.prototype.getById=function(e){for(var t=null,i=this._viewer.scene.primitives,o=i.length,r=0;r{e=new Cesium.Primitive({geometryInstances:e,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_wallColor:this.color.withAlpha(.5),u_moveColor:this.color}}})})});this.collection.add(e)})},Qc.prototype.getShader=function(){this.fs=Kc.replace("{speed}",this._speed.toFixed(1))},qc.prototype.createPathLayer=function(e={}){var t={color:e.color||"#0033FF",width:e.width||5,pointColor:e.pointColor||"#FFFFFF",id:e.id||this._core.getuid(),near:e.near,far:e.far,speed:e.speed||1};let i=Cesium.GeoJsonDataSource.load(e.url),o=[],r=[];i.then(e=>{var i=e.entities.values;for(let t=0;t{t=this._core.extend(t,e,!0,!0),this.Streamerpath.removeAll(),this.Streamerpath.create({positions:r,...t})};e={id:t.id,name:"新建流光线图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},qc.prototype.createWallLayer=function(e={}){var t={color:e.color||"#0000ff",id:e.id||this._core.getuid(),speed:e.speed,height:e.height,minHeight:e.minHeight,near:e.near,far:e.far};let i=Cesium.GeoJsonDataSource.load(e.url),o=[],r=[];i.then(e=>{var i=e.entities.values;for(let t=0;t{t=this._core.extend(t,e,!0,!0),this.Streamerwall.removeAll(),this.Streamerwall.create({positions:r,...t})};e={id:t.id,name:"新建流动墙图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},qc.prototype.createPath=function(e,t,i){var o={time:3e3,LineColor:this._core.defaultValue((i="number"==typeof(i=i||{})?{time:i}:i).color,"#ff0000"),LinkImage:this._core.defaultValue(i.url,window.SmartEarthRootUrl+I.TrailLine),height:5e4,num:100,width:2,LightSpot:!1,alpha:.3},o=this._core.extend(o,i,!0),r=ie({color:Cesium.Color.fromCssColorString(o.LineColor),image:o.LinkImage,time:o.time,alpha:o.alpha,lightSpot:o.LightSpot,lightSpotColor:Cesium.Color.fromCssColorString(o.lightSpotColor||o.LineColor),twoColor:!!o.twoColor,color1:o.twoColor&&o.twoColor.color1&&Cesium.Color.fromCssColorString(o.twoColor.color1),color2:o.twoColor&&o.twoColor.color2&&Cesium.Color.fromCssColorString(o.twoColor.color2)});let n=new Cesium.PrimitiveCollection;this._viewer.scene.primitives.add(n),this._polylines.push(n);var a=i.inflow;let s,l;for(var u=0;u{n=[e.lon,e.lat,i.minHeight,e.lon,e.lat,e.height],r.add(this.getPolylinePrimitive(n,o,i))});t={id:this._core.getuid(),name:"新建垂直飞线",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},qc.prototype.createLine=function(e,t){var i={time:3e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,"#ff0000"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.TrailLine),height:5e4,width:10,LightSpot:!1,alpha:.3},i=this._core.extend(i,t,!0),t=ie({color:Cesium.Color.fromCssColorString(i.LineColor),image:i.LinkImage,time:i.time,alpha:i.alpha,lightSpot:i.LightSpot,lightSpotColor:Cesium.Color.fromCssColorString(i.lightSpotColor||i.LineColor),twoColor:!!i.twoColor,color1:i.twoColor&&i.twoColor.color1&&Cesium.Color.fromCssColorString(i.twoColor.color1),color2:i.twoColor&&i.twoColor.color2&&Cesium.Color.fromCssColorString(i.twoColor.color2)}),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;rMath.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),r=e.num&&50Math.abs(e.pt1.lat-e.pt2.lat)){var u=(e.pt2.lat-e.pt1.lat)/r;0{e=this._core.toDegrees(e);i.push([e.lon,e.lat])});var o=Cesium_turf.lineString(i),o=this._Buffer.getBuff(o,t.width,{steps:0}),o=(this.item=this._Buffer.addBufferPolyogn(o,{material:new Cesium.ImageMaterialProperty({image:t.image,color:Cesium.Color.WHITE.withAlpha(t.alpha)}),height:e.height,perPositionHeight:!1,stRotation:90,heightReference:0,outline:!1}),{id:t.id,name:"新建道路图层",pId:0,type:"RoadLayer",item:this});return this.setTreeobj(o),this._tree.insertGroupId(o,0),this},Xc.prototype.setTreeobj=function(e){this.treeobj=e},Xc.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},Xc.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Zc.prototype.createHawkeye=function(e,t){var i=document.createElement("div");i.id="Hawkeye",i.style.position="absolute",i.style.width="15%",i.style.height="20%",i.style.bottom="0",i.style.right="0",i.style.pointerEvents="none",t&&(t.width&&(i.style.width=t.width),t.height&&(i.style.height=t.height),t.bottom&&(i.style.bottom=t.bottom),t.right&&(i.style.right=t.right),t.top&&(i.style.top=t.top,i.style.bottom="unset"),t.left&&(i.style.left=t.left,i.style.right="unset")),this._viewer.container.appendChild(i);let o;o=e.url?new this._cesium.SingleTileImageryProvider({url:e.url}):e.imageryProvider;var r=new this._cesium.Viewer("Hawkeye",{imageryProvider:o,baseLayerPicker:!1,shadows:!1,shouldAnimate:!0,animation:!0,scene3DOnly:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1}),n=(r._cesiumWidget._creditContainer.style.display="none",this);let a=this._core.defaultValue(t&&t.height,1e4);function s(){var e=n._viewer.camera.position;let t=Cesium.Cartographic.fromCartesian(e);t.height+=a,r.camera.setView({destination:Cesium.Cartographic.toCartesian(t),orientation:{heading:n._viewer.camera.heading,pitch:n._viewer.camera.pitch,roll:n._viewer.camera.roll}})}return n._viewer.scene.preRender.addEventListener(s),this.close=function(){n._viewer.scene.preRender.removeEventListener(s),r.destroy(),i.remove(),n.close=void 0},this},K.prototype.createBezierline=function(o,t){var r,n=this,a=this._viewer,s=[],l=[],u=void 0,c="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),F.states=1,this.drawHandler.setInputAction(function(e){c="左键添加点 右键结束";e=e.position,e=n._createGeoPoints(a,[{x:e.x,y:e.y}]);0==s.length&&(s.push({x:e[0],y:e[1],z:e[2]}),l.push(e)),l.push(e),s.push({x:e[0],y:e[1],z:e[2]})},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(e){n._core.CreateTooltip(c,e.endPosition,!0);var t,i,e=e.endPosition;0{i.push(e.x,e.y,s[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=n._createBezierPoints(s),i=[],t.forEach(e=>{i.push(e.x,e.y,s[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),(u=a.entities.add({name:"Bezierline",polyline:{positions:new Cesium.CallbackProperty(function(){return r},!1),clampToGround:!0,width:n._core.defaultValue(o.width,2),material:Cesium.Color.fromCssColorString(n._core.defaultValue(o.color,"#ff0000"))}})).GeoType="Bezierline",n.MilitaryStandardObj.push(u.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){n.end&&n.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,u&&(u.pottingPoint=l),n.drawHandler.destroy(),n._core.CreateTooltip(c,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?u&&(a.entities.remove(u),n.MilitaryStandardObj.pop()):t&&t(u)},this},K.prototype.createBezierArrow=function(o,t){var r,n=this,a=this._viewer,s="单击开始绘制",l=[],u=[],c=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,n.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),n.drawHandler.setInputAction(function(e){s="左键添加点 右键结束";e=e.position,e=n._createGeoPoints(a,[{x:e.x,y:e.y}]);0==l.length&&(l.push({x:e[0],y:e[1],z:e[2]}),u.push(e)),l.push({x:e[0],y:e[1],z:e[2]}),u.push(e)},Cesium.ScreenSpaceEventType.LEFT_CLICK),n.drawHandler.setInputAction(function(e){n._core.CreateTooltip(s,e.endPosition,!0);var t,i,e=e.endPosition;0{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=n._createBezierPoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),(c=a.entities.add({name:"BezierArrow",polyline:{positions:new Cesium.CallbackProperty(function(){return r},!1),clampToGround:!0,width:n._core.defaultValue(o.width,5),material:new Cesium.PolylineArrowMaterialProperty(Cesium.Color.fromCssColorString(n._core.defaultValue(o.color,"#ff0000")))}})).GeoType="BezierArrow",n.MilitaryStandardObj.push(c.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.drawHandler.setInputAction(function(e){n.end&&n.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,c&&(c.pottingPoint=u),n.drawHandler.destroy(),n._core.CreateTooltip(s,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?c&&(a.entities.remove(c),n.MilitaryStandardObj.pop()):t&&t(c)},this},K.prototype.createSwallowtailArrow=function(e,o,t){var r,n=e,a=this,s=this._viewer,l=void 0,u=[],c=[],h="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var e=e.position;h="单击完成绘制",0==c.length?(e=a._createGeoPoints(s,[{x:e.x,y:e.y}]),c.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),u.push(e,e)):2==c.length&&a.end&&a.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){a._core.CreateTooltip(h,e.endPosition,!0);var t,i,e=e.endPosition;1{i.push(e.x,e.y,c[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(l=a.plotingSwallowtailArrow(s,c,n,o),t=a._computeSwallowtailArrow(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),l.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),l.GeoType="SwallowtailArrow",a.MilitaryStandardObj.push(l.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.drawHandler.setInputAction(function(e){a.end&&a.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,l&&(l.pottingPoint=u),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?l&&(s.entities.remove(l),a.MilitaryStandardObj.pop()):t&&t(l)},this},K.prototype.createStraightArrow=function(e,o,t){var r,n=e,a=this,s=this._viewer,l=[],u=void 0,c=[],h="单击开始绘制";return F.states=1,this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+I.draw),a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var e=e.position;h="单击完成绘制",0==l.length?(e=a._createGeoPoints(s,[{x:e.x,y:e.y}]),l.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),c.push(e,e)):2==l.length&&a.end&&a.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){var t,i,e=e.endPosition;a._core.CreateTooltip(h,e,!0),1{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=a.calculateMorePoints(l),i=[],t.forEach(e=>{i.push(e.x,e.y,l[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==n?u=s.entities.add({name:"StraightArrow",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}):"box"==n&&(u=s.entities.add({name:"StraightArrow",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(a._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+a._core.defaultValue(o.extrudedHeight,200),height:i[2],outline:a._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(a._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}})),u.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),u.GeoType="StraightArrow",a.MilitaryStandardObj.push(u.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),a.drawHandler.setInputAction(function(e){a.end&&a.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,u&&(u.pottingPoint=c),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?u&&(s.entities.remove(u),a.MilitaryStandardObj.pop()):t&&t(u)},this},K.prototype.createRoundedRectangle=function(e,o,t){var r,n=e,a="单击开始绘制",s=this,l=this._viewer,u=[],c=[],h=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){var e=e.position;a="单击完成绘制",0==u.length?(e=s._createGeoPoints(l,[{x:e.x,y:e.y}]),u.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),c.push(e,e)):2==u.length&&s.end&&s.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){s._core.CreateTooltip(a,e.endPosition,!0);var t,i,e=e.endPosition;1{i.push(e.x,e.y,u[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeRoundedRectanglePoints(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==n?h=l.entities.add({name:"RoundedRectangle",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==n&&(h=l.entities.add({name:"RoundedRectangle",polygon:{hierarchy:r,material:Cesium.Color.fromCssColorString(s._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+s._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),h.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),h.GeoType="RoundedRectangle",s.MilitaryStandardObj.push(h.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,h&&(h.pottingPoint=c),s._core.CreateTooltip(a,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?h&&(l.entities.remove(h),s.MilitaryStandardObj.pop()):t&&t(h)},this},K.prototype.createSector=function(e,o,t){var r,n,a,s=e,l="单击开始绘制",u=this._viewer,c=this,h=[],m=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),c._core.mouse(c._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,c.drawHandler=new Cesium.ScreenSpaceEventHandler(u.scene.canvas),c.drawHandler.setInputAction(function(e){l="单击添加点";e=e.position,e=c._createGeoPoints(u,[{x:e.x,y:e.y}]);0==h.length?(h.push({x:e[0],y:e[1],z:e[2]},{x:e[0],y:e[1],z:e[2]}),m.push(e,e)):2==h.length?(h.push({x:e[0],y:e[1],z:e[2]}),m.push(e)):3==h.length&&c.end&&c.end(),2!==m.length||n||(n=u.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return[Cesium.Cartesian3.fromDegrees(m[0][0],m[0][1]),Cesium.Cartesian3.fromDegrees(m[1][0],m[1][1])]},!1),clampToGround:!0,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),width:3}}))},Cesium.ScreenSpaceEventType.LEFT_CLICK),c.drawHandler.setInputAction(function(e){c._core.CreateTooltip(l,e.endPosition,!0);var t,i,e=e.endPosition;2===h.length&&(h.pop(),m.pop(),i=c._createGeoPoints(u,[{x:e.x,y:e.y}]),h.push({x:i[0],y:i[1],z:i[2]}),m.push(i)),2{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=c._computeSectorPoints(h),i=[],t.forEach(e=>{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==s?r=u.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:c._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(c._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==s&&(r=u.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(c._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:c._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(c._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+c._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),r.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(a)},!1),r.GeoType="Sector",c.MilitaryStandardObj.push(r.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.drawHandler.setInputAction(function(e){c.end&&c.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,r&&(r.pottingPoint=m),c._core.CreateTooltip(l,void 0,!1),c.drawHandler.destroy(),c._core.mouse(c._viewer.container,0),n&&u.entities.remove(n),setTimeout(function(){F.states=0},100),"cancel"===e?r&&(u.entities.remove(r),c.MilitaryStandardObj.pop()):t&&t(r)},this},K.prototype.createBow=function(e,r,t){var n,a=e,s=this,l=this._viewer,u="单击开始绘制",c=[],h=[],m=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){u="单击添加点";e=e.position,e=s._createGeoPoints(l,[{x:e.x,y:e.y}]);0==c.length?(c.push({x:e[0],y:e[1],z:e[2]}),h.push(e)):1==c.length?(c.push({x:e[0],y:e[1],z:e[2]},{x:e[0]+1e-7,y:e[1]+1e-7,z:e[2]}),h.push(e,e)):3==c.length&&s.end&&s.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){var t,i,o=e.endPosition;s._core.CreateTooltip(u,e.endPosition,!0),2{i.push(e.x,e.y,c[0].z)}),n=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeBowPoints(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),n=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==a?m=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:Cesium.Color.fromCssColorString(s._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(r.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==a&&(m=l.entities.add({name:"Bow",polygon:{hierarchy:n,material:Cesium.Color.fromCssColorString(s._core.defaultValue(r.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(r.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(r.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+s._core.defaultValue(r.extrudedHeight,200),height:i[2]}})),m.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(n)},!1),m.GeoType="Bow",s.MilitaryStandardObj.push(m.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.drawHandler.setInputAction(function(e){s.end&&s.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,m&&(m.pottingPoint=h),s._core.CreateTooltip(u,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){F.states=0},100),"cancel"===e?m&&(l.entities.remove(m),s.MilitaryStandardObj.pop()):t&&t(m)},this},K.prototype.createPincerArrow=function(e,o,r){var n=e,a=this,s=this._viewer,l=[],u=[],c=void 0,h="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+I.draw),F.states=1,a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var t,i=e.position;h="单击增加点",(t=a._getPosition.getMousePosition(e))&&(4{r.push(e.x,e.y,m[0].z)}),s=r):(i=c._computeGatheringPlacePoints(m),o=c.createCloseCardinal(i),t=c.calculatePointsFBZ3(o,100),r=[],t.forEach(e=>{r.push(e.x,e.y,m[0].z)}),s=r,(p=c.plotingGatheringPlace(h,m,l,a)).polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))},!1),p.GeoType="GatheringPlace",c.MilitaryStandardObj.push(p.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),m},K.prototype.plotingGatheringPlace=function(e,t,i,o){t=this._computeGatheringPlacePoints(t),t=this.createCloseCardinal(t),t=this.calculatePointsFBZ3(t,100),t=this._createGeoPoints(e,t),i="polygon"==i?e.entities.add({name:"GatheringPlace",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(t),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):e.entities.add({name:"GatheringPlace",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(t),extrudedHeight:this._core.defaultValue(o.extrudedHeight,200)+t[2],height:t[2],material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}});return i},K.prototype.addFeature=function(e){let t,i=e.geometry.coordinates,o=[];if("PincerArrow"==e.type){var r=z.algorithm.doubleArrow(i);let e=[];-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(e=r.polygonalPoint),t=e}else if("AttackArrow"==e.type){r=z.algorithm.tailedAttackArrow(i);let e=[];-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(e=r.polygonalPoint),t=e}else i.forEach(e=>{o.push({x:e[0],y:e[1],z:e[2]})}),"StraightArrow"==e.type?t=this.calculateMorePoints(o):"RoundedRectangle"==e.type?t=this._computeRoundedRectanglePoints(o):"Sector"==e.type?t=this._computeSectorPoints(o):"Bow"==e.type?t=this._computeBowPoints(o):"GatheringPlace"==e.type?(r=this._computeGatheringPlacePoints(o),r=this.createCloseCardinal(r),t=this.calculatePointsFBZ3(r,100)):"SwallowtailArrow"==e.type?t=this._computeSwallowtailArrow(o):"Bezierline"!=e.type&&"BezierArrow"!=e.type||(t=this._createBezierPoints(o));let n;n="AttackArrow"!==e.type&&"PincerArrow"!==e.type?(n=[],t.forEach(e=>{n.push(e.x,e.y,o[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(n)):t;let a;return(a=0<=e.type.indexOf("Bezier")?this._viewer.entities.add({id:e.id,name:e.name,polyline:{positions:new Cesium.CallbackProperty(function(){return n},!1),width:e.style.width,clampToGround:!0,material:"BezierArrow"===e.type?new Cesium.PolylineArrowMaterialProperty(new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)):new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha)}}):this._viewer.entities.add({id:e.id,name:e.name,polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(n)},!1),fill:!0,extrudedHeight:void 0!==e.style.extrudedHeight?e.style.extrudedHeight+e.style.height:void 0,height:e.style.height,material:new Cesium.Color.fromCssColorString(e.style.fillColor.color).withAlpha(e.style.fillColor.alpha),outline:e.style.outline,outlineColor:e.style.outlineColor?new Cesium.Color.fromCssColorString(e.style.outlineColor.color).withAlpha(e.style.outlineColor.alpha):void 0}})).GeoType=e.type,a.pottingPoint=i,e.removeEdit||this.MilitaryStandardObj.push(a.id),this.defaultEdit(),a},K.prototype.open=function(e){var t=this,i=this._viewer,o=new FileReader,r=(o.readAsText(e),new Cesium.EntityCollection);o.onload=function(){let e=JSON.parse(this.result).features;e.forEach(e=>{e=t.addFeature(e);r.add(e)}),i.flyTo(r),t.MilitaryStandardObj.length&&!t.editHandler&&t.edit(t.openEdit,t.editOption)}},K.prototype.clear=function(){var t=this._viewer;this.MilitaryStandardObj.forEach(e=>{t.entities.removeById(e)}),this.MilitaryStandardObj=[],window.layuiLayer.close(SmartEarthPopupData.layerIndex),!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1)},K.prototype.getColor=function(e){return{color:this.colorHex("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),alpha:e.alpha}},K.prototype.getFeature=function(e){let t={id:e.id,type:e.GeoType,name:e.name,editType:""};var i=e.pottingPoint;return e.polyline?(t.editType="GroundPolyline",t.geometry={type:"polyline",coordinates:i},t.style={fillColor:this.getColor(e.polyline.material.color._value),width:e.polyline.width.getValue()}):(t.editType="GroundPolygon",t.geometry={type:"polygon",coordinates:i},t.style={fillColor:this.getColor(e.polygon.material.color._value)},e.polygon.extrudedHeight&&(t.editType="ExtrudedPolygon",t.style.height=e.polygon.height.getValue(),t.style.extrudedHeight=e.polygon.extrudedHeight.getValue()-e.polygon.height.getValue(),e.polygon.outline&&(t.style.outline=e.polygon.outline.getValue()),e.polygon.outlineColor&&(t.style.outlineColor=this.getColor(e.polygon.outlineColor._value)))),t},K.prototype.save=function(){var t,i=this._viewer,o={type:"FeatureCollection",features:[]},e=(this.MilitaryStandardObj.forEach(e=>{e=i.entities.getById(e);e&&(t=this.getFeature(e)),o.features.push(t)}),JSON.stringify(o)),e=new Blob([e],{type:"text/plain;charset=utf-8"});this._core.saveAs(e,"军标.json")},K.prototype.colorHex=function(e){if(/^(rgb|RGB)/.test(e)){for(var t=e.replace(/(rgb|RGB)*/g,"").replace("(","").replace(")","").split(","),i="#",o=0;o=e.length&&i.push(n)}return i[i.length-1],e[e.length-1],i},K.prototype.calculateVector=function(e,t,i){t=t||Math.PI/2,i=i||1;var o,r,n,a,s,l,u,c,h=Math.sqrt(e.x*e.x+e.y*e.y);return 0==e.y?(s=l=h*i*Math.cos(t)/e.x,0{a.push(e.x,e.y,t[0].z)}),"polygon"==i?r=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(a),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}):"box"==i&&(r=e.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:Cesium.Cartesian3.fromDegreesArrayHeights(a),material:Cesium.Color.fromCssColorString(this._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),extrudedHeight:a[2]+this._core.defaultValue(o.extrudedHeight,200),height:a[2],outline:this._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}})),r},K.prototype._computeSwallowtailArrow=function(e){var t=e[0].x,i=e[0].y,o=e[1].x,e=e[1].y,r=(15.8*o+3.2*t)/19,n=(15.8*e+3.2*i)/19,a=new Array(7);return a[0]={x:o,y:e},a[1]={x:r+.265625*(e-n),y:n-.265625*(o-r)},a[2]={x:r+.078125*(e-n),y:n-.078125*(o-r)},a[3]={x:t+1.6/19*(e-i),y:i-1.6/19*(o-t)},a[4]={x:(3.2*o+15.8*t)/19,y:(3.2*e+15.8*i)/19},a[5]={x:t-1.6/19*(e-i),y:i+1.6/19*(o-t)},a[6]={x:r-.078125*(e-n),y:n+.078125*(o-r)},a[7]={x:r-.265625*(e-n),y:n+.265625*(o-r)},a},K.prototype.calculateMorePoints=function(e){if(22*Math.PI?2*Math.PI-_:_;p.push({x:y,y:v})}for(var w=p,b=3*Math.PI/2,T=2*Math.PI,E=b,C=0;C2*Math.PI?2*Math.PI-E:E;w.push({x:y,y:v})}for(var S=w,P=.5*Math.PI,x=0,C=0;C2*Math.PI?2*Math.PI-x:x;S.push({x:y,y:v})}for(var D=S,I=.5*Math.PI,A=Math.PI,L=I,C=0;C2*Math.PI?2*Math.PI-L:L;D.push({x:y,y:v})}return D},K.prototype._computeSectorPoints=function(e){for(var t=this.calculateAngle(e[0],e[1]),i=this.calculateAngle(e[0],e[2]),o=(i2*Math.PI?r-2*Math.PI:r;n.push({x:l,y:u})}return n},K.prototype.calculateAngle=function(e,t){t={x:t.x-e.x,y:t.y-e.y},e=Math.atan2(t.y,t.x);return e<0&&(e+=2*Math.PI),e},K.prototype._computeBowPoints=function(e){var t=2*(e[1].x-e[0].x),i=2*(e[1].y-e[0].y),o=e[1].x*e[1].x+e[1].y*e[1].y-e[0].x*e[0].x-e[0].y*e[0].y,r=2*(e[2].x-e[1].x),n=2*(e[2].y-e[1].y),a=e[2].x*e[2].x+e[2].y*e[2].y-e[1].x*e[1].x-e[1].y*e[1].y,s=(o*n-a*i)/(t*n-r*i),l=(t*a-r*o)/(t*n-r*i),a={x:s,y:l},u=Math.sqrt((e[0].x-s)*(e[0].x-s)+(e[0].y-l)*(e[0].y-l)),c=this.calculateAngle(a,e[0]),h=this.calculateAngle(a,e[1]),o=this.calculateAngle(a,e[2]),m=Math.PI/180,d=void 0,p=[];if(c2*Math.PI?2*Math.PI-d:d;p.push({x:f,y:_})}}else{d=h2*Math.PI?d-2*Math.PI:d,p.push({x:f,y:_})}}return p},K.prototype.Cdcl=function(e,t,i,o){var r=Math.PI;function n(e){return e*r/180}var a=n((e+i)/2),e=n((e-i)/2),i=n((t-o)/2),t=Math.sin(e),o=Math.sin(i),e=Math.sin(a),i=(t*=t)*(1-(o*=o))+(1-(e*=e))*o,a=(1-t)*(1-o)+e*o;return 2*(o=Math.atan(Math.sqrt(i/a)))*6378137*(1+1/298.257*((3*(o=Math.sqrt(i*a)/o)-1)/2/a*e*(1-t)-(3*o+1)/2/i*(1-e)*t))},K.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},K.prototype.setEdit=function(e,t){this.openEdit=e=void 0===e?!0:e,t&&(this.editOption=t),this.defaultEdit()},K.prototype.openEditProp=function(e,i){var t=this;if((i=i||this.editOption||{editPropData:{}},!SmartEarthPopupData.editGraphic||!SmartEarthPopupData.editGraphic.entity)&&!this.startEdit(e))return;i.editPropData||(i.editPropData={}),this._popupmessage.createPopupProp("属性编辑",{width:i.editPropData.width||360,height:i.editPropData.height||"90%",url:"Workers/prop/jb_prop.html",shade:i.editPropData.shade,offset:i.editPropData.offset,type:e.polyline?"GroundPolyline":0{var t;Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1)):F.editVector||(e=e.position,(e=L.scene.pick(e))&&e.id instanceof Cesium.Entity?(e=e.id,A.isEditting||0!=F.states?"box_point"==e.name||"polygon_point"==e.name||"move_point"==e.name?(A.defaultEvent(!1),M="box_point"==e.name?(B=e.position.getValue(),t=Cesium.Cartographic.fromCartesian(B),B={lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height},"box_point"):"move_point"==e.name?"move_point":"polygon_point",O=e):R&&e.id===R.id||A.endThisEdit():this.startEdit(e)&&(R=e,this.editProp&&this.openEditProp(R,o))):A.endThisEdit())},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(e){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1));else if(!F.editVector){var i=L.scene.pick(e.endPosition);if(Cesium.defined(i))if(A.isEditting&&!O){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1)));!i.id||"move_point"!==i.id.name&&"polygon_point"!==i.id.name?i.id&&"box_point"===i.id.name?A.tooltip.showAt(e.endPosition,"拖拽修改高度"):i.id==R&&A.tooltip.show(!1):A.tooltip.showAt(e.endPosition,"拖拽修改位置")}else A.isEditting||0!==F.states||(i.id&&-1{t.push(e.x,e.y,c[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(t)):x,R.pottingPoint=h,0<=R.GeoType.indexOf("Bezier")?R.polyline.positions=new Cesium.CallbackProperty(function(){return t},!1):R.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}else if("box_point"==M){var _,i=L.camera.getPickRay(e.endPosition),C=L.scene.globe.pick(i,L.scene),y=Cesium.Cartographic.fromCartesian(C),v=Cesium.Math.toDegrees(y.longitude),w=Cesium.Math.toDegrees(y.latitude),b=B.lon,T=B.lat,t=u=A.Cdcl(w,v,T,b);for(_ in A.heightpointsId){var E=L.entities.getById(A.heightpointsId[_]),S=E.position._value,S=Cesium.Cartographic.fromCartesian(S),P=Cesium.Math.toDegrees(S.longitude),S=Cesium.Math.toDegrees(S.latitude),P=Cesium.Cartesian3.fromDegrees(P,S,t);E.position=P}R.polygon.extrudedHeight=new Cesium.CallbackProperty(function(){return t},!1),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseInt(t))}else{var x,y=Cesium.Cartographic.fromCartesian(C),v=Cesium.Math.toDegrees(y.longitude),w=Cesium.Math.toDegrees(y.latitude),g=(B=O.position.getValue(),Cesium.Cartographic.fromCartesian(B)),D=v-(b=(B={lon:Cesium.Math.toDegrees(g.longitude),lat:Cesium.Math.toDegrees(g.latitude),height:g.height}).lon),I=w-(T=B.lat),c=(O.position=C,[]),h=[];for(r in F.pointsId){let e,t,i=L.entities.getById(F.pointsId[r]),o=(i&&(e=i.position.getValue(),t=Cesium.Cartographic.fromCartesian(e),e={lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height},i.position=Cesium.Cartesian3.fromDegrees(e.lon+D,e.lat+I,e.height),c.push({x:e.lon+D,y:e.lat+I,z:e.height}),h.push([e.lon+D,e.lat+I,e.height])),L.entities.getById(A.heightpointsId[r]));o&&(e=o.position.getValue(),t=Cesium.Cartographic.fromCartesian(e),e={lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude),height:t.height},o.position=Cesium.Cartesian3.fromDegrees(e.lon+D,e.lat+I,e.height))}if("StraightArrow"==R.GeoType)x=A.calculateMorePoints(c);else if("RoundedRectangle"==R.GeoType)x=A._computeRoundedRectanglePoints(c);else if("Sector"==R.GeoType)x=A._computeSectorPoints(c);else if("Bow"==R.GeoType)x=A._computeBowPoints(c);else if("GatheringPlace"==R.GeoType){f=A._computeGatheringPlacePoints(c),e=A.createCloseCardinal(f);x=A.calculatePointsFBZ3(e,100)}else if("SwallowtailArrow"==R.GeoType)x=A._computeSwallowtailArrow(c);else if("Bezierline"==R.GeoType)x=A._createBezierPoints(c);else if("BezierArrow"==R.GeoType)x=A._createBezierPoints(c);else if("PincerArrow"==R.GeoType){i=z.algorithm.doubleArrow(h);let e=[];y=JSON.stringify(i.polygonalPoint).indexOf("null");x=e=-1==y?i.polygonalPoint:e}else if("AttackArrow"==R.GeoType){v=z.algorithm.tailedAttackArrow(h),g=JSON.stringify(v.polygonalPoint).indexOf("null");let e=[];x=e=-1==g?v.polygonalPoint:e}let t;t="AttackArrow"!==R.GeoType&&"PincerArrow"!==R.GeoType?(t=[],x.forEach(e=>{t.push(e.x,e.y,c[0].z)}),Cesium.Cartesian3.fromDegreesArrayHeights(t)):x,R.pottingPoint=h,0<=R.GeoType.indexOf("Bezier")?R.polyline.positions=new Cesium.CallbackProperty(function(){return t},!1):R.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1)}}}}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(e){Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1)):F.editVector||(O&&o.callBack&&o.callBack.update&&o.callBack.update(O.name,R),O=void 0,A.defaultEvent(!0))},Cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(e){var t,i;Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1)):F.editVector||(t=L.scene.pick(e.position),Cesium.defined(t)&&0==F.states&&(i=t.id,-1!==A.MilitaryStandardObj.indexOf(i.id)&&A.delButton(!0,e.position,function(){L.entities.removeById(i.id);var e=A.MilitaryStandardObj.indexOf(i.id);A.MilitaryStandardObj.splice(e,1),A.delButton(!1),A.tooltip.show(!1),A.endThisEdit(),A.defaultEdit(),o.callBack&&o.callBack.delete&&o.callBack.delete(i)})))},Cesium.ScreenSpaceEventType.RIGHT_DOWN),A.defaultEvent(!0),F.pointsId)L.entities.removeById(F.pointsId[t]);for(t in A.heightpointsId)L.entities.removeById(A.heightpointsId[t]);A.heightpointsId=[],A.heightpoints=[],F.pointsId=[],this.endThisEdit=()=>{for(var e in A.defaultEvent(!0),F.pointsId)L.entities.removeById(F.pointsId[e]);for(var e in A.heightpointsId)L.entities.removeById(A.heightpointsId[e]);A.movePoint&&L.entities.remove(A.movePoint),A.movePoint=void 0,R=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},A.isEditting=!1,F.pointsId=[],A.heightpointsId=[],A.heightpoints=[],A.delButton(!1)}}},K.prototype.spArray=function(e,t){for(var i=[],o=0;o{t.push(this._core.toDegrees(e))}),t.push(t[0]);let i,o=((i=n.isInner?this.isClockWise(t):!this.isClockWise(t))&&t.reverse(),[]);var a=this.getInverseTransform(r);for(let e=0;e{var e;0===i.id.indexOf("Link_")?i.polyline.material=o._core.getLinkMaterial(t.linkColor,t.linkPointColor,t.linkTime):0===i.id.indexOf("ConeRadar_")?i.cylinder.material=o._core.getConeRadarMaterial(t.coneRadarColor):0===i.id.indexOf("MultiCircleScan_")?i.ellipse.material=o._core.getMultiCircleScanMaterial(t.multiCircleColor,t.multiCircleTime):0===i.id.indexOf("SectorScan_")?(e=o._core.defaultValue(t.sectorScanAngle,45),i.ellipse.material=o._core.getSectorScanMaterial(t.sectorScanColor,e),i.ellipse.stRotation=new o._cesium.CallbackProperty(function(e,t){e=i.orientation.getValue(e,t);return o._cesium.HeadingPitchRoll.fromQuaternion(e).heading-Math.PI/2},!1)):0===i.id.indexOf("CircleScan_")?i.ellipse.material=o._core.getCircleScanMaterial(t.circleScanColor,t.circleScanTime):0===i.id.indexOf("RadarScan_")&&(i.ellipse.material=o._core.getRadarScanMaterial(t.radarScanColor,t.radarScanTime))})},ih.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},ih.prototype.setTreeobj=function(e){this.treeobj=e},ih.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},oh.prototype.addHeatMap=function(e,t={}){"HeatmapGL"===t.type?this.item=new Wr(this._viewer,t):this.item=new Ur(this._viewer,t),t.sourceData&&this.item.create(t.sourceData);t={id:this._core.getuid(),name:e,pId:0,type:"Heatmap",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},oh.prototype.setData=function(e){this.item&&this.item.setData(e)},oh.prototype.flyToBounding=function(){this.item&&this.item.flyToBounding()},oh.prototype.deleteObject=function(){this.item&&this.item.destroy()},oh.prototype.setTreeobj=function(e){this.treeobj=e},oh.prototype.setVisibility=function(e){null!=this.item&&this.item.show(e)},rh.prototype.createSatelliteTrail=function(t){t=t||{};let e=this._viewer,i=new Cesium.JulianDate.fromDate(new Date),o=Cesium.JulianDate.addSeconds(i,3600,new Cesium.JulianDate),r=(e.clock.startTime=t.start||i.clone(),e.clock.stopTime=t.stop||o.clone(),e.clock.currentTime=t.start||i.clone(),e.clock.clockRange=Cesium.ClockRange.LOOP_STOP,e.clock.multiplier=t.speed||2,this.flyHeight=t.height||7e5,[]);return t.path?r=t.path:this.getRandState(r,2),r.forEach(e=>{this.getStatePath(e,t)}),this},rh.prototype.getStatePath=function(e,t){let i=this._viewer;var o=i.clock.startTime.clone(),r=i.clock.stopTime.clone(),n=this.computeCirclularFlight(e,2);let a=i.entities.add({availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:o,stop:r})]),position:n,orientation:new Cesium.VelocityOrientationProperty(n),cylinder:{HeightReference:Cesium.HeightReference.CLAMP_TO_GROUND,length:this.flyHeight,topRadius:0,bottomRadius:this.flyHeight/2,material:this._core.getConeRadarMaterial(t.radarColor||"#00ff00"),outline:!1,numberOfVerticalLines:0}});a.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(a);n=this.computeCirclularFlight(e,1);let s={availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:o,stop:r})]),position:n,orientation:new Cesium.VelocityOrientationProperty(n),path:{resolution:1,material:new Cesium.PolylineGlowMaterialProperty({color:Cesium.Color.DEEPSKYBLUE}),width:t.width||5}},l=(t.img?"object"==typeof t.img?s.billboard=t.img:"string"==typeof t.img&&(s.billboard={image:t.img,scale:t.scale}):s.model={uri:t.model||window.SmartEarthRootUrl+I.flyModel,minimumPixelSize:32,scale:t.scale},i.entities.add(s));l.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Cesium.LagrangePolynomialApproximation}),this.TrailEntitys.push(l)},rh.prototype.clear=function(){this.TrailEntitys.forEach(e=>{this._viewer.entities.remove(e)}),this.TrailEntitys=[]},rh.prototype.faster=function(){this._viewer.animation.viewModel.faster()},rh.prototype.slower=function(){this._viewer.animation.viewModel.slower()},rh.prototype.setSpeed=function(e){this._viewer.clock.multiplier=parseFloat(e)},rh.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},rh.prototype.computeCirclularFlight=function(t,e){var i=this._viewer.clock.startTime.clone();let o=new Cesium.SampledPositionProperty;if(1==e)for(let e=0;e=s.level_min&&i.level{this.init&&this.init()}:(i=``,$(this._viewer.container).append(i),this.videoContainer=document.getElementById(t),this.options.video.container=this.videoContainer,this.load(),this.videoContainer.oncanplay=()=>{this.thisVideo||(this.init&&this.init(),e&&e(this))})},lh.prototype.load=function(){var e,t=this.url;if("hls"===this.videoType){if(!window.Hls){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/hls.js")}this.videoContainer.canPlayType("application/vnd.apple.mpegurl")?this.videoContainer.src=t:Hls.isSupported()&&((e=new Hls).loadSource(t),e.attachMedia(this.videoContainer),this.player=e)}else if("flv"===this.videoType){if(!window.flvjs){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/flv.js")}flvjs.isSupported()&&((e=flvjs.createPlayer({type:"flv",url:t})).attachMediaElement(this.videoContainer),e.load(),this.player=e)}else this.videoContainer.src=t,this.thisVideo&&(this.videoContainer.load(),this.videoContainer.play());this.isLoad=!0},lh.prototype.pause=function(){"mp4"!==this.videoType&&(this.isLoad=!1),this.player&&this.player.destroy(),this.videoContainer.pause()},lh.prototype.flyTo=function(){this.thisVideo&&this.thisVideo.flyTo()},lh.prototype.play=function(){this.isLoad||this.load(),this.videoContainer.play()},lh.prototype.init=function(){this.thisVideo||(!this.isPause&&this.videoContainer&&this.videoContainer.readyState===this.videoContainer.HAVE_ENOUGH_DATA&&this.play(),this.video2D?this.thisVideo=new Al(this._viewer,this.options):this.thisVideo=new Ko(this._viewer,this.options))},lh.prototype.updateVideo=function(e){(e.url||e.type)&&(e.type&&(this.videoType=e.type),e.url&&(this.url=e.url),e.url&&(this.pause(),this.load(),this.videoContainer.oncanplay=()=>{this.play()})),this.thisVideo.updatePost(e)},lh.prototype.setVisibility=function(e){this.thisVideo&&this.thisVideo.setVisibility(e)},lh.prototype.destroy=function(){this.thisVideo&&this.thisVideo.destroy(),this.thisVideo=null,this.player&&this.player.destroy&&this.player.destroy(),this.videoContainer&&this.videoContainer.remove()},uh.prototype.GeoWTFS=function(e){var t=(e=e||{}).token||"c53eb074c3fcba5ac86103d4d711bbe8",i=e.url||"https://t{s}.tianditu.gov.cn/",o={viewer:this._viewer,subdomains:["0","1","2","3","4","5","6","7"],metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:Cesium.Color.WHITE,scale:.5,outlineColor:Cesium.Color.BLACK,outlineWidth:5,style:Cesium.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:Cesium.Color.RED,backgroundPadding:new Cesium.Cartesian2(10,10),horizontalOrigin:Cesium.HorizontalOrigin.LEFT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:new Cesium.Cartesian2(0,8),heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY},billboardGraphics:{horizontalOrigin:Cesium.HorizontalOrigin.RIGHT,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:Cesium.Cartesian2.ZERO,alignedAxis:Cesium.Cartesian3.ZERO,color:Cesium.Color.WHITE,rotation:0,scale:1,width:18,height:18,heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY}},o=(e=this._core.extend(o,e,!0),new Cesium.GeoWTFS(e));return o.getTileUrl=function(){return i+"mapservice/GetTiles?lxys={z},{x},{y}&tk="+t},o.getIcoUrl=function(){return i+"mapservice/GetIcon?id={id}&tk="+t},o.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),o},ch.prototype.createPolygonLayer=function(e={}){let o={color:e.color||"rgba(135,206,235,0.6)",image:e.image||window.SmartEarthRootUrl+I.water,height:e.height,extrudedHeight:e.extrudedHeight,frequency:e.frequency||1e3,speed:e.speed||10,amplitude:e.amplitude||10,near:e.near,far:e.far,id:e.id||this._core.getuid()},t=(Cesium.Color.fromCssColorString(o.color),Cesium.GeoJsonDataSource.load(e.url)),r=new Cesium.PrimitiveCollection;t.then(e=>{var t=e.entities.values;for(let e=0;e{var a=Math.max(...n.mData)*C,s=n.mHorPointsNum,l=n.mVerPointsNum;if(_=n.mCenterPoint&&n.mCenterPoint.length?n.mCenterPoint:_){var u=new Float64Array(3*n.mData.length),c=0,h=new Float32Array(2*n.mData.length),m=0,d=new Uint16Array(s*(l-1)*2*3),p=0;let r=0;for(let i=n.mHStartAngle,o=0;i{this.image=e;let t=this.clampToGround?Cesium.GroundPrimitive:Cesium.Primitive;this.circle=new t({geometryInstances:this.getInstances(),appearance:this.getAppearance(),asynchronous:!1}),setTimeout(()=>{this.circle.appearance.material.uniforms.color.alpha=2})}),this._viewer.scene.primitives.add(this),this},dh.prototype.createDRWCircle=function(e={}){this.type="DRW",this.radius=e.radius||50,this.multiple=e.multiple||5,this.scale=[this.radius,this.radius,1];var t=Cesium.Color.fromCssColorString(e.color||"#80ccff");this.color=[t.red,t.green,t.blue],this.clampToGround=e.clampToGround,this.position=e.position;let i=document.createElement("canvas"),o=(i.width=512,i.height=512,i.getContext("2d")),r=o.createRadialGradient(256,256,0,256,256,256),n=(r.addColorStop(.1,"rgba(255, 255, 255, 1.0)"),r.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),r.addColorStop(.3,"rgba(255, 255, 255, 0.9)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),r.addColorStop(.9,"rgba(255, 255, 255, 0.2)"),r.addColorStop(1,"rgba(255, 255, 255, 1.0)"),o.clearRect(0,0,512,512),o.strokeStyle="rgb(255, 255, 255)",o.setLineDash([80,80]),o.lineWidth=30,o.arc(256,256,180,0,2*Math.PI,!0),o.stroke(),o.beginPath(),o.arc(256,256,256,0,2*Math.PI,!0),o.fillStyle=r,o.fill(),o.restore(),this.image=i,this.clampToGround?Cesium.GroundPrimitive:Cesium.Primitive);return this.circle=new n({geometryInstances:this.getInstances(),appearance:this.getAppearance(),asynchronous:!1}),setTimeout(()=>{this.circle.appearance.material.uniforms.color.alpha=2}),this._viewer.scene.primitives.add(this),this},dh.prototype.getInstances=function(){var e,t;return this.clampToGround?(t=Cesium.Cartesian3.fromDegrees(this.position.lon,this.position.lat,this.position.height),e=this._core.setPositionOffset(t,{x:-this.scale[0],y:-this.scale[1],z:0}),t=this._core.setPositionOffset(t,{x:this.scale[0],y:this.scale[1],z:0}),new Cesium.GeometryInstance({geometry:new Cesium.RectangleGeometry({rectangle:Cesium.Rectangle.fromCartesianArray([e,t])}),modelMatrix:this.modelMatrix})):(this.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(this.position.lon,this.position.lat,this.position.height)),new Cesium.GeometryInstance({geometry:this.getGeometry(),modelMatrix:this.modelMatrix}))},dh.prototype.getGeometry=function(){return this._core.customGeometry({scale:this.scale,position:[-1,-1,0,1,-1,0,1,1,0,-1,1,0],st:[0,0,1,0,1,1,0,1],indices:[0,1,2,0,2,3],boundingSphere:new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),1)})},dh.prototype.getAppearance=function(){return new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{image:this.image,angle:this.angle,color:new Cesium.Color(...this.color,0)},source:mh}})})},dh.prototype.update=function(e){this.circle&&this.show&&(this.circle.appearance.material.uniforms.angle=Cesium.Math.toRadians(this.angle+=this.multiple),this.circle.update(e))},dh.prototype.isDestroyed=function(){return this.destroyed},dh.prototype.destroy=function(){this.circle&&this.circle.destroy(),this.circle=null,this.destroyed=!0},dh.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this)},dh.prototype.setVisibility=function(e){this.show=e};var ph="uniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nmaterial.diffuse = czm_gammaCorrect(color.rgb);\nmaterial.alpha = color.a * pow(1.0 - st.t, 2.0);\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n",gh="uniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat powerRatio = fract(czm_frameNumber / 30.0) + 1.0;\nfloat alpha = pow(1.0 - st.t, powerRatio);\nmaterial.diffuse = czm_gammaCorrect(color.rgb);\nmaterial.alpha = alpha * color.a;\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n",fh="uniform sampler2D image;\nuniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 v_st = materialInput.st;\nfloat dt = fract(czm_frameNumber / 90.0);\nvec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt));\nvec4 imageColor = texture2D(image, st);\nvec3 diffuse = imageColor.rgb;\nfloat alpha = imageColor.a;\ndiffuse *= color.rgb;\nalpha *= color.a;\ndiffuse *= color.rgb;\nalpha *= color.a;\nmaterial.diffuse = diffuse;\nmaterial.alpha = alpha * pow(1.0 - v_st.t, 2.0);\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n";function _h(e){this._viewer=e,this._core=new v,this.angle=0,this.multiple=1,this.destroyed=!1,this.type="cylinder",this.show=!0}function Ch(e,t){this.show=!0,this._position=Cesium.Cartesian3.fromDegrees(t.position.lon,t.position.lat,t.position.height),this._command=void 0,this._outlineCommand=void 0,this._angle=0,this._viewer=e,this._speed=X(t.multiple,1),this._color=X(t.color,"#80ccff"),this._color=Cesium.Color.fromCssColorString(this._color).withAlpha(.5),this._outlineColor=X(t.outlineColor,"#ffff00"),this._outlineColor=Cesium.Color.fromCssColorString(this._outlineColor),this._scale=X(t.scale,new Cesium.Cartesian3(1,1,1)),this._modelMatrix=this.computeModelMatrix(),this._height=0,this.animate=X(t.animate,!0),e.scene.primitives.add(this)}function yh(e){this._viewer=e,this._core=new v,this.destroyed=!1,this.show=!0,this._values=new Map,this._viewer.scene.primitives.add(this),this.img={}}function Q(e,t){var h;this._viewer=e,this._cesium=t,this._core=new v,this._Label=new G(this._viewer,this._cesium),this._Circle=new V(this._viewer,this._cesium),this._Box=new B(this._viewer,this._cesium),this._Cone=new j(this._viewer,this._cesium),this._Color=new m(this._viewer,this._cesium),this._Polyline=new R(this._viewer,this._cesium),this._Rectangle=new H(this._viewer,this._cesium),this._Polygon=new M(this._viewer,this._cesium),this._ImageLabel=new sc(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new w(this._viewer,this._cesium,this._ImageryProvidererid),this._Ellipsoid=new Pr(this._viewer,this._cesium),this._PointModel=new P(this._viewer,this._cesium),this._wall=new lc(this._viewer,this._cesium),this._Terrain=new Fc(this._viewer,this._cesium),this._createdynamicObject=new k(this._viewer,this._cesium),this._GeometryCreator,this._ImageryLayer=new hc(this._viewer,this._cesium),this._VolumeGeoJsonFeatureLayer=void 0,this._PolygonVectorGeoJsonFeatureLayer=void 0,this._skyBox=new Nc(this._viewer,this._cesium),this._flowField=new jc(this._viewer,this._cesium),this._canvasField=new ql(this._viewer,this._cesium),this.VectorGeoJsonFeatureLayer=new S(this._viewer,this._cesium),this._straightArrow=new K(this._viewer,this._cesium),this._SimpleGraphic=new x(this._viewer,this._cesium),this._popupmessage=new yi(this._viewer,this._cesium),this.VectorImgFeatureLayer=new ah(this._viewer,this._cesium),this._TerrainModifier=new sh(this._viewer,this._cesium),t.Resource._Implementations.createImageSGS||(h=new de({workerPath:window.SmartEarthRootUrl+"/Workers/nullValueRemoveWorker.js"}),t.Resource._Implementations.createImageSGS=function(e,t,n){var i,a,s={r:0,g:0,b:0,a:255},l=(-1{var t=this.getCylinderGeometryValue(4,4,1,6),t=new Cesium.GeometryInstance({geometry:this.getGeometry(t),modelMatrix:this.modelMatrix});this.cylinder1=new Cesium.Primitive({geometryInstances:t,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{image:e,color:new Cesium.Color(this.color[0],this.color[1],this.color[2],0)},source:fh}}),renderState:{cull:{enabled:!1}}}),asynchronous:!1}),setTimeout(()=>{this.cylinder1.appearance.material.uniforms.color.alpha=2})}),this._viewer.scene.primitives.add(this),this},_h.prototype.getAppearance=function(){return"cylinder"===this.type?new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color:new Cesium.Color(...this.color)},source:ph}}),renderState:{cull:{enabled:!1}}}):"cone"===this.type?new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color:new Cesium.Color(...this.color)},source:gh}}),renderState:{cull:{enabled:!1}}}):void 0},_h.prototype.getGeometry=function(e){return this._core.customGeometry({scale:this.scale,boundingSphere:new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),1),...JSON.parse(JSON.stringify(e))})},_h.prototype.getCylinderGeometryValue=function(e=1,t=1,n=1,a=30){var s=[e,0],l=[t,0],u=Cesium.Math.toRadians(360/a),c=1/a;let h=[],m=[0,1,a+1,1,a+2,a+1],d=[];h[0]=s[0],h[1]=s[1],h[2]=0,h[3*(a+1)]=l[0],h[3*(a+1)+1]=l[1],h[3*(a+1)+2]=n,d[0]=0,d[1]=0,d[2*(a+1)]=0;for(let e=d[2*(a+1)+1]=1,t,i,o,r;e<=a;e++)t=u*e,i=c*e,o=s[0]*Math.cos(t)-s[1]*Math.sin(t),r=s[1]*Math.cos(t)+s[0]*Math.sin(t),h[3*e]=o,h[3*e+1]=r,o=l[h[3*e+2]=0]*Math.cos(t)-l[1]*Math.sin(t),r=l[1]*Math.cos(t)+l[0]*Math.sin(t),h[3*(a+1)+3*e]=o,h[3*(a+1)+3*e+1]=r,h[3*(a+1)+3*e+2]=n,d[2*e]=i,d[2*e+1]=0,d[2*(a+1)+2*e]=i,d[2*(a+1)+2*e+1]=1,m.push(e,e+1,a+e+1,e+1,a+e+2,a+e+1);return{position:h,st:d,indices:m}},_h.prototype.update=function(e){var t;this.cylinder&&this.show&&("cylinder"===this.type&&(void 0===this.dt&&(this.dt=0),this.dt+=.003*this.multiple,1r},owner:this,pass:Cesium.Pass.TRANSLUCENT,modelMatrix:this._modelMatrix,boundingVolume:new Cesium.BoundingSphere(this._position,1)})},Ch.prototype.createVertexArray=function(e,t=!1){t=this.cereatePositionsAndIndice(t),t=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t.positions}),textureCoordinates:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t.sts})},indices:t.indices,primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(t.positions)}),t=Cesium.GeometryPipeline.computeNormal(t);return Cesium.VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:Cesium.BufferUsage.STATIC_DRAW})},Ch.prototype.cereatePositionsAndIndice=function(e=!1){return{indices:e?[0,1,0,1,2,1,2,3,2,3,0,3,0,4,0,1,4,1,2,4,2,3,4,3]:[0,1,4,1,2,4,2,3,4,3,0,4],positions:[1,0,1.5,0,1,1.5,-1,0,1.5,0,-1,1.5,0,0,0],sts:[]}},Ch.prototype.createVertexShader=function(){return"attribute vec3 position;\n void main()\n {\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},Ch.prototype.createFragmentShader=function(){return"uniform vec4 color;\n void main()\n {\n gl_FragColor = color;\n }\n "},Ch.prototype.computeModelMatrix=function(){var e=Cesium.Transforms.eastNorthUpToFixedFrame(this._position),t=Cesium.Matrix4.fromScale(this._scale);return Cesium.Matrix4.multiply(e,t,new Cesium.Matrix4)},yh.prototype.add=function(t={}){t.id=t.id||this._core.uuid(),t.name=t.name||"红绿灯";let e=document.createElement("canvas");var i=e.getContext("2d");return this._values.set(t.id,{id:t.id,name:t.name,canvas:e,context:i,far:t.far||800,state:{left:-1,center:1,right:1,time:30},show:!0,deleteObject:()=>{this.removeById(t.id)},setVisibility:e=>{this.showById(t.id,e)},update:e=>{this.updateById(t.id,e)}}),this.loadImage||(this.loadImage=[Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.l_go).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.l_wait).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.l_stop).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.l_null).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.go).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.wait).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.stop).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.null).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.r_go).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.r_wait).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.r_stop).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.r_null).fetchImage(),Cesium.Resource.createIfNeeded(window.SmartEarthRootUrl+I.trafficLight.bg).fetchImage()]),this.imageData?this.addGeometry(t):Promise.all(this.loadImage).then(e=>{this.imageData={left:{go:e[0],wait:e[1],stop:e[2],null:e[3]},center:{go:e[4],wait:e[5],stop:e[6],null:e[7]},right:{go:e[8],wait:e[9],stop:e[10],null:e[11]},bg:e[12]},this.addGeometry(t)}),this._values.get(t.id)},yh.prototype.addGeometry=function(e={}){let t=this._values.get(e.id);this.drawImage(t,e);var i=e.scale||1,o=.02*t.canvas.width*i,i=.02*t.canvas.height*i,o=new Cesium.Cartesian3(o,i,1),i=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height+i),i=(t.position=i,Cesium.Transforms.eastNorthUpToFixedFrame(i)),r=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e.heading||0),Cesium.Math.toRadians(0),Cesium.Math.toRadians(90)),r=Cesium.Matrix3.fromHeadingPitchRoll(r),r=(Cesium.Matrix4.multiplyByMatrix3(i,r,i),Cesium.Matrix4.fromScale(o)),o=(Cesium.Matrix4.multiply(i,r,i),new Cesium.PlaneGeometry),r=new Cesium.GeometryInstance({geometry:o,modelMatrix:i,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});let n=Cesium.Material.fromType("Image");n.uniforms.image=t.canvas.toDataURL("image/png"),t.geometry=new Cesium.Primitive({id:e,geometryInstances:r,appearance:new Cesium.MaterialAppearance({flat:!0,material:n})})},yh.prototype.getImage=function(e,t){let i="null";return 0===t?i="wait":-1===t?i="stop":1===t&&(i="go"),this.imageData[e][i]},yh.prototype.drawImage=function(e,t){var i=this._core.defaultValue(t.left,e.state.left),o=this._core.defaultValue(t.center,e.state.center),r=this._core.defaultValue(t.right,e.state.right),t=this._core.defaultValue(t.time,e.state.time),n=(e.state={left:i,center:o,right:r,time:t},this.imageData.bg),a=this.getImage("left",i),s=this.getImage("left"),l=this.getImage("center",o),u=this.getImage("center"),c=this.getImage("right",r),h=this.getImage("right"),n=(e.canvas.height=n.height,e.canvas.width=n.width,e.context.drawImage(n,0,0,n.width,n.height,0,0,n.width,n.height),a.height+25),m=2*a.height+35;e.context.drawImage(-1===i?a:s,0,0,a.width,a.height,10,15,a.width,a.height),e.context.drawImage(0===i?a:s,0,0,a.width,a.height,10,n,a.width,a.height),e.context.drawImage(1===i?a:s,0,0,a.width,a.height,10,m,a.width,a.height),e.context.drawImage(-1===o?l:u,0,0,l.width,l.height,303,15,l.width,l.height),e.context.drawImage(0===o?l:u,0,0,l.width,l.height,303,n,l.width,l.height),e.context.drawImage(1===o?l:u,0,0,l.width,l.height,303,m,l.width,l.height),e.context.drawImage(-1===r?c:h,0,0,c.width,c.height,485,15,c.width,c.height),e.context.drawImage(0===r?c:h,0,0,c.width,c.height,485,n,c.width,c.height),e.context.drawImage(1===r?c:h,0,0,c.width,c.height,485,m,c.width,c.height),this.drawTime(e.context,{left:i,center:o,x:153,y:143,time:t})},yh.prototype.drawTime=function(e,t={}){let i=1,o=(0===t.left||0===t.center?i=0:1===t.left||1===t.center?i=1:-1===t.left&&-1===t.center&&(i=-1),"#31fb09"),r=(0===i?o="#ffd511":-1===i&&(o="#f81838"),t.time||0);0===(r=99<(r=r<0?0:r)?99:r)?r="00":r<10?r="0"+r:r+="",e.font="bold 60px Arial",e.fillStyle=o,e.fillText(r,t.x,t.y)},yh.prototype.updateById=function(e,t={}){let i=this._values.get(e);i&&(i.context.clearRect(0,0,i.canvas.width,i.canvas.height),this.drawImage(i,t),i.context.isUpdate=!0)},yh.prototype.update=function(e){if(this.show)for(var t of this._values.values())t.show&&t.geometry&&this.isShow(t)&&(t.context.isUpdate&&(t.geometry.appearance.material.uniforms.image=t.canvas.toDataURL("image/png"),t.context.isUpdate=null),t.geometry.update(e))},yh.prototype.isShow=function(e){return Cesium.Cartesian3.distance(this._viewer.camera.position,e.position){e.style=0==t?new Cesium.Cesium3DTileStyle({show:!1}):1==t?new Cesium.Cesium3DTileStyle({show:!0}):new Cesium.Cesium3DTileStyle({color:`color('rgba(255,255,255,${t})')`})})},Q.prototype.createTerrainModifier=function(e,t,i){return this._TerrainModifier.createTerrainModifier(e,t,i)},Q.prototype.createS3MLayer=function(e,t={},i){return new Rt({url:e,...t=t instanceof Cesium.Scene?{scene:t}:t},i)},Q.prototype.createWaterPolygonLayer=function(e={}){let t=new ch(this._viewer);return t.createPolygonLayer(e)},Q.prototype.createCloudMap=function(e,t,i,o){return new M(this._viewer,this._cesium).createCloudMap(e,t,i,o)},Q.prototype.addVideoPolygon=function(e,t){return new M(this._viewer,this._cesium).addVideoPolygon(e,t)},Q.prototype.addVideoBox=function(e,t){return new M(this._viewer,this._cesium).addVideoPlane(e,t)},Q.prototype.CZML=function(e,t,i){let o=new ih(this._viewer,this._cesium);return o.addCZML(e,t,i)},Q.prototype.addHeatMap=function(e,t){let i=new oh(this._viewer,this._cesium);return i.addHeatMap(e,t)},Q.prototype.militaryPlotting=function(e,t,i,o){var r=this._straightArrow,n=null;let a,s;i?s="function"==typeof i?(a={},i):(a=i,o):a={};var l=e=>{a.removeEdit&&r.MilitaryStandardObj.pop(),r.defaultEdit(),s&&s(e)};switch(e){case"StraightArrow":n=r.createStraightArrow(t,a,l);break;case"SwallowtailArrow":n=r.createSwallowtailArrow(t,a,l);break;case"PincerArrow":n=r.createPincerArrow(t,a,l);break;case"AttackArrow":n=r.createAttackArrow(t,a,l);break;case"GatheringPlace":n=r.createHandlerPolygon(t,a,l);break;case"RoundedRectangle":n=r.createRoundedRectangle(t,a,l);break;case"Sector":n=r.createSector(t,a,l);break;case"Bow":n=r.createBow(t,a,l);break;case"Bezierline":n=r.createBezierline(a,l);break;case"BezierArrow":n=r.createBezierArrow(a,l)}return n},Q.prototype.MilitaryCopy=function(e){return this._straightArrow.copyJb(e)},Q.prototype.NightMode=function(e){let t=this._viewer;var i=t.imageryLayers.length;let o,r;r=e?o=.15:o=1;for(let e=0;e{e.imageBasedLightingFactor.x=r,e.imageBasedLightingFactor.y=r}),t.scene.skyAtmosphere.show=!e},Q.prototype.SaveMilitaryStandard=function(){this._straightArrow.save()},Q.prototype.OpenMilitaryStandard=function(e){this._straightArrow.open(e)},Q.prototype.ClearMilitaryStandard=function(){this._straightArrow.clear()},Q.prototype.getEntityById=function(e){return this._straightArrow.getEntityById(e)},Q.prototype.startModify=function(e){this._straightArrow.edit(e)},Q.prototype.createSimpleGraphic=function(e,t,i){let o=this._SimpleGraphic;return o.createSimpleGraphic(e,t,i)},Q.prototype.addSimpleGraphic=function(e,t,i){let o=this._SimpleGraphic;return o.addSimpleGraphic(e,t,i)},Q.prototype.GeoWTFS=function(e){return this._TdtLabel||(this._TdtLabel=new uh(this._viewer,this._cesium)),this._TdtLabel.GeoWTFS(e)},Q.prototype.Video3D=function(e){let t=new lh(this._viewer,this._cesium);return t.Video3D(e)},Q.prototype.addRotateEffectCircle=function(e){return new dh(this._viewer).createRotateCircle(e)},Q.prototype.addTetrahedron=function(e){return new Ch(this._viewer,e)},Q.prototype.addTrafficLight=function(e){return this._TrafficLight||(this._TrafficLight=new yh(this._viewer)),this._TrafficLight.add(e)},Q.prototype.addDRWEffectCircle=function(e){return new dh(this._viewer).createDRWCircle(e)},Q.prototype.addEffectCylinder=function(e){return new _h(this._viewer).createCylinder(e)},Q.prototype.addEffectCone=function(e){return new _h(this._viewer).createCone(e)},Q.prototype.createGeoJsonFeatureLayerProviderOptimization=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Q.prototype.createGeoJsonFeatureLayerProviderGisOptimization=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerGisOptimization(e,t,i,o,r,n)},Q.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Q.prototype.PointVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.PointVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Q.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.PolylineVectorGeoJsonFeatureLayerGis(e,t,i,o,r,n)},Q.prototype.createGeoJsonFeatureLayerProviderClassOptimization=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerClassOptimization(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimization1(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimizationtest=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerDthOptimization(e,t,i,o,r,n)},Q.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e,t,i,o,r,n)},Q.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VolumeVectorGeoJsonFeatureLayerOptimizationtest(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp(e,t,i,o,r,n)},Q.prototype.createHistogramVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createHistogramVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLaycolorVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createVector3DTilesFeatureLayer=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVector3DTilesFeatureLayer(e,t,i,o,r,n)},Q.prototype.createVector3DTilesFeatureLayerRelease=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVector3DTilesFeatureLayerRelease(e,t,i,o,r,n)},Q.prototype.createGeojsonImage=function(e){return new S(this._viewer,this._cesium).createGeojsonImage(e)},Q.prototype.createGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.VectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createGeojsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,o,r){var n=new w(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createGeojsonKmlFeatureLayer(e,t,i,o,r)},Q.prototype.sfsterrainprovider=function(e,t,i,o,r){var n=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain(e,t,i,o,r)},Q.prototype.createWMTSTerrain=function(e,t,i,o,r){var n=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createWMTSTerrain(e,t,i,o,r)},Q.prototype.sfsterrainprovider71=function(e,t,i,o,r){var n=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createSFSTerrain71(e,t,i,o,r)},Q.prototype.createTerrain=function(e,t,i,o,r){var n=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createTerrain(e,t,i,o,r)},Q.prototype.createTerrainLayer=function(e,t,i,o,r,n){var a=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createTerrainLayer(e,t,i,o,r,n)},Q.prototype.createArcGISTerrain=function(e,t,i,o,r){var n=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,n.createArcGISTerrain(e,t,i,o,r)},Q.prototype.createCesiumTerrain=function(e,t,i,o){var r=new Fc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,r.createCesiumTerrain(e,t,i,o)},Q.prototype.getFlyData=function(e,t){this._createdynamicObject.getFlyData(e,t)},Q.prototype.createDynamicObject=function(e,t,i){return this._createdynamicObject.Start(e,t,i)},Q.prototype.addmodle=function(e){return this._createdynamicObject.addmodle(e)},Q.prototype.createSatelliteTrail=function(e){let t=new rh(this._viewer,this._cesium);return t.createSatelliteTrail(e)},Q.prototype.executePauseFly3DPaths=function(){return this._createdynamicObject.executePauseFly3DPaths()},Q.prototype.executePlayForwardFly3DPaths=function(){return this._createdynamicObject.executePlayForwardFly3DPaths()},Q.prototype.executePlayReverseFly3DPaths=function(){return this._createdynamicObject.executePlayReverseFly3DPaths()},Q.prototype.executeSignout=function(){return this._createdynamicObject.executeSignout()},Q.prototype.createLabel=function(e,t,i,o,r){var n=new G(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabel(e,t,i,o,r)},Q.prototype.createPosition=function(e,t,i){return new ac(this._viewer,this._cesium).createPosition(e,t,i)},Q.prototype.createLocation=function(e,t,i){return this._Point.createLocation(e,t,i)},Q.prototype.createPoint=function(e,t,i,o,r,n){return this._Point.createPoint(e,t,i,o,r,n)},Q.prototype.createLonlat=function(e){return this._Point.createLonlat(e)},Q.prototype.createDivPoint=function(e,t,i){let o=new Ci(this._viewer);return o.createDivPoint(e,t,i)},Q.prototype.createRichTextPoint=function(e,t,i,o){return this._Point.createRichTextPoint(e,t,i,o)},Q.prototype.SkyBox=function(e,t){return this._skyBox.SkyBox(e,t)},Q.prototype.setSpaceBackground=function(e){return this._skyBox.setSpaceBackground(e)},Q.prototype.createWindField=function(e,t){return this._flowField.createWindField(e,t)},Q.prototype.createField=function(e,t){return this._canvasField.createField(e,t)},Q.prototype.createRoad=function(e={}){let t=new Xc(this._viewer);return t.createRoad(e)},Q.prototype.createTrailLinePath=function(e,t,i){return this._trailLine.createPath(e,t,i)},Q.prototype.createFlyingLine=function(e,t){return this._trailLine.createFlyingLine(e,t)},Q.prototype.createTrailLineWall=function(e,t){return this._trailLine.createWall(e,t)},Q.prototype.createTrailLine=function(e,t){return this._trailLine.createLine(e,t)},Q.prototype.createModel=function(e,t,i,o,r,n){return new P(this._viewer,this._cesium).createModel(e,t,i,o,r,n)},Q.prototype.createModelEditable=function(e,t,i,o,r,n){return new P(this._viewer,this._cesium).createModelEditable(e,t,i,o,r,n)},Q.prototype.createPointModel=function(e,t){return this._PointModel.createPointModel(e,t)},Q.prototype.executePolyline=function(e){return new R(this._viewer,this._cesium).executePolyline(e)},Q.prototype.executePolygon=function(e){return new M(this._viewer,this._cesium).executePolygon(e)},Q.prototype.executeWall=function(e,t){return new lc(this._viewer,this._cesium).executeWall(e,t)},Q.prototype.createWall=function(e,t,i,o){return new lc(this._viewer,this._cesium).createWall(e,t,i,o)},Q.prototype.executePolyline1=function(e){return new R(this._viewer,this._cesium).executePolyline1(method)},Q.prototype.createPolylineVolume=function(e,t,i,o,r){return new nc(this._viewer,this._cesium).createPolylineVolume(e,t,i,o,r)},Q.prototype.createCorridor=function(e,t,i,o){return new tu(this._viewer,this._cesium).createCorridor(e,t,i,o)},Q.prototype.addViewCone=function(e){let t=new Qo(this._viewer,this._cesium);return t.addViewCone(e)},Q.prototype.createViewCone=function(e,t){let i=new Qo(this._viewer,this._cesium);return i.createViewCone(e,t)},Q.prototype.createModifyMesh=function(e,t,i,o,r){return this.createModelClipping(o,{type:"polygon",isInner:!0,positions:t})},Q.prototype.createModelClipping=function(e,t){return new th(this._viewer,this._cesium).addClipping(e,t)},Q.prototype.createModelModifier=function(i,o,r,n){let a=[];return this._D3Tilesets&&this._D3Tilesets.forEach((e,t)=>{e=this.createModifyMesh(i,o,r,e,n);a.push(e)}),{remove:()=>{a.forEach((e,t)=>{e.remove()}),a=[]}}},Q.prototype.createPopupMessage=function(e){return new yi(this._viewer,this._cesium).createPopupMessage(e)},Q.prototype.createMeasurement=function(e){return new yi(this._viewer,this._cesium).createMeasurement(e)},Q.prototype.createPlotting=function(e){return new yi(this._viewer,this._cesium).createPlotting(e)},Q.prototype.createPopupProp=function(e,t){return this._popupmessage.createPopupProp(e,t)},Q.prototype.createModelLibrary=function(e){return this._popupmessage.createModelLibrary(e)},Q.prototype.createHawkeye=function(e,t){return new Zc(this._viewer,this._cesium).createHawkeye(e,t)},Q.prototype.createGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createBillboardGeoJsonFeature=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createBillboardGeoJsonFeature(e,t,i,o,r,n)},Q.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Ei(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createBillboardPointGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createKmlLayer=function(e,t,i){return new $c(this._viewer,this._cesium).createKmlLayer(e,t,i)},Q.prototype.addKmlLayer=function(e,t,i,o){return new $c(this._viewer,this._cesium).addKmlLayer(e,t,i,o)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis=function(e,t,i,o,r){var n=new so(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createBillboardGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ei(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createBillboardGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createPointGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointGeojsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createModelGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelGeojsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createCirclePointGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelPointGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPrimitivLabelPointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabelPointGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelPointGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createSXTLabelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n,a){var s=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,s.createCustomCallbackGeoJsonFeatureLayerProvider(e,t,i,o,r,a,n)},Q.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createLabelPolymerizationGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointPolymerizationGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelpolymerizationGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelpolymerizationGeoJsonFeatureLayers(e,t,i,o,r,n)},Q.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createStreetscapeGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPrimitiveLabelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelImageGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelImageGeoJsonFeatureLayerProvider1(e,t,i,o,r,n)},Q.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createLabelRichtextGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createModelGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPointGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createArcGisImageryLayer=function(e,t,i,o,r,n){var a=new hc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createArcGisImageryLayer(e,t,i,o,r,n)},Q.prototype.createImageryLayerGrid=function(e){return new hc(this._viewer,this._cesium).createImageryLayerGrid(e)},Q.prototype.createWebMapServerImageLayer=function(e,t,i,o,r,n){var a=new hc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapServerImageLayer(e,t,i,o,r,n)},Q.prototype.createWebMapTileServerImageLayer=function(e,t,i,o,r,n){var a=new hc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createWebMapTileServerImageLayer(e,t,i,o,r,n)},Q.prototype.createUrlTemplateImageryProvider=function(e,t,i,o,r,n){var a=new hc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createUrlTemplateImageryProvider(e,t,i,o,r,n)},Q.prototype.createCirclePointGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createCirclePointGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPrimitivePolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ri(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPrimitiveGroundPolylineGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Ri(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createGroundPolylineGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.exectPointModel=function(e,t,i,o,r,n){var a=new P(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.exectPointModel(e,t,i,o,r,n)},Q.prototype.createPolygonModel=function(e,t,i,o,r,n){var a=new P(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonModel(e,t,i,o,r,n)},Q.prototype.modelMove=function(){return new P(this._viewer,this._cesium).modelMove()},Q.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Ri(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineVectorGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,o,r,n){var a=new Ri(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolylineVectorGeoJsonFeatureLayerProviderModel(e,t,i,o,r,n)},Q.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createpolylineVolumeGeojsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createpolylineVolumeGeojsonPrimitiveLayer(e,t,i,o,r,n)},Q.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,i,o,r){var n=new Hc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createVolumeGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Hc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerOptimizations=function(e,t,i,o,r,n){var a=new Hc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Hc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPolygonVectorGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new Gc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,i,o,r,n){var a=new Gc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerOptimization(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(e,t,i,o,r,n){var a=new Gc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayersd(e,t,i,o,r,n)},Q.prototype.createWallGeoFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallGeoFeatureLayer(e,t,i,o,r,n)},Q.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,i,o,r,n){var a=new uo(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallPrimitiveGeoFeatureLayer(e,t,i,o,r,n)},Q.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new uo(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createWallGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createImageryProvider=function(e,t,i,o,r,n,a){var s=new hc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,s.createImageryProvider(e,t,i,o,r,n,a)},Q.prototype.createCacheImageryProvider=function(e,t,i,o,r,n){var a=new hc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,a.createCacheImageryProvider(e,t,i,o,r,n)},Q.prototype.createterrainProvider=function(e,t,i,o){return this._TerrainProvider.createterrainProvider(e,t,i,o)},Q.prototype.createPolylineImageryProviderer=function(e,t,i,o){return this._ImageryLayer.createPolylineImageryProviderer(e,t,i,o)},Q.prototype.createMVTWithStyle=function(e,t,i,o){return this._ImageryLayer.createMVTWithStyle(e,t,i,o)},Q.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,o,r,n){var a=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createPolygonGeoJsonFeatureLayer1=function(e,t,i,o,r){var n=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonGeoJsonFeatureLayer(e,t,i,o,r)},Q.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProvider(e,t,i,o,r,n)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(e,t,i,o,r,n){var a=new Gc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVolumeVectorGeoJsonFeatureLayerDth(e,t,i,o,r,n)},Q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,i,o,r,n){var a=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderModel(e,t,i,o,r,n)},Q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,o,r,n){var a=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,o,r,n)},Q.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(e,t,i,o,r,n){var a=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createPolygonVectorGeoJsonFeatureLayerProviderlsd(e,t,i,o,r,n)},Q.prototype.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,i,o,r,n){var a=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,a.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls(e,t,i,o,r,n)},Q.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,i,o,r){var n=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonVectorFeatureLayerProvider(e,t,i,o,r)},Q.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,i,o,r){var n=new Oi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygonVectorMonomerFeatureLayerProvider(e,t,i,o,r)},Q.prototype.createPolygonMapGeoJsonFeatureLayer=function(e,t,i,o,r,n){return this._MapGeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e,t,i,o,r,n)},Q.prototype.createGeoJsonDataSource=function(e,t,i,o,r){var n=new w(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createGeoJsonDataSource(e,t,i,o,r)},Q.prototype.DeleteObject=function(e){if(this._core.isnull(e._viewer))console.log("obj is null");else for(var t in e.deleteObject(),e)delete e[t]},Q.prototype.createCircle=function(e,t,i,o){return new V(this._viewer,this._cesium).createCircle(e,t,i,o)},Q.prototype.CreateRectangle=function(e,t,i,o,r){return new H(this._viewer,this._cesium).CreateRectangle(e,t,i,o,r)},Q.prototype.createBox=function(e,t,i,o){return(t=new B(this._viewer,this._cesium)).createBox(e,t,i,o)},Q.prototype.createBillboardbatch=function(e){return new xl(this._viewer,this._cesium).createBillboardbatch(e)},Q.prototype.createBillboard=function(e){return new xl(this._viewer,this._cesium).createBillboard(e)},Q.prototype.createCone=function(e,t,i,o){return new j(this._viewer,this._cesium).createCone(e,t,i,o)},Q.prototype.createRectangularSensor=function(e,t,i,o){return new j(this._viewer,this._cesium).createRectangularSensor(e,t,i,o)},Q.prototype.createRadarMaskScan=function(e,t,i,o){return new j(this._viewer,this._cesium).createRadarMaskScan(e,t,i,o)},Q.prototype.ConicSensor=function(e,t,i){return new eu(this._viewer).create(e,t,i)},Q.prototype.FieldIntensity=function(e,t){return new hh(this._viewer).create(e,t)},Q.prototype.createRadarMask=function(e,t,i,o){return new j(this._viewer,this._cesium).createRadarMask(e,t,i,o)},Q.prototype.createConeRadar=function(e,t){return new j(this._viewer,this._cesium).createConeRadar(e,t)},Q.prototype.createColor=function(e,t,i,o){return new m(this._viewer,this._cesium).createColor(e,t,i,o)},Q.prototype.createPolyline=function(e,t,i,o,r){var n=new R(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolyline(e,t,i,this._core.isnull(o)?0:o,r)},Q.prototype.createLink=function(e,t,i){return new R(this._viewer,this._cesium).createLink(e,t,i)},Q.prototype.createLinkPro=function(e,t,i){return new R(this._viewer,this._cesium).createLinkPro(e,t,i)},Q.prototype.createLandingLine=function(e,t={}){return new R(this._viewer,this._cesium).createLandingLine(e,t)},Q.prototype.createLinkPros=function(e){return new R(this._viewer,this._cesium).createLinkPros(e)},Q.prototype.createPathLayer=function(e){return this._trailLine.createPathLayer(e)},Q.prototype.createTrailWallLayer=function(e){return this._trailLine.createWallLayer(e)},Q.prototype.createPolygon=function(e,t,i,o,r){var n=new M(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.createPolygon(e,t,i,o,r)},Q.prototype.createSector=function(e,t,i,o,r){return new M(this._viewer,this._cesium).createSector(e,t,i,o,r)},Q.prototype.executeEllipsoid=function(e,t,i,o){t=new Pr(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,t.createEllipsoid(e,t,i,o)},Q.prototype.createImageLabel=function(e,t,i,o){var r=new sc(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(i=F.selectedItem.id),i=this._core.isnull(i)?0:i,r.createImageLabel(e,t,i,o)},Q.prototype.toHtmlColor=function(e){return this._Color.toHtmlColor(e)},Q.prototype.CreateLabel=function(e,t,i,o,r,n){var a=new G(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(r=F.selectedItem.id),r=this._core.isnull(r)?0:r,a.CreateLabel(e,t,i,o,r,n)},Q.prototype.CreateImageLabel=function(e,t,i,o,r){var n=new sc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreateImageLabel(e,t,i,o,r)},Q.prototype.createImage=function(e,t,i,o,r){var n=new sc(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreateImageLabel(e,t,i,o,r)},Q.prototype.CreatePolyline=function(e,t,i,o,r){var n=new R(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(o=F.selectedItem.id),o=this._core.isnull(o)?0:o,n.CreatePolyline(e,t,i,o,r)},Q.prototype.CreateCircle=function(e,t,i,o,r,n){var a=new V(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(r=F.selectedItem.id),r=this._core.isnull(r)?0:r,a.CreateCircle(e,t,i,o,r,n)},Q.prototype.CreateEllipse=function(e,t,i,o,r,n,a,s){var l=new V(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(a=F.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateEllipse(e,t,i,o,r,n,a,s)},Q.prototype.CreateBox=function(e,t,i,o,r,n,a,s){var l=new B(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(a=F.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateBox(e,t,i,o,r,n,a,s)},Q.prototype.CreatePosition=function(e,t,i,o,r,n,a,s){return new ac(this._viewer,this._cesium).CreatePosition(e,t,i,o,r,n,a,s)},Q.prototype.createColor=function(e,t,i,o){return new m(this._viewer,this._cesium).CreateColor(e,t,i,o)},Q.prototype.CreateCone=function(e,t,i,o,r,n,a,s){var l=new j(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(a=F.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCone(e,t,i,o,r,n,a,s)},Q.prototype.CreateCylinder=function(e,t,i,o,r,n,a,s){var l=new j(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(a=F.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateCylinder(e,t,i,o,r,n,a,s)},Q.prototype.CreateSphere=function(e,t,i,o,r,n,a,s){var l=new Pr(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(F.selectedItem)&&"group"==F.selectedItem.type&&(a=F.selectedItem.id),a=this._core.isnull(a)?0:a,l.CreateSphere(e,t,i,o,r,n,a,s)},Q.prototype.createPointOptimization=function(e,t){return new L(this._viewer,this._cesium).createPointOptimization(e,t)},Q.prototype.createRectangleOptimization=function(e,t){return new H(this._viewer,this._cesium).createRectangleOptimization(e,t)},Q.prototype.createCircleOptimization=function(e,t){return new V(this._viewer,this._cesium).createCircleOptimization(e,t)},Q.prototype.createCylinderOptimization=function(e,t){return new j(this._viewer,this._cesium).createCylinderOptimization(e,t)},Q.prototype.createPointOptimization=function(e,t){return new L(this._viewer,this._cesium).createPointOptimization(e,t)},Q.prototype.CreatePolygonEdit=function(){return this._core.EntityEdit(this._viewer,this._cesium)},Q.prototype.CreateVectorImageFeatureLayer=function(e,t,i,o,r,n,a){return this.VectorImgFeatureLayer.CreateVectorImageFeatureLayer(e,t,i,o,r,n,a)},Q.prototype.createVolumetricMeasureTool=function(){return new dr(this._viewer,this._cesium)},Object.defineProperties(Q.prototype,{SimpleGraphic:{get:function(){return this._SimpleGraphic}},GeoJsonFeatureLayer:{get:function(){return this._GeoJsonFeatureLayer}},MilitaryPlotting:{get:function(){return this._straightArrow}},_D3Tileset:{get:function(){return new A(this._viewer,this._cesium)}}}),Object.defineProperties(Q.prototype,{_trailLine:{get:function(){return new qc(this._viewer,this._cesium)}}}),Object.defineProperties(Q.prototype,{_Point:{get:function(){return new L(this._viewer,this._cesium)}},GeometryCreator:{CreateLinearRingGeometry:function(e){return{}}}}),vh.prototype.get=function(e){return this.czmlData.get(e)},vh.prototype.flyTo=function(e){this._viewer.flyTo(this.get(e))},vh.prototype.trackedEntity=function(e){let t=this.get(e);this._viewer.trackedEntity=t.entities.getById(e)},vh.prototype.delete=function(e){var t=this.czmlData.get(e);this._viewer.dataSources.remove(t),this.czmlData.delete(e)},vh.prototype.deleteAll=function(){for(var e of this.czmlData.values())this._viewer.dataSources.remove(e);this.czmlData=new Map},vh.prototype.getThisPlayTime=function(){return this._viewer.clock.currentTime.secondsOfDay-this._viewer.clock.startTime.secondsOfDay},vh.prototype.init=function(i,e,o={}){var t={gltf:o.modelUrl||"http://183.162.245.49:18076/sdkdemo_2022/SmartEarthSDK/Workers/Model/xiaoche.glb",runAnimations:!0,scale:o.modelScale||1,minimumPixelSize:o.minimumPixelSize};let r=[{id:"document",name:"czmlPathAnimation",version:"1.0",clock:{interval:"2021-01-01T00:00:00Z/2021-01-02T00:00:00Z",currentTime:"2021-01-01T00:00:00Z",multiplier:1}}],n=this.getThisPlayTime();e={lon:e.lon,lat:e.lat,height:e.alt||e.height||0};r.push({path:{show:void 0!==o.showPath&&o.showPath,leadTime:0,trailTime:1e5,width:3,resolution:1,material:{polylineGlow:{glowPower:.3,taperPower:1,color:{rgba:o.color||[255,255,0,255]}}}},id:i,position:{interpolationAlgorithm:"LINEAR",interpolationDegree:1,forwardExtrapolationType:"HOLD",backwardExtrapolationType:"HOLD",epoch:"2021-01-01T00:00:00Z",cartographicDegrees:[n,e.lon,e.lat,e.height,86400,e.lon,e.lat,e.height]},orientation:{velocityReference:"#position"},model:t});let a=new this.Cesium.CzmlDataSource;return this._viewer.dataSources.add(a),a.prePosition=e,this.czmlData.set(i,a),a.process(r).then(e=>{let t=e.entities.getById(i);t.propData=o.propData,this._viewer.clock.currentTime=this.Cesium.JulianDate.addSeconds(this._viewer.clock.startTime.clone(),n,new this.Cesium.JulianDate),o.callback&&o.callback(a)}),a},vh.prototype.update=function(e,t,i=1){let o=this.get(e);var r=this.getThisPlayTime(),t={lon:t.lon,lat:t.lat,height:t.alt||t.height||0};let n=t.lon-o.prePosition.lon,a=t.lat-o.prePosition.lat,s=t.height-o.prePosition.height;e=[{id:e,position:{epoch:"2021-01-01T00:00:00Z",cartographicDegrees:[r+i,t.lon,t.lat,t.height,86400,t.lon+n,t.lat+a,t.height+s]}}];o.prePosition=t,o&&o.process(e)},vh.prototype.pick=function(t){this.endPick(),this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let i;this.pickHandler.setInputAction(e=>{(i=this._viewer.scene.pick(e.endPosition))&&i.id&&this.get(i.id.id)&&t&&t(i)},this.Cesium.ScreenSpaceEventType.LEFT_CLICK)},vh.prototype.endPick=function(){this.pickHandler.destroy(),this.pickHandler=void 0},wh.prototype.AttachEvent=function(e,o){var t,i,r=this._viewer,n=this._Core,n=this._Core;return e===zr.L_Click?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),i):e===zr.L_DBL_Click?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i):e===zr.L_Down?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),i):e===zr.L_Up?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.LEFT_UP),i):e===zr.M_Click?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),i):e===zr.M_Down?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),i):e===zr.M_Up?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),i):e===zr.R_Click?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),i):e===zr.R_Down?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),i):e===zr.R_Up?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){var t=r.scene.pickPosition(e.position);let i;t&&(i=n.toDegrees(t)),"function"==typeof o&&o(e,i)},this._cesium.ScreenSpaceEventType.RIGHT_UP),i):e===zr.Wheel?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){"function"==typeof o&&o(e)},this._cesium.ScreenSpaceEventType.WHEEL),i):e===zr.Move?(t=this._viewer.scene,(i=new this._cesium.ScreenSpaceEventHandler(t.canvas)).setInputAction(function(e){"function"==typeof o&&o(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),i):void 0},wh.prototype.AttachOnLButtonDblClkEvent=function(i){var e=this._viewer.scene,o=this._viewer,r=this._Core,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),e},wh.prototype.AttachOnLButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),e},wh.prototype.AttachOnLButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.LEFT_UP),e},wh.prototype.AttachOnMButtonDblClkEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),e},wh.prototype.AttachOnMButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),e},wh.prototype.AttachOnMButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),e},wh.prototype.AttachOnMouseWheelEvent=function(t){var e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){"function"==typeof t&&t(e)},this._cesium.ScreenSpaceEventType.WHEEL),e},wh.prototype.AttachOnFrameEvent=function(t){var e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){"function"==typeof t&&t(e)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),e},wh.prototype.AttachOnRButtonDownEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),e},wh.prototype.AttachOnRButtonUpEvent=function(i){var o=this._viewer,r=this._Core,e=this._viewer.scene,e=new this._cesium.ScreenSpaceEventHandler(e.canvas);return e.setInputAction(function(e){e=o.scene.pickPosition(e.position);let t;e&&(t=r.toDegrees(e)),"function"==typeof i&&i(click,t)},this._cesium.ScreenSpaceEventType.RIGHT_UP),e},wh.prototype.AttachCameraChangeEvent=function(e){return this._viewer.scene.camera.percentageChanged=1e-6,this._viewer.scene.camera.changed.addEventListener(e),e},wh.prototype.CameraMoveEndEvent=function(e){var t=this._viewer,i=!1;function o(){i=!0}function r(){i&&(e&&e(),t.scene.camera.moveStart.removeEventListener(o),t.scene.camera.moveEnd.removeEventListener(r))}setTimeout(function(){t.scene.camera.moveStart.addEventListener(o),t.scene.camera.moveEnd.addEventListener(r)},0)},bh.prototype.DetachEvent=function(e,t){t===zr.L_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK):t===zr.L_DBL_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK):t===zr.L_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN):t===zr.L_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP):t===zr.M_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK):t===zr.M_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN):t===zr.M_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP):t===zr.R_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK):t===zr.R_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN):t===zr.R_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP):t===zr.Wheel?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL):t===zr.Move?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE):e&&e.destroy()},bh.prototype.DetachEventAll=function(e){e&&e.destroy()},bh.prototype.RemoNormalCesiumLeftDoubleClick=function(){this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},bh.prototype.DetachCameraChangeEvent=function(e){this._viewer.scene.camera.percentageChanged=.5,this._viewer.scene.camera.changed.removeEventListener(e)},Th.prototype.zoomIn=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomIn(e)},Eh.prototype.zoomOut=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomOut(e)},Sh.prototype.flyToObj=function(e){if(e&&e.flyTo)e.flyTo();else if(e&&null!=e.west&&null!=e.west)this._viewer.camera.flyTo({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else if(e&&e.rectangle)this._viewer.camera.flyTo({destination:e.rectangle});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=F.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.flyTo(i)}catch(e){}}var o,r,n,a,s;e&&e.item?e.item.entities?this._viewer.flyTo(e.item):e.item._primitives&&e.item._primitives.length?0<(t=f.filter(e.item._primitives,function(e){return null==e.geometryInstances})).length&&(null!=t[0]._boundingSpheres?this._viewer.camera.flyToBoundingSphere(t[0]._boundingSpheres[0]):null!=t[0]._primitive&&null!=t[0]._primitive&&null!=t[0]._primitive._boundingSpheres[0]&&null!=t[0]._primitive._boundingSpheres[0]?this._viewer.camera.flyToBoundingSphere(t[0]._primitive._boundingSpheres[0]):null!=t[0]._labels&&0{this._viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z,i),++r>=o&&(this._viewer.clock.onTick.removeEventListener(n),t&&t())};this._viewer.clock.onTick.addEventListener(n)},Lh.prototype.deleteItem=function(e){F.delete(e,this._viewer,this._cesium)},Lh.prototype.testTreeSource=function(){console.log(this._tree)},Mh.prototype.findItem=function(e){for(var t="",i=f.clone(this._tree),o=e.split("\\"),r=0;r{e.objectType===t&&i.push(e)}),i.forEach(e=>{this._viewer.entities.remove(e)}),i=null},q.prototype.setVisibilityAll=function(t,i){this._viewer.entities.values.forEach(e=>{e.objectType===t&&(e.show=i)})},q.prototype.rename=function(e,t){return this._renameGroup.rename(e,t)},q.prototype.getNextItem=function(e,t){return this._getNextItem.getNextItem(e)},q.prototype.isGroup=function(e){return this._isGroup.isGroup(e)},Object.defineProperties(q.prototype,{exitsObjectType:{get:function(){return Vh}}}),q.prototype.insertProjectTree=function(e,t,i,o,r,n){return this._core.isnull(e)&&!this._core.isnull(this._tree.selectedItem)&&"group"==this._tree.selectedItem.type&&(e=this._tree.selectedItem.id),e=this._core.isnull(e)?0:e,this._core.isnull(t)||(e=this.createGroup(t,!0,e)),this._getObject.insertProjectTree(e,i,o,r,n)},q.prototype.exitsGroup=function(e,t){return F.exitsGroup(e,t)},q.prototype.getTreeSource=function(){var e=f.cloneDeep(F.getSource());return F.removeItem(e)},q.prototype.unifiedProject=function(e,t){this._getObject.unifiedProject(e,t)},q.prototype.clearn=function(){F.clearn()},Object.defineProperties(q.prototype,{Source:{get:function(){return F.TempSource}}}),Object.defineProperties(q.prototype,{currentObj:{get:function(){return F.currentObj}}}),q.prototype.InitTree=function(e,t){if(e&&e.length)for(var i=0;i{e.success&&e.registeredModules&&e.registeredModules.indexOf(37)?(new Date).getTime()<(a=new Date(e.expireDate).getTime())&&(n=!0,Cesium[s]=u):n=!1;e=logSmartEarthLog&&logSmartEarthLog(a);(n=e?!0:n)||(cn(t),this[l].destroy())}),!u){var c=logSmartEarthLog&&logSmartEarthLog(a);if(!(n=c?!0:n))return void cn(t)}Cesium.Ion.defaultAccessToken=e.defaultAccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8",this.rightRotate=e.rightRotate;var h={toolbar:!1,baseLayerPicker:!1,shadows:!1,skyAtmosphere:new Cesium.SkyAtmosphere,terrainShadows:Cesium.ShadowMode.ENABLED,shouldAnimate:!0,animation:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!0,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,imageryProviderViewModels:[],terrainProviderViewModels:[],contextOptions:{webgl:{preserveDrawingBuffer:!0},failIfMajorPerformanceCaveat:!1},navigation:!0,disableRightClickMenu:!0};if("string"==typeof e?h.imageryProvider=new Cesium.SingleTileImageryProvider({url:e}):(e.url&&(h.imageryProvider=new Cesium.SingleTileImageryProvider({url:e.url})),this._core.extend(h,e,!0)),h.baseLayerPicker){let t=this.getAllImageryView();if(h.basemaps)h.basemaps.forEach(e=>{h.imageryProviderViewModels.push(t[e])});else for(var m in t)h.imageryProviderViewModels.push(t[m])}else h.imageryProvider||(c=this._core.defaultValue(localStorage.getItem("sdkIsOnline"),1),parseInt(c)?h.imageryProvider=new Cesium.ArcGisMapServerImageryProvider({name:"ArcGisMapServer",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"}):h.imageryProvider=new Cesium.SingleTileImageryProvider({url:window.SmartEarthRootUrl+"Workers/image/earth.jpg"}));c={destination:Cesium.Cartesian3.fromDegrees(e.x||110,e.y||32,e.z||8e6),orientation:{heading:Cesium.Math.toRadians(this._core.defaultValue(e.heading,0)),pitch:Cesium.Math.toRadians(this._core.defaultValue(e.pitch,-90)),roll:Cesium.Math.toRadians(this._core.defaultValue(e.roll,0))},duration:e.duration||.5};if(e.removeGlobe&&(h.skyBox=!1,h.skyAtmosphere=!1,h.contextOptions={failIfMajorPerformanceCaveat:!1,webgl:{alpha:!0,preserveDrawingBuffer:!0}}),this._Viewer=new Cesium.Viewer(t,h),this._Viewer.scene,this._tree=i,this._Viewer._enableInfoOrSelection=!1,this._Viewer.scene.globe.baseColor=Cesium.Color.WHITE,this._Viewer.shadowMap.size=2048,this._Viewer._cesiumWidget._creditContainer.style.display="none",this._Viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,this._AttachEvent=void 0,this._DetachEvent=void 0,this._Analysis=void 0,this._Navigate=void 0,this._Creator=void 0,this._Command=void 0,this._ProjectTree=void 0,this._Coordinate=void 0,this._VectorTileProvider=void 0,this.toolbar=e.toolbar,e.removeGlobe?(this._Viewer.imageryLayers.removeAll(),this._Viewer.shadows=!1,this._Viewer.scene.fog.enabled=!1,this._Viewer.scene.globe.show=!1,this._Viewer.scene.backgroundColor=Cesium.Color.fromCssColorString("rgba(0,0,0,0)"),e.backgroundImage&&(this._Viewer.container.style.backgroundImage="url("+e.backgroundImage+")")):this._Viewer.scene.globe.depthTestAgainstTerrain=!0,this.Navigate.flyToPointsInterest(c,o),this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._Viewer.extend(Cesium.viewerCesiumInspectorMixin),this.rightRotate&&(this._Viewer.scene.screenSpaceCameraController.zoomEventTypes.shift(),this._Viewer.scene.screenSpaceCameraController.tiltEventTypes[0]=1),h.maxViewHeight&&(this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance=h.maxViewHeight),h.minViewHeight||h.maxViewPitch){this.minViewHeight=h.minViewHeight,this.maxViewPitch=h.maxViewPitch&&Cesium.Math.toRadians(h.maxViewPitch);let r=0,n=this._Viewer.scene,t=!1;if(this.maxViewPitch){let e=new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas);e.setInputAction(()=>{t=!0},Cesium.ScreenSpaceEventType.MIDDLE_DOWN),e.setInputAction(()=>{t=!1},Cesium.ScreenSpaceEventType.MIDDLE_UP),e.setInputAction(()=>{t=!0},Cesium.ScreenSpaceEventType.RIGHT_DOWN),e.setInputAction(()=>{t=!1},Cesium.ScreenSpaceEventType.RIGHT_UP)}this._Viewer.scene.preRender.addEventListener(()=>{let i=this._Viewer.camera;if(i&&i.positionCartographic){if(this.maxViewPitch){let e=i.pitch;t&&e>this.maxViewPitch?(e=this.maxViewPitch,i.setView({destination:this.oldPosition||i.position.clone(),orientation:{heading:i.heading,pitch:e,roll:0}})):this.oldPosition=i.position.clone()}if(this.minViewHeight){var o=n.globe.getHeight(i.positionCartographic);r=o||r;let e,t;o=i.positionCartographic.height-r,o=(t=this._Viewer.scene.globe.translucency.enabled||this._Analysis&&(this._Analysis._UndergroundMode&&this._Analysis._UndergroundMode.isUndergroundMode||this._Analysis._StreetView&&this._Analysis._StreetView.isStreetView)?(e=i.positionCartographic.height<-200,-200):(e=o=Cesium.QuadtreeTileLoadState.DONE&&(null!=e.children[i].data.terrainData._mesh||null!=e.children[i].data.terrainData._buffer)&&e.children[i].x==t.x&&e.children[i].y==t.y)return e.children[i]}(r,o=i.positionToTileXY(t,n));if(null==a)break;r=a}return r}function _(e){var t;for($.grep(p._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t',this._Viewer.container.appendChild(this.cursorPoint),e=>{e=(e=e||i).position||e.endPosition;this.cursorPoint.style.top=e.y-18+"px",this.cursorPoint.style.left=e.x-18+"px",this.cursorPoint.style.visibility="unset",this.cursorPoint.style.opacity=1}),r=e=>{e=e.position||e.endPosition;this.cursorPoint.style.top=e.y-18+"px",this.cursorPoint.style.left=e.x-18+"px"},n=(this.cursorHandel.setInputAction(e=>{i=e,clearTimeout(t),t=void 0,this._Viewer.camera.positionCartographic.height<1e4?o(e):(this.cursorPoint.style.visibility="hidden",this.cursorPoint.style.opacity=0)},this.rightRotate?Cesium.ScreenSpaceEventType.RIGHT_DOWN:Cesium.ScreenSpaceEventType.MIDDLE_DOWN),this.cursorHandel.setInputAction(e=>{this.cursorPoint.style.visibility="hidden"},this.rightRotate?Cesium.ScreenSpaceEventType.RIGHT_UP:Cesium.ScreenSpaceEventType.MIDDLE_UP),this.cursorHandel.setInputAction(e=>{i=e,t&&r(e)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.cursorHandel.setInputAction(e=>{clearTimeout(t),o(),t=setTimeout(()=>{this.cursorPoint.style.visibility="hidden",this.cursorPoint.style.opacity=0,t=void 0},500)},Cesium.ScreenSpaceEventType.WHEEL),0),a;this.cursorHandel.setInputAction(e=>{this._PointFly&&this._PointFly.end&&this._PointFly.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.cursorHandel.setInputAction(e=>{n++,clearInterval(a),a=setTimeout(()=>{n=0},500),2<=n&&(n=0,this._PointFly||(this._PointFly=new ar(this._Viewer,Cesium)),this._PointFly&&this._PointFly.end&&this._PointFly.end(),this._PointFly.setPointFly({position:this.Navigate.getMousePosition(e),hideImage:!0,time:this._rotateFlyTime,pitch:Cesium.Math.toDegrees(this._Viewer.camera.pitch)}))},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}else this.cursorHandel&&this.cursorHandel.destroy(),this.cursorHandel=void 0,this.cursorPoint&&this.cursorPoint.remove(),this.cursorPoint=void 0},zh.prototype.pick=function(e,o=!0,r=!0,n=!1){this.endPick(),this.pick_callBcak=e,this._Viewer._enableInfoOrSelection=!0,r&&(this.pick_stage=this.Core.addPickStage(this._Viewer)),this.pick_handel=new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas);let a,s,l,u;this.pick_handel.setInputAction(t=>{if(r&&this.pick_stage.remove(),a=this._Viewer.scene.pick(t.position),s=void 0,!a||n){var i=this._Viewer.scene.pickPosition(t.position);if(!i)return;let e=this.Core.toDegrees(i);u="坐标信息",s={"经度":e.lon.toFixed(6),"纬度":e.lat.toFixed(6),"高度":e.height.toFixed(2)}}else if(a)if(r&&this.pick_stage.select(a),a.id)a.id.fid&&a.id.attributes?(u=a.id.fid,s=a.id.attributes):a.id.id&&a.id.properties?(u=a.id.name||a.id.id,s=a.id.properties.getValue?a.id.properties.getValue():a.id.properties):a.id.feature&&(u=a.id.feature.id,s=a.id.feature.properties);else if(a._modelId)a._modelId.id&&a._modelId.properties&&(u=a._modelId.id,s=a._modelId.properties);else if(!a.color&&a.content){u="模型"+a.content.tile._priority;i=this._Viewer.scene.pickPosition(t.position);if(i){let e=this.Core.toDegrees(i);s={"经度":e.lon.toFixed(6),"纬度":e.lat.toFixed(6),"高度":e.height.toFixed(2)}}}if(o&&s){for(var e in l='',s)l+=``;l+="
${e}${s[e]}
",this._Viewer.selectedEntity=new Cesium.Entity({name:u,description:l})}else if(a&&a.getPropertyNames&&a.getProperty){let e=a.getPropertyNames();s={},e.forEach(e=>{s[e]=a.getProperty(e)})}this.pick_callBcak&&(a||s)&&this.pick_callBcak(s,a,t)},Cesium.ScreenSpaceEventType.LEFT_CLICK)},zh.prototype.pickPosition=function(e,t=!0){this.endPick(),this.pick(e,t,!1,!0)},zh.prototype.endPick=function(){this._Viewer.infoBox&&this._Viewer.infoBox.viewModel.closeClicked.raiseEvent(),this._Viewer._enableInfoOrSelection=!1,this.pick_callBcak=void 0,this.pick_handel&&this.pick_handel.destroy(),this.pick_handel=void 0,this.pick_stage&&(this.pick_stage.remove(),this.pick_stage.destroy(),this.pick_stage=void 0)},zh.prototype.getAllImageryView=function(){return{arcgis_img:new Cesium.ProviderViewModel({name:"ArcGIS影像",tooltip:"ArcGIS影像",iconUrl:window.SmartEarthRootUrl+"Workers/image/baseLayer/arcgis_img.png",creationFunction:()=>new Cesium.ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}),arcgis_dark:new Cesium.ProviderViewModel({name:"蓝色底图",tooltip:"蓝色底图",iconUrl:window.SmartEarthRootUrl+"Workers/image/baseLayer/arcgis_dark.png",creationFunction:()=>new Cesium.ArcGisMapServerImageryProvider({url:"http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer",enablePickFeatures:!1,usePreCachedTilesIfAvailable:!1,tilingScheme:this.Core.getOffsetTilingScheme()})})}},Object.defineProperties(zh.prototype,{Analysis:{get:function(){return null==this._Analysis&&(this._Analysis=new O(this._Viewer,Cesium)),this._Analysis}},Navigate:{get:function(){return null==this._Navigate&&(this._Navigate=new Ah(this._Viewer,Cesium,this._tree)),this._Navigate}},Creator:{get:function(){return null==this._Creator&&(this._Creator=new Q(this._Viewer,Cesium)),this._Creator}},Core:{get:function(){return null==this._Core&&(this._Core=new v),this._Core}},Command:{get:function(){return null==this._Command&&(this._Command=new jr(this._Viewer,Cesium)),this._Command}},ProjectTree:{get:function(){return null==this._ProjectTree&&(this._ProjectTree=new q(this._Viewer,Cesium,this._tree)),this._ProjectTree}},tree:{get:function(){return this._tree}},Viewer:{get:function(){return this._Viewer}},toolbar:{get:function(){return"block"===this._Viewer._toolbar.style.display},set:function(e){this._Viewer._toolbar.style.display=e?"block":"none"}},wireframe:{get:function(){return this._Viewer.cesiumInspector.viewModel.wireframe},set:function(e){this._Viewer.cesiumInspector.viewModel.wireframe=e}},tileCoordinates:{get:function(){return this._Viewer.cesiumInspector.viewModel.tileCoordinates},set:function(e){this._Viewer.cesiumInspector.viewModel.tileCoordinates=e}},bloom:{get:function(){return this._Viewer.scene.postProcessStages.bloom.enabled},set:function(e){this._Viewer.scene.postProcessStages.bloom.enabled=e}},sunLight:{get:function(){return this._Viewer.scene.globe.enableLighting},set:function(e){var t=this.lightColor,i=this.lightIntensity;this._Viewer.scene.light=e?new Cesium.SunLight:new Cesium.DirectionalLight({direction:new Cesium.Cartesian3(.35492591601301104,-.8909182691839401,-.2833588392420772)}),this.lightColor=t,this.lightIntensity=i,this._Viewer.scene.globe.enableLighting=e}},lightIntensity:{get:function(){return this._Viewer.scene.light&&this._Viewer.scene.light.intensity},set:function(e){this._Viewer.scene.light&&(this._Viewer.scene.light.intensity=e)}},lightColor:{get:function(){return this._Viewer.scene.light&&this._Viewer.scene.light.color.toCssHexString()},set:function(e){this._Viewer.scene.light&&(this._Viewer.scene.light.color=Cesium.Color.fromCssColorString(e))}},colorAdjustment:{get:function(){return this._Viewer.scene.colorAdjustment||new $l(this._Viewer)}},brightness:{get:function(){return this.colorAdjustment.brightness},set:function(e){this.colorAdjustment.brightness=e}},contrast:{get:function(){return this.colorAdjustment.contrast},set:function(e){this.colorAdjustment.contrast=e}},saturation:{get:function(){return this.colorAdjustment.saturation},set:function(e){this.colorAdjustment.saturation=e}},rotateFlyTime:{get:function(){return this._rotateFlyTime||30},set:function(e){this._rotateFlyTime=e}}}),zh.prototype.navControl=function(e,t){var i=t?"":"none";this._Viewer.cesiumNavigation&&("all"===e?(this._Viewer.cesiumNavigation.container.style.display=i,this._Viewer.cesiumNavigation.navigationDiv.style.display=i,this._Viewer.cesiumNavigation.distanceLegendDiv.style.display=i):("nav"===e?this._Viewer.cesiumNavigation.navigationDiv.style.display=i:this._Viewer.cesiumNavigation.distanceLegendDiv.style.display=i,t&&(this._Viewer.cesiumNavigation.container.style.display=i)))},zh.prototype.CreateWfs=function(e,t,i,o,r,n,a,s,l){return new W(e,t,i,o,r,n,a,s,l)},zh.prototype.AttachEvent=function(e,t){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachEvent(e,t)},zh.prototype.RemoNormalCesiumLeftDoubleClick=function(){return null==this._DetachEvent&&(this._DetachEvent=new bh(this._Viewer,Cesium)),this._DetachEvent.RemoNormalCesiumLeftDoubleClick()},zh.prototype.AttachOnLButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonDblClkEvent(e)},zh.prototype.AttachOnLButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonDownEvent(e)},zh.prototype.AttachOnLButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonUpEvent(e)},zh.prototype.AttachOnMButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonDblClkEvent(e)},zh.prototype.AttachOnMButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonDownEvent(e)},zh.prototype.AttachOnMButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonUpEvent(e)},zh.prototype.AttachOnMouseWheelEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnMouseWheelEvent(e)},zh.prototype.AttachOnFrameEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnFrameEvent(e)},zh.prototype.AttachOnRButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnRButtonDownEvent(e)},zh.prototype.AttachOnRButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachOnRButtonUpEvent(e)},zh.prototype.AttachCameraChangeEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.AttachCameraChangeEvent(e)},zh.prototype.CameraMoveEndEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new wh(this._Viewer,Cesium)),this._AttachEvent.CameraMoveEndEvent(e)},zh.prototype.DetachEvent=function(e,t){return null==this._DetachEvent&&(this._DetachEvent=new bh(this._Viewer,Cesium)),this._DetachEvent.DetachEvent(e,t)},zh.prototype.DetachEventAll=function(e){return null==this._DetachEvent&&(this._DetachEvent=new bh(this._Viewer,Cesium)),this._DetachEvent.DetachEventAll(e)},zh.prototype.DetachCameraChangeEvent=function(e){return null==this._DetachEvent&&(this._DetachEvent=new bh(this._Viewer,Cesium)),this._DetachEvent.DetachCameraChangeEvent(e)},Uh.prototype.createRightScreen=function(e){this.rightContainer=document.createElement("div"),this.rightContainer.id="SDKSecondaryScreen",this.rightContainer.style.cssText=` height: 100%; flex: 1; position: relative; `,this.parentElement.append(this.rightContainer),this.defaultStyle={display:this.parentElement.style.display,flexDirection:this.parentElement.style.flexDirection,flex:this.parentElement.style.flex},this.parentElement.style.display="flex",this.parentElement.style.flexDirection="row",this.parentElement.style.flex=1,this.right=new zh("SDKSecondaryScreen",e),this.right.Navigate.Stop(),this.leftEvenListener()},Uh.prototype.leftEvenListener=function(){this.right._Viewer.camera.setView({destination:this.left._Viewer.camera.position.clone(),orientation:{heading:this.left._Viewer.camera.heading,pitch:this.left._Viewer.camera.pitch,roll:this.left._Viewer.camera.roll}})},Uh.prototype.rightEvenListener=function(){this.left._Viewer.camera.setView({destination:this.right._Viewer.camera.position.clone(),orientation:{heading:this.right._Viewer.camera.heading,pitch:this.right._Viewer.camera.pitch,roll:this.right._Viewer.camera.roll}})};let Wh,Yh;function Jh(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new v,this._getPosition=new C(this._viewer,this._cesium),this._tree=F,this._points=[],this._polylines=[],this.Streamerpath=new Yc(this._viewer),this.Streamerwall=new Qc(this._viewer)}function Kh(e,t){this._viewer=e,this._cesium=t}function Qh(e,t){this._viewer=e,this._cesium=t,this._current=new Kh(this._viewer,this._cesium)}Uh.prototype.addEvenListener=function(){this.leftContainer.onmouseover=()=>{Wh||(Wh=this.leftEvenListener.bind(this),this.left._Viewer.scene.preRender.addEventListener(Wh)),Yh&&this.right._Viewer.scene.preRender.removeEventListener(Yh),Yh=null},this.rightContainer.onmouseover=()=>{Yh||(Yh=this.rightEvenListener.bind(this),this.right._Viewer.scene.preRender.addEventListener(Yh)),Wh&&this.left._Viewer.scene.preRender.removeEventListener(Wh),Wh=null}},Uh.prototype.removeEvenListener=function(){this.leftContainer.onmouseover=null,this.rightContainer.onmouseover=null,Yh&&this.right._Viewer.scene.preRender.removeEventListener(Yh),Wh&&this.left._Viewer.scene.preRender.removeEventListener(Wh),Yh=null,Wh=null},Uh.prototype.destroy=function(){this.removeEvenListener(),this.rightContainer.remove(),this.left=null,this.right=null,this.parentElement.style.display=this.defaultStyle.display,this.parentElement.style.flexDirection=this.defaultStyle.flexDirection,this.parentElement.style.flex=this.defaultStyle.flex,this.leftContainer.style.width="100%"},Jh.prototype.createPathLayer=function(e={}){var t={lineColor:e.color||"#0033FF",linewidth:e.width||5,pointColor:e.pointColor||"#FFFFFF",id:e.id||this._core.getuid(),near:e.near,far:e.far,speed:e.speed||1};let i=Cesium.GeoJsonDataSource.load(e.url);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t{var i=e.entities.values;let o=[];for(let t=0;t{r=[e.lon,e.lat,i.minHeight,e.lon,e.lat,e.height],this._polylines.push(this._viewer.entities.add({name:"FlyingLine",polyline:{positions:Cesium.Cartesian3.fromDegreesArrayHeights(r),width:i.width,material:o}}))});t={id:this._core.getuid(),name:"新建垂直飞线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},Jh.prototype.createLine=function(e,t){var i={time:3e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,"#ff0000"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.TrailLine),width:10},t=new te((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time),o=[];if(e[0].x||e[0].y)if(void 0!==e[0].z)if(-180<=e[0].x&&e[0].x<=180)for(r=0;rMath.abs(e.pt1.lat-e.pt2.lat)?Math.abs(e.pt1.lon-e.pt2.lon):Math.abs(e.pt1.lat-e.pt2.lat),r=e.num&&50Math.abs(e.pt1.lat-e.pt2.lat)){var u=(e.pt2.lat-e.pt1.lat)/r;0{var t=qh.SmartEarth&&qh.SmartEarth.VERSION,i=qh.SmartEarth&&qh.SmartEarth.COMPILETIME,o=qh.Cesium&&qh.Cesium.VERSION;let r=e===1/0||-1http://183.162.245.49:18076/sdkdemo_2022 接口文档:http://183.162.245.49:18076/sdkdemo_2022/api `;return setTimeout(console.log.bind(console,e,"font:bold 50px 微软雅黑;color:#018aff;","color:#018aff;font-size:13px;font-family:微软雅黑"),0),-1=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},rm.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},rm.prototype._loadTile=function(e){var r=[],n=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),a=this;return e.features.forEach(function(e){if(a._propertyToBeFiltered&&Array.isArray(a._valuesToBeFiltered)){var t=e.properties[a._propertyToBeFiltered];if(a._valuesToBeFiltered.includes(t))return}var o,t=e.geometry.type;"Polygon"===t||"MultiPolygon"===t?(o=[],a.heightById[e.properties.house_id]=e.properties.height,e.geometry.coordinates.forEach(function(e,i){o.push([]),e.forEach(function(e){var t;2this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),(e=2=n-2}):e).sort(function(e,t){return-(e.level-t.level)}),e=e.filter(function(e){return i._isTileInRange(e)}),this._upperLevelLimit&&(e=this._refineTiles(e,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=o,a=[],l=s=0,e.forEach(function(e){var t="z"+e.level+"x"+e.x+"y"+e.y;a.push(t),i._tileKeys.push(t),i._primitiveByTile[t]||(e=i._urlTemplate.replace(window.encodeURIComponent("{x}"),e.x).replace(window.encodeURIComponent("{y}"),e.y).replace(window.encodeURIComponent("{z}"),e.level),s++,i._fetch(e).then(function(e){if(i._isRemoved)throw new Error("DISCARD");if(i._isCameraMoving)throw new Error("DISCARD");if(o!==i._moveEndTimestamp)throw new Error("DISCARD");e=i._loadTile(e);i._primitiveCollection.add(e),i._primitiveByTile[t]=e,s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a))}).catch(function(e){s<=++l&&(i._tileKeys=a,i._removeObsoletePrimitives(i._primitiveByTile,a)),e.message}))}))},rm.prototype._refineTiles=function(e,s){var l=[],u=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level