月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-10-10 77f9937b32f67f5b7d5476b0a1db19956702c0c8
public/SmartEarthSDK/SmartEarth.min.js
@@ -4,7 +4,11 @@
 * @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.s<time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb) / 2.0;\n}\nreturn material;\n}\n",ee="uniform vec4 color;\nuniform vec4 color1;\nuniform vec4 color2;\nuniform vec4 lightSpotColor;\nuniform sampler2D image;\nuniform bool twoColor;\nuniform bool lightSpot;\nuniform float alpha;\nuniform float intervalTime;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat time = fract(czm_frameNumber / (60.0 * intervalTime));\nif(twoColor){\nif(st.s < time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb)/2.0;\n}\nreturn material;\n}\n";function te(e,t,i){Cesium.PolylineTrailLinkMaterialProperty||(Cesium.PolylineTrailLinkMaterialProperty=te,Cesium.Material.PolylineTrailLinkType="PolylineTrailLink",Cesium.Material.PolylineTrailLinkImage=window.SmartEarthRootUrl+I.TrailLine,Cesium.Material.PolylineTrailLinkSource=Z,Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType,{fabric:{type:Cesium.Material.PolylineTrailLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),color1:new Cesium.Color(0,1,0,.5),color2:new Cesium.Color(1,0,0,.5),image:Cesium.Material.PolylineTrailLinkImage,twoColor:!1,lightSpot:!1,lightSpotColor:new Cesium.Color(1,1,1,.5),alpha:.3,time:0},source:Cesium.Material.PolylineTrailLinkSource},translucent:function(e){return!0}})),Cesium.Material,this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=Cesium.Color.fromCssColorString(e||"#ffffff"),this._Line=t||Cesium.Material.PolylineTrailLinkImage,this.duration=i||3e3,this.alpha=.3,this._time=(new Date).getTime(),"object"==typeof this._Line&&(this._Line.LightSpot?this._Line.color=Cesium.Color.fromCssColorString(this._Line.color):(this._Line.color1=Cesium.Color.fromCssColorString(this._Line.color1),this._Line.color2=Cesium.Color.fromCssColorString(this._Line.color2))),this.isConstant=!1,this.definitionChanged=this._definitionChanged,this.color=Cesium.createPropertyDescriptor("color")}function ie(e){return new Cesium.Material({fabric:{uniforms:{color:X(e.color,new Cesium.Color(1,0,0,.5)),color1:X(e.color1,new Cesium.Color(0,1,0,.5)),color2:X(e.color2,new Cesium.Color(1,0,0,.5)),image:X(e.image,window.SmartEarthRootUrl+I.TrailLine),twoColor:X(e.twoColor,!1),lightSpot:X(e.lightSpot,!1),lightSpotColor:X(e.lightSpotColor,new Cesium.Color(1,1,1,.5)),alpha:X(e.alpha,.3),intervalTime:X(e.time,3e3)/1e3},source:ee}})}function oe(e=!0){this.async=e}function re(e){if(this._mapContainer=e,!window.echarts){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/echarts.min.js")}this.Init(e)}function ne(e){this.serverUrl=e}function ae(e,t){this.mediaOutputPath=e||"test.mp4",this.videoBPS=t||512e4}te.prototype.getType=function(e){return"PolylineTrailLink"},te.prototype.setScale=function(e){this.scale=e},te.prototype.getValue=function(e,t){return(t=Cesium.defined(t)?t:{}).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),"object"==typeof this._Line?this._Line.LightSpot?(t.lightSpot=!0,t.lightSpotColor=this._Line.color):(t.color1=this._Line.color1,t.color2=this._Line.color2,t.twoColor=!0):t.image=this._Line,void 0!==this.scale?t.time=this.scale:t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t.alpha=this.alpha,t},te.prototype.equals=function(e){return this===e||e instanceof te&&Cesium.Property.equals(this._color,e._color)},oe.prototype.getXmlHttpRequest=function(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new ActiveXObject("MsXml2.XmlHttp"):void 0},oe.prototype.includeJsText=function(e,t){var i;null!=e&&((i=document.createElement("script")).type="text/javascript",i.text=t,e.appendChild(i))},oe.prototype.includeJsSrc=function(e,t){var i;null!=e&&((i=document.createElement("script")).type="text/javascript",i.src=t,e.appendChild(i))},oe.prototype.addJs=function(e){var t=this.getXmlHttpRequest(),i=this;t.onreadystatechange=function(){4===t.readyState&&(200===t.status||304===t.status?i.includeJsSrc(document.body||document.head,e):console.log("XML request error: "+t.statusText+" ("+t.status+")"))},t.open("GET",e,i.async),t.send(null),404===t.status?console.log(e+" is not found"):i.includeJsText(document.body||document.head,t.responseText)},re.prototype.setOption=function(e,t){return this._echartsContainer&&t&&this.clear(),this._overlay||(this._overlay=this._createChartOverlay()),this._overlay.setOption(e),this},re.prototype._createChartOverlay=function(){var e=this._mapContainer.scene,t=(e.canvas.setAttribute("tabIndex",0),document.createElement("div"));return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=e.canvas.width+"px",t.style.height=e.canvas.height+"px",t.style.pointerEvents="none",t.setAttribute("id","smartearth-cesium-echarts"),t.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(t),this._echartsContainer=t,echarts.init(t)},re.prototype.deleteObject=re.prototype.clear=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},re.prototype.updateOverlay=function(e){this._overlay&&this._overlay.setOption(e)},re.prototype.getMap=function(){return this._mapContainer},re.prototype.getOverlay=function(){return this._overlay},re.prototype.show=function(){document.getElementById(this._id).style.visibility="visible"},re.prototype.hide=function(){document.getElementById(this._id).style.visibility="hidden"},re.prototype.Init=function(c){function r(e){var t;return(o[e]||(t=o[e]={i:e,l:!1,exports:{}},i[e].call(t.exports,t,t.exports,r),t.l=!0,t)).exports}var i,o;i=[function(e,t,i){e.exports=i(1)},function(e,t,i){echarts?i(2).load():console.error("missing echarts lib")},function(e,t,i){function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}i.r(t);n=[{key:"create",value:function(e,t){var i;e.eachComponent("GLMap",function(e){(i=new s(c,t)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=i}),e.eachSeries(function(e){"GLMap"===e.get("coordinateSystem")&&(e.coordinateSystem=i)})}},{key:"dimensions",get:function(){return["lng","lat"]}}],o((r=s).prototype,[{key:"setMapOffset",value:function(e){return this._mapOffset=e,this}},{key:"getViewer",value:function(){return this._viewer}},{key:"dataToPoint",value:function(e){var t;return this._viewer&&this._viewer.scene?(t=this._viewer.scene,(e=Cesium.Cartesian3.fromDegrees(e[0],e[1]))?!(t.mode===Cesium.SceneMode.SCENE3D&&Cesium.Cartesian3.angleBetween(t.camera.position,e)>Cesium.Math.toRadians(80))&&((t=t.cartesianToCanvasCoordinates(e))?[t.x-this._mapOffset[0],t.y-this._mapOffset[1]]:[]):[0,0]):[]}},{key:"pointToData",value:function(e){var t=this._mapOffset,i=c.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 c},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(e,t){this.api=t,this.dispose(),c.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(e,t){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e){c.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,ce=6378245,ue=.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-ue*o*o,r=Math.sqrt(o);return[180*i/(ce/r*Math.cos(t)*le),180*e/(ce*(1-ue)/(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.86<t&&t<53.55)}};function me(e,t,i){if(e&&t){"#"!==e[0]&&(e=this.colorHex(e)),"#"!==t[0]&&(t=this.colorHex(t));for(var e=this.colorRgb(e),o=e[0],r=e[1],n=e[2],e=this.colorRgb(t),a=(e[0]-o)/i,s=(e[1]-r)/i,l=(e[2]-n)/i,c=[],u=0;u<i;u++){var h=this.colorHex("rgb("+parseInt(a*u+o)+","+parseInt(s*u+r)+","+parseInt(l*u+n)+")");c.push(h)}return c}return this}function de(e){if(e=e||[],!Cesium.defined(e.workerPath))throw new Cesium.DeveloperError("workerPath is required.");this._workerPath=e.workerPath,this._poolSize=Cesium.defaultValue(e.poolSize,16),this._workers=[],this._defered=[]}me.prototype.colorRgb=function(e){if((e=e.toLowerCase())&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}for(var o=[],i=1;i<7;i+=2)o.push(parseInt("0x"+e.slice(i,i+2)));return o}return e},me.prototype.colorHex=function(e){if(/^(rgb|RGB)/.test(e)){for(var t=e.replace(/(rgb|RGB)*/g,"").replace("(","").replace(")","").split(","),i="#",o=0;o<t.length;o++){var r=Number(t[o]).toString(16);"0"===(r=1===r.length?"0"+r:r)&&(r+=r),i+=r}return i=7!==i.length?e:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e))return e;var n=e.replace(/#/,"").split("");if(6===n.length)return e;if(3===n.length){for(var a="#",o=0;o<n.length;o+=1)a+=n[o]+n[o];return a}},Object.defineProperties(de.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),de.prototype.queueWorkItem=function(e,t){for(var i,o=Cesium.when.defer(),r=null,n=999999,a=0;a<this._workers.length;a++){r=this._workers[a];this._workers[a].jobQueueSize<n&&(r=this._workers[a],n=this._workers[a].jobQueueSize)}0<n&&this._workers.length<this.poolSize&&(r=new Worker(this._workerPath),i=this,r.addEventListener("message",function(e){i.onWorkerMessage(e)},!1),r.addEventListener("error",function(e){i.onWorkerError(e)},!1),r.jobQueueSize=0,this._workers.push(r),r.id=Cesium.createGuid()),e.workerId=r.id;var s=Cesium.createGuid();return e.deferedId=s,this._defered[s]=o,r.jobQueueSize++,r.postMessage(e,t),o},de.prototype.trimPool=function(e){var t=this;if(null==e)null!=this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){t.trimPool(!0)},5e3);else{for(var i=0;i<this._workers.length;i++)0==this._workers[i].jobQueueSize&&(this._workers[i].terminate(),this._workers.splice(i,1),i--);this._workers.length?this.timerId=setTimeout(function(){t.trimPool(!0)},5e3):this.timerId=null}},de.prototype.onWorkerMessage=function(e){var t=e.data,e=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i}(this._workers,function(e){return e.id===t.workerId}),e=(null!=e&&(this._workers[e].jobQueueSize--,this.trimPool()),this._defered[t.deferedId]);delete this._defered[t.deferedId],e.resolve(t)},de.prototype.onWorkerError=function(e){console.log(e)};let pe=new Map;function ge(i){if(i=(i=(i=i.replaceAll("//","/")).replace("http:/","http://")).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<n.children.length)for(let i=0;i<n.children.length;i++){let e=n.children.item(i),t=e.nodeName;if(t=(t=t.split(":"))[1]||t[0],void 0===o[t])o[t]=r(e);else{if(void 0===o[t].push){let e=o[t];o[t]=[],o[t].push(e)}o[t].push(r(e))}}else{if(n.attributes&&n.attributes.length&&!n.textContent){let i={};for(let e=0,t;e<n.attributes.length;e++)(t=n.attributes[e]).split?(t=t.split("="),i[t[0]]=t[1]):i[t.name]=t.textContent;return i}o=n.textContent}return o}catch(e){console.log(e.message)}}(9==e.nodeType?e.documentElement:e):{}}var Ce=Object.freeze({UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4}),ye=function o(r,n,a){function s(i,e){if(!n[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(l)return l(i,!0);e=new Error("Cannot find module '"+i+"'");throw e.code="MODULE_NOT_FOUND",e}t=n[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return s(t||e)},t,t.exports,o,r,n,a)}return n[i].exports}for(var l="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,i){var o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array,r=(i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var o in i)i.hasOwnProperty(o)&&(e[o]=i[o])}}return e},i.shrinkBuf=function(e,t){if(e.length!==t){if(e.subarray)return e.subarray(0,t);e.length=t}return e},{arraySet:function(e,t,i,o,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+o),r);else for(var n=0;n<o;n++)e[r+n]=t[i+n]},flattenChunks:function(e){for(var t,i,o,r=0,n=0,a=e.length;n<a;n++)r+=e[n].length;for(o=new Uint8Array(r),n=t=0,a=e.length;n<a;n++)i=e[n],o.set(i,t),t+=i.length;return o}}),n={arraySet:function(e,t,i,o,r){for(var n=0;n<o;n++)e[r+n]=t[i+n]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,n))},i.setTyped(o)},{}],2:[function(e,t,i){var l=e("./common"),r=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){n=!1}for(var c=new l.Buf8(256),o=0;o<256;o++)c[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function u(e,t){if(t<65537&&(e.subarray&&n||!e.subarray&&r))return String.fromCharCode.apply(null,l.shrinkBuf(e,t));for(var i="",o=0;o<t;o++)i+=String.fromCharCode(e[o]);return i}c[254]=c[254]=1,i.string2buf=function(e){for(var t,i,o,r,n=e.length,a=0,s=0;s<n;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<n&&56320==(64512&(o=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(o-56320),s++),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new l.Buf8(a),s=r=0;r<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<n&&56320==(64512&(o=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(o-56320),s++),i<128?t[r++]=i:(i<2048?t[r++]=192|i>>>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 u(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,o=t.length;i<o;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){for(var i,o,r=t||e.length,n=new Array(2*r),a=0,s=0;s<r;)if((i=e[s++])<128)n[a++]=i;else if(4<(o=c[i]))n[a++]=65533,s+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&s<r;)i=i<<6|63&e[s++],o--;1<o?n[a++]=65533:i<65536?n[a++]=i:(i-=65536,n[a++]=55296|i>>10&1023,n[a++]=56320|1023&i)}return u(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+c[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<i?2e3:i;n=n+(r=r+t[o++]|0)|0,--a;);r%=65521,n%=65521}return r|n<<16|0}},{}],4:[function(e,t,i){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){var s=function(){for(var e=[],t=0;t<256;t++){for(var i=t,o=0;o<8;o++)i=1&i?3988292384^i>>>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<n;a++)e=e>>>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,c=e.next_in,u=e.input,h=c+(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,S=l.distcode,E=(1<<l.lenbits)-1,P=(1<<l.distbits)-1;e:do{for(b<15&&(w+=u[c++]<<b,b+=8,w+=u[c++]<<b,b+=8),i=T[w&E];;){if(w>>>=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)-1)];continue}if(32&o){l.mode=12;break e}e.msg="invalid literal/length code",l.mode=30;break e}for(r=65535&i,(o&=15)&&(b<o&&(w+=u[c++]<<b,b+=8),r+=w&(1<<o)-1,w>>>=o,b-=o),b<15&&(w+=u[c++]<<b,b+=8,w+=u[c++]<<b,b+=8),i=S[w&P];;){if(w>>>=o=i>>>24,b-=o,!(16&(o=i>>>16&255))){if(0==(64&o)){i=S[(65535&i)+(w&(1<<o)-1)];continue}e.msg="invalid distance code",l.mode=30;break e}if(n=65535&i,b<(o&=15)&&(w+=u[c++]<<b,(b+=8)<o&&(w+=u[c++]<<b,b+=8)),f<(n+=w&(1<<o)-1)){e.msg="invalid distance too far back",l.mode=30;break e}if(w>>>=o,b-=o,(o=m-p)<n){if(C<(o=n-o)&&l.sane){e.msg="invalid distance too far back",l.mode=30;break e}if(s=v,(a=0)===y){if(a+=_-o,o<r){for(r-=o;d[m++]=v[a++],--o;);a=m-n,s=d}}else if(y<o){if(a+=_+y-o,(o-=y)<r){for(r-=o;d[m++]=v[a++],--o;);if(a=0,y<r){for(r-=o=y;d[m++]=v[a++],--o;);a=m-n,s=d}}}else if(a+=y-o,o<r){for(r-=o;d[m++]=v[a++],--o;);a=m-n,s=d}for(;2<r;)d[m++]=s[a++],d[m++]=s[a++],d[m++]=s[a++],r-=3;r&&(d[m++]=s[a++],1<r&&(d[m++]=s[a++]))}else{for(a=m-n;d[m++]=d[a++],d[m++]=d[a++],d[m++]=d[a++],2<(r-=3););r&&(d[m++]=d[a++],1<r&&(d[m++]=d[a++]))}break}}break}}while(c<h&&m<g);w&=(1<<(b-=(r=b>>3)<<3))-1,e.next_in=c-=r,e.next_out=m,e.avail_in=c<h?h-c+5:5-(c-h),e.avail_out=m<g?g-m+257:257-(m-g),l.hold=w,l.bits=b}},{}],8:[function(e,t,i){var L=e("../utils/common"),M=e("./adler32"),R=e("./crc32"),O=e("./inffast"),B=e("./inftrees"),V=1,F=2,H=0,G=-2,k=1,o=852,r=592;function N(e){return(e>>>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,H):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<t))?G:(null!==o.window&&o.wbits!==t&&(o.window=null),o.wrap=i,o.wbits=t,s(e))}function c(e,t){var i;return e?(i=new n,(e.state=i).window=null,(i=l(e,t))!==H&&(e.state=null),i):G}var j,U,z=!0;function W(e,t,i,o){var r,e=e.state;return null===e.window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new L.Buf8(e.wsize)),o>=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<e.wsize&&(e.whave+=r))),0}i.inflateReset=s,i.inflateReset2=l,i.inflateResetKeep=a,i.inflateInit=function(e){return c(e,15)},i.inflateInit2=c,i.inflate=function(e,t){var i,o,r,n,a,s,l,c,u,h,m,d,p,g,f,_,C,y,v,w,b,T,S,E,P=0,x=new L.Buf8(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return G;12===(i=e.state).mode&&(i.mode=13),a=e.next_out,r=e.output,l=e.avail_out,n=e.next_in,o=e.input,s=e.avail_in,c=i.hold,u=i.bits,h=s,m=l,T=H;e:for(;;)switch(i.mode){case k:if(0===i.wrap)i.mode=13;else{for(;u<16;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(2&i.wrap&&35615===c)x[i.check=0]=255&c,x[1]=c>>>8&255,i.check=R(i.check,x,2,0),u=c=0,i.mode=2;else if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31)e.msg="incorrect header check",i.mode=30;else if(8!=(15&c))e.msg="unknown compression method",i.mode=30;else{if(u-=4,b=8+(15&(c>>>=4)),0===i.wbits)i.wbits=b;else if(b>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<b,e.adler=i.check=1,i.mode=512&c?10:12,u=c=0}}break;case 2:for(;u<16;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(i.flags=c,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=c>>8&1),512&i.flags&&(x[0]=255&c,x[1]=c>>>8&255,i.check=R(i.check,x,2,0)),u=c=0,i.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.head&&(i.head.time=c),512&i.flags&&(x[0]=255&c,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,i.check=R(i.check,x,4,0)),u=c=0,i.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.head&&(i.head.xflags=255&c,i.head.os=c>>8),512&i.flags&&(x[0]=255&c,x[1]=c>>>8&255,i.check=R(i.check,x,2,0)),u=c=0,i.mode=5;case 5:if(1024&i.flags){for(;u<16;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.length=c,i.head&&(i.head.extra_len=c),512&i.flags&&(x[0]=255&c,x[1]=c>>>8&255,i.check=R(i.check,x,2,0)),u=c=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<s;);if(512&i.flags&&(i.check=R(i.check,o,d,n)),s-=d,n+=d,b)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(d=0;b=o[n+d++],i.head&&b&&i.length<65536&&(i.head.comment+=String.fromCharCode(b)),b&&d<s;);if(512&i.flags&&(i.check=R(i.check,o,d,n)),s-=d,n+=d,b)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;u<16;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(c!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}u=c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}e.adler=i.check=N(c),u=c=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=c,i.bits=u,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last)c>>>=7&u,u-=7&u,i.mode=27;else{for(;u<3;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}switch(i.last=1&c,--u,3&(c>>>=1)){case 0:i.mode=14;break;case 1:I=A=void 0;var I,A=i;if(z){for(j=new L.Buf32(512),U=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(V,A.lens,0,288,j,0,A.work,{bits:9}),I=0;I<32;)A.lens[I++]=5;B(F,A.lens,0,32,U,0,A.work,{bits:5}),z=!1}if(A.lencode=j,A.lenbits=9,A.distcode=U,A.distbits=5,i.mode=20,6!==t)break;c>>>=2,u-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}c>>>=2,u-=2}break;case 14:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&c,u=c=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<d?s:d)?l:d))break e;L.arraySet(r,o,n,d,a),s-=d,n+=d,l-=d,a+=d,i.length-=d}else i.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(i.nlen=257+(31&c),c>>>=5,u-=5,i.ndist=1+(31&c),c>>>=5,u-=5,i.ncode=4+(15&c),c>>>=4,u-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;u<3;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.lens[D[i.have++]]=7&c,c>>>=3,u-=3}for(;i.have<19;)i.lens[D[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},T=B(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,T){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;_=(P=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,C=65535&P,!((f=P>>>24)<=u);){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(C<16)c>>>=f,u-=f,i.lens[i.have++]=C;else{if(16===C){for(E=f+2;u<E;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(c>>>=f,u-=f,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}b=i.lens[i.have-1],d=3+(3&c),c>>>=2,u-=2}else if(17===C){for(E=f+3;u<E;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}b=0,d=3+(7&(c>>>=f)),c>>>=3,u=u-f-3}else{for(E=f+7;u<E;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}b=0,d=11+(127&(c>>>=f)),c>>>=7,u=u-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,S={bits:i.lenbits},T=B(V,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,T){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},T=B(F,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.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=c,i.bits=u,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,c=i.hold,u=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;_=(P=i.lencode[c&(1<<i.lenbits)-1])>>>16&255,C=65535&P,!((f=P>>>24)<=u);){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(_&&0==(240&_)){for(y=f,v=_,w=C;_=(P=i.lencode[w+((c&(1<<y+v)-1)>>y)])>>>16&255,C=65535&P,!(y+(f=P>>>24)<=u);){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}c>>>=y,u-=y,i.back+=y}if(c>>>=f,u-=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(E=i.extra;u<E;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,u-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;_=(P=i.distcode[c&(1<<i.distbits)-1])>>>16&255,C=65535&P,!((f=P>>>24)<=u);){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(0==(240&_)){for(y=f,v=_,w=C;_=(P=i.distcode[w+((c&(1<<y+v)-1)>>y)])>>>16&255,C=65535&P,!(y+(f=P>>>24)<=u);){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}c>>>=y,u-=y,i.back+=y}if(c>>>=f,u-=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(E=i.extra;u<E;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,u-=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=l<d?l:d,i.length-=d;r[a++]=g[p++],--d;);0===i.length&&(i.mode=21);break;case 26:if(0===l)break e;r[a++]=i.length,l--,i.mode=21;break;case 27:if(i.wrap){for(;u<32;){if(0===s)break e;s--,c|=o[n++]<<u,u+=8}if(m-=l,e.total_out+=m,i.total+=m,m&&(e.adler=i.check=(i.flags?R:M)(i.check,r,m,a-m)),m=l,(i.flags?c:N(c))!==i.check){e.msg="incorrect data check",i.mode=30;break}u=c=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;u<32;){if(0===s)break e;s--,c+=o[n++]<<u,u+=8}if(c!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}u=c=0}i.mode=29;case 29:T=1;break e;case 30:T=-3;break e;case 31:return-4;default:return G}return e.next_out=a,e.avail_out=l,e.next_in=n,e.avail_in=s,i.hold=c,i.bits=u,(i.wsize||m!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&W(e,e.output,e.next_out,m-e.avail_out),h-=e.avail_in,m-=e.avail_out,e.total_in+=h,e.total_out+=m,i.total+=m,i.wrap&&m&&(e.adler=i.check=(i.flags?R:M)(i.check,r,m,e.next_out-m)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),T=(0==h&&0===m||4===t)&&T===H?-5:T},i.inflateEnd=function(e){var t;return e&&e.state?((t=e.state).window&&(t.window=null),e.state=null,H):G},i.inflateGetHeader=function(e,t){return!e||!e.state||0==(2&(e=e.state).wrap)?G:((e.head=t).done=!1,H)},i.inflateSetDictionary=function(e,t){var i,o=t.length;return!e||!e.state||0!==(i=e.state).wrap&&11!==i.mode?G:11===i.mode&&M(1,t,o,0)!==i.check?-3:W(e,t,o,o)?(i.mode=31,-4):(i.havedict=1,H)},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var O=e("../utils/common"),B=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],V=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],F=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],H=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,o,r,n,a,s){for(var l,c,u,h,m,d,p,g,f,_=s.bits,C=0,y=0,v=0,w=0,b=0,T=0,S=0,E=0,P=0,x=0,D=null,I=0,A=new O.Buf16(16),L=new O.Buf16(16),M=null,R=0,C=0;C<=15;C++)A[C]=0;for(y=0;y<o;y++)A[t[i+y]]++;for(b=_,w=15;1<=w&&0===A[w];w--);if(w<b&&(b=w),0===w)r[n++]=20971520,r[n++]=20971520,s.bits=1;else{for(v=1;v<w&&0===A[v];v++);for(b<v&&(b=v),C=E=1;C<=15;C++)if((E=(E<<=1)-A[C])<0)return-1;if(0<E&&(0===e||1!==w))return-1;for(L[1]=0,C=1;C<15;C++)L[C+1]=L[C]+A[C];for(y=0;y<o;y++)0!==t[i+y]&&(a[L[t[i+y]]++]=y);if(d=0===e?(D=M=a,19):1===e?(D=B,I-=257,M=V,R-=257,256):(D=F,M=H,-1),C=v,m=n,S=y=x=0,u=-1,h=(P=1<<(T=b))-1,1===e&&852<P||2===e&&592<P)return 1;for(;;){for(f=a[y]<d?(g=0,a[y]):a[y]>d?(g=M[R+a[y]],D[I+a[y]]):(g=96,0),l=1<<(p=C-S),v=c=1<<T;r[m+(x>>S)+(c-=l)]=p<<24|g<<16|f|0,0!==c;);for(l=1<<C-1;x&l;)l>>=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<C&&(x&h)!==u){for(m+=v,E=1<<(T=C-(S=0===S?b:S));T+S<w&&!((E-=A[T+S])<=0);)T++,E<<=1;if(P+=1<<T,1===e&&852<P||2===e&&592<P)return 1;r[u=x&h]=b<<24|T<<16|m-n|0}}0!==x&&(r[m+x]=C-S<<24|64<<16|0),s.bits=b}return 0}},{"../utils/common":1}],10:[function(e,t,i){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){var h=e("./zlib/inflate"),m=e("./utils/common"),d=e("./utils/strings"),p=e("./zlib/constants"),o=e("./zlib/messages"),r=e("./zlib/zstream"),n=e("./zlib/gzheader"),g=Object.prototype.toString;function a(e){if(!(this instanceof a))return new a(e);this.options=m.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options,e=(t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0,h.inflateInit2(this.strm,t.windowBits));if(e!==p.Z_OK)throw new Error(o[e]);this.header=new n,h.inflateGetHeader(this.strm,this.header)}function s(e,t){t=new a(t);if(t.push(e,!0),t.err)throw t.msg||o[t.err];return t.result}a.prototype.push=function(e,t){var i,o,r,n,a,s=this.strm,l=this.options.chunkSize,c=this.options.dictionary,u=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?p.Z_FINISH:p.Z_NO_FLUSH,"string"==typeof e?s.input=d.binstring2buf(e):"[object ArrayBuffer]"===g.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new m.Buf8(l),s.next_out=0,s.avail_out=l),(i=h.inflate(s,p.Z_NO_FLUSH))===p.Z_NEED_DICT&&c&&(a="string"==typeof c?d.string2buf(c):"[object ArrayBuffer]"===g.call(c)?new Uint8Array(c):c,i=h.inflateSetDictionary(this.strm,a)),i===p.Z_BUF_ERROR&&!0===u&&(i=p.Z_OK,u=!1),i!==p.Z_STREAM_END&&i!==p.Z_OK)return this.onEnd(i),!(this.ended=!0)}while(!s.next_out||0!==s.avail_out&&i!==p.Z_STREAM_END&&(0!==s.avail_in||o!==p.Z_FINISH&&o!==p.Z_SYNC_FLUSH)||("string"===this.options.to?(a=d.utf8border(s.output,s.next_out),r=s.next_out-a,n=d.buf2string(s.output,a),s.next_out=r,s.avail_out=l-r,r&&m.arraySet(s.output,s.output,a,r,0),this.onData(n)):this.onData(m.shrinkBuf(s.output,s.next_out))),0===s.avail_in&&0===s.avail_out&&(u=!0),(0<s.avail_in||0===s.avail_out)&&i!==p.Z_STREAM_END);return(o=i===p.Z_STREAM_END?p.Z_FINISH:o)===p.Z_FINISH?(i=h.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===p.Z_OK):o!==p.Z_SYNC_FLUSH||(this.onEnd(p.Z_OK),!(s.avail_out=0))},a.prototype.onData=function(e){this.chunks.push(e)},a.prototype.onEnd=function(e){e===p.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=m.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=a,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js"),ve=1,we=2,be=4;function Te(e,t,i,o){var e=e|t<<8,t=e>>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 Se(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),c=new Uint8Array(16),u=Te(a[s+0],a[s+1],c,0),h=Te(a[s+2],a[s+3],c,4),m=0;m<3;m++){var d=c[m],p=c[4+m];l&&u<=h?(c[8+m]=(d+p)/2,c[12+m]=0):(c[8+m]=(2*d+p)/3,c[12+m]=(d+2*p)/3)}c[11]=255,c[15]=l&&u<=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]=c[_+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 S=e,E=t,P=E[(L=i)+0],x=E[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|=E[L++]<<8*O;for(O=0;O<8;++O)A[M++]=R>>3*O&7}for(I=0;I<16;++I)S[4*I+3]=D[A[I]]}}function Ee(e){}Ee.decode=function(e,t,i,o,r){if(null!=e&&null!=o&&0!=i&&0!=t){var n=0;if((n=11<r||5===r?be:32|ve)&ve&&32&n)for(var a,s,l,c,u,h,m,r=e,d=t,p=i,g=o,f=new Uint16Array(4),_=r,C=d/4,y=p/4,v=0;v<y;v++)for(var w=0;w<C;w++)f[0]=g[a=4*((y-v)*C+w)],f[1]=g[1+a],s=31&f[0],l=2016&f[0],c=63488&f[0],u=31&f[1],h=2016&f[1],m=63488&f[1],f[2]=5*s+3*u>>3|5*l+3*h>>3&2016|5*c+3*m>>3&63488,f[3]=5*u+3*s>>3|5*h+3*l>>3&2016|5*m+3*c>>3&63488,u=g[2+a],_[s=4*v*d+4*w]=f[3&u],_[1+s]=f[u>>2&3],_[2+s]=f[u>>4&3],_[3+s]=f[u>>6&3],_[s+=d]=f[u>>8&3],_[s+1]=f[u>>10&3],_[s+2]=f[u>>12&3],_[s+3]=f[u>>14],u=g[3+a],_[s+=d]=f[3&u],_[s+1]=f[u>>2&3],_[s+2]=f[u>>4&3],_[s+3]=f[u>>6&3],_[s+=d]=f[u>>8&3],_[s+1]=f[u>>10&3],_[s+2]=f[u>>12&3],_[s+3]=f[u>>14];else for(var b=e,T=t,S=i,V=o,E=n,F=0!=(E&ve)?8:16,P=0,x=0;x<S;x+=4)for(var D=0;D<T;D+=4){for(var I=new Uint8Array(64),A=(Se(I,V,P,E),0),L=0;L<4;++L)for(var M=0;M<4;++M){var R=D+M,O=x+L;if(R<T&&O<S)for(var H=4*(T*(S-O)+R),B=0;B<4;++B)b[H++]=I[A++];else A+=4}P+=F}}};qt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Ie=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);var Pe,xe,De,Ie,Ae="object"!=typeof WebAssembly?{supported:!1}:(Qt="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",WebAssembly.validate(qt)&&(Qt="B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB"),qt=WebAssembly.instantiate(function(e){for(var t=new Uint8Array(e.length),i=0;i<e.length;++i){var o=e.charCodeAt(i);t[i]=96<o?o-71:64<o?o-65:47<o?o+4:46<o?63:62}for(var r=0,i=0;i<e.length;++i)t[r++]=t[i]<60?Ie[t[i]]:64*(t[i]-60)+t[++i];return t.buffer.slice(0,r)}(Qt),{}).then(function(e){(Pe=e.instance).exports.__wasm_call_ctors()}),xe={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},De={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},{ready:qt,supported:!0,decodeVertexBuffer:function(e,t,i,o,r){Le(Pe.exports.meshopt_decodeVertexBuffer,e,t,i,o,Pe.exports[xe[r]])},decodeIndexBuffer:function(e,t,i,o){Le(Pe.exports.meshopt_decodeIndexBuffer,e,t,i,o)},decodeIndexSequence:function(e,t,i,o){Le(Pe.exports.meshopt_decodeIndexSequence,e,t,i,o)},decodeGltfBuffer:function(e,t,i,o,r,n){Le(Pe.exports[De[r]],e,t,i,o,Pe.exports[xe[n]])}});function Le(e,t,i,o,r,n){var a=Pe.exports.sbrk,s=i+3&-4,l=a(s*o),c=a(r.length),u=new Uint8Array(Pe.exports.memory.buffer),e=(u.set(r,c),e(l,i,o,c,r.length));if(0==e&&n&&n(l,s,o),t.set(u.subarray(l,l+i*o)),a(l-a(0)),0!=e)throw new Error("Malformed buffer data: "+e)}function Me(){}Me.s3tc=!0,Me.pvrtc=!1,Me.etc1=!1;const Re={SV_Unkown:0,SV_Standard:1,SV_Compressed:2,SV_DracoCompressed:3},Oe={Standard:0,Draco:1,MeshOpt:2},Be={0:Uint32Array.BYTES_PER_ELEMENT,1:Float32Array.BYTES_PER_ELEMENT,2:Float64Array.BYTES_PER_ELEMENT},Ve={LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21,CRN_DXT5:26,STANDARD_CRN:27},Fe={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},He={Invalid:0,Position:1,PositionW:2,Normal:4,Tangent:8,FirstTexcoord:16,SecondTexcoord:32,Color:64,SecondColor:128,Custom0:512,Custom1:1024};function Ge(e,t,i){i=e.byteLength;return e=e.subarray(0,0+i),new TextDecoder("utf-8").decode(e)}function ke(e,t,i){t=t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,e=new Uint8Array(e,i,t);return{string:Ge(e),bytesOffset:i+=t,length:t}}function Ne(t,i,o,e,r){let n={},a=(n.rangeList=i.getFloat32(o,!0),o+=Float32Array.BYTES_PER_ELEMENT,n.rangeMode=i.getUint16(o,!0),o+=Uint16Array.BYTES_PER_ELEMENT,{});a.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,a.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,a.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT;var s=i.getFloat64(o,!0);if(o+=Float64Array.BYTES_PER_ELEMENT,n.boundingSphere={center:a,radius:s},3===r){const u={},h=(u.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,u.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,u.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,{}),m=(h.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,h.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,h.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,{}),d=(m.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,m.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,m.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,{});d.x=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,d.y=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,d.z=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT,n.obb={xExtent:h,yExtent:m,zExtent:d,obbCenter:u}}s=ke(t,i,o);let l=s.string;o=s.bytesOffset;var s=l.indexOf("Geometry"),c=(-1!==s&&(s=l.substring(s),l=l.replace(s,"")),n.childTile=l,n.geodes=[],i.getUint32(o,!0));o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<c;e++)o=function(t,i,o,e){let r={},n=[],a=new Array(16);for(let e=0;e<16;e++)a[e]=i.getFloat64(o,!0),o+=Float64Array.BYTES_PER_ELEMENT;r.matrix=a,r.skeletonNames=n;var s=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<s;e++){var l=ke(t,i,o);n.push(l.string),o=l.bytesOffset}return e.push(r),o}(t,i,o,n.geodes);return e.push(n),o=3===r?ke(t,i,o).bytesOffset:o}function je(i,o,r,n){var a=o.getUint32(r,!0);if(n.verticesCount=a,!((r+=Uint32Array.BYTES_PER_ELEMENT)<=0)){var s=o.getUint16(r,!0),o=(r+=Uint16Array.BYTES_PER_ELEMENT,o.getUint16(r,!0),s*Float32Array.BYTES_PER_ELEMENT),a=(r+=Uint16Array.BYTES_PER_ELEMENT,a*s*Float32Array.BYTES_PER_ELEMENT),i=new Uint8Array(i,r,a);r+=a;let e=n.vertexAttributes,t=n.attrLocation;t.aPosition=e.length,e.push({index:t.aPosition,typedArray:i,componentsPerAttribute:s,componentDatatype:5126,offsetInBytes:0,strideInBytes:o,normalize:!1})}return r}function Ue(i,o,r,n){var a=o.getUint32(r,!0);if(r+=Uint32Array.BYTES_PER_ELEMENT,!(a<=0)){var s=o.getUint16(r,!0),o=(r+=Uint16Array.BYTES_PER_ELEMENT,o.getUint16(r,!0)),a=(r+=Uint16Array.BYTES_PER_ELEMENT,a*s*Float32Array.BYTES_PER_ELEMENT),i=new Uint8Array(i,r,a);r+=a;let e=n.vertexAttributes,t=n.attrLocation;t.aNormal=e.length,e.push({index:t.aNormal,typedArray:i,componentsPerAttribute:s,componentDatatype:5126,offsetInBytes:0,strideInBytes:o,normalize:!1})}return r}function ze(t,i,o,e){var r=i.getUint32(o,!0),n=(o+=Uint32Array.BYTES_PER_ELEMENT,e.verticesCount);let a;if(0<r){i.getUint16(o,!0),o=(o+=Uint16Array.BYTES_PER_ELEMENT)+2*Uint8Array.BYTES_PER_ELEMENT;i=r*Uint8Array.BYTES_PER_ELEMENT*4;let e=new Uint8Array(t,o,i);a=e.slice(0,i),o+=i}else{a=new Uint8Array(4*n);for(let e=0;e<n;e++)a[4*e]=255,a[4*e+1]=255,a[4*e+2]=255,a[4*e+3]=255}let s=e.vertexAttributes,l=e.attrLocation;return l.aColor=s.length,s.push({index:l.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:4,normalize:!0}),e.vertexColor=a,o}function We(i,o,r,n){var a=o.getUint32(r,!0);if(r+=Uint32Array.BYTES_PER_ELEMENT,!(a<=0)){o.getUint16(r,!0),r=(r+=Uint16Array.BYTES_PER_ELEMENT)+2*Uint8Array.BYTES_PER_ELEMENT;o=a*Uint8Array.BYTES_PER_ELEMENT*4,a=new Uint8Array(i,r,o);r+=o;let e=n.vertexAttributes,t=n.attrLocation;t.aSecondColor=e.length,e.push({index:t.aSecondColor,typedArray:a,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:4,normalize:!0})}return r}function Ye(o,r,n,a){var e=r.getUint16(n,!0);n=(n+=Uint16Array.BYTES_PER_ELEMENT)+Uint16Array.BYTES_PER_ELEMENT;for(let i=0;i<e;i++){var s=r.getUint32(n,!0),l=(n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint16(n,!0)),s=(n+=Uint16Array.BYTES_PER_ELEMENT,r.getUint16(n,!0),n+=Uint16Array.BYTES_PER_ELEMENT,s*l*Float32Array.BYTES_PER_ELEMENT),c=new Uint8Array(o,n,s),s=(n+=s,"aTexCoord"+i);let e=a.vertexAttributes,t=a.attrLocation;t[s]=e.length,e.push({index:t[s],typedArray:c,componentsPerAttribute:l,componentDatatype:5126,offsetInBytes:0,strideInBytes:l*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return n}function Je(i,t,o,r){var n=t.getUint16(o,!0);o=(o+=Uint16Array.BYTES_PER_ELEMENT)+Uint16Array.BYTES_PER_ELEMENT;let a=r.vertexAttributes,s=r.attrLocation;for(let e=0;e<n;e++){var l=t.getUint32(o,!0),c=(o+=Uint32Array.BYTES_PER_ELEMENT,t.getUint16(o,!0)),u=(o+=Uint16Array.BYTES_PER_ELEMENT,t.getUint16(o,!0),o+=Uint16Array.BYTES_PER_ELEMENT,l*c*Float32Array.BYTES_PER_ELEMENT);if(17===c||29===c){let e=new Uint8Array(i,o,u);r.instanceCount=l,r.instanceMode=c,r.instanceBuffer=e,r.instanceIndex=1;var h=e.slice(0,c*l*4);r.vertexColorInstance=h;let t;17===c?(t=17*Float32Array.BYTES_PER_ELEMENT,s.uv2=a.length,a.push({index:s.uv2,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:0,strideInBytes:t,instanceDivisor:1}),s.uv3=a.length,a.push({index:s.uv3,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv4=a.length,a.push({index:s.uv4,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.secondary_colour=a.length,a.push({index:s.secondary_colour,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv6=a.length,a.push({index:s.uv6,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1})):29===c&&(t=29*Float32Array.BYTES_PER_ELEMENT,s.uv1=a.length,a.push({index:s.uv1,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:0,strideInBytes:t,instanceDivisor:1,byteLength:u}),s.uv2=a.length,a.push({index:s.uv2,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv3=a.length,a.push({index:s.uv3,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv4=a.length,a.push({index:s.uv4,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv5=a.length,a.push({index:s.uv5,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv6=a.length,a.push({index:s.uv6,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv7=a.length,a.push({index:s.uv7,componentsPerAttribute:3,componentDatatype:5126,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.secondary_colour=a.length,a.push({index:s.secondary_colour,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}),s.uv9=a.length,a.push({index:s.uv9,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:t,instanceDivisor:1}))}else{var m=l*c;r.instanceBounds=new Float32Array(m);for(let e=0;e<m;e++)r.instanceBounds[e]=t.getFloat32(o+e*Float32Array.BYTES_PER_ELEMENT,!0)}o+=u}return o}function Ke(t,i,o,r,n){if(3===n&&(i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT),o=je(t,i,o,r),o=Ue(t,i,o,r),o=ze(t,i,o,r),3!==n&&(o=We(t,i,o,r)),o=Ye(t,i,o,r),o=Je(t,i,o,r),3===n){o=function(t,i,o,r){var n=i.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<n;e++){var a=i.getUint32(o,!0),s=(o+=Uint32Array.BYTES_PER_ELEMENT,i.getUint16(o,!0)),l=(o+=Uint16Array.BYTES_PER_ELEMENT,i.getUint16(o,!0)),a=(o+=Uint16Array.BYTES_PER_ELEMENT,a*s*Be[l]),l=new Uint8Array(t,o,a);o+=a;const c=r.vertexAttributes,u=r.attrLocation;a="aCustom"+e;u[a]=c.length,c.push({index:u[a],typedArray:l,componentsPerAttribute:s,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1})}return o}(t,i,o,r);n=ke(t,i,o),t=(o=n.bytesOffset,r.customVertexAttribute=JSON.parse(n.string),"aCustom"+r.customVertexAttribute.TextureCoordMatrix),n="aCustom"+r.customVertexAttribute.VertexWeight;void 0!==r.attrLocation[t]&&(r.attrLocation.aTextureCoordMatrix=r.attrLocation[t],delete r.attrLocation[t]),void 0!==r.attrLocation[n]&&(r.attrLocation.aVertexWeight=r.attrLocation[n],delete r.attrLocation[n]);let e=o%4;o+=e=e&&4-e,t=o,n=(r=i).getUint32(t,!0),t+=Uint32Array.BYTES_PER_ELEMENT,n<=0||(i=r.getUint16(t,!0),t+=Uint16Array.BYTES_PER_ELEMENT,r.getUint16(t,!0),t=(t+=Uint16Array.BYTES_PER_ELEMENT)+n*i*Float32Array.BYTES_PER_ELEMENT),o=t}return o}function Qe(i,o,n,a){var s=o.getUint32(n,!0),r=(n+=Uint32Array.BYTES_PER_ELEMENT,a.compressOptions=s,o.getUint32(n,!0));n+=Uint32Array.BYTES_PER_ELEMENT,a.minVerticesValue={x:0,y:0,z:0,w:0},a.minTexCoordValue=[{x:0,y:0},{x:0,y:0}],a.texCoordCompressConstant=[{x:0,y:0,z:0},{x:0,y:0,z:0}];for(let t=0;t<r;t++){var l=o.getUint32(n,!0),c=(n+=Uint32Array.BYTES_PER_ELEMENT,a.vertCompressConstant=o.getFloat32(n,!0),n+=Float32Array.BYTES_PER_ELEMENT,a.minVerticesValue.x=o.getFloat64(n,!0),n+=Float64Array.BYTES_PER_ELEMENT,a.minVerticesValue.y=o.getFloat64(n,!0),n+=Float64Array.BYTES_PER_ELEMENT,a.minVerticesValue.z=o.getFloat64(n,!0),n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),u=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),h=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),m=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),d=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),p=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),g=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),f=(n+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(n,!0)),_=(n+=Float64Array.BYTES_PER_ELEMENT,a.minTexCoordValue[0].x=h,a.minTexCoordValue[0].y=m,a.minTexCoordValue[1].x=g,a.minTexCoordValue[1].y=f,a.texCoordCompressConstant[0].x=c,a.texCoordCompressConstant[0].y=u,a.texCoordCompressConstant[1].x=d,a.texCoordCompressConstant[1].y=p,o.getInt32(n,!0));n+=Int32Array.BYTES_PER_ELEMENT;for(let e=0;e<_;e++){var C=o.getInt32(n,!0);n+=Int32Array.BYTES_PER_ELEMENT;let r=0;C!==He.Custom0&&C!==He.Custom1||(r=o.getInt32(n,!0),n+=Int32Array.BYTES_PER_ELEMENT);var y=o.getInt32(n,!0),v=(n+=Int32Array.BYTES_PER_ELEMENT,new Uint8Array(i,n,y));let e=(n+=Uint8Array.BYTES_PER_ELEMENT*y)%4;n+=e=e&&4-e;{w=void 0;b=void 0;T=void 0;y=void 0;S=void 0;E=void 0;var w=l;var b=C;var T=r;y=v;var S=a;var E=s;let e=0,t;const P=S.vertexAttributes,x=S.attrLocation;switch(b){case He.Normal:case He.FirstTexcoord:case He.SecondTexcoord:e=2*Uint16Array.BYTES_PER_ELEMENT,0!=(16&E)||b!==He.FirstTexcoord&&b!==He.SecondTexcoord||(e=2*Float32Array.BYTES_PER_ELEMENT),t=new Uint8Array(w*e);break;case He.Color:case He.SecondColor:e=4*Uint8Array.BYTES_PER_ELEMENT,t=new Uint8Array(4*w);break;case He.Custom0:case He.Custom1:e=Float32Array.BYTES_PER_ELEMENT*T,t=new Uint8Array(w*T*4);break;default:e=4*Uint16Array.BYTES_PER_ELEMENT,t=new Uint8Array(w*e)}Ae.decodeVertexBuffer(t,w,e,y,y.length);let i,o;switch(b){case He.Position:x.aPosition=P.length,P.push({index:x.aPosition,typedArray:new Uint16Array(t.buffer,0,t.length/2),componentsPerAttribute:4,componentDatatype:5122,offsetInBytes:0,strideInBytes:0,normalize:!1}),S.verticesCount=w;break;case He.Normal:x.aNormal=P.length,P.push({index:x.aNormal,typedArray:new Int16Array(t.buffer,0,t.length/2),componentsPerAttribute:2,componentDatatype:5122,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case He.FirstTexcoord:i=0==(16&E)?(o=5126,new Float32Array(t.buffer,0,t.length/4)):(o=5122,new Uint16Array(t.buffer,0,t.length/2)),x.aTexCoord0=P.length,P.push({index:x.aTexCoord0,typedArray:i,componentsPerAttribute:2,componentDatatype:o,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case He.SecondTexcoord:i=0==(16&E)?(o=5126,new Float32Array(t.buffer,0,t.length/4)):(o=5122,new Uint16Array(t.buffer,0,t.length/2)),x.aTexCoord1=P.length,P.push({index:x.aTexCoord1,typedArray:i,componentsPerAttribute:2,componentDatatype:o,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case He.Color:x.aColor=P.length,P.push({index:x.aColor,typedArray:t,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:0,normalize:!0});break;case He.SecondColor:x.aSecondColor=P.length,P.push({index:x.aSecondColor,typedArray:t,componentsPerAttribute:4,componentDatatype:5120,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case He.Custom0:x.aCustom0=P.length,P.push({index:x.aCustom0,typedArray:new Float32Array(t.buffer,0,t.length/4),componentsPerAttribute:T,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case He.Custom1:x.aCustom1=P.length,P.push({index:x.aCustom1,typedArray:new Float32Array(t.buffer,0,t.length/4),componentsPerAttribute:T,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1})}}}h=ke(i,o,n),m=(n=h.bytesOffset,a.customVertexAttribute=JSON.parse(h.string),"aCustom"+a.customVertexAttribute.TextureCoordMatrix),g="aCustom"+a.customVertexAttribute.VertexWeight;void 0!==a.attrLocation[m]&&(a.attrLocation.aTextureCoordMatrix=a.attrLocation[m],t===r-1&&delete a.attrLocation[m]),void 0!==a.attrLocation[g]&&(a.attrLocation.aVertexWeight=a.attrLocation[g],t===r-1&&delete a.attrLocation[g]);let e=n%4;n+=e=e&&4-e}return n}function qe(e,t,i,o){var r=t.getUint32(i,!0);return o.compressOptions=r,i+=Uint32Array.BYTES_PER_ELEMENT,i=((r&Fe.SVC_Vertex)===Fe.SVC_Vertex?function(o,r,n,a){var s=r.getUint32(n,!0);if(a.verticesCount=s,!((n+=Uint32Array.BYTES_PER_ELEMENT)<=0)){var l=r.getUint16(n,!0),c=(n+=Uint16Array.BYTES_PER_ELEMENT,r.getUint16(n,!0),l*Int16Array.BYTES_PER_ELEMENT),u=(n+=Uint16Array.BYTES_PER_ELEMENT,r.getFloat32(n,!0));n+=Float32Array.BYTES_PER_ELEMENT;let e={};e.x=r.getFloat32(n,!0),n+=Float32Array.BYTES_PER_ELEMENT,e.y=r.getFloat32(n,!0),n+=Float32Array.BYTES_PER_ELEMENT,e.z=r.getFloat32(n,!0),n+=Float32Array.BYTES_PER_ELEMENT,e.w=r.getFloat32(n,!0),n+=Float32Array.BYTES_PER_ELEMENT,a.vertCompressConstant=u,a.minVerticesValue=e;r=s*l*Int16Array.BYTES_PER_ELEMENT,u=new Uint8Array(o,n,r);n+=r;let t=a.vertexAttributes,i=a.attrLocation;i.aPosition=t.length,t.push({index:i.aPosition,typedArray:u,componentsPerAttribute:l,componentDatatype:5122,offsetInBytes:0,strideInBytes:c,normalize:!1})}return n}:je)(e,t,i,o),i=We(e,t,i=ze(e,t,i=((r&Fe.SVC_Normal)===Fe.SVC_Normal?function(i,o,r,n){var a=o.getUint32(r,!0);if(r+=Uint32Array.BYTES_PER_ELEMENT,!(a<=0)){o.getUint16(r,!0),r+=Uint16Array.BYTES_PER_ELEMENT;o=o.getUint16(r,!0),a=(r+=Uint16Array.BYTES_PER_ELEMENT,2*a*Int16Array.BYTES_PER_ELEMENT),i=new Uint8Array(i,r,a);r+=a;let e=n.vertexAttributes,t=n.attrLocation;t.aNormal=e.length,e.push({index:t.aNormal,typedArray:i,componentsPerAttribute:2,componentDatatype:5122,offsetInBytes:0,strideInBytes:o,normalize:!1})}return r}:Ue)(e,t,i,o),o),o),i=((r&Fe.SVC_TexutreCoord)===Fe.SVC_TexutreCoord?function(r,n,a,s){s.texCoordCompressConstant=[],s.minTexCoordValue=[];var e=n.getUint16(a,!0);a=(a+=Uint16Array.BYTES_PER_ELEMENT)+Uint16Array.BYTES_PER_ELEMENT;for(let o=0;o<e;o++){var l=n.getUint8(a,!0),c=(a=(a+=Uint8Array.BYTES_PER_ELEMENT)+3*Uint8Array.BYTES_PER_ELEMENT,n.getUint32(a,!0)),u=(a+=Uint32Array.BYTES_PER_ELEMENT,n.getUint16(a,!0)),h=(a+=Uint16Array.BYTES_PER_ELEMENT,n.getUint16(a,!0),a+=Uint16Array.BYTES_PER_ELEMENT,n.getFloat32(a,!0));a+=Float32Array.BYTES_PER_ELEMENT,s.texCoordCompressConstant.push(h);let e={};e.x=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.y=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.z=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,e.w=n.getFloat32(a,!0),a+=Float32Array.BYTES_PER_ELEMENT,s.minTexCoordValue.push(e);var h=c*u*Int16Array.BYTES_PER_ELEMENT,m=new Uint8Array(r,a,h),d=(a+=h)%4,d=(0!=d&&(a+=4-d),"aTexCoord"+o);let t=s.vertexAttributes,i=s.attrLocation;i[d]=t.length,t.push({index:i[d],typedArray:m,componentsPerAttribute:u,componentDatatype:5122,offsetInBytes:0,strideInBytes:u*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),l&&(h=c*Float32Array.BYTES_PER_ELEMENT,m=new Uint8Array(r,a,h),a+=h,s.texCoordZMatrix=!0,d="aTexCoordZ"+o,i[d]=t.length,t.push({index:i[d],typedArray:m,componentsPerAttribute:1,componentDatatype:5126,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1}))}return a}:Ye)(e,t,i,o),(r&Fe.SVC_TexutreCoordIsW)===Fe.SVC_TexutreCoordIsW&&(o.textureCoordIsW=!0),i=Je(e,t,i,o)}function Xe(i,o,r,n,a){o.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT;var t=o.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<t;e++){3===a&&(o.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT);var s=ke(i,o,r),l=s.string,s=(r=s.bytesOffset,s.length%4);0!=s&&(r+=4-s);let e=o.getUint32(r,!0);if(r+=Int32Array.BYTES_PER_ELEMENT,3===a)switch(e){case Oe.Standard:e=Re.SV_Standard;break;case Oe.Draco:e=Re.SV_DracoCompressed;break;case Oe.MeshOpt:e=Re.SV_Compressed}var s={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1},c=(e===Re.SV_Standard?r=Ke(i,o,r,s,a):e===Re.SV_Compressed&&3===a?r=Qe(i,o,r,s):e===Re.SV_Compressed&&(r=qe(i,o,r,s)),[]);r=e===Re.SV_Compressed&&3===a?function(o,r,n,a){var t=r.getInt32(n,!0);n+=Int32Array.BYTES_PER_ELEMENT;for(let e=0;e<t;e++){const d={};var s=r.getInt32(n,!0);if(n+=Int32Array.BYTES_PER_ELEMENT,!(s<1)){var l=r.getInt8(n,!0),c=(n+=Int8Array.BYTES_PER_ELEMENT,r.getInt8(n,!0),n+=Int8Array.BYTES_PER_ELEMENT,r.getInt8(n,!0)),u=(n+=Int8Array.BYTES_PER_ELEMENT,r.getInt8(n,!0),n+=Int8Array.BYTES_PER_ELEMENT,r.getInt32(n,!0));n+=Int32Array.BYTES_PER_ELEMENT;let e,t=(13!==c?(e=new Uint8Array(o,n,u),n+=Uint8Array.BYTES_PER_ELEMENT*u):(e=new Uint32Array(o,n,u),n+=Uint32Array.BYTES_PER_ELEMENT*u),n%4);n+=t=t&&4-t;let i;13!==c?(i=new Uint8Array(s*Uint32Array.BYTES_PER_ELEMENT),Ae.decodeIndexBuffer(i,s,Uint32Array.BYTES_PER_ELEMENT,e)):i=e;var h=r.getInt32(n,!0);n+=Int32Array.BYTES_PER_ELEMENT;const p=new(0===(d.indexType=l)?Uint16Array:Uint32Array)(s);d.indicesCount=s;u=new Uint32Array(i.buffer,i.byteOffset,i.byteLength/4);p.set(u,0),d.indicesTypedArray=p,d.primitiveType=c;for(let e=0;e<h;e++){var m=ke(o,r,n);n=m.bytesOffset,d.materialCode=m.string}a.push(d),n+=t=(t=n%4)&&4-t}}return n}(i,o,r,c):function(o,t,r,n,a){var i=t.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<i;e++){let i={};3===a&&(t.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT);var s=t.getUint32(r,!0),l=(r+=Uint32Array.BYTES_PER_ELEMENT,t.getUint8(r,!0)),c=(r+=Uint8Array.BYTES_PER_ELEMENT,t.getUint8(r,!0),r+=Uint8Array.BYTES_PER_ELEMENT,t.getUint8(r,!0));if(r=(r+=Uint8Array.BYTES_PER_ELEMENT)+Uint8Array.BYTES_PER_ELEMENT,0<s){let e=null,t;1===l||3===l?(t=s*Uint32Array.BYTES_PER_ELEMENT,e=new Uint8Array(o,r,t)):(t=s*Uint16Array.BYTES_PER_ELEMENT,e=new Uint8Array(o,r,t),s%2!=0&&(t+=2)),i.indicesTypedArray=e,r+=t}i.indicesCount=s,i.indexType=l,i.primitiveType=c;var u=t.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<u;e++){var h=ke(o,t,r),m=h.string;r=h.bytesOffset,i.materialCode=m}0!=r%4&&(r+=4-r%4),n.push(i)}return r}(i,o,r,c,a);let t=void 0;2===c.length&&13===c[1].primitiveType&&3<=c[1].indicesCount&&(t=S3MEdgeProcessor.createEdgeDataByIndices(s,c[1])),n[l]={vertexPackage:s,arrIndexPackage:c,edgeGeometry:t},3===a&&(o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT,o.getFloat64(r,!0),r+=Float64Array.BYTES_PER_ELEMENT)}return r=3!==a?(r+=o.getUint32(r,!0))+Uint32Array.BYTES_PER_ELEMENT:r}let Ze={red:0,green:0,blue:0,alpha:0};function $e(e,t,i){let o=e.vertexAttributes,r=e.attrLocation;e=o.length;r[1===i?"instanceId":"batchId"]=e,o.push({index:e,typedArray:t,componentsPerAttribute:1,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,instanceDivisor:i})}Me.parseBuffer=function(e){let t=0,i={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},o=new DataView(e);i.version=o.getFloat32(t,!0),t+=Float32Array.BYTES_PER_ELEMENT,2<=i.version&&(o.getUint32(t,!0),t+=Uint32Array.BYTES_PER_ELEMENT),3<=i.version&&(o.getUint32(t,!0),t+=Uint32Array.BYTES_PER_ELEMENT),o.getUint32(t,!0),t+=Uint32Array.BYTES_PER_ELEMENT;r=e,s=t,r=new Uint8Array(e,s);var r,n,a,e=ye.inflate(r).buffer,s=(o=new DataView(e),t=0,o.getUint32(t,!0)),l=(t+=Uint32Array.BYTES_PER_ELEMENT,t=function(t,i,o,r){let e={};var n=[],a=(i.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,i.getUint32(o,!0));o+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<a;e++)o=Ne(t,i,o,n,r.version);e.pageLods=n;var s=o%4;return 0!=s&&(o+=4-s),r.groupNode=e,o}(e,o,t,i),t=Xe(e,o,t,i.geoPackage,i.version),t=function(o,r,n,a){r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;var t=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<t;e++){var s=ke(o,r,n),l=s.string,s=(n=s.bytesOffset,s.length%4),s=(0!=s&&(n+=4-s),r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint32(n,!0)),c=(n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint32(n,!0));n+=Uint32Array.BYTES_PER_ELEMENT;let e=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=r.getUint32(n,!0),h=(n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint32(n,!0));n+=Uint32Array.BYTES_PER_ELEMENT;let t=new Uint8Array(o,n,u),i=(n+=u,h===Ve.RGB||h===Ve.BGR?33776:33779);22===e&&(i=36196),Me.s3tc||33776!==i&&33779!==i||(u=new Uint8Array(s*c*4),Ee.decode(u,s,c,t,h),t=u,e=0,i=h===Ve.RGB||h===Ve.RGB?273:4369),a[l]={id:l,width:s,height:c,compressType:e,nFormat:h,internalFormat:i,arrayBufferView:t}}return n}(e,o,t,i.texturePackage),t=(r=e,h=o,n=t,a=i,h=h.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,r=Ge(r=new Uint8Array(r,n,h)),n+=h,a.materials=JSON.parse(r),n),e),c=o,u=t,h=s,m=i.geoPackage,d=i.version;if(3===d&&(h=c.getUint32(u,!0),u+=Uint32Array.BYTES_PER_ELEMENT),1==(1&h)){c.getUint32(u,!0),u+=Uint32Array.BYTES_PER_ELEMENT;var p=c.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<p;e++){var g=ke(l,c,u),f=g.string,_=(u=g.bytesOffset,c.getUint32(u,!0));u+=Uint32Array.BYTES_PER_ELEMENT;let r={};if(m[f].pickInfo=r,-1==m[f].vertexPackage.instanceIndex){let o=new Float32Array(m[f].vertexPackage.verticesCount);for(let i=0;i<_;i++){var C=c.getUint32(u,!0),y=(u+=Uint32Array.BYTES_PER_ELEMENT,c.getUint32(u,!0));u+=Uint32Array.BYTES_PER_ELEMENT;let t=[];for(let e=0;e<y;e++){var v=c.getUint32(u,!0),w=(u+=Uint32Array.BYTES_PER_ELEMENT,c.getUint32(u,!0));u+=Uint32Array.BYTES_PER_ELEMENT,o.fill(i,v,v+w),t.push({vertexColorOffset:v,vertexColorCount:w,batchId:i})}r[C]=t}$e(m[f].vertexPackage,o,void 0)}else{var b=m[f].vertexPackage.instanceCount,T=m[f].vertexPackage.instanceBuffer,S=m[f].vertexPackage.instanceMode;let t=new Float32Array(b),i=[];for(let e=0;e<_;e++){var E=c.getUint32(u,!0),P=(i.push(E),u+=Uint32Array.BYTES_PER_ELEMENT,c.getUint32(u,!0));u+=Uint32Array.BYTES_PER_ELEMENT;for(let e=0;e<P;e++)c.getUint32(u,!0),u+=Uint32Array.BYTES_PER_ELEMENT,3===d&&(c.getUint32(u,!0),u+=Uint32Array.BYTES_PER_ELEMENT)}var x=17===S?16:28;x*=Float32Array.BYTES_PER_ELEMENT;for(let e=0;e<b;e++){var D=(t[e]=e)*S*Float32Array.BYTES_PER_ELEMENT+x,D=(Cesium.Color.unpack(T,D,Ze),2===d?i[e]:Ze.red+256*Ze.green+65536*Ze.blue);void 0===r[D]&&(r[D]={vertexColorCount:1,instanceIds:[],vertexColorOffset:e}),r[D].instanceIds.push(e)}$e(m[f].vertexPackage,t,1)}}}return i};function et(e,t,i){var o=e._gl;this.contextId=e.id,this.textureId=t,this.layerId=i.layerId,this.rootName=i.rootName,this.context=e,this.width=i.width,this.height=i.height,this.compressType=i.compressType,this.internalFormat=i.internalFormat,this.pixelFormat=i.pixelFormat,this.arrayBufferView=i.arrayBufferView,this.wrapS=Cesium.defaultValue(i.wrapS,Cesium.TextureWrap.CLAMP_TO_EDGE),this.wrapT=Cesium.defaultValue(i.wrapT,Cesium.TextureWrap.CLAMP_TO_EDGE),this._target=o.TEXTURE_2D,this._texture=void 0,this.refCount=1,this.arrayBufferView&&this.init()}function tt(){this.ambientColor=new Cesium.Color,this.diffuseColor=new Cesium.Color,this.specularColor=new Cesium.Color(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.texMatrix=Cesium.Matrix4.clone(Cesium.Matrix4.IDENTITY,new Cesium.Matrix4),this.textures=[]}et.prototype.init=function(){let e=this.context._gl;this._texture||(this._texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,this._texture);var t=this.internalFormat;6410!==t&&4369!==t||e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0);let i=0,o=0,r=this.width,n=this.height;var a=function(e,t,i,o){let r=e.length,n=i,a=o,s=0;for(;;){var l=Cesium.PixelFormat.compressedTextureSizeInBytes(t,n,a);if(s+=l,n>>=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<this.arrayBufferView.byteLength&&a);1<i?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this.wrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this.wrapT),e.texParameteri(this._target,this.context._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,1),e.bindTexture(e.TEXTURE_2D,null),this.arrayBufferView=void 0,this.ready=!0},et.prototype.isDestroyed=function(){return!1},et.prototype.destroy=function(){let e=this.context._gl;e.deleteTexture(this._texture),this._texture=null,this.id=0,Cesium.destroyObject(this)},tt.prototype.isDestroyed=function(){return!1},tt.prototype.destroy=function(){var e=this.textures.length;for(let t=0;t<e;t++){let e=this.textures[t];e.destroy()}return this.textures.length=0,this.ambientColor=void 0,this.diffuseColor=void 0,this.specularColor=void 0,Cesium.destroyObject(this)};var it="attribute vec4 aPosition;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef VertexNormal\nattribute vec3 aNormal;\n#endif\n#ifdef Instance\nattribute float instanceId;\n#else\nattribute float batchId;\n#endif\n#ifdef USE_VertexWeight\nattribute float aVertexWeight;\n#endif\n#ifdef USE_TextureCoordMatrix\nattribute vec2 aTextureCoordMatrix;\n#endif\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nvarying vec4 vTexCoord;\nuniform mat4 uTexMatrix;\n#ifdef COMPUTE_TEXCOORD\nuniform float uTexture0Width;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\nvarying vec2 vIsRGBA;\n#endif\n#endif\n#ifdef TexCoord2\nattribute vec4 aTexCoord1;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef InstanceBim\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 secondary_colour;\nattribute vec4 uv6;\n#endif\n#ifdef InstancePipe\nattribute vec4 uv1;\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 uv5;\nattribute vec4 uv6;\nattribute vec4 uv7;\nattribute vec4 secondary_colour;\nattribute vec4 uv9;\n#endif\nuniform vec4 uFillForeColor;\nuniform vec4 uSelectedColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\nvarying vec4 vColor;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nisRGBA = floor(nDel20);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid operation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor)\n{\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nvertexColor *= selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\n}\n#ifdef COMPRESS_TEXCOORD\n#ifdef TexCoord\nuniform vec2 decode_texCoord0_min;\n#endif\n#ifdef TexCoord2\nuniform vec2 decode_texCoord1_min;\n#endif\n#ifdef MeshOPT_Compress\nuniform vec3 decode_texCoord0_vNormConstant;\nuniform vec3 decode_texCoord1_vNormConstant;\n#else\nuniform float decode_texCoord0_normConstant;\nuniform float decode_texCoord1_normConstant;\n#endif\n#endif\n#ifdef COMPRESS_VERTEX\nuniform vec4 decode_position_min;\nuniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_NORMAL\nuniform float normal_rangeConstant;\n#endif\nvoid main()\n{\n#ifdef COMPRESS_VERTEX\nvec4 vertexPos = vec4(1.0);\nvertexPos = decode_position_min + vec4(aPosition.xyz, 1.0) * decode_position_normConstant;\n#else\nvec4 vertexPos = aPosition;\n#endif\n#ifdef TexCoord\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord0;\ntexCoord0.x = aTexCoord0.x * decode_texCoord0_vNormConstant.x;\ntexCoord0.y = aTexCoord0.y * decode_texCoord0_vNormConstant.y;\nvTexCoord.xy = decode_texCoord0_min + texCoord0.xy;\n#else\nvTexCoord.xy = decode_texCoord0_min.xy + aTexCoord0.xy * decode_texCoord0_normConstant;\n#endif\n#else\nvTexCoord.xy = aTexCoord0.xy;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.x = 0.0;\nvTexCoordTransform.x = aTexCoord0.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.x = aTextureCoordMatrix.x;\n#endif\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z, vIsRGBA.x);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\n#endif\n#ifdef TexCoord2\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord1;\ntexCoord1.x = aTexCoord1.x * decode_texCoord1_vNormConstant.x;\ntexCoord1.y = aTexCoord1.y * decode_texCoord1_vNormConstant.y;\nvTexCoord.zw = decode_texCoord1_min + texCoord1.xy;\n#else\nvTexCoord.zw = decode_texCoord1_min.xy + aTexCoord1.xy * decode_texCoord1_normConstant;\n#endif\n#else\nvTexCoord.zw = aTexCoord1.xy;\n#endif\nvTexMatrix2 = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.y = 0.0;\nvTexCoordTransform.y = aTexCoord1.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.y = aTextureCoordMatrix.y;\n#endif\nif(vTexCoordTransform.y < -90000.0)\n{\nvTexMatrix2.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.y), vTexMatrix2.x, vTexMatrix2.y, vTexMatrix2.z, vIsRGBA.y);\nvTexMatrix2.w = log2(uTexture1Width * vTexMatrix.z);\n#endif\nvec4 vertexColor = uFillForeColor;\n#ifdef VertexColor\nvertexColor *= aColor;\n#endif\n#ifdef VertexNormal\nvec3 normal = aNormal;\n#ifdef COMPRESS_NORMAL\n#ifdef MeshOPT_Compress\nnormal.x = aNormal.x / 127.0;\nnormal.y = aNormal.y / 127.0;\nnormal.z = 1.0 - abs(normal.x) - abs(normal.y);\nnormal = normalize(normal);\n#else\nnormal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy;\n#endif\n#endif\n#endif\n#ifdef InstanceBim\nmat4 worldMatrix;\nworldMatrix[0] = uv2;\nworldMatrix[1] = uv3;\nworldMatrix[2] = uv4;\nworldMatrix[3] = vec4(0, 0, 0, 1);\nvertexPos = vec4(vertexPos.xyz,1.0) * worldMatrix;\nvertexColor *= secondary_colour;\n#endif\n#ifdef InstancePipe\nmat4 worldMatrix;\nmat4 worldMatrix0;\nmat4 worldMatrix1;\nvec4 worldPos0;\nvec4 worldPos1;\nworldMatrix0[0] = uv1;\nworldMatrix0[1] = uv2;\nworldMatrix0[2] = uv3;\nworldMatrix0[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nworldMatrix1[0] = uv4;\nworldMatrix1[1] = uv5;\nworldMatrix1[2] = uv6;\nworldMatrix1[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nvec4 realVertex = vec4(vertexPos.xyz, 1.0);\nrealVertex.x = realVertex.x * uv7.z;\nworldPos0 = realVertex * worldMatrix0;\nworldPos1 = realVertex * worldMatrix1;\nvertexColor *= secondary_colour;\n#ifdef TexCoord\nif(aTexCoord0.y > 0.5)\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.y, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos1;\nworldMatrix = worldMatrix1;\n}\nelse\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.x, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos0;\nworldMatrix = worldMatrix0;\n}\n#endif\n#ifdef VertexNormal\nnormal.x = normal.x * uv7.z;\n#endif\n#endif\n#ifdef Instance\nfloat index = instanceId;\n#else\nfloat index = batchId;\n#endif\nvec4 operationType = batchTable_operation(index);\noperation(operationType, vec4(1.0), uSelectedColor, vertexColor);\nvSecondColor = batchTable_pickColor(index);\nvec4 positionMC = vec4(vertexPos.xyz, 1.0);\nvColor = vertexColor;\n#ifdef VertexNormal\nvNormalEC = czm_normal * normal;\n#endif\nvPositionMC = positionMC;\nvPositionEC = (czm_modelView * positionMC).xyz;\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n",ot="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nuniform vec4 uDiffuseColor;\n#ifdef TexCoord\nvarying vec4 vTexCoord;\n#ifdef COMPUTE_TEXCOORD\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\nvarying vec2 vIsRGBA;\n#endif\n#endif\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\n#ifdef TexCoord2\nuniform sampler2D uTexture2;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate, float isRGBA)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(isRGBA > 0.5)\n{\nvec2 rgbTexCoord;\nrgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5;\nrgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5;\ncolor = texture2D(curTexture, rgbTexCoord.xy, -10.0);\nvec2 vecAlphaTexCoord;\nvecAlphaTexCoord.x = rgbTexCoord.x;\nvecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5;\ncolor.a = texture2D(curTexture, vecAlphaTexCoord.xy, -10.0).r;\n}\nelse\n{\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nvec4 FColor = getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x);\n#ifdef TexCoord2\nfloat texTileWidth1 = vTexMatrix2.z * uTexture1Width;\nrealTexCoord = vec3(vTexCoord.zw, vTexCoordTransform.y);\nvec4 SColor = getTexColorForS3M(uTexture2, realTexCoord, texTileWidth1, vTexMatrix2.w, vTexMatrix2.z, vTexMatrix2.xy, vIsRGBA.y);\nSColor.r = clamp(SColor.r, 0.0, 1.0);\nSColor.g = clamp(SColor.g, 0.0, 1.0);\nSColor.b = clamp(SColor.b, 0.0, 1.0);\nreturn FColor * SColor;\n#else\nreturn FColor;\n#endif\n}\n#endif\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n#ifndef HDR\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\nreturn vec4(linearOut, srgbIn.a);\n#else\nreturn srgbIn;\n#endif\n}\nvec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR\nreturn pow(linearIn, vec3(1.0/2.2));\n#else\nreturn linearIn;\n#endif\n}\nvec3 applyTonemapping(vec3 linearIn)\n{\n#ifndef HDR\nreturn czm_acesTonemapping(linearIn);\n#else\nreturn linearIn;\n#endif\n}\nvec3 computeNormal(in vec3 oriVertex)\n{\nvec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z)));\nnormal = normalize(normal);\nreturn normal;\n}\nvoid main()\n{\nif(vColor.a < 0.1)\n{\ndiscard;\n}\nvec4 baseColorWithAlpha = vColor;\n#ifdef COMPUTE_TEXCOORD\nbaseColorWithAlpha *= SRGBtoLINEAR4(getTextureColor());\n#endif\nif(baseColorWithAlpha.a < 0.1)\n{\ndiscard;\n}\nvec3 normal = vec3(0.0);\n#ifdef VertexNormal\nnormal = normalize(vNormalEC);\n#endif\nnormal = length(normal) > 0.1 ? normal : computeNormal(vPositionMC.xyz);\nvec3 color = baseColorWithAlpha.rgb;\nvec3 dirVectorEC = normalize(czm_lightDirectionEC);\nfloat dotProduct = dot( normal, dirVectorEC );\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\ndirDiffuseWeight = dirDiffuseWeight * 0.5 + 0.5;\ncolor += color * uDiffuseColor.rgb * dirDiffuseWeight;\n#ifdef TexCoord\ncolor = LINEARtoSRGB(color);\n#endif\ngl_FragColor = vec4(color, baseColorWithAlpha.a);\n}\n";function rt(){this.context=void 0,this.model=void 0,this.index=void 0}function nt(){this.model=void 0,this.context=void 0,this.index=0}rt.prototype.set=function(e,t,i){this.context=e,this.model=t,this.index=i},rt.prototype.execute=function(){var e=this.context,t=this.index,i=this.model.vertexPackage;let o=i.vertexAttributes[t];if(!Cesium.defined(o))throw new Cesium.DeveloperError("attribute is null");if(-1!==i.instanceIndex&&!Cesium.defined(this.model.instanceBuffer)){if(!Cesium.defined(i.instanceBuffer))throw new Cesium.DeveloperError("instance buffer is null");this.model.instanceBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:i.instanceBuffer,usage:Cesium.BufferUsage.STATIC_DRAW})}1!==o.instanceDivisor||Cesium.defined(o.typedArray)?Cesium.defined(o.vertexBuffer)||(o.vertexBuffer=Cesium.Buffer.createVertexBuffer({context:e,typedArray:o.typedArray,usage:Cesium.BufferUsage.STATIC_DRAW}),o.typedArray=null,delete o.typedArray):o.vertexBuffer=this.model.instanceBuffer},nt.prototype.set=function(e,t,i){this.model=t,this.context=e,this.index=i},nt.prototype.execute=function(){var t=this.context;let i=this.model.arrIndexPackage[this.index];var o=this.model.vertexPackage.verticesCount;if(!Cesium.defined(i))throw new Cesium.DeveloperError("index package is null");if(!Cesium.defined(i.indexBuffer)){if(!Cesium.defined(i.indicesTypedArray))throw new Cesium.DeveloperError("index buffer is null");let e=Cesium.IndexDatatype.UNSIGNED_SHORT;(1===i.indexType||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 at=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"}),st=Object.freeze({SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32}),lt=Object.freeze({BIM:17,PIPELINE:29});function ct(){this.model=void 0,this.context=void 0}function ut(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;t<i;t++)this.vertexBufferToCreate.enqueue(t);for(t=0,i=this.arrIndexPackage.length;t<i;t++)this.indexBufferToCreate.enqueue(t);this.shaderProgramToCreate.enqueue(0),this.boundingVolume=e.boundingVolume,this.material=Cesium.defaultValue(e.material,new tt),this.geoName=e.geoName,this.modelMatrix=e.modelMatrix,this.geoMatrix=e.geoMatrix,this.invGeoMatrix=Cesium.Matrix4.inverse(this.geoMatrix,new Cesium.Matrix4),this.instanceCount=e.vertexPackage.instanceCount,this.attributeLocations=e.vertexPackage.attrLocation,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.pickInfo=Cesium.defaultValue(e.pickInfo,{}),this.selectionInfoMap=new Cesium.AssociativeArray,this.batchTable=void 0,this.batchTableDirty=!1,this.idsOperationMap=new Cesium.AssociativeArray,this.pickColorIdentifier="vSecondColor",this.createBoundingBoxForInstance(),this.ready=!1}ct.prototype.set=function(e,t){this.model=t,this.context=e},ct.prototype.execute=function(){const e=this.context,t=this.model;var i=t.layer,o=t.vs,r=t.fs,n=t.attributeLocations,a=t.material,s=t.vertexPackage,o=t.batchTable?t.batchTable.getVertexShaderCallback()(o):o;void 0===e.texturelod&&(e.texturelod=Cesium.defaultValue(function(t,i){var o=i.length;for(let e=0;e<o;++e){var r=t.getExtension(i[e]);if(r)return r}}(e._gl,["EXT_shader_texture_lod"]),!1));let l=new Cesium.ShaderSource({sources:[o]}),c=new Cesium.ShaderSource({sources:[r]});Cesium.defined(n.aNormal)&&(l.defines.push(at.VertexNormal),c.defines.push(at.VertexNormal)),Cesium.defined(n.aColor)&&l.defines.push(at.VertexColor),a&&0<a.textures.length&&(l.defines.push(at.COMPUTE_TEXCOORD),c.defines.push(at.COMPUTE_TEXCOORD)),a&&2===a.textures.length&&(l.defines.push(at.TexCoord2),c.defines.push(at.TexCoord2)),Cesium.defined(n.aTexCoord0)&&(l.defines.push("TexCoord"),c.defines.push("TexCoord")),-1<s.instanceIndex&&l.defines.push(at.Instance),s.instanceMode===lt.BIM&&l.defines.push(at.InstanceBim),s.instanceMode===lt.PIPELINE&&l.defines.push(at.InstancePipe),Cesium.defined(s.compressOptions)&&(((o=s.compressOptions)&st.SVC_Vertex)===st.SVC_Vertex&&l.defines.push(at.COMPRESS_VERTEX),(o&st.SVC_Normal)===st.SVC_Normal&&l.defines.push(at.COMPRESS_NORMAL),(o&st.SVC_VertexColor)===st.SVC_VertexColor&&l.defines.push(at.COMPRESS_COLOR),(o&st.SVC_TexutreCoord)===st.SVC_TexutreCoord&&l.defines.push(at.COMPRESS_TEXCOORD)),Cesium.defined(t.arrIndexPackage)&&0<t.arrIndexPackage.length&&2===t.arrIndexPackage[0].primitiveType&&c.defines.push(at.UseLineColor),Cesium.defined(s.customVertexAttribute)&&Cesium.defined(s.customVertexAttribute.TextureCoordMatrix)&&l.defines.push("USE_TextureCoordMatrix"),Cesium.defined(s.customVertexAttribute)&&Cesium.defined(s.customVertexAttribute.VertexWeight)&&l.defines.push("USE_VertexWeight"),"MESHOPT"===i._vertexCompressionType&&l.defines.push("MeshOPT_Compress"),t.shaderProgram=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:l,fragmentShaderSource:c,attributeLocations:n})};const ht=new rt,mt=new nt,dt=new ct;function pt(e){ut.call(this,e),this.vs=it,this.fs=ot,this.useLineColor=!1}ut.prototype.createBuffers=function(t){{var i=this,o=t,r=i.layer.context;let e=i.vertexBufferToCreate;for(;e.length;){var n=e.peek();if(ht.set(r,i,n),!o.jobScheduler.execute(ht,Cesium.JobType.BUFFER))break;e.dequeue()}}{var a=this,s=t,l=a.layer.context;let e=a.indexBufferToCreate;for(;e.length;){var c=e.peek();if(mt.set(l,a,c),!s.jobScheduler.execute(mt,Cesium.JobType.BUFFER))break;e.dequeue()}}},ut.prototype.createShaderProgram=function(t){{var i=this,o=t,r=i.layer.context;let e=i.shaderProgramToCreate;for(;e.length&&(e.peek(),dt.set(r,i),o.jobScheduler.execute(dt,Cesium.JobType.PROGRAM));)e.dequeue()}},ut.prototype.createBatchTable=function(e){var t=this;if(!Cesium.defined(t.batchTable)&&t.pickInfo){var i=t.layer.context;let e=[];e.push({functionName:"batchTable_operation",componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4},{functionName:"batchTable_pickColor",componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var o=t.pickInfo,o=Object.keys(o),o=0<t.instanceCount?t.instanceCount:o.length;t.batchTable=new Cesium.BatchTable(i,e,o)}},ut.prototype.createBoundingBoxForInstance=function(){var e,t,i=new Cesium.Cartesian3;const o=this.vertexPackage;Cesium.defined(o)&&-1!==o.instanceIndex&&Cesium.defined(o.instanceBounds)&&(e=o.instanceBounds,t=new Cesium.Cartesian3(e[0],e[1],e[2]),e=new Cesium.Cartesian3(e[3],e[4],e[5]),e=Cesium.Cartesian3.lerp(t,e,.5,i),i=Cesium.Cartesian3.distance(e,t),t=new Cesium.Cartesian3,Cesium.Matrix4.multiplyByPoint(this.modelMatrix,e,t),this.boundingVolume.center=t,this.boundingVolume.radius=i,o.instanceBounds=void 0)},ut.prototype.initLayerSetting=function(e){0<Object.keys(e._objsOperationList).length&&this.updateObjsOperation(e._objsOperationList)},ut.prototype.createPickIds=function(){let r=new Cesium.Cartesian4;var n=this.layer;const a=n.context,t=this.pickInfo;if(Cesium.defined(t)){for(var s in t)t.hasOwnProperty(s)&&this.selectionInfoMap.set(s,t[s]);let i=this.batchTable,o=this.selectionInfoMap,e=o._hash;for(var l in e)if(e.hasOwnProperty(l)){var c=o.get(l);let e;var l=(e=Cesium.defined(e)?e:a.createPickId({primitive:n,id:l})).color;r.x=Cesium.Color.floatToByte(l.red),r.y=Cesium.Color.floatToByte(l.green),r.z=Cesium.Color.floatToByte(l.blue),r.w=Cesium.Color.floatToByte(l.alpha);let t=c.instanceIds;0<this.instanceCount?t.map(function(e){i.setBatchedAttribute(e,1,r)}):(l=c[0].batchId,i.setBatchedAttribute(l,1,r))}this.pickInfo=void 0}},ut.prototype.updateBatchTableAttributes=function(){let i=this;var o=this.idsOperationMap;for(let e=0,t=o.length;e<t;e++){let t=o.values[e];t.dirty&&(t.dirty=!1,0<this.instanceCount?Array.isArray(t.instanceIds)&&t.instanceIds.map(function(e){i.batchTable.setBatchedAttribute(e,0,t.operationValue)}):Cesium.defined(t.batchId)&&this.batchTable.setBatchedAttribute(t.batchId,0,t.operationValue))}},ut.prototype.updateObjsOperation=function(e){if(this.ready&&!(this.selectionInfoMap.length<1)){let t=this.selectionInfoMap._hash;for(var i in t)if(t.hasOwnProperty(i)){var o=e[i];if(Cesium.defined(o)){var r=t[i][0],n=r.batchId,r=r.instanceIds;let e=this.idsOperationMap.get(i);(e=Cesium.defined(e)?e:{batchId:n,instanceIds:r,operationValue:new Cesium.Cartesian4,dirty:!0}).dirty=!0,e.operationValue.x=1&e.operationValue.x|o,this.idsOperationMap.set(i,e),this.batchTableDirty=!0}}}},(pt.prototype=Object.create(ut.prototype)).constructor=ut,pt.prototype.createCommand=function(){if(!Cesium.defined(this.colorCommand)&&0===this.vertexBufferToCreate.length&&0===this.indexBufferToCreate.length&&0===this.shaderProgramToCreate.length){var i=this.layer,o=i.context,r=this.vertexPackage,n=this.arrIndexPackage,a=r.vertexAttributes;if(!(n.length<1)){var n=n[0],s=this.material;this.vertexArray=new Cesium.VertexArray({context:o,attributes:a,indexBuffer:n.indexBuffer});let e=Cesium.PrimitiveType.TRIANGLES;switch(n.primitiveType){case 1:e=Cesium.PrimitiveType.POINTS;break;case 2:e=Cesium.PrimitiveType.LINES;break;case 4:e=Cesium.PrimitiveType.TRIANGLES}this.useLineColor=e===Cesium.PrimitiveType.LINES,this.colorCommand=new Cesium.DrawCommand({primitiveType:e,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),pickId:this.pickColorIdentifier,vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:s.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.OPAQUE,renderState:s.bTransparentSorting?Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND}):Cesium.RenderState.fromCache({cull:{enabled:!1},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND}),instanceCount:r.instanceCount});let t=function(e,t,i){const o={uGeoMatrix:function(){return i.geoMatrix},uTexMatrix:function(){return e.texMatrix},uFillForeColor:function(){return i.useLineColor?t.style3D.lineColor:t.style3D.fillForeColor},uInverseGeoMatrix:function(){return i.invGeoMatrix},uTexture:function(){return e.textures[0]},uTexture2:function(){return e.textures[1]},uTexture0Width:function(){return e.textures[0].width},uTexture1Width:function(){return e.textures[1].width},uDiffuseColor:function(){return e.diffuseColor},uSelectedColor:function(){return t._selectedColor}},r=i.vertexPackage;var n=r.compressOptions;return(n&st.SVC_Vertex)===st.SVC_Vertex&&(o.decode_position_min=function(){return r.minVerticesValue},o.decode_position_normConstant=function(){return r.vertCompressConstant}),(n&st.SVC_Normal)===st.SVC_Normal&&(o.normal_rangeConstant=function(){return r.normalRangeConstant}),(n&st.SVC_TexutreCoord)===st.SVC_TexutreCoord&&(0<r.texCoordCompressConstant.length&&(o.decode_texCoord0_min=function(){return r.minTexCoordValue[0]},o.decode_texCoord0_normConstant=function(){return r.texCoordCompressConstant[0]},o.decode_texCoord0_vNormConstant=function(){return r.texCoordCompressConstant[0]}),1<r.texCoordCompressConstant.length&&(o.decode_texCoord1_min=function(){return r.minTexCoordValue[1]},o.decode_texCoord1_normConstant=function(){return r.texCoordCompressConstant[1]},o.decode_texCoord1_vNormConstant=function(){return r.texCoordCompressConstant[1]}),2<r.texCoordCompressConstant.length&&(o.decode_texCoord2_min=function(){return r.minTexCoordValue[2]},o.decode_texCoord2_normConstant=function(){return r.texCoordCompressConstant[2]}),3<r.texCoordCompressConstant.length&&(o.decode_texCoord3_min=function(){return r.minTexCoordValue[3]},o.decode_texCoord3_normConstant=function(){return r.texCoordCompressConstant[3]}),4<r.texCoordCompressConstant.length&&(o.decode_texCoord4_min=function(){return r.minTexCoordValue[4]},o.decode_texCoord4_normConstant=function(){return r.texCoordCompressConstant[4]}),5<r.texCoordCompressConstant.length&&(o.decode_texCoord5_min=function(){return r.minTexCoordValue[5]},o.decode_texCoord5_normConstant=function(){return r.texCoordCompressConstant[5]}),6<r.texCoordCompressConstant.length&&(o.decode_texCoord6_min=function(){return r.minTexCoordValue[6]},o.decode_texCoord6_normConstant=function(){return r.texCoordCompressConstant[6]}),7<r.texCoordCompressConstant.length&&(o.decode_texCoord7_min=function(){return r.minTexCoordValue[7]},o.decode_texCoord7_normConstant=function(){return r.texCoordCompressConstant[7]})),o}(s,i,this);this.batchTable&&(t=this.batchTable.getUniformMapCallback()(t)),this.colorCommand.uniformMap=t,this.vertexPackage=void 0,this.arrIndexPackage=void 0,this.vs=void 0,this.fs=void 0,this.ready=!0}}},pt.prototype.update=function(e,t){this.ready?(this.batchTableDirty&&(this.updateBatchTableAttributes(),this.batchTableDirty=!1),this.batchTable&&this.batchTable.update(e),e.commandList.push(this.colorCommand)):(this.createBatchTable(e),this.createPickIds(),this.createBuffers(e),this.createShaderProgram(e),this.createCommand(e),this.initLayerSetting(t))},pt.prototype.isDestroyed=function(){return!1},pt.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.material=this.material&&!this.material.isDestroyed()&&this.material.destroy(),this.batchTable=this.batchTable&&!this.batchTable.isDestroyed()&&this.batchTable.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,this.modelMatrix=void 0,this.pickInfo=void 0,this.selectionInfoMap=void 0,this.vs=void 0,this.fs=void 0,Cesium.destroyObject(this)};var gt="attribute vec4 aPosition;\nattribute vec4 aColor;\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid main()\n{\n#ifdef TexCoord\nvTexCoord.xy = aTexCoord0.xy;\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvTexCoordTransform.x = aTexCoord0.z;\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\nvec4 vertexPos = aPosition;\n#ifdef VertexColor\nvColor = aColor;\n#endif\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n",ft="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef TexCoord\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\n#ifdef TexCoord\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nreturn getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy);\n}\n#endif\nvoid main()\n{\nvec4 baseColorWithAlpha = vec4(1.0);\n#ifdef VertexColor\nvec4 baseColorWithAlpha = vColor;\n#endif\n#ifdef TexCoord\nbaseColorWithAlpha *= getTextureColor();\n#endif\ngl_FragColor = baseColorWithAlpha;\n}\n";function _t(e){ut.call(this,e),this.vs=gt,this.fs=ft}(_t.prototype=Object.create(ut.prototype)).constructor=ut,_t.prototype.createCommand=function(){var e,t,i,o,r,n,a;Cesium.defined(this.colorCommand)||0!==this.vertexBufferToCreate.length||0!==this.indexBufferToCreate.length||0!==this.shaderProgramToCreate.length||(e=this.layer.context,t=this.vertexPackage,o=this.arrIndexPackage,i=t.vertexAttributes,o.length<1||(o=o[0],r=this.material,this.vertexArray=new Cesium.VertexArray({context:e,attributes:i,indexBuffer:o.indexBuffer}),this.colorCommand=new Cesium.DrawCommand({primitiveType:o.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:r.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.OPAQUE,renderState:Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND}),instanceCount:t.instanceCount}),this.colorCommand.uniformMap=(n=r,a=this,{uGeoMatrix:function(){return a.geoMatrix},uInverseGeoMatrix:function(){return a.invGeoMatrix},uTexture:function(){return n.textures[0]},uTexture0Width:function(){return n.textures[0].width}}),this.vertexPackage=void 0,this.arrIndexPackage=void 0,this.vs=void 0,this.fs=void 0,this.ready=!0))},_t.prototype.update=function(e,t){this.ready?e.commandList.push(this.colorCommand):(this.createBuffers(e),this.createShaderProgram(e),this.createCommand(e),this.initLayerSetting(t))},_t.prototype.isDestroyed=function(){return!1},_t.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.material=this.material&&!this.material.isDestroyed()&&this.material.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,this.modelMatrix=void 0,this.pickInfo=void 0,this.selectionInfoMap=void 0,this.vs=void 0,this.fs=void 0,Cesium.destroyObject(this)};let Ct={OSGBFile:function(e){return new _t(e)},OSGBCacheFile:function(e){return new pt(e)}};function yt(){}function vt(a,e){if(-1<a.instanceIndex){var s=a;var l=new Cesium.Cartesian3;let e=new Cesium.BoundingSphere;var s=s.instanceBounds;return Cesium.defined(s)&&(u=new Cesium.Cartesian3(s[0],s[1],s[2]),s=new Cesium.Carteisan3(s[3],s[4],s[5]),s=new Cesium.Cartesian3.lerp(u,s,.5,l),l=new Cesium.Cartesian3.distance(s,u),e.center=s,e.radius=l),e}{var c=a;var u=e;s=new Cesium.BoundingSphere;let t=new Cesium.Cartesian3;var l=c.vertexAttributes[0],h=l.componentsPerAttribute,m=Cesium.defined(c.compressOptions)&&(c.compressOptions&st.SVC_Vertex)===st.SVC_Vertex;let i=1,o,r,n=(r=m?(i=c.vertCompressConstant,o=new Cesium.Cartesian3(c.minVerticesValue.x,c.minVerticesValue.y,c.minVerticesValue.z),new Uint16Array(l.typedArray.buffer,l.typedArray.byteOffset,l.typedArray.byteLength/2)):new Float32Array(l.typedArray.buffer,l.typedArray.byteOffset,l.typedArray.byteLength/4),[]);for(let e=0;e<c.verticesCount;e++)Cesium.Cartesian3.fromArray(r,h*e,t),m&&(t=Cesium.Cartesian3.multiplyByScalar(t,i,t),t=Cesium.Cartesian3.add(t,o,t)),n.push(Cesium.Cartesian3.clone(t));return Cesium.BoundingSphere.fromPoints(n,s),Cesium.BoundingSphere.transform(s,u,s),n.length=0,s;return}}function wt(o,r,n){var i=r.groupNode;let a=[];for(let t=0,e=i.pageLods.length;t<e;t++){let e={};var s,l=i.pageLods[t];e.rangeMode=l.rangeMode,e.rangeDataList=l.childTile,e.rangeList=l.rangeList,l.obb?e.boundingVolume={box:{center:l.obb.obbCenter,xExtent:l.obb.xExtent,yExtent:l.obb.yExtent,zExtent:l.obb.zExtent}}:(m=l.boundingSphere.center,s=l.boundingSphere.radius,""!==e.rangeDataList?e.boundingVolume={sphere:{center:new Cesium.Cartesian3(m.x,m.y,m.z),radius:s}}:e.isLeafTile=!0);{c=void 0;u=void 0;h=void 0;m=void 0;d=void 0;p=void 0;g=void 0;w=void 0;b=void 0;T=void 0;C=void 0;f=void 0;y=void 0;_=void 0;C=void 0;v=void 0;y=void 0;S=void 0;E=void 0;P=void 0;x=void 0;D=void 0;I=void 0;A=void 0;L=void 0;var c=o;var u=r;var h=n;var m=l;var d=e;var p=new Cesium.Matrix3;let i={};var g=m.geodes;for(let t=0,e=g.length;t<e;t++){var f,_,C,y,v,w=g[t],b=w.matrix,T=Cesium.Matrix4.multiply(c.modelMatrix,b,new Cesium.Matrix4);let e;Cesium.defined(d.boundingVolume)&&(d.boundingVolume.sphere?(e=new Cesium.BoundingSphere(d.boundingVolume.sphere.center,d.boundingVolume.sphere.radius),Cesium.BoundingSphere.transform(e,c.modelMatrix,e)):d.boundingVolume.box&&(C=d.boundingVolume.box,f=new Cesium.Cartesian3(C.center.x,C.center.y,C.center.z),y=new Cesium.Cartesian4(C.xExtent.x,C.xExtent.y,C.xExtent.z,0),_=new Cesium.Cartesian4(C.yExtent.x,C.yExtent.y,C.yExtent.z,0),C=new Cesium.Cartesian4(C.zExtent.x,C.zExtent.y,C.zExtent.z,0),v=new Cesium.Matrix3,Cesium.Matrix3.setColumn(v,0,y,v),Cesium.Matrix3.setColumn(v,1,_,v),Cesium.Matrix3.setColumn(v,2,C,v),f=Cesium.Matrix4.multiplyByPoint(c.modelMatrix,f,f),y=Cesium.Matrix4.getMatrix3(c.modelMatrix,p),v=Cesium.Matrix3.multiply(y,v,v),e=new Cesium.OrientedBoundingBox(f,v)));var S=w.skeletonNames;for(let t=0,e=S.length;t<e;t++){var E=S[t],P=u.geoPackage[E],x=P.vertexPackage,D=P.arrIndexPackage,I=P.pickInfo;let e;0<D.length&&(e=h[D[0].materialCode]);var A=vt(x,T);i[E]=Ct[c.fileType]({layer:c,vertexPackage:x,arrIndexPackage:D,pickInfo:I,modelMatrix:T,geoMatrix:b,boundingVolume:A,material:e,edgeGeometry:P.edgeGeometry,geoName:E})}}if(!(Object.keys(i).length<1)){if(!Cesium.defined(d.boundingVolume)){let e=[];for(var L in i)i.hasOwnProperty(L)&&e.push(i[L].boundingVolume);d.boundingVolume={sphere:Cesium.BoundingSphere.fromBoundingSpheres(e)}}d.geoMap=i}}Cesium.defined(e.geoMap)&&a.push(e)}return a}yt.parse=function(e,t,i){if(Cesium.defined(t))return wt(e,t,function(o,r,n){let a={};var s=r.materials.material;for(let e=0,t=s.length;e<t;e++){var l=s[e].material,c=l.id;let i=new tt;a[c]=i;var c=l.ambient,c=(i.ambientColor=new Cesium.Color(c.r,c.g,c.b,c.a),l.diffuse),c=(i.diffuseColor=new Cesium.Color(c.r,c.g,c.b,c.a),l.specular),u=(i.specularColor=new Cesium.Color(c.r,c.g,c.b,c.a),i.shininess=l.shininess,i.bTransparentSorting=l.transparentsorting,l.textureunitstates),h=u.length;for(let e=0;e<h;e++){var m=u[e].textureunitstate,d=m.id,p=0===m.addressmode.u?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE,g=0===m.addressmode.v?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE;i.texMatrix=Cesium.Matrix4.unpack(m.texmodmatrix);let t=r.texturePackage[d];if(Cesium.defined(t)&&0<t.arrayBufferView.byteLength){t.wrapS=p,t.wrapT=g;m=n.fileName+d;let e=o.textureCache.getTexture(m);Cesium.defined(e)||(Cesium.PixelFormat.isCompressedFormat(t.internalFormat)?e=new et(o,d,t):(d=Cesium.Math.isPowerOfTwo(t.width)&&Cesium.Math.isPowerOfTwo(t.height),e=new Cesium.Texture({context:o,source:{width:t.width,height:t.height,arrayBufferView:t.arrayBufferView},sampler:new Cesium.Sampler({minificationFilter:d?o._gl.LINEAR_MIPMAP_LINEAR:o._gl.LINEAR,wrapS:p,wrapT:g})}),d&&e.generateMipmap(Cesium.MipmapHint.NICEST)),o.textureCache.addTexture(m,e)),i.textures.push(e)}}}return a}(e.context,t,i))};var bt=Object.freeze({Distance:0,Pixel:1,GeometryError:2});function Tt(e,t,i,o,r,n){this.layer=e,this.parent=t;var a=o.replace(/\\/g,"/");this.fileExtension=Cesium.getExtensionFromUri(o),this.relativePath=function(e,t){e=e.replace(/\+/g,"%2B");let i=t._basePath,o=-1<t._basePath.indexOf("realspace");if(!o)return e;var t=i.replace(/(.*realspace)/,""),r=i.replace(/\/rest\/realspace/g,"").replace(t,"");return r+"/rest/realspace"+t+"data/path/"+e.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,"")}(a,e),this.relativePath=this.relativePath.replace("data/path/data/path","data/path"),this.fileName=o,this.isLeafTile=0===r,this.isRootTile=!1,this.boundingVolume=this.createBoundingVolume(i,e.modelMatrix);let s=Cesium.Resource.createIfNeeded(e._baseResource);if(Cesium.defined(t))this.baseUri=t.baseUri;else{let e=new Cesium.Resource(a);this.baseUri=e.getBaseUri()}this.contentResource=s.getDerivedResource({url:this.relativePath}),this.serverKey=Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.centerZDepth=0,this.pixel=0,this.depth=t?t.depth+1:0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.renderEntities=[],this.lodRangeData=Cesium.defaultValue(r,16),this.lodRangeMode=Cesium.defaultValue(n,bt.Pixel),this.contentState=this.isLeafTile?Ce.READY:Ce.UNLOADED,this.touchedFrame=0,this.requestedFrame=0,this.processFrame=0,this.selectedFrame=0,this.updatedVisibilityFrame=0,this.foveatedFactor=0,this.priority=0,(this.priorityHolder=this).wasMinPriorityChild=!1,this.shouldSelect=!1,this.selected=!1,this.finalResolution=!0,this.refines=!1}function St(e){return e.boundingVolume}function Et(e,t,i){e._cache.add(t),Me.s3tc=e.context.s3tc,Me.pvrtc=e.context.pvrtc,Me.etc1=e.context.etc1;i=Me.parseBuffer(i);if(i){e=yt.parse(e,i,t);{var a=t;var s=e;let i=a.layer;var l=s.length;let o=Number.MAX_VALUE,r=0,n=bt.Pixel;for(let t=0;t<l;t++){var c,u=s[t],h=u.boundingVolume,m=u.rangeDataList,m=a.baseUri+m,d=u.rangeList,p=u.rangeMode;let e=u.geoMap;for(c in 0!==d&&(u=new Tt(i,a,h,m,d,p),a.children.push(u),i._cache.add(u)),e)e.hasOwnProperty(c)&&a.renderEntities.push(e[c]);o=Math.min(o,d),r=Math.max(r,d),n=p}a.isRootTile&&(a.lodRangeData=n===bt.Pixel?o/2:2*r,a.lodRangeMode=n)}t.selectedFrame=0,t.contentState=Ce.READY,t.contentReadyPromise.resolve(i)}else t.contentState=Ce.FAILED,t.contentReadyPromise.reject()}function Pt(e,t,i){return Math.max(Cesium.Math.normalize(e,t,i)-Cesium.Math.EPSILON7,0)}function xt(e,t,i){e*=Math.pow(10,t);return parseInt(e)*Math.pow(10,i)}function Dt(){this._stack=[]}function It(e,t){return 0===t.distanceToCamera&&0===e.distanceToCamera?t.centerZDepth-e.centerZDepth:t.distanceToCamera-e.distanceToCamera}function At(e,t,i){t.requestedFrame!==i.frameNumber&&t.contentState===Ce.UNLOADED&&(e._requestTiles.push(t),t.requestedFrame=i.frameNumber)}function Lt(e,t,i){t.processFrame===i.frameNumber||t.contentState!==Ce.READY||t.renderable||(t.processFrame=i.frameNumber,e._processTiles.push(t))}function Mt(e,t,i){t.touchedFrame!==i.frameNumber&&(e._cache.touch(t),t.touchedFrame=i.frameNumber)}function Rt(e,t,i){var o,r;o=o=t,e=e=e,(r=r=i).updatedVisibilityFrame!==e.frameNumber&&(r.updatedVisibilityFrame=e.frameNumber,r.updateVisibility(e,o)),i.wasMinPriorityChild=!1,i.priorityHolder=i,r=i,(e=t)._maximumPriority.distance=Math.max(r.distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(r.distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(r.depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(r.depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(r.foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(r.foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.pixel=Math.max(r.pixel,e._maximumPriority.pixel),e._minimumPriority.pixel=Math.min(r.pixel,e._minimumPriority.pixel),i.shouldSelect=!1,i.selected=!1}function Ot(i,o,r){for(;o.length;){let e=o.pop();var n=e.parent,n=!Cesium.defined(n)||n.refines;let t=!1;a=i;a=!(t=0!==(s=e).children.length&&(s.lodRangeMode===bt.Pixel?s.pixel/a.lodRangeScale>s.lodRangeData:s.lodRangeMode===bt.GeometryError?16<s.geometryError:s.distanceToCamera*a.lodRangeScale<s.lodRangeData)?function(e,i,t,o){let r,n=i.children;var a=n.length;for(r=0;r<a;++r)Rt(o,e,n[r]);n.sort(It);let s=!0,l=!1,c=-1,u=Number.MAX_VALUE;for(r=0;r<a;++r){var h=n[r],h=(h.foveatedFactor<u&&(c=r,u=h.foveatedFactor),h.visible?(t.push(h),l=!0):(At(e,h,o),Mt(e,h,o),Lt(e,h,o)),h.renderable);s=s&&h}if(l||(s=!1),-1!==c){let e=n[c],t=(e.wasMinPriorityChild=!0,(i.wasMinPriorityChild||i.isRootTile)&&u<=i.priorityHolder.foveatedFactor?i.priorityHolder:i);for(t.foveatedFactor=Math.min(e.foveatedFactor,t.foveatedFactor),t.distanceToCamera=Math.min(e.distanceToCamera,t.distanceToCamera),r=0;r<a;++r){let e=n[r];e.priorityHolder=t}}return s}(i,e,o,r)&&n:t)&&n;At(i,e,r),Lt(i,e,r),a&&(s=i,n=e,a=r,n.selectedFrame!==a.frameNumber&&n.renderable&&(s._selectedTiles.push(n),n.selectedFrame=a.frameNumber)),Mt(i,e,r),e.refines=t}var a,s}function Bt(){this._list=new Cesium.DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}Object.defineProperties(Tt.prototype,{renderable:{get:function(){var t=this.renderEntities,i=t.length;if(0===i)return!1;for(let e=0;e<i;e++)if(!t[e].ready)return!1;return!0}}}),Tt.prototype.createBoundingVolume=function(e,t){return Cesium.defined(e.sphere)?(s=e.sphere,l=t,c=new Cesium.Cartesian3,u=Cesium.Cartesian3.clone(s.center),s=s.radius,u=Cesium.Matrix4.multiplyByPoint(l,u,u),l=Cesium.Matrix4.getScale(l,c),s*=Cesium.Cartesian3.maximumComponent(l),new Cesium.TileBoundingSphere(u,s)):Cesium.defined(e.box)?(c=e.box,l=t,u=new Cesium.Matrix3,s=new Cesium.Cartesian3,Cesium.defined(c.center)?(n=new Cesium.Cartesian3(c.center.x,c.center.y,c.center.z),r=new Cesium.Cartesian4(c.xExtent.x,c.xExtent.y,c.xExtent.z,0),i=new Cesium.Cartesian4(c.yExtent.x,c.yExtent.y,c.yExtent.z,0),o=new Cesium.Cartesian4(c.zExtent.x,c.zExtent.y,c.zExtent.z,0),a=new Cesium.Matrix3,Cesium.Matrix3.setColumn(a,0,r,a),Cesium.Matrix3.setColumn(a,1,i,a),Cesium.Matrix3.setColumn(a,2,o,a),n=Cesium.Matrix4.multiplyByPoint(l,n,n),r=Cesium.Matrix4.getMatrix3(l,u),a=Cesium.Matrix3.multiply(r,a,a),new Cesium.TileOrientedBoundingBox(n,a)):(i=new Cesium.Cartesian3(c.min.x,c.min.y,c.min.z),Cesium.Matrix4.multiplyByPoint(l,i,i),o=new Cesium.Cartesian3(c.max.x,c.max.y,c.max.z),Cesium.Matrix4.multiplyByPoint(l,o,o),r=(u=Cesium.BoundingSphere.fromCornerPoints(i,o,new Cesium.BoundingSphere)).center,n=u.radius,a=Cesium.Matrix4.getScale(l,s),n*=Cesium.Cartesian3.maximumComponent(a),new Cesium.TileBoundingSphere(r,n))):void 0;var i,o,r,n,a,s,l,c,u},Tt.prototype.canTraverse=function(){return 0!==this.children.length&&!this.isLeafTile&&(!Cesium.defined(this.lodRangeData)||this.pixel>this.lodRangeData)},Tt.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},Tt.prototype.getGeometryError=function(e){var t=e.camera,i=this.layer.context.drawingBufferHeight;return this.lodRangeData*i/(this.boundingVolume.distanceToCamera(e)*t.frustum.sseDenominator)},Tt.prototype.distanceToTile=function(e){let t=St(this);return t.distanceToCamera(e)},Tt.prototype.distanceToTileCenter=function(e){var t=new Cesium.Cartesian3,i=St(this).boundingVolume,i=Cesium.Cartesian3.subtract(i.center,e.camera.positionWC,t);return Cesium.Cartesian3.dot(e.camera.directionWC,i)},Tt.prototype.visibility=function(e,t){var i=St(this);return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},Tt.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(o<Cesium.Cartesian3.magnitude(r)?(r=Cesium.Cartesian3.normalize(r,e),r=Cesium.Cartesian3.multiplyByScalar(r,o,e),o=Cesium.Cartesian3.add(i.center,r,e),i=Cesium.Cartesian3.subtract(o,t.positionWC,e),r=Cesium.Cartesian3.normalize(i,e),n.foveatedFactor=1-Math.abs(Cesium.Cartesian3.dot(t.directionWC,r))):n.foveatedFactor=0))},Tt.prototype.requestContent=function(){let t=this,i=this.layer,e=this.contentResource.clone(),o=new Cesium.Request({throttle:!0,throttleByServer:!0,type:Cesium.RequestType.TILES3D,priorityFunction:function(){return r.priority},serverKey:(r=this).serverKey});var r,n;this.request=o,e.request=o;let a=e.fetchArrayBuffer();if(!Cesium.defined(a))return!1;this.contentState=Ce.LOADING,this.contentReadyPromise=Cesium.when.defer();n=this;let s=function(e){n.contentState=Ce.FAILED,n.contentReadyPromise&&n.contentReadyPromise.reject(e)};return a.then(function(e){t.isDestroyed()?s():Et(i,t,e)}).catch(function(e){o.state===Cesium.RequestState.CANCELLED?t.contentState=Ce.UNLOADED:s(e)}),!0},Tt.prototype.updatePriority=function(e,t){var i=e._minimumPriority,e=e._maximumPriority,o=xt(Pt(this.foveatedFactor,i.foveatedFactor,e.foveatedFactor),4,4),r=xt(1-Pt(this.pixel,i.pixel,e.pixel),4,8),i=Pt(this.distanceToCamera,i.distance,e.distance),e=xt(i,4,0);this.priority=o+r+e},Tt.prototype.update=function(i,o){for(let e=0,t=this.renderEntities.length;e<t;e++)this.renderEntities[e].update(i,o)},Tt.prototype.free=function(){this.contentState=Ce.UNLOADED,this.request=void 0,this.cacheNode=void 0,this.priorityHolder=void 0,this.contentReadyPromise=void 0,this.priorityHolder=void 0;for(let e=0,t=this.renderEntities.length;e<t;e++)this.renderEntities[e].destroy();this.renderEntities.length=0,this.children.length=0},Tt.prototype.isDestroyed=function(){return!1},Tt.prototype.destroy=function(){return this.free(),Cesium.destroyObject(this)},Dt.prototype.schedule=function(e,i){var t=this._stack,o=e,r=t,n=i;for(let e=r.length=0,t=o._rootTiles.length;e<t;e++){var a=o._rootTiles[e];Rt(n,o,a),a.visible&&r.push(a)}Ot(e,t,i);{var s=e,l=i;let t=s._requestTiles;var c=t.length;for(let e=0;e<c;++e)t[e].updatePriority(s,l)}},Bt.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},Bt.prototype.touch=function(e){e=e.cacheNode;Cesium.defined(e)&&this._list.splice(this._sentinel,e)},Bt.prototype.add=function(e){Cesium.defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},Bt.prototype.unloadTile=function(e,t,i){var o=t.cacheNode;Cesium.defined(o)&&(this._list.remove(o),t.cacheNode=void 0,i(e,t))},Bt.prototype.unloadTiles=function(e,t){var i=this._trimTiles,o=(this._trimTiles=!1,this._list),r=1024*e.maximumMemoryUsage*1024,n=this._sentinel;let a=o.head;for(;a&&a!==n&&(e.totalMemoryUsageInBytes>r||i);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}},Bt.prototype.trim=function(){this._trimTiles=!0};var Vt=Object.freeze({RESET:0,SetColor:1,SELECTED:2,HIDE:4,OFFSET:8,CLIP:16,BLOOM:32,ALL:255});function Ft(){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 Ht(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 Dt,this._selections=[],this._objsOperationList={},this._requestTiles=[],this._processTiles=[],this._selectedTiles=[],this._cache=new Bt,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._vertexCompressionType=void 0,this._style3D=new Ft,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 Gt(e,t){e.updateObjsOperation(t.ids,t)}function kt(e,t){return e.priority-t.priority}function Nt(e,t){t.free()}function jt(e){e._cache.unloadTiles(e,Nt)}Object.defineProperties(Ft.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(Ht.prototype,{ready:{get:function(){return 0<this._rootTiles.length}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(e){Cesium.Check.typeOf.number("max visible distance",e),this._visibleDistanceMax=e}},visibleDistanceMin:{get:function(){return this._visibleDistanceMin},set:function(e){Cesium.Check.typeOf.number("min visible distance",e),this._visibleDistanceMin=e}},lodRangeScale:{get:function(){return this._lodRangeScale},set:function(e){Cesium.Check.typeOf.number("set layer lod range scale",e),this._lodRangeScale=e}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(e){this._totalMemoryUsageInBytes=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},style3D:{get:function(){return this._style3D},set:function(e){this._style3D=e}}}),Ht.prototype.loadConfig=function(t,s){let l=this;Cesium.when(t).then(function(e){let t=Cesium.Resource.createIfNeeded(e);return e=t.getBaseUri(!0),l._url=t.url,l._basePath=e,l._baseResource=t,s?t.fetchXML():t.fetchJson()}).then(function(e){var t=(e=s?_e(e):e).extensions,t=(t?(l.fileType=t["s3m:FileType"],l._vertexCompressionType=t["s3m:VertexCompressionType"]):l.fileType=e.FileType,e.position||e.Position),i=t.x||t.X,o=t.y||t.Y,t=t.z||t.Z,r=(l._position=Cesium.Cartesian3.fromDegrees(i,o,t),l.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(l._position),l.invModelMatrix=Cesium.Matrix4.inverse(l.modelMatrix,l.invModelMatrix),e.heightRange?(l._minHeight=e.heightRange.min,l._maxHeight=e.heightRange.max):e.HeightRange&&(l._minHeight=e.HeightRange.MinHeight,l._maxHeight=e.HeightRange.MaxHeight),e.geoBounds?l._rectangle=Cesium.Rectangle.fromDegrees(e.geoBounds.left,e.geoBounds.bottom,e.geoBounds.right,e.geoBounds.top):l.viewPosition=Cesium.Cartesian3.fromDegrees(i,o,l._maxHeight),e.wDescript&&(t=e.wDescript.range,l._minWValue=t.min,l._maxWValue=t.max),e.tiles||e.rootTiles||e.OSGFiles&&e.OSGFiles.Files);for(let e=0,t=r.length;e<t;e++){var n=r[e];if(n){var a=n.url||n.FileName;let e={box:n.boundingbox},t=(n.BoundingSphere&&(e.sphere={radius:n.BoundingSphere.Radius,center:new Cesium.Cartesian3(n.BoundingSphere.CenterX,n.BoundingSphere.CenterY,n.BoundingSphere.CenterZ)}),new Tt(l,void 0,e,a));t.isRootTile=!0,l._cache.add(t),l._rootTiles.push(t)}}l._readyPromise.resolve(l)}).otherwise(function(e){s?l._readyPromise.reject(e):l.loadConfig(t,!0)})},Ht.prototype._tranverseRenderEntity=function(i,o){let r=[];for(let e=0,t=this._rootTiles.length;e<t;e++){var n=this._rootTiles[e];r.push(n)}for(;r.length;){var a=r.pop();for(let e=0,t=a.renderEntities.length;e<t;e++){var s=a.renderEntities[e];s.ready&&o(s,i)}for(let e=0,t=a.children.length;e<t;e++)r.push(a.children[e])}},Ht.prototype._updateObjsOperation=function(e){this._tranverseRenderEntity({ids:e},Gt)},Ht.prototype._setObjsOperationType=function(i,o){Cesium.Check.defined("set Objs Operation ids",i),Cesium.Check.defined("set Objs Operation operationType",o),Array.isArray(i)||(i=[i]);let r=new Cesium.AssociativeArray;for(let e=0,t=i.length;e<t;e++){var n,a=i[e];Cesium.defined(a)&&((n=Cesium.defaultValue(this._objsOperationList[a],0))!==o&&(n|=o,this._objsOperationList[a]=n,r.set(a,n)))}0<r.length&&this._updateObjsOperation(r._hash)},Ht.prototype._removeObjsOperationType=function(i,e){Cesium.Check.defined("set Objs Operation ids",i),Array.isArray(i)||(i=[i]);var o=Vt.ALL^e;let r=new Cesium.AssociativeArray;for(let e=0,t=i.length;e<t;e++){var n=i[e],a=this._objsOperationList[n];Cesium.defined(a)&&((a&=o)===Vt.RESET?delete this._objsOperationList[n]:this._objsOperationList[n]=a,r.set(n,a))}0<r.length&&this._updateObjsOperation(r._hash)},Ht.prototype.releaseSelection=function(){this._selections.length<1||(this._removeObjsOperationType(this._selections,Vt.SELECTED),this._selections.length=0)},Ht.prototype.setSelection=function(e){Cesium.Check.defined("setSelection ids",e),Array.isArray(e)||(e=[e]),this.releaseSelection(),this._selections=this._selections.concat(e),this._setObjsOperationType(e,Vt.SELECTED)},Ht.prototype.prePassesUpdate=function(e){this.ready&&e.newFrame&&(this._cache.reset(),this._requestTiles.length=0,this._processTiles.length=0,this._selectedTiles.length=0)},Ht.prototype.postPassesUpdate=function(e){this.ready&&jt(this)},Ht.prototype.update=function(e){if(this.ready&&this.show){this._schuduler.schedule(this,e);{let i=this._requestTiles;var o=i.length;i.sort(kt);for(let t=0;t<o;++t){let e=i[t];e.requestContent()}}var i=this,r=e,n=i._processTiles,a=n.length;for(let t=0;t<a;++t){let e=n[t];e.update(r,i)}{var s=this,l=e;let t=s._selectedTiles;var c=t.length;for(let e=0;e<c;e++)t[e].update(l,s)}}},Ht.prototype.isDestroyed=function(){return!1},Ht.prototype.deleteObject=function(){this.scene.primitives.remove(this)},Ht.prototype.destroy=function(){return this._cache.reset(),jt(this),this._rootTiles.length=0,this._requestTiles.length=0,this._processTiles.length=0,this._selectedTiles.length=0,Cesium.destroyObject(this)},Ht.prototype.setVisibility=function(e){this.show=e};var Ut="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nif(plus && st.s < time && time - st.s <= 0.1){\nmaterial.alpha = 1.0 - (time - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\nmaterial.alpha = ((1.0-time) - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}\nreturn material;\n}\n";let zt=new Map;function f(e){this._viewer=e}f.prototype.defaultValue=X,f.prototype.createRandomId=function(){return(1e7*Math.random()).toString(16).substr(0,4)+"-"+(new Date).getTime()+"-"+Math.random().toString().substr(2,5)},f.prototype.mouse=function(e,t,i){e.style.cursor=1==t?"url("+i+"),auto":"default"},f.prototype.CreateTooltip=function(e={},t,i){(o="object"==typeof e?e:o)&&o.origin&&("center"===o.origin&&(r=15,n=-12),"top"===o.origin&&(r=15,n=-44),"bottom"!==o.origin)||(r=15,n=20),o&&o.color?("white"===o.color&&(a="background: rgba(255, 255, 255, 0.8);color: black;"),"black"===o.color&&(a="background: rgba(0, 0, 0, 0.5);color: white;"),"yellow"===o.color&&(a="color: black;background-color: #ffcc33;border: 1px solid white;")):a="background: rgba(0, 0, 0, 0.5);color: white;",s=o&&o.id?"toolTip"+o.id:"toolTip";var o,r,n,a,s,l,c=(this._viewer?this._viewer.container:document).querySelector("#"+s);return c||(l=document.createElement("div"),$(".cesium-viewer").append(l),l='<div id="'+s+'" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+a+'"></div>',$(".cesium-viewer").append(l),c=document.getElementById(s)),i?(c.innerHTML=e,c.style.left=t.x+r+"px",c.style.top=t.y+n+"px",c.style.display="block"):c.style.display="none",{tooltip:c,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"}}},f.prototype.getWMTSData=function(c,t){ge(c.url+"?service=WMTS&request=GetCapabilities").then(o=>{let r=o.xmlObj,e,n,a,s={};if(c.gisserverTMS)e=_e(r),n=e.Contents&&e.Contents.Layer;else{let i=r.getElementsByTagName("Layer");for(let e=0,t;e<i.length;e++)if((t=i[e].getElementsByTagName("ows:Identifier"))&&t[0]&&t[0].innerHTML===c.layer){r=i[e];break}n=_e(r)}if(n){let e=n.TileMatrixSetLink,t=n.WGS84BoundingBox;var l;t&&(o=t.LowerCorner.split(" "),l=t.UpperCorner.split(" "),a=Cesium.BoundingSphere.fromPoints([Cesium.Cartesian3.fromDegrees(o[0],o[1]),Cesium.Cartesian3.fromDegrees(l[0],l[1])]));let i;if(c.gisserverTMS)i=e;else{let t=c.srs||"EPSG:4326";i=e.filter(e=>e.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})})},f.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)},f.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]},f.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}},f.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;"),s||(e='<div id="'+a+'" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;'+e+'"></div>',$(i.container).append(e),s=document.getElementById(a)),t.addX||0),c=t.addY||0,u=this;function h(){if(n){if(void 0!==t.far||void 0!==t.near){var e=u.getPointToCameraDistance(i,n);if(e>t.far)return void(s.style.display="none");if(e<t.near)return void(s.style.display="none");s.style.display="block"}e=i.scene.cartesianToCanvasCoordinates(n);e&&(o=-s.offsetWidth/2+l,r=-s.offsetHeight+c,s.style.left=e.x+o+"px",s.style.top=e.y+r+"px")}}return t.closeBtn&&(s.className="resultToolTip resultToolTipClose",s.onclick=()=>{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+c,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()}}},f.prototype.CombineEcharts=function(e,t,i){return this._CombineEcharts||(this._CombineEcharts=new re(e)),this._CombineEcharts.setOption(t,i)},f.prototype.getHeatmapData=function(t,i,o=600){let r=[];for(let e=0;e<o;e++){var n=Math.random()*(t.east-t.west)+t.west,a=Math.random()*(t.north-t.south)+t.south,s=i.value||Math.random()*(i.max-i.min)+i.min;r.push({x:n,y:a,value:s})}return r},f.prototype.pickFromRay=function(e,t,i,o=[]){if(!t.equals(i))return i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),new Cesium.Cartesian3),t=new Cesium.Ray(t,i),e.scene.pickFromRay(t,o)},f.prototype.openLocalFile=function(e={}){let o=document.createElement("input");o.accept=e.accept,o.type="file",e.multiple&&(o.multiple="multiple"),o.onchange=function(){if("function"==typeof e.callback&&o.files.length)if(e.multiple){let t=[],i=[];for(let e=0;e<o.files.length;e++)t.push(URL.createObjectURL(o.files[e])),i.push(o.files[e]);e.callback(t,i)}else e.callback(URL.createObjectURL(o.files[0]),o.files[0])},o.click()},f.prototype.openShapeFile=function(i,o){this.openLocalFile({multiple:!0,accept:".shp,.dbf",callback:(r,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文件")})}})},f.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))},f.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<t*(r.length-1)?n++:n=0,r[Math.floor(n/t)===r.length-1?0:Math.floor(n/t)]):e},!1)},f.prototype.isDOM=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},f.prototype.getJSON=function(e,t){const i=new XMLHttpRequest;i.responseType="json",i.open("get",e,!0),i.onload=function(){if(!(200<=i.status&&i.status<300))throw new Error(i.statusText);t(i.response)},i.send()},f.prototype.getPositionFromWKT=function(e){let t=e+"!",n,a=[];return-1<t.indexOf("MULTIPOLYGON")?(n=(n=(n=t.replace("MULTIPOLYGON(","")).replace(")!","")).split(")),((")).forEach((e,t)=>{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<t.indexOf("POLYGON")&&(n=(n=(n=t.replace("POLYGON(","")).replace(")!","")).split("),(")).forEach((e,t)=>{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},f.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)}},f.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},f.prototype.isClockwise=function(e){e=Cesium_turf.lineString(e);return Cesium_turf.booleanClockwise(e)},f.prototype.saveAs=function(e,t){if(!window.saveAs){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/FileSaver.js")}saveAs(e,t)},f.prototype.getEntityProp=function(e){var t=e.properties&&e.properties.getValue();return{id:e.id,properties:t}},f.prototype.getEntityPropValue=function(e,t){e=e.properties&&e.properties.getValue();return-1<t.indexOf("[")&&-1<t.indexOf("]")&&(t=t.replace("[","").replace("]","")),e&&e[t]},f.prototype.setheight=function(e,t){e=Cesium.Cartographic.fromCartesian(e);return Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,t)},f.prototype.setpolylineheight=function(e,t){let i=[];return e.forEach(function(e){e=Cesium.Cartographic.fromCartesian(e);i.push(Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,t))}),i},f.prototype.StyleContrastGeoJson=function(e,t){var i={color:t.Color.WHITE,pixelSize:1,outlineColor:t.Color.BLACK,outlineWidth:0,show:!0,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},o={id:"my label",text:"",font:"30px sans-serif",fillColor:t.Color.WHITE,outlineColor:t.Color.WHITE,outlineWidth:"10",scale:1,distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},r={show:!0,scale:1,width:void 0,height:void 0,pixelOffset:void 0,color:t.Color.WHITE,image:"",distanceDisplayCondition:new t.DistanceDisplayCondition(0,999999999)},n={positions:[],arcType:t.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:t.Color.RED,height:30},a={height:0,heightReference:t.HeightReference.NONE,show:!0,fill:!0,material:t.Color.WHITE,outline:!1,outlineColor:t.Color.BLACK,outlineWidth:1,stRotation:0,granularity:t.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:t.ShadowMode.ENABLED,clampToGround:!0},s=(this.isnull(e.near)&&(e.near=0),this.isnull(e.far)&&(e.far=999999999),parseFloat(e.near)),l=parseFloat(e.far);return delete e.near,delete e.far,null!=e.point&&(e.point=this.extend(i,e.point,!0),e.point.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.label&&(e.label=this.extend(o,e.label,!0),e.label.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.billboard&&(e.billboard=this.extend(r,e.billboard,!0),e.billboard.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polyline&&(e.polyline=this.extend(n,e.polyline,!0),e.polyline.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),null!=e.polygon&&(e.polygon=this.extend(a,e.polygon,!0),e.polygon.distanceDisplayCondition=new t.DistanceDisplayCondition(s,l)),e},f.prototype.getCatesian3FromPX=function(e,t,i,o){var r,n=t.scene.pick(e),a=t.scene.drillPick(e),s=null;if(o){for(var l=0;l<a.length;l++)if(a[l].id._id!=(o&&o[0]&&o[0].id)&&a[l].id._id!=(o&&o[1]&&o[1].id)){s=a[l].id;break}}else s=n;if(t.scene.pickPositionSupported&&i.defined(s))r=t.scene.pickPosition(e);else{n=t.camera.getPickRay(e);if(!n)return;r=t.scene.globe.pick(n,t.scene)}return r},f.prototype.StyleContrast=function(e,t,i){var o={text:"",font:" 30px sans-serif",style:i.LabelStyle.FILL_AND_OUTLINE,fillColor:i.Color.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new i.Color(.165,.165,.165,.8),backgroundPadding:new i.Cartesian2(7,5),scale:1,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,eyeOffset:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,heightReference:i.HeightReference.NONE,scaleByDistance:void 0,distanceDisplayCondition:void 0},r={show:!0,position:i.Cartesian3.ZERO,pixelOffset:i.Cartesian2.ZERO,eyeOffset:i.Cartesian3.ZERO,heightReference:i.HeightReference.NONE,horizontalOrigin:i.HorizontalOrigin.CENTER,verticalOrigin:i.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:i.Color.WHITE,rotation:0,alignedAxis:i.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},n={show:!0,pixelSize:1,heightReference:i.HeightReference.NONE,color:i.WHITE,outlineColor:i.Color.BLACK,outlineWidth:1,scaleByDistance:void 0,translucencyByDistance:void 0,distanceDisplayCondition:void 0},a={positions:[],width:5,material:i.Color.ALICEBLUE,arcType:i.ArcType.GEODESIC},s={polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray([-72,40,-70,35,-75,30,-70,30,-68,40])),height:0,extrudedHeight:0,material:"rgba(245, 20, 20, 0.91)"},l=(this.isnull(t.near)&&(t.near=0),this.isnull(t.far)&&(t.far=999999999),parseFloat(t.near)),c=parseFloat(t.far);return delete t.near,delete t.far,t.distanceDisplayCondition=new i.DistanceDisplayCondition(l,c),"lable"==e?t=this.extend(o,t,!0):"billboard"==e?t=this.extend(r,t,!0):"point"==e?t=this.extend(n,t,!0):"polyline"==e?t=this.extend(a,t,!0):"polygon"==e&&(t=this.extend(s,t,!0)),t},f.prototype.createPolyline=function(e,t,i,o){var r;return-1==t?(r=new o.PolylineGeometry(e),new o.GeometryInstance({id:i,geometry:r})):(r=new o.GroundPolylineGeometry(e),new o.GeometryInstance({geometry:r,id:i}))},f.prototype.createPolygon=function(e,t,i,o){var r=e.material,n=new o.PolygonGeometry(e);return delete e.material,new o.GeometryInstance({id:i,geometry:n,attributes:{color:new o.ColorGeometryInstanceAttribute.fromColor(r)}})},f.prototype.coordinate=function(e,t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?this.coordinate(e,t[i]):e.push(t[i]);return e},f.prototype.Analysis=function(e,t){var i;return/^\[/.test(e)&&/\]$/.test(e)&&(i=e.replace(/\[/,"").replace(/\]/,""),null!=t.properties[i]&&(e=t.properties[i])),e},f.prototype.unique=function(e){for(var t=[],i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t},f.prototype.extend=function(e,t,i=!1,o=!1){for(var r in t)o?e.hasOwnProperty(r)&&(e[r]=t[r]):e.hasOwnProperty(r)&&!i||(e[r]=t[r]);return e},f.prototype.setPositionOffset=(e,t,i)=>{e=Cesium.Transforms.headingPitchRollToFixedFrame(e,i||new Cesium.HeadingPitchRoll),i=new Cesium.Cartesian3(0,0,0);return Cesium.Matrix4.multiplyByPoint(e,t,i),i},f.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},f.prototype.trackedEntity=function(n,a,e={}){let u={type:"tracked",heading:0,pitch:-45,distance:1e3,minDistance:0};Object.assign(u,e);let h,m,d;if(u.tooltip){u.tooltip=Object.assign({innerHTML:"",drag:!1,near:0,far:1e3,addX:0,addY:0},u.tooltip);e=`<div id="trackedTooltip${a.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;"><div class="trackedTooltipContainer"></div></div>`;if($(n.container).append(e),h=document.getElementById("trackedTooltip"+a.id),(m=h.firstElementChild).innerHTML=u.tooltip.innerHTML,m.style.left=u.tooltip.addX+"px",m.style.top=u.tooltip.addY+"px",m.style.position="relative",u.tooltip.drag){(d=document.createElement("div")).className="trackedTooltip-arrow",h.appendChild(d);let n,a,s,l,c=(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<t?90:-90,l=`rotate(${i}deg)`};c(u.tooltip.addX,u.tooltip.addY),d.style.cssText=`
!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.s<time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb) / 2.0;\n}\nreturn material;\n}\n", ee = "uniform vec4 color;\nuniform vec4 color1;\nuniform vec4 color2;\nuniform vec4 lightSpotColor;\nuniform sampler2D image;\nuniform bool twoColor;\nuniform bool lightSpot;\nuniform float alpha;\nuniform float intervalTime;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat time = fract(czm_frameNumber / (60.0 * intervalTime));\nif(twoColor){\nif(st.s < time){\nmaterial.alpha = color1.a;\nmaterial.diffuse = color1.rgb;\n}else{\nmaterial.alpha = color2.a;\nmaterial.diffuse = color2.rgb;\n}\n}else if(lightSpot){\nif(st.s<time){\nmaterial.alpha = pow(st.s / time, 20.0);\nif(material.alpha<alpha){\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = alpha;\nmaterial.diffuse = color.rgb;\n}\n}else{\nvec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\nmaterial.alpha = colorImage.a * color.a;\nmaterial.diffuse = (colorImage.rgb + color.rgb)/2.0;\n}\nreturn material;\n}\n"; function te(e, t, i) { Cesium.PolylineTrailLinkMaterialProperty || (Cesium.PolylineTrailLinkMaterialProperty = te, Cesium.Material.PolylineTrailLinkType = "PolylineTrailLink", Cesium.Material.PolylineTrailLinkImage = window.SmartEarthRootUrl + I.TrailLine, Cesium.Material.PolylineTrailLinkSource = Z, Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType, { fabric: { type: Cesium.Material.PolylineTrailLinkType, uniforms: { color: new Cesium.Color(1, 0, 0, .5), color1: new Cesium.Color(0, 1, 0, .5), color2: new Cesium.Color(1, 0, 0, .5), image: Cesium.Material.PolylineTrailLinkImage, twoColor: !1, lightSpot: !1, lightSpotColor: new Cesium.Color(1, 1, 1, .5), alpha: .3, time: 0 }, source: Cesium.Material.PolylineTrailLinkSource }, translucent: function (e) { return !0 } })), Cesium.Material, this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = Cesium.Color.fromCssColorString(e || "#ffffff"), this._Line = t || Cesium.Material.PolylineTrailLinkImage, this.duration = i || 3e3, this.alpha = .3, this._time = (new Date).getTime(), "object" == typeof this._Line && (this._Line.LightSpot ? this._Line.color = Cesium.Color.fromCssColorString(this._Line.color) : (this._Line.color1 = Cesium.Color.fromCssColorString(this._Line.color1), this._Line.color2 = Cesium.Color.fromCssColorString(this._Line.color2))), this.isConstant = !1, this.definitionChanged = this._definitionChanged, this.color = Cesium.createPropertyDescriptor("color") } function ie(e) { return new Cesium.Material({ fabric: { uniforms: { color: X(e.color, new Cesium.Color(1, 0, 0, .5)), color1: X(e.color1, new Cesium.Color(0, 1, 0, .5)), color2: X(e.color2, new Cesium.Color(1, 0, 0, .5)), image: X(e.image, window.SmartEarthRootUrl + I.TrailLine), twoColor: X(e.twoColor, !1), lightSpot: X(e.lightSpot, !1), lightSpotColor: X(e.lightSpotColor, new Cesium.Color(1, 1, 1, .5)), alpha: X(e.alpha, .3), intervalTime: X(e.time, 3e3) / 1e3 }, source: ee } }) } function oe(e = !0) { this.async = e } function re(e) { if (this._mapContainer = e, !window.echarts) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/echarts.min.js") } this.Init(e) } function ne(e) { this.serverUrl = e } function ae(e, t) { this.mediaOutputPath = e || "test.mp4", this.videoBPS = t || 512e4 } te.prototype.getType = function (e) { return "PolylineTrailLink" }, te.prototype.setScale = function (e) { this.scale = e }, te.prototype.getValue = function (e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this._color, e, Cesium.Color.WHITE, t.color), "object" == typeof this._Line ? this._Line.LightSpot ? (t.lightSpot = !0, t.lightSpotColor = this._Line.color) : (t.color1 = this._Line.color1, t.color2 = this._Line.color2, t.twoColor = !0) : t.image = this._Line, void 0 !== this.scale ? t.time = this.scale : t.time = ((new Date).getTime() - this._time) % this.duration / this.duration, t.alpha = this.alpha, t }, te.prototype.equals = function (e) { return this === e || e instanceof te && Cesium.Property.equals(this._color, e._color) }, oe.prototype.getXmlHttpRequest = function () { return window.XMLHttpRequest ? new XMLHttpRequest : window.ActiveXObject ? new ActiveXObject("MsXml2.XmlHttp") : void 0 }, oe.prototype.includeJsText = function (e, t) { var i; null != e && ((i = document.createElement("script")).type = "text/javascript", i.text = t, e.appendChild(i)) }, oe.prototype.includeJsSrc = function (e, t) { var i; null != e && ((i = document.createElement("script")).type = "text/javascript", i.src = t, e.appendChild(i)) }, oe.prototype.addJs = function (e) { var t = this.getXmlHttpRequest(), i = this; t.onreadystatechange = function () { 4 === t.readyState && (200 === t.status || 304 === t.status ? i.includeJsSrc(document.body || document.head, e) : console.log("XML request error: " + t.statusText + " (" + t.status + ")")) }, t.open("GET", e, i.async), t.send(null), 404 === t.status ? console.log(e + " is not found") : i.includeJsText(document.body || document.head, t.responseText) }, re.prototype.setOption = function (e, t) { return this._echartsContainer && t && this.clear(), this._overlay || (this._overlay = this._createChartOverlay()), this._overlay.setOption(e), this }, re.prototype._createChartOverlay = function () { var e = this._mapContainer.scene, t = (e.canvas.setAttribute("tabIndex", 0), document.createElement("div")); return t.style.position = "absolute", t.style.top = "0px", t.style.left = "0px", t.style.width = e.canvas.width + "px", t.style.height = e.canvas.height + "px", t.style.pointerEvents = "none", t.setAttribute("id", "smartearth-cesium-echarts"), t.setAttribute("class", "echartMap"), this._mapContainer.container.appendChild(t), this._echartsContainer = t, echarts.init(t) }, re.prototype.deleteObject = re.prototype.clear = function () { this._echartsContainer && (this._mapContainer.container.removeChild(this._echartsContainer), this._echartsContainer = null), this._overlay && (this._overlay.dispose(), this._overlay = null) }, re.prototype.updateOverlay = function (e) { this._overlay && this._overlay.setOption(e) }, re.prototype.getMap = function () { return this._mapContainer }, re.prototype.getOverlay = function () { return this._overlay }, re.prototype.show = function () { document.getElementById(this._id).style.visibility = "visible" }, re.prototype.hide = function () { document.getElementById(this._id).style.visibility = "hidden" }, re.prototype.Init = function (c) { function r(e) { var t; return (o[e] || (t = o[e] = { i: e, l: !1, exports: {} }, i[e].call(t.exports, t, t.exports, r), t.l = !0, t)).exports } var i, o; i = [function (e, t, i) { e.exports = i(1) }, function (e, t, i) { echarts ? i(2).load() : console.error("missing echarts lib") }, function (e, t, i) { function o(e, t) { for (var i = 0; i < t.length; i++) { var o = t[i]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o) } } i.r(t); n = [{ key: "create", value: function (e, t) { var i; e.eachComponent("GLMap", function (e) { (i = new s(c, t)).setMapOffset(e.__mapOffset || [0, 0]), e.coordinateSystem = i }), e.eachSeries(function (e) { "GLMap" === e.get("coordinateSystem") && (e.coordinateSystem = i) }) } }, { key: "dimensions", get: function () { return ["lng", "lat"] } }], o((r = s).prototype, [{ key: "setMapOffset", value: function (e) { return this._mapOffset = e, this } }, { key: "getViewer", value: function () { return this._viewer } }, { key: "dataToPoint", value: function (e) { var t; return this._viewer && this._viewer.scene ? (t = this._viewer.scene, (e = Cesium.Cartesian3.fromDegrees(e[0], e[1])) ? !(t.mode === Cesium.SceneMode.SCENE3D && Cesium.Cartesian3.angleBetween(t.camera.position, e) > Cesium.Math.toRadians(80)) && ((t = t.cartesianToCanvasCoordinates(e)) ? [t.x - this._mapOffset[0], t.y - this._mapOffset[1]] : []) : [0, 0]) : [] } }, { key: "pointToData", value: function (e) { var t = this._mapOffset, i = c.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 c }, defaultOption: { roam: !1 } }), echarts.extendComponentView({ type: "GLMap", init: function (e, t) { this.api = t, this.dispose(), c.scene.postRender.addEventListener(this.moveHandler, this) }, moveHandler: function (e, t) { this.api.dispatchAction({ type: "GLMapRoam" }) }, render: function (e, t, i) { }, dispose: function (e) { c.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, ce = 6378245, ue = .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 - ue * o * o, r = Math.sqrt(o); return [180 * i / (ce / r * Math.cos(t) * le), 180 * e / (ce * (1 - ue) / (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.86 < t && t < 53.55) } }; function me(e, t, i) { if (e && t) { "#" !== e[0] && (e = this.colorHex(e)), "#" !== t[0] && (t = this.colorHex(t)); for (var e = this.colorRgb(e), o = e[0], r = e[1], n = e[2], e = this.colorRgb(t), a = (e[0] - o) / i, s = (e[1] - r) / i, l = (e[2] - n) / i, c = [], u = 0; u < i; u++) { var h = this.colorHex("rgb(" + parseInt(a * u + o) + "," + parseInt(s * u + r) + "," + parseInt(l * u + n) + ")"); c.push(h) } return c } return this } function de(e) { if (e = e || [], !Cesium.defined(e.workerPath)) throw new Cesium.DeveloperError("workerPath is required."); this._workerPath = e.workerPath, this._poolSize = Cesium.defaultValue(e.poolSize, 16), this._workers = [], this._defered = [] } me.prototype.colorRgb = function (e) { if ((e = e.toLowerCase()) && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) { if (4 === e.length) { for (var t = "#", i = 1; i < 4; i += 1)t += e.slice(i, i + 1).concat(e.slice(i, i + 1)); e = t } for (var o = [], i = 1; i < 7; i += 2)o.push(parseInt("0x" + e.slice(i, i + 2))); return o } return e }, me.prototype.colorHex = function (e) { if (/^(rgb|RGB)/.test(e)) { for (var t = e.replace(/(rgb|RGB)*/g, "").replace("(", "").replace(")", "").split(","), i = "#", o = 0; o < t.length; o++) { var r = Number(t[o]).toString(16); "0" === (r = 1 === r.length ? "0" + r : r) && (r += r), i += r } return i = 7 !== i.length ? e : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) return e; var n = e.replace(/#/, "").split(""); if (6 === n.length) return e; if (3 === n.length) { for (var a = "#", o = 0; o < n.length; o += 1)a += n[o] + n[o]; return a } }, Object.defineProperties(de.prototype, { errorEvent: { get: function () { return this.errorEvent } }, poolSize: { get: function () { return this._poolSize } } }), de.prototype.queueWorkItem = function (e, t) { for (var i, o = Cesium.when.defer(), r = null, n = 999999, a = 0; a < this._workers.length; a++) { r = this._workers[a]; this._workers[a].jobQueueSize < n && (r = this._workers[a], n = this._workers[a].jobQueueSize) } 0 < n && this._workers.length < this.poolSize && (r = new Worker(this._workerPath), i = this, r.addEventListener("message", function (e) { i.onWorkerMessage(e) }, !1), r.addEventListener("error", function (e) { i.onWorkerError(e) }, !1), r.jobQueueSize = 0, this._workers.push(r), r.id = Cesium.createGuid()), e.workerId = r.id; var s = Cesium.createGuid(); return e.deferedId = s, this._defered[s] = o, r.jobQueueSize++, r.postMessage(e, t), o }, de.prototype.trimPool = function (e) { var t = this; if (null == e) null != this.timerId && clearTimeout(this.timerId), this.timerId = setTimeout(function () { t.trimPool(!0) }, 5e3); else { for (var i = 0; i < this._workers.length; i++)0 == this._workers[i].jobQueueSize && (this._workers[i].terminate(), this._workers.splice(i, 1), i--); this._workers.length ? this.timerId = setTimeout(function () { t.trimPool(!0) }, 5e3) : this.timerId = null } }, de.prototype.onWorkerMessage = function (e) { var t = e.data, e = function (e, t) { for (var i = 0; i < e.length; i++)if (t(e[i])) return i }(this._workers, function (e) { return e.id === t.workerId }), e = (null != e && (this._workers[e].jobQueueSize--, this.trimPool()), this._defered[t.deferedId]); delete this._defered[t.deferedId], e.resolve(t) }, de.prototype.onWorkerError = function (e) { console.log(e) }; let pe = new Map; function ge(i) { if (i = (i = (i = i.replaceAll("//", "/")).replace("http:/", "http://")).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 < n.children.length) for (let i = 0; i < n.children.length; i++) { let e = n.children.item(i), t = e.nodeName; if (t = (t = t.split(":"))[1] || t[0], void 0 === o[t]) o[t] = r(e); else { if (void 0 === o[t].push) { let e = o[t]; o[t] = [], o[t].push(e) } o[t].push(r(e)) } } else { if (n.attributes && n.attributes.length && !n.textContent) { let i = {}; for (let e = 0, t; e < n.attributes.length; e++)(t = n.attributes[e]).split ? (t = t.split("="), i[t[0]] = t[1]) : i[t.name] = t.textContent; return i } o = n.textContent } return o } catch (e) { console.log(e.message) } }(9 == e.nodeType ? e.documentElement : e) : {} } var Ce = Object.freeze({ UNLOADED: 0, LOADING: 1, PARSING: 2, READY: 3, FAILED: 4 }), ye = function o(r, n, a) { function s(i, e) { if (!n[i]) { if (!r[i]) { var t = "function" == typeof require && require; if (!e && t) return t(i, !0); if (l) return l(i, !0); e = new Error("Cannot find module '" + i + "'"); throw e.code = "MODULE_NOT_FOUND", e } t = n[i] = { exports: {} }; r[i][0].call(t.exports, function (e) { var t = r[i][1][e]; return s(t || e) }, t, t.exports, o, r, n, a) } return n[i].exports } for (var l = "function" == typeof require && require, e = 0; e < a.length; e++)s(a[e]); return s }({ 1: [function (e, t, i) { var o = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array, r = (i.assign = function (e) { for (var t = Array.prototype.slice.call(arguments, 1); t.length;) { var i = t.shift(); if (i) { if ("object" != typeof i) throw new TypeError(i + "must be non-object"); for (var o in i) i.hasOwnProperty(o) && (e[o] = i[o]) } } return e }, i.shrinkBuf = function (e, t) { if (e.length !== t) { if (e.subarray) return e.subarray(0, t); e.length = t } return e }, { arraySet: function (e, t, i, o, r) { if (t.subarray && e.subarray) e.set(t.subarray(i, i + o), r); else for (var n = 0; n < o; n++)e[r + n] = t[i + n] }, flattenChunks: function (e) { for (var t, i, o, r = 0, n = 0, a = e.length; n < a; n++)r += e[n].length; for (o = new Uint8Array(r), n = t = 0, a = e.length; n < a; n++)i = e[n], o.set(i, t), t += i.length; return o } }), n = { arraySet: function (e, t, i, o, r) { for (var n = 0; n < o; n++)e[r + n] = t[i + n] }, flattenChunks: function (e) { return [].concat.apply([], e) } }; i.setTyped = function (e) { e ? (i.Buf8 = Uint8Array, i.Buf16 = Uint16Array, i.Buf32 = Int32Array, i.assign(i, r)) : (i.Buf8 = Array, i.Buf16 = Array, i.Buf32 = Array, i.assign(i, n)) }, i.setTyped(o) }, {}], 2: [function (e, t, i) { var l = e("./common"), r = !0, n = !0; try { String.fromCharCode.apply(null, [0]) } catch (e) { r = !1 } try { String.fromCharCode.apply(null, new Uint8Array(1)) } catch (e) { n = !1 } for (var c = new l.Buf8(256), o = 0; o < 256; o++)c[o] = 252 <= o ? 6 : 248 <= o ? 5 : 240 <= o ? 4 : 224 <= o ? 3 : 192 <= o ? 2 : 1; function u(e, t) { if (t < 65537 && (e.subarray && n || !e.subarray && r)) return String.fromCharCode.apply(null, l.shrinkBuf(e, t)); for (var i = "", o = 0; o < t; o++)i += String.fromCharCode(e[o]); return i } c[254] = c[254] = 1, i.string2buf = function (e) { for (var t, i, o, r, n = e.length, a = 0, s = 0; s < n; s++)55296 == (64512 & (i = e.charCodeAt(s))) && s + 1 < n && 56320 == (64512 & (o = e.charCodeAt(s + 1))) && (i = 65536 + (i - 55296 << 10) + (o - 56320), s++), a += i < 128 ? 1 : i < 2048 ? 2 : i < 65536 ? 3 : 4; for (t = new l.Buf8(a), s = r = 0; r < a; s++)55296 == (64512 & (i = e.charCodeAt(s))) && s + 1 < n && 56320 == (64512 & (o = e.charCodeAt(s + 1))) && (i = 65536 + (i - 55296 << 10) + (o - 56320), s++), i < 128 ? t[r++] = i : (i < 2048 ? t[r++] = 192 | i >>> 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 u(e, e.length) }, i.binstring2buf = function (e) { for (var t = new l.Buf8(e.length), i = 0, o = t.length; i < o; i++)t[i] = e.charCodeAt(i); return t }, i.buf2string = function (e, t) { for (var i, o, r = t || e.length, n = new Array(2 * r), a = 0, s = 0; s < r;)if ((i = e[s++]) < 128) n[a++] = i; else if (4 < (o = c[i])) n[a++] = 65533, s += o - 1; else { for (i &= 2 === o ? 31 : 3 === o ? 15 : 7; 1 < o && s < r;)i = i << 6 | 63 & e[s++], o--; 1 < o ? n[a++] = 65533 : i < 65536 ? n[a++] = i : (i -= 65536, n[a++] = 55296 | i >> 10 & 1023, n[a++] = 56320 | 1023 & i) } return u(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 + c[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 < i ? 2e3 : i; n = n + (r = r + t[o++] | 0) | 0, --a;); r %= 65521, n %= 65521 } return r | n << 16 | 0 } }, {}], 4: [function (e, t, i) { t.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 } }, {}], 5: [function (e, t, i) { var s = function () { for (var e = [], t = 0; t < 256; t++) { for (var i = t, o = 0; o < 8; o++)i = 1 & i ? 3988292384 ^ i >>> 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 < n; a++)e = e >>> 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, c = e.next_in, u = e.input, h = c + (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, S = l.distcode, E = (1 << l.lenbits) - 1, P = (1 << l.distbits) - 1; e: do { for (b < 15 && (w += u[c++] << b, b += 8, w += u[c++] << b, b += 8), i = T[w & E]; ;) { if (w >>>= 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) - 1)]; continue } if (32 & o) { l.mode = 12; break e } e.msg = "invalid literal/length code", l.mode = 30; break e } for (r = 65535 & i, (o &= 15) && (b < o && (w += u[c++] << b, b += 8), r += w & (1 << o) - 1, w >>>= o, b -= o), b < 15 && (w += u[c++] << b, b += 8, w += u[c++] << b, b += 8), i = S[w & P]; ;) { if (w >>>= o = i >>> 24, b -= o, !(16 & (o = i >>> 16 & 255))) { if (0 == (64 & o)) { i = S[(65535 & i) + (w & (1 << o) - 1)]; continue } e.msg = "invalid distance code", l.mode = 30; break e } if (n = 65535 & i, b < (o &= 15) && (w += u[c++] << b, (b += 8) < o && (w += u[c++] << b, b += 8)), f < (n += w & (1 << o) - 1)) { e.msg = "invalid distance too far back", l.mode = 30; break e } if (w >>>= o, b -= o, (o = m - p) < n) { if (C < (o = n - o) && l.sane) { e.msg = "invalid distance too far back", l.mode = 30; break e } if (s = v, (a = 0) === y) { if (a += _ - o, o < r) { for (r -= o; d[m++] = v[a++], --o;); a = m - n, s = d } } else if (y < o) { if (a += _ + y - o, (o -= y) < r) { for (r -= o; d[m++] = v[a++], --o;); if (a = 0, y < r) { for (r -= o = y; d[m++] = v[a++], --o;); a = m - n, s = d } } } else if (a += y - o, o < r) { for (r -= o; d[m++] = v[a++], --o;); a = m - n, s = d } for (; 2 < r;)d[m++] = s[a++], d[m++] = s[a++], d[m++] = s[a++], r -= 3; r && (d[m++] = s[a++], 1 < r && (d[m++] = s[a++])) } else { for (a = m - n; d[m++] = d[a++], d[m++] = d[a++], d[m++] = d[a++], 2 < (r -= 3);); r && (d[m++] = d[a++], 1 < r && (d[m++] = d[a++])) } break } } break } } while (c < h && m < g); w &= (1 << (b -= (r = b >> 3) << 3)) - 1, e.next_in = c -= r, e.next_out = m, e.avail_in = c < h ? h - c + 5 : 5 - (c - h), e.avail_out = m < g ? g - m + 257 : 257 - (m - g), l.hold = w, l.bits = b } }, {}], 8: [function (e, t, i) { var L = e("../utils/common"), M = e("./adler32"), R = e("./crc32"), O = e("./inffast"), B = e("./inftrees"), V = 1, F = 2, H = 0, G = -2, k = 1, o = 852, r = 592; function N(e) { return (e >>> 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, H) : 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 < t)) ? G : (null !== o.window && o.wbits !== t && (o.window = null), o.wrap = i, o.wbits = t, s(e)) } function c(e, t) { var i; return e ? (i = new n, (e.state = i).window = null, (i = l(e, t)) !== H && (e.state = null), i) : G } var j, U, z = !0; function W(e, t, i, o) { var r, e = e.state; return null === e.window && (e.wsize = 1 << e.wbits, e.wnext = 0, e.whave = 0, e.window = new L.Buf8(e.wsize)), o >= 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 < e.wsize && (e.whave += r))), 0 } i.inflateReset = s, i.inflateReset2 = l, i.inflateResetKeep = a, i.inflateInit = function (e) { return c(e, 15) }, i.inflateInit2 = c, i.inflate = function (e, t) { var i, o, r, n, a, s, l, c, u, h, m, d, p, g, f, _, C, y, v, w, b, T, S, E, P = 0, x = new L.Buf8(4), D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e || !e.state || !e.output || !e.input && 0 !== e.avail_in) return G; 12 === (i = e.state).mode && (i.mode = 13), a = e.next_out, r = e.output, l = e.avail_out, n = e.next_in, o = e.input, s = e.avail_in, c = i.hold, u = i.bits, h = s, m = l, T = H; e: for (; ;)switch (i.mode) { case k: if (0 === i.wrap) i.mode = 13; else { for (; u < 16;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (2 & i.wrap && 35615 === c) x[i.check = 0] = 255 & c, x[1] = c >>> 8 & 255, i.check = R(i.check, x, 2, 0), u = c = 0, i.mode = 2; else if (i.flags = 0, i.head && (i.head.done = !1), !(1 & i.wrap) || (((255 & c) << 8) + (c >> 8)) % 31) e.msg = "incorrect header check", i.mode = 30; else if (8 != (15 & c)) e.msg = "unknown compression method", i.mode = 30; else { if (u -= 4, b = 8 + (15 & (c >>>= 4)), 0 === i.wbits) i.wbits = b; else if (b > i.wbits) { e.msg = "invalid window size", i.mode = 30; break } i.dmax = 1 << b, e.adler = i.check = 1, i.mode = 512 & c ? 10 : 12, u = c = 0 } } break; case 2: for (; u < 16;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (i.flags = c, 8 != (255 & i.flags)) { e.msg = "unknown compression method", i.mode = 30; break } if (57344 & i.flags) { e.msg = "unknown header flags set", i.mode = 30; break } i.head && (i.head.text = c >> 8 & 1), 512 & i.flags && (x[0] = 255 & c, x[1] = c >>> 8 & 255, i.check = R(i.check, x, 2, 0)), u = c = 0, i.mode = 3; case 3: for (; u < 32;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.head && (i.head.time = c), 512 & i.flags && (x[0] = 255 & c, x[1] = c >>> 8 & 255, x[2] = c >>> 16 & 255, x[3] = c >>> 24 & 255, i.check = R(i.check, x, 4, 0)), u = c = 0, i.mode = 4; case 4: for (; u < 16;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.head && (i.head.xflags = 255 & c, i.head.os = c >> 8), 512 & i.flags && (x[0] = 255 & c, x[1] = c >>> 8 & 255, i.check = R(i.check, x, 2, 0)), u = c = 0, i.mode = 5; case 5: if (1024 & i.flags) { for (; u < 16;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.length = c, i.head && (i.head.extra_len = c), 512 & i.flags && (x[0] = 255 & c, x[1] = c >>> 8 & 255, i.check = R(i.check, x, 2, 0)), u = c = 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 < s;); if (512 & i.flags && (i.check = R(i.check, o, d, n)), s -= d, n += d, b) break e } else i.head && (i.head.name = null); i.length = 0, i.mode = 8; case 8: if (4096 & i.flags) { if (0 === s) break e; for (d = 0; b = o[n + d++], i.head && b && i.length < 65536 && (i.head.comment += String.fromCharCode(b)), b && d < s;); if (512 & i.flags && (i.check = R(i.check, o, d, n)), s -= d, n += d, b) break e } else i.head && (i.head.comment = null); i.mode = 9; case 9: if (512 & i.flags) { for (; u < 16;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (c !== (65535 & i.check)) { e.msg = "header crc mismatch", i.mode = 30; break } u = c = 0 } i.head && (i.head.hcrc = i.flags >> 9 & 1, i.head.done = !0), e.adler = i.check = 0, i.mode = 12; break; case 10: for (; u < 32;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } e.adler = i.check = N(c), u = c = 0, i.mode = 11; case 11: if (0 === i.havedict) return e.next_out = a, e.avail_out = l, e.next_in = n, e.avail_in = s, i.hold = c, i.bits = u, 2; e.adler = i.check = 1, i.mode = 12; case 12: if (5 === t || 6 === t) break e; case 13: if (i.last) c >>>= 7 & u, u -= 7 & u, i.mode = 27; else { for (; u < 3;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } switch (i.last = 1 & c, --u, 3 & (c >>>= 1)) { case 0: i.mode = 14; break; case 1: I = A = void 0; var I, A = i; if (z) { for (j = new L.Buf32(512), U = 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(V, A.lens, 0, 288, j, 0, A.work, { bits: 9 }), I = 0; I < 32;)A.lens[I++] = 5; B(F, A.lens, 0, 32, U, 0, A.work, { bits: 5 }), z = !1 } if (A.lencode = j, A.lenbits = 9, A.distcode = U, A.distbits = 5, i.mode = 20, 6 !== t) break; c >>>= 2, u -= 2; break e; case 2: i.mode = 17; break; case 3: e.msg = "invalid block type", i.mode = 30 }c >>>= 2, u -= 2 } break; case 14: for (c >>>= 7 & u, u -= 7 & u; u < 32;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if ((65535 & c) != (c >>> 16 ^ 65535)) { e.msg = "invalid stored block lengths", i.mode = 30; break } if (i.length = 65535 & c, u = c = 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 < d ? s : d) ? l : d)) break e; L.arraySet(r, o, n, d, a), s -= d, n += d, l -= d, a += d, i.length -= d } else i.mode = 12; break; case 17: for (; u < 14;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (i.nlen = 257 + (31 & c), c >>>= 5, u -= 5, i.ndist = 1 + (31 & c), c >>>= 5, u -= 5, i.ncode = 4 + (15 & c), c >>>= 4, u -= 4, 286 < i.nlen || 30 < i.ndist) { e.msg = "too many length or distance symbols", i.mode = 30; break } i.have = 0, i.mode = 18; case 18: for (; i.have < i.ncode;) { for (; u < 3;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.lens[D[i.have++]] = 7 & c, c >>>= 3, u -= 3 } for (; i.have < 19;)i.lens[D[i.have++]] = 0; if (i.lencode = i.lendyn, i.lenbits = 7, S = { bits: i.lenbits }, T = B(0, i.lens, 0, 19, i.lencode, 0, i.work, S), i.lenbits = S.bits, T) { e.msg = "invalid code lengths set", i.mode = 30; break } i.have = 0, i.mode = 19; case 19: for (; i.have < i.nlen + i.ndist;) { for (; _ = (P = i.lencode[c & (1 << i.lenbits) - 1]) >>> 16 & 255, C = 65535 & P, !((f = P >>> 24) <= u);) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (C < 16) c >>>= f, u -= f, i.lens[i.have++] = C; else { if (16 === C) { for (E = f + 2; u < E;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (c >>>= f, u -= f, 0 === i.have) { e.msg = "invalid bit length repeat", i.mode = 30; break } b = i.lens[i.have - 1], d = 3 + (3 & c), c >>>= 2, u -= 2 } else if (17 === C) { for (E = f + 3; u < E;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } b = 0, d = 3 + (7 & (c >>>= f)), c >>>= 3, u = u - f - 3 } else { for (E = f + 7; u < E;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } b = 0, d = 11 + (127 & (c >>>= f)), c >>>= 7, u = u - 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, S = { bits: i.lenbits }, T = B(V, i.lens, 0, i.nlen, i.lencode, 0, i.work, S), i.lenbits = S.bits, T) { e.msg = "invalid literal/lengths set", i.mode = 30; break } if (i.distbits = 6, i.distcode = i.distdyn, S = { bits: i.distbits }, T = B(F, i.lens, i.nlen, i.ndist, i.distcode, 0, i.work, S), i.distbits = S.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 = c, i.bits = u, 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, c = i.hold, u = i.bits, 12 === i.mode && (i.back = -1); break } for (i.back = 0; _ = (P = i.lencode[c & (1 << i.lenbits) - 1]) >>> 16 & 255, C = 65535 & P, !((f = P >>> 24) <= u);) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (_ && 0 == (240 & _)) { for (y = f, v = _, w = C; _ = (P = i.lencode[w + ((c & (1 << y + v) - 1) >> y)]) >>> 16 & 255, C = 65535 & P, !(y + (f = P >>> 24) <= u);) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } c >>>= y, u -= y, i.back += y } if (c >>>= f, u -= 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 (E = i.extra; u < E;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.length += c & (1 << i.extra) - 1, c >>>= i.extra, u -= i.extra, i.back += i.extra } i.was = i.length, i.mode = 23; case 23: for (; _ = (P = i.distcode[c & (1 << i.distbits) - 1]) >>> 16 & 255, C = 65535 & P, !((f = P >>> 24) <= u);) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (0 == (240 & _)) { for (y = f, v = _, w = C; _ = (P = i.distcode[w + ((c & (1 << y + v) - 1) >> y)]) >>> 16 & 255, C = 65535 & P, !(y + (f = P >>> 24) <= u);) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } c >>>= y, u -= y, i.back += y } if (c >>>= f, u -= 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 (E = i.extra; u < E;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } i.offset += c & (1 << i.extra) - 1, c >>>= i.extra, u -= 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 = l < d ? l : d, i.length -= d; r[a++] = g[p++], --d;); 0 === i.length && (i.mode = 21); break; case 26: if (0 === l) break e; r[a++] = i.length, l--, i.mode = 21; break; case 27: if (i.wrap) { for (; u < 32;) { if (0 === s) break e; s--, c |= o[n++] << u, u += 8 } if (m -= l, e.total_out += m, i.total += m, m && (e.adler = i.check = (i.flags ? R : M)(i.check, r, m, a - m)), m = l, (i.flags ? c : N(c)) !== i.check) { e.msg = "incorrect data check", i.mode = 30; break } u = c = 0 } i.mode = 28; case 28: if (i.wrap && i.flags) { for (; u < 32;) { if (0 === s) break e; s--, c += o[n++] << u, u += 8 } if (c !== (4294967295 & i.total)) { e.msg = "incorrect length check", i.mode = 30; break } u = c = 0 } i.mode = 29; case 29: T = 1; break e; case 30: T = -3; break e; case 31: return -4; default: return G }return e.next_out = a, e.avail_out = l, e.next_in = n, e.avail_in = s, i.hold = c, i.bits = u, (i.wsize || m !== e.avail_out && i.mode < 30 && (i.mode < 27 || 4 !== t)) && W(e, e.output, e.next_out, m - e.avail_out), h -= e.avail_in, m -= e.avail_out, e.total_in += h, e.total_out += m, i.total += m, i.wrap && m && (e.adler = i.check = (i.flags ? R : M)(i.check, r, m, e.next_out - m)), e.data_type = i.bits + (i.last ? 64 : 0) + (12 === i.mode ? 128 : 0) + (20 === i.mode || 15 === i.mode ? 256 : 0), T = (0 == h && 0 === m || 4 === t) && T === H ? -5 : T }, i.inflateEnd = function (e) { var t; return e && e.state ? ((t = e.state).window && (t.window = null), e.state = null, H) : G }, i.inflateGetHeader = function (e, t) { return !e || !e.state || 0 == (2 & (e = e.state).wrap) ? G : ((e.head = t).done = !1, H) }, i.inflateSetDictionary = function (e, t) { var i, o = t.length; return !e || !e.state || 0 !== (i = e.state).wrap && 11 !== i.mode ? G : 11 === i.mode && M(1, t, o, 0) !== i.check ? -3 : W(e, t, o, o) ? (i.mode = 31, -4) : (i.havedict = 1, H) }, i.inflateInfo = "pako inflate (from Nodeca project)" }, { "../utils/common": 1, "./adler32": 3, "./crc32": 5, "./inffast": 7, "./inftrees": 9 }], 9: [function (e, t, i) { var O = e("../utils/common"), B = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], V = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], F = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], H = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; t.exports = function (e, t, i, o, r, n, a, s) { for (var l, c, u, h, m, d, p, g, f, _ = s.bits, C = 0, y = 0, v = 0, w = 0, b = 0, T = 0, S = 0, E = 0, P = 0, x = 0, D = null, I = 0, A = new O.Buf16(16), L = new O.Buf16(16), M = null, R = 0, C = 0; C <= 15; C++)A[C] = 0; for (y = 0; y < o; y++)A[t[i + y]]++; for (b = _, w = 15; 1 <= w && 0 === A[w]; w--); if (w < b && (b = w), 0 === w) r[n++] = 20971520, r[n++] = 20971520, s.bits = 1; else { for (v = 1; v < w && 0 === A[v]; v++); for (b < v && (b = v), C = E = 1; C <= 15; C++)if ((E = (E <<= 1) - A[C]) < 0) return -1; if (0 < E && (0 === e || 1 !== w)) return -1; for (L[1] = 0, C = 1; C < 15; C++)L[C + 1] = L[C] + A[C]; for (y = 0; y < o; y++)0 !== t[i + y] && (a[L[t[i + y]]++] = y); if (d = 0 === e ? (D = M = a, 19) : 1 === e ? (D = B, I -= 257, M = V, R -= 257, 256) : (D = F, M = H, -1), C = v, m = n, S = y = x = 0, u = -1, h = (P = 1 << (T = b)) - 1, 1 === e && 852 < P || 2 === e && 592 < P) return 1; for (; ;) { for (f = a[y] < d ? (g = 0, a[y]) : a[y] > d ? (g = M[R + a[y]], D[I + a[y]]) : (g = 96, 0), l = 1 << (p = C - S), v = c = 1 << T; r[m + (x >> S) + (c -= l)] = p << 24 | g << 16 | f | 0, 0 !== c;); for (l = 1 << C - 1; x & l;)l >>= 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 < C && (x & h) !== u) { for (m += v, E = 1 << (T = C - (S = 0 === S ? b : S)); T + S < w && !((E -= A[T + S]) <= 0);)T++, E <<= 1; if (P += 1 << T, 1 === e && 852 < P || 2 === e && 592 < P) return 1; r[u = x & h] = b << 24 | T << 16 | m - n | 0 } } 0 !== x && (r[m + x] = C - S << 24 | 64 << 16 | 0), s.bits = b } return 0 } }, { "../utils/common": 1 }], 10: [function (e, t, i) { t.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" } }, {}], 11: [function (e, t, i) { t.exports = function () { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0 } }, {}], "/lib/inflate.js": [function (e, t, i) { var h = e("./zlib/inflate"), m = e("./utils/common"), d = e("./utils/strings"), p = e("./zlib/constants"), o = e("./zlib/messages"), r = e("./zlib/zstream"), n = e("./zlib/gzheader"), g = Object.prototype.toString; function a(e) { if (!(this instanceof a)) return new a(e); this.options = m.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e || {}); var t = this.options, e = (t.raw && 0 <= t.windowBits && t.windowBits < 16 && (t.windowBits = -t.windowBits, 0 === t.windowBits && (t.windowBits = -15)), !(0 <= t.windowBits && t.windowBits < 16) || e && e.windowBits || (t.windowBits += 32), 15 < t.windowBits && t.windowBits < 48 && 0 == (15 & t.windowBits) && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new r, this.strm.avail_out = 0, h.inflateInit2(this.strm, t.windowBits)); if (e !== p.Z_OK) throw new Error(o[e]); this.header = new n, h.inflateGetHeader(this.strm, this.header) } function s(e, t) { t = new a(t); if (t.push(e, !0), t.err) throw t.msg || o[t.err]; return t.result } a.prototype.push = function (e, t) { var i, o, r, n, a, s = this.strm, l = this.options.chunkSize, c = this.options.dictionary, u = !1; if (this.ended) return !1; o = t === ~~t ? t : !0 === t ? p.Z_FINISH : p.Z_NO_FLUSH, "string" == typeof e ? s.input = d.binstring2buf(e) : "[object ArrayBuffer]" === g.call(e) ? s.input = new Uint8Array(e) : s.input = e, s.next_in = 0, s.avail_in = s.input.length; do { if (0 === s.avail_out && (s.output = new m.Buf8(l), s.next_out = 0, s.avail_out = l), (i = h.inflate(s, p.Z_NO_FLUSH)) === p.Z_NEED_DICT && c && (a = "string" == typeof c ? d.string2buf(c) : "[object ArrayBuffer]" === g.call(c) ? new Uint8Array(c) : c, i = h.inflateSetDictionary(this.strm, a)), i === p.Z_BUF_ERROR && !0 === u && (i = p.Z_OK, u = !1), i !== p.Z_STREAM_END && i !== p.Z_OK) return this.onEnd(i), !(this.ended = !0) } while (!s.next_out || 0 !== s.avail_out && i !== p.Z_STREAM_END && (0 !== s.avail_in || o !== p.Z_FINISH && o !== p.Z_SYNC_FLUSH) || ("string" === this.options.to ? (a = d.utf8border(s.output, s.next_out), r = s.next_out - a, n = d.buf2string(s.output, a), s.next_out = r, s.avail_out = l - r, r && m.arraySet(s.output, s.output, a, r, 0), this.onData(n)) : this.onData(m.shrinkBuf(s.output, s.next_out))), 0 === s.avail_in && 0 === s.avail_out && (u = !0), (0 < s.avail_in || 0 === s.avail_out) && i !== p.Z_STREAM_END); return (o = i === p.Z_STREAM_END ? p.Z_FINISH : o) === p.Z_FINISH ? (i = h.inflateEnd(this.strm), this.onEnd(i), this.ended = !0, i === p.Z_OK) : o !== p.Z_SYNC_FLUSH || (this.onEnd(p.Z_OK), !(s.avail_out = 0)) }, a.prototype.onData = function (e) { this.chunks.push(e) }, a.prototype.onEnd = function (e) { e === p.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = m.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg }, i.Inflate = a, i.inflate = s, i.inflateRaw = function (e, t) { return (t = t || {}).raw = !0, s(e, t) }, i.ungzip = s }, { "./utils/common": 1, "./utils/strings": 2, "./zlib/constants": 4, "./zlib/gzheader": 6, "./zlib/inflate": 8, "./zlib/messages": 10, "./zlib/zstream": 11 }] }, {}, [])("/lib/inflate.js"), ve = 1, we = 2, be = 4; function Te(e, t, i, o) { var e = e | t << 8, t = e >> 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 Se(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), c = new Uint8Array(16), u = Te(a[s + 0], a[s + 1], c, 0), h = Te(a[s + 2], a[s + 3], c, 4), m = 0; m < 3; m++) { var d = c[m], p = c[4 + m]; l && u <= h ? (c[8 + m] = (d + p) / 2, c[12 + m] = 0) : (c[8 + m] = (2 * d + p) / 3, c[12 + m] = (d + 2 * p) / 3) } c[11] = 255, c[15] = l && u <= 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] = c[_ + 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 S = e, E = t, P = E[(L = i) + 0], x = E[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 |= E[L++] << 8 * O; for (O = 0; O < 8; ++O)A[M++] = R >> 3 * O & 7 } for (I = 0; I < 16; ++I)S[4 * I + 3] = D[A[I]] } } function Ee(e) { } Ee.decode = function (e, t, i, o, r) { if (null != e && null != o && 0 != i && 0 != t) { var n = 0; if ((n = 11 < r || 5 === r ? be : 32 | ve) & ve && 32 & n) for (var a, s, l, c, u, h, m, r = e, d = t, p = i, g = o, f = new Uint16Array(4), _ = r, C = d / 4, y = p / 4, v = 0; v < y; v++)for (var w = 0; w < C; w++)f[0] = g[a = 4 * ((y - v) * C + w)], f[1] = g[1 + a], s = 31 & f[0], l = 2016 & f[0], c = 63488 & f[0], u = 31 & f[1], h = 2016 & f[1], m = 63488 & f[1], f[2] = 5 * s + 3 * u >> 3 | 5 * l + 3 * h >> 3 & 2016 | 5 * c + 3 * m >> 3 & 63488, f[3] = 5 * u + 3 * s >> 3 | 5 * h + 3 * l >> 3 & 2016 | 5 * m + 3 * c >> 3 & 63488, u = g[2 + a], _[s = 4 * v * d + 4 * w] = f[3 & u], _[1 + s] = f[u >> 2 & 3], _[2 + s] = f[u >> 4 & 3], _[3 + s] = f[u >> 6 & 3], _[s += d] = f[u >> 8 & 3], _[s + 1] = f[u >> 10 & 3], _[s + 2] = f[u >> 12 & 3], _[s + 3] = f[u >> 14], u = g[3 + a], _[s += d] = f[3 & u], _[s + 1] = f[u >> 2 & 3], _[s + 2] = f[u >> 4 & 3], _[s + 3] = f[u >> 6 & 3], _[s += d] = f[u >> 8 & 3], _[s + 1] = f[u >> 10 & 3], _[s + 2] = f[u >> 12 & 3], _[s + 3] = f[u >> 14]; else for (var b = e, T = t, S = i, V = o, E = n, F = 0 != (E & ve) ? 8 : 16, P = 0, x = 0; x < S; x += 4)for (var D = 0; D < T; D += 4) { for (var I = new Uint8Array(64), A = (Se(I, V, P, E), 0), L = 0; L < 4; ++L)for (var M = 0; M < 4; ++M) { var R = D + M, O = x + L; if (R < T && O < S) for (var H = 4 * (T * (S - O) + R), B = 0; B < 4; ++B)b[H++] = I[A++]; else A += 4 } P += F } } }; qt = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 3, 2, 0, 0, 5, 3, 1, 0, 1, 12, 1, 0, 10, 22, 2, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11, 7, 0, 65, 0, 253, 15, 26, 11]), Ie = new Uint8Array([32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, 108, 28, 118, 29, 73, 115]); var Pe, xe, De, Ie, Ae = "object" != typeof WebAssembly ? { supported: !1 } : (Qt = "B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB", WebAssembly.validate(qt) && (Qt = "B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB"), qt = WebAssembly.instantiate(function (e) { for (var t = new Uint8Array(e.length), i = 0; i < e.length; ++i) { var o = e.charCodeAt(i); t[i] = 96 < o ? o - 71 : 64 < o ? o - 65 : 47 < o ? o + 4 : 46 < o ? 63 : 62 } for (var r = 0, i = 0; i < e.length; ++i)t[r++] = t[i] < 60 ? Ie[t[i]] : 64 * (t[i] - 60) + t[++i]; return t.buffer.slice(0, r) }(Qt), {}).then(function (e) { (Pe = e.instance).exports.__wasm_call_ctors() }), xe = { 0: "", 1: "meshopt_decodeFilterOct", 2: "meshopt_decodeFilterQuat", 3: "meshopt_decodeFilterExp", NONE: "", OCTAHEDRAL: "meshopt_decodeFilterOct", QUATERNION: "meshopt_decodeFilterQuat", EXPONENTIAL: "meshopt_decodeFilterExp" }, De = { 0: "meshopt_decodeVertexBuffer", 1: "meshopt_decodeIndexBuffer", 2: "meshopt_decodeIndexSequence", ATTRIBUTES: "meshopt_decodeVertexBuffer", TRIANGLES: "meshopt_decodeIndexBuffer", INDICES: "meshopt_decodeIndexSequence" }, { ready: qt, supported: !0, decodeVertexBuffer: function (e, t, i, o, r) { Le(Pe.exports.meshopt_decodeVertexBuffer, e, t, i, o, Pe.exports[xe[r]]) }, decodeIndexBuffer: function (e, t, i, o) { Le(Pe.exports.meshopt_decodeIndexBuffer, e, t, i, o) }, decodeIndexSequence: function (e, t, i, o) { Le(Pe.exports.meshopt_decodeIndexSequence, e, t, i, o) }, decodeGltfBuffer: function (e, t, i, o, r, n) { Le(Pe.exports[De[r]], e, t, i, o, Pe.exports[xe[n]]) } }); function Le(e, t, i, o, r, n) { var a = Pe.exports.sbrk, s = i + 3 & -4, l = a(s * o), c = a(r.length), u = new Uint8Array(Pe.exports.memory.buffer), e = (u.set(r, c), e(l, i, o, c, r.length)); if (0 == e && n && n(l, s, o), t.set(u.subarray(l, l + i * o)), a(l - a(0)), 0 != e) throw new Error("Malformed buffer data: " + e) } function Me() { } Me.s3tc = !0, Me.pvrtc = !1, Me.etc1 = !1; const Re = { SV_Unkown: 0, SV_Standard: 1, SV_Compressed: 2, SV_DracoCompressed: 3 }, Oe = { Standard: 0, Draco: 1, MeshOpt: 2 }, Be = { 0: Uint32Array.BYTES_PER_ELEMENT, 1: Float32Array.BYTES_PER_ELEMENT, 2: Float64Array.BYTES_PER_ELEMENT }, Ve = { LUMINANCE_8: 1, LUMINANCE_16: 2, ALPHA: 3, ALPHA_4_LUMINANCE_4: 4, LUMINANCE_ALPHA: 5, RGB_565: 6, BGR565: 7, RGB: 10, BGR: 11, ARGB: 12, ABGR: 13, BGRA: 14, WEBP: 25, RGBA: 28, DXT1: 17, DXT2: 18, DXT3: 19, DXT4: 20, DXT5: 21, CRN_DXT5: 26, STANDARD_CRN: 27 }, Fe = { SVC_Vertex: 1, SVC_Normal: 2, SVC_VertexColor: 4, SVC_SecondColor: 8, SVC_TexutreCoord: 16, SVC_TexutreCoordIsW: 32 }, He = { Invalid: 0, Position: 1, PositionW: 2, Normal: 4, Tangent: 8, FirstTexcoord: 16, SecondTexcoord: 32, Color: 64, SecondColor: 128, Custom0: 512, Custom1: 1024 }; function Ge(e, t, i) { i = e.byteLength; return e = e.subarray(0, 0 + i), new TextDecoder("utf-8").decode(e) } function ke(e, t, i) { t = t.getUint32(i, !0), i += Uint32Array.BYTES_PER_ELEMENT, e = new Uint8Array(e, i, t); return { string: Ge(e), bytesOffset: i += t, length: t } } function Ne(t, i, o, e, r) { let n = {}, a = (n.rangeList = i.getFloat32(o, !0), o += Float32Array.BYTES_PER_ELEMENT, n.rangeMode = i.getUint16(o, !0), o += Uint16Array.BYTES_PER_ELEMENT, {}); a.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, a.y = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, a.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT; var s = i.getFloat64(o, !0); if (o += Float64Array.BYTES_PER_ELEMENT, n.boundingSphere = { center: a, radius: s }, 3 === r) { const u = {}, h = (u.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, u.y = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, u.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, {}), m = (h.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, h.y = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, h.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, {}), d = (m.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, m.y = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, m.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, {}); d.x = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, d.y = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, d.z = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT, n.obb = { xExtent: h, yExtent: m, zExtent: d, obbCenter: u } } s = ke(t, i, o); let l = s.string; o = s.bytesOffset; var s = l.indexOf("Geometry"), c = (-1 !== s && (s = l.substring(s), l = l.replace(s, "")), n.childTile = l, n.geodes = [], i.getUint32(o, !0)); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < c; e++)o = function (t, i, o, e) { let r = {}, n = [], a = new Array(16); for (let e = 0; e < 16; e++)a[e] = i.getFloat64(o, !0), o += Float64Array.BYTES_PER_ELEMENT; r.matrix = a, r.skeletonNames = n; var s = i.getUint32(o, !0); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < s; e++) { var l = ke(t, i, o); n.push(l.string), o = l.bytesOffset } return e.push(r), o }(t, i, o, n.geodes); return e.push(n), o = 3 === r ? ke(t, i, o).bytesOffset : o } function je(i, o, r, n) { var a = o.getUint32(r, !0); if (n.verticesCount = a, !((r += Uint32Array.BYTES_PER_ELEMENT) <= 0)) { var s = o.getUint16(r, !0), o = (r += Uint16Array.BYTES_PER_ELEMENT, o.getUint16(r, !0), s * Float32Array.BYTES_PER_ELEMENT), a = (r += Uint16Array.BYTES_PER_ELEMENT, a * s * Float32Array.BYTES_PER_ELEMENT), i = new Uint8Array(i, r, a); r += a; let e = n.vertexAttributes, t = n.attrLocation; t.aPosition = e.length, e.push({ index: t.aPosition, typedArray: i, componentsPerAttribute: s, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: o, normalize: !1 }) } return r } function Ue(i, o, r, n) { var a = o.getUint32(r, !0); if (r += Uint32Array.BYTES_PER_ELEMENT, !(a <= 0)) { var s = o.getUint16(r, !0), o = (r += Uint16Array.BYTES_PER_ELEMENT, o.getUint16(r, !0)), a = (r += Uint16Array.BYTES_PER_ELEMENT, a * s * Float32Array.BYTES_PER_ELEMENT), i = new Uint8Array(i, r, a); r += a; let e = n.vertexAttributes, t = n.attrLocation; t.aNormal = e.length, e.push({ index: t.aNormal, typedArray: i, componentsPerAttribute: s, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: o, normalize: !1 }) } return r } function ze(t, i, o, e) { var r = i.getUint32(o, !0), n = (o += Uint32Array.BYTES_PER_ELEMENT, e.verticesCount); let a; if (0 < r) { i.getUint16(o, !0), o = (o += Uint16Array.BYTES_PER_ELEMENT) + 2 * Uint8Array.BYTES_PER_ELEMENT; i = r * Uint8Array.BYTES_PER_ELEMENT * 4; let e = new Uint8Array(t, o, i); a = e.slice(0, i), o += i } else { a = new Uint8Array(4 * n); for (let e = 0; e < n; e++)a[4 * e] = 255, a[4 * e + 1] = 255, a[4 * e + 2] = 255, a[4 * e + 3] = 255 } let s = e.vertexAttributes, l = e.attrLocation; return l.aColor = s.length, s.push({ index: l.aColor, typedArray: a, componentsPerAttribute: 4, componentDatatype: 5121, offsetInBytes: 0, strideInBytes: 4, normalize: !0 }), e.vertexColor = a, o } function We(i, o, r, n) { var a = o.getUint32(r, !0); if (r += Uint32Array.BYTES_PER_ELEMENT, !(a <= 0)) { o.getUint16(r, !0), r = (r += Uint16Array.BYTES_PER_ELEMENT) + 2 * Uint8Array.BYTES_PER_ELEMENT; o = a * Uint8Array.BYTES_PER_ELEMENT * 4, a = new Uint8Array(i, r, o); r += o; let e = n.vertexAttributes, t = n.attrLocation; t.aSecondColor = e.length, e.push({ index: t.aSecondColor, typedArray: a, componentsPerAttribute: 4, componentDatatype: 5121, offsetInBytes: 0, strideInBytes: 4, normalize: !0 }) } return r } function Ye(o, r, n, a) { var e = r.getUint16(n, !0); n = (n += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; for (let i = 0; i < e; i++) { var s = r.getUint32(n, !0), l = (n += Uint32Array.BYTES_PER_ELEMENT, r.getUint16(n, !0)), s = (n += Uint16Array.BYTES_PER_ELEMENT, r.getUint16(n, !0), n += Uint16Array.BYTES_PER_ELEMENT, s * l * Float32Array.BYTES_PER_ELEMENT), c = new Uint8Array(o, n, s), s = (n += s, "aTexCoord" + i); let e = a.vertexAttributes, t = a.attrLocation; t[s] = e.length, e.push({ index: t[s], typedArray: c, componentsPerAttribute: l, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: l * Float32Array.BYTES_PER_ELEMENT, normalize: !1 }) } return n } function Je(i, t, o, r) { var n = t.getUint16(o, !0); o = (o += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; let a = r.vertexAttributes, s = r.attrLocation; for (let e = 0; e < n; e++) { var l = t.getUint32(o, !0), c = (o += Uint32Array.BYTES_PER_ELEMENT, t.getUint16(o, !0)), u = (o += Uint16Array.BYTES_PER_ELEMENT, t.getUint16(o, !0), o += Uint16Array.BYTES_PER_ELEMENT, l * c * Float32Array.BYTES_PER_ELEMENT); if (17 === c || 29 === c) { let e = new Uint8Array(i, o, u); r.instanceCount = l, r.instanceMode = c, r.instanceBuffer = e, r.instanceIndex = 1; var h = e.slice(0, c * l * 4); r.vertexColorInstance = h; let t; 17 === c ? (t = 17 * Float32Array.BYTES_PER_ELEMENT, s.uv2 = a.length, a.push({ index: s.uv2, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 0, strideInBytes: t, instanceDivisor: 1 }), s.uv3 = a.length, a.push({ index: s.uv3, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv4 = a.length, a.push({ index: s.uv4, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.secondary_colour = a.length, a.push({ index: s.secondary_colour, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv6 = a.length, a.push({ index: s.uv6, componentsPerAttribute: 4, componentDatatype: 5121, normalize: !0, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 })) : 29 === c && (t = 29 * Float32Array.BYTES_PER_ELEMENT, s.uv1 = a.length, a.push({ index: s.uv1, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 0, strideInBytes: t, instanceDivisor: 1, byteLength: u }), s.uv2 = a.length, a.push({ index: s.uv2, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv3 = a.length, a.push({ index: s.uv3, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv4 = a.length, a.push({ index: s.uv4, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv5 = a.length, a.push({ index: s.uv5, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv6 = a.length, a.push({ index: s.uv6, componentsPerAttribute: 4, componentDatatype: 5126, normalize: !1, offsetInBytes: 20 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv7 = a.length, a.push({ index: s.uv7, componentsPerAttribute: 3, componentDatatype: 5126, normalize: !1, offsetInBytes: 24 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.secondary_colour = a.length, a.push({ index: s.secondary_colour, componentsPerAttribute: 4, componentDatatype: 5121, normalize: !0, offsetInBytes: 27 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 }), s.uv9 = a.length, a.push({ index: s.uv9, componentsPerAttribute: 4, componentDatatype: 5121, normalize: !0, offsetInBytes: 28 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: t, instanceDivisor: 1 })) } else { var m = l * c; r.instanceBounds = new Float32Array(m); for (let e = 0; e < m; e++)r.instanceBounds[e] = t.getFloat32(o + e * Float32Array.BYTES_PER_ELEMENT, !0) } o += u } return o } function Ke(t, i, o, r, n) { if (3 === n && (i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT), o = je(t, i, o, r), o = Ue(t, i, o, r), o = ze(t, i, o, r), 3 !== n && (o = We(t, i, o, r)), o = Ye(t, i, o, r), o = Je(t, i, o, r), 3 === n) { o = function (t, i, o, r) { var n = i.getUint32(o, !0); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < n; e++) { var a = i.getUint32(o, !0), s = (o += Uint32Array.BYTES_PER_ELEMENT, i.getUint16(o, !0)), l = (o += Uint16Array.BYTES_PER_ELEMENT, i.getUint16(o, !0)), a = (o += Uint16Array.BYTES_PER_ELEMENT, a * s * Be[l]), l = new Uint8Array(t, o, a); o += a; const c = r.vertexAttributes, u = r.attrLocation; a = "aCustom" + e; u[a] = c.length, c.push({ index: u[a], typedArray: l, componentsPerAttribute: s, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }) } return o }(t, i, o, r); n = ke(t, i, o), t = (o = n.bytesOffset, r.customVertexAttribute = JSON.parse(n.string), "aCustom" + r.customVertexAttribute.TextureCoordMatrix), n = "aCustom" + r.customVertexAttribute.VertexWeight; void 0 !== r.attrLocation[t] && (r.attrLocation.aTextureCoordMatrix = r.attrLocation[t], delete r.attrLocation[t]), void 0 !== r.attrLocation[n] && (r.attrLocation.aVertexWeight = r.attrLocation[n], delete r.attrLocation[n]); let e = o % 4; o += e = e && 4 - e, t = o, n = (r = i).getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT, n <= 0 || (i = r.getUint16(t, !0), t += Uint16Array.BYTES_PER_ELEMENT, r.getUint16(t, !0), t = (t += Uint16Array.BYTES_PER_ELEMENT) + n * i * Float32Array.BYTES_PER_ELEMENT), o = t } return o } function Qe(i, o, n, a) { var s = o.getUint32(n, !0), r = (n += Uint32Array.BYTES_PER_ELEMENT, a.compressOptions = s, o.getUint32(n, !0)); n += Uint32Array.BYTES_PER_ELEMENT, a.minVerticesValue = { x: 0, y: 0, z: 0, w: 0 }, a.minTexCoordValue = [{ x: 0, y: 0 }, { x: 0, y: 0 }], a.texCoordCompressConstant = [{ x: 0, y: 0, z: 0 }, { x: 0, y: 0, z: 0 }]; for (let t = 0; t < r; t++) { var l = o.getUint32(n, !0), c = (n += Uint32Array.BYTES_PER_ELEMENT, a.vertCompressConstant = o.getFloat32(n, !0), n += Float32Array.BYTES_PER_ELEMENT, a.minVerticesValue.x = o.getFloat64(n, !0), n += Float64Array.BYTES_PER_ELEMENT, a.minVerticesValue.y = o.getFloat64(n, !0), n += Float64Array.BYTES_PER_ELEMENT, a.minVerticesValue.z = o.getFloat64(n, !0), n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), u = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), h = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), m = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), d = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), p = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), g = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), f = (n += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(n, !0)), _ = (n += Float64Array.BYTES_PER_ELEMENT, a.minTexCoordValue[0].x = h, a.minTexCoordValue[0].y = m, a.minTexCoordValue[1].x = g, a.minTexCoordValue[1].y = f, a.texCoordCompressConstant[0].x = c, a.texCoordCompressConstant[0].y = u, a.texCoordCompressConstant[1].x = d, a.texCoordCompressConstant[1].y = p, o.getInt32(n, !0)); n += Int32Array.BYTES_PER_ELEMENT; for (let e = 0; e < _; e++) { var C = o.getInt32(n, !0); n += Int32Array.BYTES_PER_ELEMENT; let r = 0; C !== He.Custom0 && C !== He.Custom1 || (r = o.getInt32(n, !0), n += Int32Array.BYTES_PER_ELEMENT); var y = o.getInt32(n, !0), v = (n += Int32Array.BYTES_PER_ELEMENT, new Uint8Array(i, n, y)); let e = (n += Uint8Array.BYTES_PER_ELEMENT * y) % 4; n += e = e && 4 - e; { w = void 0; b = void 0; T = void 0; y = void 0; S = void 0; E = void 0; var w = l; var b = C; var T = r; y = v; var S = a; var E = s; let e = 0, t; const P = S.vertexAttributes, x = S.attrLocation; switch (b) { case He.Normal: case He.FirstTexcoord: case He.SecondTexcoord: e = 2 * Uint16Array.BYTES_PER_ELEMENT, 0 != (16 & E) || b !== He.FirstTexcoord && b !== He.SecondTexcoord || (e = 2 * Float32Array.BYTES_PER_ELEMENT), t = new Uint8Array(w * e); break; case He.Color: case He.SecondColor: e = 4 * Uint8Array.BYTES_PER_ELEMENT, t = new Uint8Array(4 * w); break; case He.Custom0: case He.Custom1: e = Float32Array.BYTES_PER_ELEMENT * T, t = new Uint8Array(w * T * 4); break; default: e = 4 * Uint16Array.BYTES_PER_ELEMENT, t = new Uint8Array(w * e) }Ae.decodeVertexBuffer(t, w, e, y, y.length); let i, o; switch (b) { case He.Position: x.aPosition = P.length, P.push({ index: x.aPosition, typedArray: new Uint16Array(t.buffer, 0, t.length / 2), componentsPerAttribute: 4, componentDatatype: 5122, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }), S.verticesCount = w; break; case He.Normal: x.aNormal = P.length, P.push({ index: x.aNormal, typedArray: new Int16Array(t.buffer, 0, t.length / 2), componentsPerAttribute: 2, componentDatatype: 5122, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }); break; case He.FirstTexcoord: i = 0 == (16 & E) ? (o = 5126, new Float32Array(t.buffer, 0, t.length / 4)) : (o = 5122, new Uint16Array(t.buffer, 0, t.length / 2)), x.aTexCoord0 = P.length, P.push({ index: x.aTexCoord0, typedArray: i, componentsPerAttribute: 2, componentDatatype: o, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }); break; case He.SecondTexcoord: i = 0 == (16 & E) ? (o = 5126, new Float32Array(t.buffer, 0, t.length / 4)) : (o = 5122, new Uint16Array(t.buffer, 0, t.length / 2)), x.aTexCoord1 = P.length, P.push({ index: x.aTexCoord1, typedArray: i, componentsPerAttribute: 2, componentDatatype: o, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }); break; case He.Color: x.aColor = P.length, P.push({ index: x.aColor, typedArray: t, componentsPerAttribute: 4, componentDatatype: 5121, offsetInBytes: 0, strideInBytes: 0, normalize: !0 }); break; case He.SecondColor: x.aSecondColor = P.length, P.push({ index: x.aSecondColor, typedArray: t, componentsPerAttribute: 4, componentDatatype: 5120, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }); break; case He.Custom0: x.aCustom0 = P.length, P.push({ index: x.aCustom0, typedArray: new Float32Array(t.buffer, 0, t.length / 4), componentsPerAttribute: T, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }); break; case He.Custom1: x.aCustom1 = P.length, P.push({ index: x.aCustom1, typedArray: new Float32Array(t.buffer, 0, t.length / 4), componentsPerAttribute: T, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: 0, normalize: !1 }) } } } h = ke(i, o, n), m = (n = h.bytesOffset, a.customVertexAttribute = JSON.parse(h.string), "aCustom" + a.customVertexAttribute.TextureCoordMatrix), g = "aCustom" + a.customVertexAttribute.VertexWeight; void 0 !== a.attrLocation[m] && (a.attrLocation.aTextureCoordMatrix = a.attrLocation[m], t === r - 1 && delete a.attrLocation[m]), void 0 !== a.attrLocation[g] && (a.attrLocation.aVertexWeight = a.attrLocation[g], t === r - 1 && delete a.attrLocation[g]); let e = n % 4; n += e = e && 4 - e } return n } function qe(e, t, i, o) { var r = t.getUint32(i, !0); return o.compressOptions = r, i += Uint32Array.BYTES_PER_ELEMENT, i = ((r & Fe.SVC_Vertex) === Fe.SVC_Vertex ? function (o, r, n, a) { var s = r.getUint32(n, !0); if (a.verticesCount = s, !((n += Uint32Array.BYTES_PER_ELEMENT) <= 0)) { var l = r.getUint16(n, !0), c = (n += Uint16Array.BYTES_PER_ELEMENT, r.getUint16(n, !0), l * Int16Array.BYTES_PER_ELEMENT), u = (n += Uint16Array.BYTES_PER_ELEMENT, r.getFloat32(n, !0)); n += Float32Array.BYTES_PER_ELEMENT; let e = {}; e.x = r.getFloat32(n, !0), n += Float32Array.BYTES_PER_ELEMENT, e.y = r.getFloat32(n, !0), n += Float32Array.BYTES_PER_ELEMENT, e.z = r.getFloat32(n, !0), n += Float32Array.BYTES_PER_ELEMENT, e.w = r.getFloat32(n, !0), n += Float32Array.BYTES_PER_ELEMENT, a.vertCompressConstant = u, a.minVerticesValue = e; r = s * l * Int16Array.BYTES_PER_ELEMENT, u = new Uint8Array(o, n, r); n += r; let t = a.vertexAttributes, i = a.attrLocation; i.aPosition = t.length, t.push({ index: i.aPosition, typedArray: u, componentsPerAttribute: l, componentDatatype: 5122, offsetInBytes: 0, strideInBytes: c, normalize: !1 }) } return n } : je)(e, t, i, o), i = We(e, t, i = ze(e, t, i = ((r & Fe.SVC_Normal) === Fe.SVC_Normal ? function (i, o, r, n) { var a = o.getUint32(r, !0); if (r += Uint32Array.BYTES_PER_ELEMENT, !(a <= 0)) { o.getUint16(r, !0), r += Uint16Array.BYTES_PER_ELEMENT; o = o.getUint16(r, !0), a = (r += Uint16Array.BYTES_PER_ELEMENT, 2 * a * Int16Array.BYTES_PER_ELEMENT), i = new Uint8Array(i, r, a); r += a; let e = n.vertexAttributes, t = n.attrLocation; t.aNormal = e.length, e.push({ index: t.aNormal, typedArray: i, componentsPerAttribute: 2, componentDatatype: 5122, offsetInBytes: 0, strideInBytes: o, normalize: !1 }) } return r } : Ue)(e, t, i, o), o), o), i = ((r & Fe.SVC_TexutreCoord) === Fe.SVC_TexutreCoord ? function (r, n, a, s) { s.texCoordCompressConstant = [], s.minTexCoordValue = []; var e = n.getUint16(a, !0); a = (a += Uint16Array.BYTES_PER_ELEMENT) + Uint16Array.BYTES_PER_ELEMENT; for (let o = 0; o < e; o++) { var l = n.getUint8(a, !0), c = (a = (a += Uint8Array.BYTES_PER_ELEMENT) + 3 * Uint8Array.BYTES_PER_ELEMENT, n.getUint32(a, !0)), u = (a += Uint32Array.BYTES_PER_ELEMENT, n.getUint16(a, !0)), h = (a += Uint16Array.BYTES_PER_ELEMENT, n.getUint16(a, !0), a += Uint16Array.BYTES_PER_ELEMENT, n.getFloat32(a, !0)); a += Float32Array.BYTES_PER_ELEMENT, s.texCoordCompressConstant.push(h); let e = {}; e.x = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, e.y = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, e.z = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, e.w = n.getFloat32(a, !0), a += Float32Array.BYTES_PER_ELEMENT, s.minTexCoordValue.push(e); var h = c * u * Int16Array.BYTES_PER_ELEMENT, m = new Uint8Array(r, a, h), d = (a += h) % 4, d = (0 != d && (a += 4 - d), "aTexCoord" + o); let t = s.vertexAttributes, i = s.attrLocation; i[d] = t.length, t.push({ index: i[d], typedArray: m, componentsPerAttribute: u, componentDatatype: 5122, offsetInBytes: 0, strideInBytes: u * Int16Array.BYTES_PER_ELEMENT, normalize: !1 }), l && (h = c * Float32Array.BYTES_PER_ELEMENT, m = new Uint8Array(r, a, h), a += h, s.texCoordZMatrix = !0, d = "aTexCoordZ" + o, i[d] = t.length, t.push({ index: i[d], typedArray: m, componentsPerAttribute: 1, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: Float32Array.BYTES_PER_ELEMENT, normalize: !1 })) } return a } : Ye)(e, t, i, o), (r & Fe.SVC_TexutreCoordIsW) === Fe.SVC_TexutreCoordIsW && (o.textureCoordIsW = !0), i = Je(e, t, i, o) } function Xe(i, o, r, n, a) { o.getUint32(r, !0), r += Uint32Array.BYTES_PER_ELEMENT; var t = o.getUint32(r, !0); r += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < t; e++) { 3 === a && (o.getUint32(r, !0), r += Uint32Array.BYTES_PER_ELEMENT); var s = ke(i, o, r), l = s.string, s = (r = s.bytesOffset, s.length % 4); 0 != s && (r += 4 - s); let e = o.getUint32(r, !0); if (r += Int32Array.BYTES_PER_ELEMENT, 3 === a) switch (e) { case Oe.Standard: e = Re.SV_Standard; break; case Oe.Draco: e = Re.SV_DracoCompressed; break; case Oe.MeshOpt: e = Re.SV_Compressed }var s = { vertexAttributes: [], attrLocation: {}, instanceCount: 0, instanceMode: 0, instanceIndex: -1 }, c = (e === Re.SV_Standard ? r = Ke(i, o, r, s, a) : e === Re.SV_Compressed && 3 === a ? r = Qe(i, o, r, s) : e === Re.SV_Compressed && (r = qe(i, o, r, s)), []); r = e === Re.SV_Compressed && 3 === a ? function (o, r, n, a) { var t = r.getInt32(n, !0); n += Int32Array.BYTES_PER_ELEMENT; for (let e = 0; e < t; e++) { const d = {}; var s = r.getInt32(n, !0); if (n += Int32Array.BYTES_PER_ELEMENT, !(s < 1)) { var l = r.getInt8(n, !0), c = (n += Int8Array.BYTES_PER_ELEMENT, r.getInt8(n, !0), n += Int8Array.BYTES_PER_ELEMENT, r.getInt8(n, !0)), u = (n += Int8Array.BYTES_PER_ELEMENT, r.getInt8(n, !0), n += Int8Array.BYTES_PER_ELEMENT, r.getInt32(n, !0)); n += Int32Array.BYTES_PER_ELEMENT; let e, t = (13 !== c ? (e = new Uint8Array(o, n, u), n += Uint8Array.BYTES_PER_ELEMENT * u) : (e = new Uint32Array(o, n, u), n += Uint32Array.BYTES_PER_ELEMENT * u), n % 4); n += t = t && 4 - t; let i; 13 !== c ? (i = new Uint8Array(s * Uint32Array.BYTES_PER_ELEMENT), Ae.decodeIndexBuffer(i, s, Uint32Array.BYTES_PER_ELEMENT, e)) : i = e; var h = r.getInt32(n, !0); n += Int32Array.BYTES_PER_ELEMENT; const p = new (0 === (d.indexType = l) ? Uint16Array : Uint32Array)(s); d.indicesCount = s; u = new Uint32Array(i.buffer, i.byteOffset, i.byteLength / 4); p.set(u, 0), d.indicesTypedArray = p, d.primitiveType = c; for (let e = 0; e < h; e++) { var m = ke(o, r, n); n = m.bytesOffset, d.materialCode = m.string } a.push(d), n += t = (t = n % 4) && 4 - t } } return n }(i, o, r, c) : function (o, t, r, n, a) { var i = t.getUint32(r, !0); r += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < i; e++) { let i = {}; 3 === a && (t.getUint32(r, !0), r += Uint32Array.BYTES_PER_ELEMENT); var s = t.getUint32(r, !0), l = (r += Uint32Array.BYTES_PER_ELEMENT, t.getUint8(r, !0)), c = (r += Uint8Array.BYTES_PER_ELEMENT, t.getUint8(r, !0), r += Uint8Array.BYTES_PER_ELEMENT, t.getUint8(r, !0)); if (r = (r += Uint8Array.BYTES_PER_ELEMENT) + Uint8Array.BYTES_PER_ELEMENT, 0 < s) { let e = null, t; 1 === l || 3 === l ? (t = s * Uint32Array.BYTES_PER_ELEMENT, e = new Uint8Array(o, r, t)) : (t = s * Uint16Array.BYTES_PER_ELEMENT, e = new Uint8Array(o, r, t), s % 2 != 0 && (t += 2)), i.indicesTypedArray = e, r += t } i.indicesCount = s, i.indexType = l, i.primitiveType = c; var u = t.getUint32(r, !0); r += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < u; e++) { var h = ke(o, t, r), m = h.string; r = h.bytesOffset, i.materialCode = m } 0 != r % 4 && (r += 4 - r % 4), n.push(i) } return r }(i, o, r, c, a); let t = void 0; 2 === c.length && 13 === c[1].primitiveType && 3 <= c[1].indicesCount && (t = S3MEdgeProcessor.createEdgeDataByIndices(s, c[1])), n[l] = { vertexPackage: s, arrIndexPackage: c, edgeGeometry: t }, 3 === a && (o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT, o.getFloat64(r, !0), r += Float64Array.BYTES_PER_ELEMENT) } return r = 3 !== a ? (r += o.getUint32(r, !0)) + Uint32Array.BYTES_PER_ELEMENT : r } let Ze = { red: 0, green: 0, blue: 0, alpha: 0 }; function $e(e, t, i) { let o = e.vertexAttributes, r = e.attrLocation; e = o.length; r[1 === i ? "instanceId" : "batchId"] = e, o.push({ index: e, typedArray: t, componentsPerAttribute: 1, componentDatatype: 5126, offsetInBytes: 0, strideInBytes: 0, instanceDivisor: i }) } Me.parseBuffer = function (e) { let t = 0, i = { version: void 0, groupNode: void 0, geoPackage: {}, matrials: void 0, texturePackage: {} }, o = new DataView(e); i.version = o.getFloat32(t, !0), t += Float32Array.BYTES_PER_ELEMENT, 2 <= i.version && (o.getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT), 3 <= i.version && (o.getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT), o.getUint32(t, !0), t += Uint32Array.BYTES_PER_ELEMENT; r = e, s = t, r = new Uint8Array(e, s); var r, n, a, e = ye.inflate(r).buffer, s = (o = new DataView(e), t = 0, o.getUint32(t, !0)), l = (t += Uint32Array.BYTES_PER_ELEMENT, t = function (t, i, o, r) { let e = {}; var n = [], a = (i.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT, i.getUint32(o, !0)); o += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < a; e++)o = Ne(t, i, o, n, r.version); e.pageLods = n; var s = o % 4; return 0 != s && (o += 4 - s), r.groupNode = e, o }(e, o, t, i), t = Xe(e, o, t, i.geoPackage, i.version), t = function (o, r, n, a) { r.getUint32(n, !0), n += Uint32Array.BYTES_PER_ELEMENT; var t = r.getUint32(n, !0); n += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < t; e++) { var s = ke(o, r, n), l = s.string, s = (n = s.bytesOffset, s.length % 4), s = (0 != s && (n += 4 - s), r.getUint32(n, !0), n += Uint32Array.BYTES_PER_ELEMENT, r.getUint32(n, !0)), c = (n += Uint32Array.BYTES_PER_ELEMENT, r.getUint32(n, !0)); n += Uint32Array.BYTES_PER_ELEMENT; let e = r.getUint32(n, !0); n += Uint32Array.BYTES_PER_ELEMENT; var u = r.getUint32(n, !0), h = (n += Uint32Array.BYTES_PER_ELEMENT, r.getUint32(n, !0)); n += Uint32Array.BYTES_PER_ELEMENT; let t = new Uint8Array(o, n, u), i = (n += u, h === Ve.RGB || h === Ve.BGR ? 33776 : 33779); 22 === e && (i = 36196), Me.s3tc || 33776 !== i && 33779 !== i || (u = new Uint8Array(s * c * 4), Ee.decode(u, s, c, t, h), t = u, e = 0, i = h === Ve.RGB || h === Ve.RGB ? 273 : 4369), a[l] = { id: l, width: s, height: c, compressType: e, nFormat: h, internalFormat: i, arrayBufferView: t } } return n }(e, o, t, i.texturePackage), t = (r = e, h = o, n = t, a = i, h = h.getUint32(n, !0), n += Uint32Array.BYTES_PER_ELEMENT, r = Ge(r = new Uint8Array(r, n, h)), n += h, a.materials = JSON.parse(r), n), e), c = o, u = t, h = s, m = i.geoPackage, d = i.version; if (3 === d && (h = c.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT), 1 == (1 & h)) { c.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT; var p = c.getUint32(u, !0); u += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < p; e++) { var g = ke(l, c, u), f = g.string, _ = (u = g.bytesOffset, c.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT; let r = {}; if (m[f].pickInfo = r, -1 == m[f].vertexPackage.instanceIndex) { let o = new Float32Array(m[f].vertexPackage.verticesCount); for (let i = 0; i < _; i++) { var C = c.getUint32(u, !0), y = (u += Uint32Array.BYTES_PER_ELEMENT, c.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT; let t = []; for (let e = 0; e < y; e++) { var v = c.getUint32(u, !0), w = (u += Uint32Array.BYTES_PER_ELEMENT, c.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT, o.fill(i, v, v + w), t.push({ vertexColorOffset: v, vertexColorCount: w, batchId: i }) } r[C] = t } $e(m[f].vertexPackage, o, void 0) } else { var b = m[f].vertexPackage.instanceCount, T = m[f].vertexPackage.instanceBuffer, S = m[f].vertexPackage.instanceMode; let t = new Float32Array(b), i = []; for (let e = 0; e < _; e++) { var E = c.getUint32(u, !0), P = (i.push(E), u += Uint32Array.BYTES_PER_ELEMENT, c.getUint32(u, !0)); u += Uint32Array.BYTES_PER_ELEMENT; for (let e = 0; e < P; e++)c.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT, 3 === d && (c.getUint32(u, !0), u += Uint32Array.BYTES_PER_ELEMENT) } var x = 17 === S ? 16 : 28; x *= Float32Array.BYTES_PER_ELEMENT; for (let e = 0; e < b; e++) { var D = (t[e] = e) * S * Float32Array.BYTES_PER_ELEMENT + x, D = (Cesium.Color.unpack(T, D, Ze), 2 === d ? i[e] : Ze.red + 256 * Ze.green + 65536 * Ze.blue); void 0 === r[D] && (r[D] = { vertexColorCount: 1, instanceIds: [], vertexColorOffset: e }), r[D].instanceIds.push(e) } $e(m[f].vertexPackage, t, 1) } } } return i }; function et(e, t, i) { var o = e._gl; this.contextId = e.id, this.textureId = t, this.layerId = i.layerId, this.rootName = i.rootName, this.context = e, this.width = i.width, this.height = i.height, this.compressType = i.compressType, this.internalFormat = i.internalFormat, this.pixelFormat = i.pixelFormat, this.arrayBufferView = i.arrayBufferView, this.wrapS = Cesium.defaultValue(i.wrapS, Cesium.TextureWrap.CLAMP_TO_EDGE), this.wrapT = Cesium.defaultValue(i.wrapT, Cesium.TextureWrap.CLAMP_TO_EDGE), this._target = o.TEXTURE_2D, this._texture = void 0, this.refCount = 1, this.arrayBufferView && this.init() } function tt() { this.ambientColor = new Cesium.Color, this.diffuseColor = new Cesium.Color, this.specularColor = new Cesium.Color(0, 0, 0, 0), this.shininess = 50, this.bTransparentSorting = !1, this.texMatrix = Cesium.Matrix4.clone(Cesium.Matrix4.IDENTITY, new Cesium.Matrix4), this.textures = [] } et.prototype.init = function () { let e = this.context._gl; this._texture || (this._texture = e.createTexture()), e.bindTexture(e.TEXTURE_2D, this._texture); var t = this.internalFormat; 6410 !== t && 4369 !== t || e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, !0); let i = 0, o = 0, r = this.width, n = this.height; var a = function (e, t, i, o) { let r = e.length, n = i, a = o, s = 0; for (; ;) { var l = Cesium.PixelFormat.compressedTextureSizeInBytes(t, n, a); if (s += l, n >>= 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 < this.arrayBufferView.byteLength && a); 1 < i ? (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR_MIPMAP_LINEAR)) : (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR)), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, this.wrapS), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, this.wrapT), e.texParameteri(this._target, this.context._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, 1), e.bindTexture(e.TEXTURE_2D, null), this.arrayBufferView = void 0, this.ready = !0 }, et.prototype.isDestroyed = function () { return !1 }, et.prototype.destroy = function () { let e = this.context._gl; e.deleteTexture(this._texture), this._texture = null, this.id = 0, Cesium.destroyObject(this) }, tt.prototype.isDestroyed = function () { return !1 }, tt.prototype.destroy = function () { var e = this.textures.length; for (let t = 0; t < e; t++) { let e = this.textures[t]; e.destroy() } return this.textures.length = 0, this.ambientColor = void 0, this.diffuseColor = void 0, this.specularColor = void 0, Cesium.destroyObject(this) }; var it = "attribute vec4 aPosition;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef VertexNormal\nattribute vec3 aNormal;\n#endif\n#ifdef Instance\nattribute float instanceId;\n#else\nattribute float batchId;\n#endif\n#ifdef USE_VertexWeight\nattribute float aVertexWeight;\n#endif\n#ifdef USE_TextureCoordMatrix\nattribute vec2 aTextureCoordMatrix;\n#endif\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nvarying vec4 vTexCoord;\nuniform mat4 uTexMatrix;\n#ifdef COMPUTE_TEXCOORD\nuniform float uTexture0Width;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\nvarying vec2 vIsRGBA;\n#endif\n#endif\n#ifdef TexCoord2\nattribute vec4 aTexCoord1;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef InstanceBim\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 secondary_colour;\nattribute vec4 uv6;\n#endif\n#ifdef InstancePipe\nattribute vec4 uv1;\nattribute vec4 uv2;\nattribute vec4 uv3;\nattribute vec4 uv4;\nattribute vec4 uv5;\nattribute vec4 uv6;\nattribute vec4 uv7;\nattribute vec4 secondary_colour;\nattribute vec4 uv9;\n#endif\nuniform vec4 uFillForeColor;\nuniform vec4 uSelectedColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\nvarying vec4 vColor;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nisRGBA = floor(nDel20);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid operation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor)\n{\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nvertexColor *= selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\n}\n#ifdef COMPRESS_TEXCOORD\n#ifdef TexCoord\nuniform vec2 decode_texCoord0_min;\n#endif\n#ifdef TexCoord2\nuniform vec2 decode_texCoord1_min;\n#endif\n#ifdef MeshOPT_Compress\nuniform vec3 decode_texCoord0_vNormConstant;\nuniform vec3 decode_texCoord1_vNormConstant;\n#else\nuniform float decode_texCoord0_normConstant;\nuniform float decode_texCoord1_normConstant;\n#endif\n#endif\n#ifdef COMPRESS_VERTEX\nuniform vec4 decode_position_min;\nuniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_NORMAL\nuniform float normal_rangeConstant;\n#endif\nvoid main()\n{\n#ifdef COMPRESS_VERTEX\nvec4 vertexPos = vec4(1.0);\nvertexPos = decode_position_min + vec4(aPosition.xyz, 1.0) * decode_position_normConstant;\n#else\nvec4 vertexPos = aPosition;\n#endif\n#ifdef TexCoord\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord0;\ntexCoord0.x = aTexCoord0.x * decode_texCoord0_vNormConstant.x;\ntexCoord0.y = aTexCoord0.y * decode_texCoord0_vNormConstant.y;\nvTexCoord.xy = decode_texCoord0_min + texCoord0.xy;\n#else\nvTexCoord.xy = decode_texCoord0_min.xy + aTexCoord0.xy * decode_texCoord0_normConstant;\n#endif\n#else\nvTexCoord.xy = aTexCoord0.xy;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.x = 0.0;\nvTexCoordTransform.x = aTexCoord0.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.x = aTextureCoordMatrix.x;\n#endif\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z, vIsRGBA.x);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\n#endif\n#ifdef TexCoord2\n#ifdef COMPRESS_TEXCOORD\n#ifdef MeshOPT_Compress\nvec2 texCoord1;\ntexCoord1.x = aTexCoord1.x * decode_texCoord1_vNormConstant.x;\ntexCoord1.y = aTexCoord1.y * decode_texCoord1_vNormConstant.y;\nvTexCoord.zw = decode_texCoord1_min + texCoord1.xy;\n#else\nvTexCoord.zw = decode_texCoord1_min.xy + aTexCoord1.xy * decode_texCoord1_normConstant;\n#endif\n#else\nvTexCoord.zw = aTexCoord1.xy;\n#endif\nvTexMatrix2 = vec4(0.0,0.0,1.0,0.0);\nvIsRGBA.y = 0.0;\nvTexCoordTransform.y = aTexCoord1.z;\n#ifdef USE_TextureCoordMatrix\nvTexCoordTransform.y = aTextureCoordMatrix.y;\n#endif\nif(vTexCoordTransform.y < -90000.0)\n{\nvTexMatrix2.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.y), vTexMatrix2.x, vTexMatrix2.y, vTexMatrix2.z, vIsRGBA.y);\nvTexMatrix2.w = log2(uTexture1Width * vTexMatrix.z);\n#endif\nvec4 vertexColor = uFillForeColor;\n#ifdef VertexColor\nvertexColor *= aColor;\n#endif\n#ifdef VertexNormal\nvec3 normal = aNormal;\n#ifdef COMPRESS_NORMAL\n#ifdef MeshOPT_Compress\nnormal.x = aNormal.x / 127.0;\nnormal.y = aNormal.y / 127.0;\nnormal.z = 1.0 - abs(normal.x) - abs(normal.y);\nnormal = normalize(normal);\n#else\nnormal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy;\n#endif\n#endif\n#endif\n#ifdef InstanceBim\nmat4 worldMatrix;\nworldMatrix[0] = uv2;\nworldMatrix[1] = uv3;\nworldMatrix[2] = uv4;\nworldMatrix[3] = vec4(0, 0, 0, 1);\nvertexPos = vec4(vertexPos.xyz,1.0) * worldMatrix;\nvertexColor *= secondary_colour;\n#endif\n#ifdef InstancePipe\nmat4 worldMatrix;\nmat4 worldMatrix0;\nmat4 worldMatrix1;\nvec4 worldPos0;\nvec4 worldPos1;\nworldMatrix0[0] = uv1;\nworldMatrix0[1] = uv2;\nworldMatrix0[2] = uv3;\nworldMatrix0[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nworldMatrix1[0] = uv4;\nworldMatrix1[1] = uv5;\nworldMatrix1[2] = uv6;\nworldMatrix1[3] = vec4( 0.0, 0.0, 0.0, 1.0 );\nvec4 realVertex = vec4(vertexPos.xyz, 1.0);\nrealVertex.x = realVertex.x * uv7.z;\nworldPos0 = realVertex * worldMatrix0;\nworldPos1 = realVertex * worldMatrix1;\nvertexColor *= secondary_colour;\n#ifdef TexCoord\nif(aTexCoord0.y > 0.5)\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.y, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos1;\nworldMatrix = worldMatrix1;\n}\nelse\n{\nvec4 tex4Vec = uTexMatrix * vec4(uv7.x, aTexCoord0.x, 0.0, 1.0);\nvTexCoord.xy = tex4Vec.xy;\nvertexPos = worldPos0;\nworldMatrix = worldMatrix0;\n}\n#endif\n#ifdef VertexNormal\nnormal.x = normal.x * uv7.z;\n#endif\n#endif\n#ifdef Instance\nfloat index = instanceId;\n#else\nfloat index = batchId;\n#endif\nvec4 operationType = batchTable_operation(index);\noperation(operationType, vec4(1.0), uSelectedColor, vertexColor);\nvSecondColor = batchTable_pickColor(index);\nvec4 positionMC = vec4(vertexPos.xyz, 1.0);\nvColor = vertexColor;\n#ifdef VertexNormal\nvNormalEC = czm_normal * normal;\n#endif\nvPositionMC = positionMC;\nvPositionEC = (czm_modelView * positionMC).xyz;\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n", ot = "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nuniform vec4 uDiffuseColor;\n#ifdef TexCoord\nvarying vec4 vTexCoord;\n#ifdef COMPUTE_TEXCOORD\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\nvarying vec2 vIsRGBA;\n#endif\n#endif\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\n#ifdef VertexNormal\nvarying vec3 vNormalEC;\n#endif\n#ifdef TexCoord2\nuniform sampler2D uTexture2;\nuniform float uTexture1Width;\nvarying vec4 vTexMatrix2;\n#endif\n#ifdef COMPUTE_TEXCOORD\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate, float isRGBA)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(isRGBA > 0.5)\n{\nvec2 rgbTexCoord;\nrgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5;\nrgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5;\ncolor = texture2D(curTexture, rgbTexCoord.xy, -10.0);\nvec2 vecAlphaTexCoord;\nvecAlphaTexCoord.x = rgbTexCoord.x;\nvecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5;\ncolor.a = texture2D(curTexture, vecAlphaTexCoord.xy, -10.0).r;\n}\nelse\n{\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nvec4 FColor = getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x);\n#ifdef TexCoord2\nfloat texTileWidth1 = vTexMatrix2.z * uTexture1Width;\nrealTexCoord = vec3(vTexCoord.zw, vTexCoordTransform.y);\nvec4 SColor = getTexColorForS3M(uTexture2, realTexCoord, texTileWidth1, vTexMatrix2.w, vTexMatrix2.z, vTexMatrix2.xy, vIsRGBA.y);\nSColor.r = clamp(SColor.r, 0.0, 1.0);\nSColor.g = clamp(SColor.g, 0.0, 1.0);\nSColor.b = clamp(SColor.b, 0.0, 1.0);\nreturn FColor * SColor;\n#else\nreturn FColor;\n#endif\n}\n#endif\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n#ifndef HDR\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\nreturn vec4(linearOut, srgbIn.a);\n#else\nreturn srgbIn;\n#endif\n}\nvec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR\nreturn pow(linearIn, vec3(1.0/2.2));\n#else\nreturn linearIn;\n#endif\n}\nvec3 applyTonemapping(vec3 linearIn)\n{\n#ifndef HDR\nreturn czm_acesTonemapping(linearIn);\n#else\nreturn linearIn;\n#endif\n}\nvec3 computeNormal(in vec3 oriVertex)\n{\nvec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z)));\nnormal = normalize(normal);\nreturn normal;\n}\nvoid main()\n{\nif(vColor.a < 0.1)\n{\ndiscard;\n}\nvec4 baseColorWithAlpha = vColor;\n#ifdef COMPUTE_TEXCOORD\nbaseColorWithAlpha *= SRGBtoLINEAR4(getTextureColor());\n#endif\nif(baseColorWithAlpha.a < 0.1)\n{\ndiscard;\n}\nvec3 normal = vec3(0.0);\n#ifdef VertexNormal\nnormal = normalize(vNormalEC);\n#endif\nnormal = length(normal) > 0.1 ? normal : computeNormal(vPositionMC.xyz);\nvec3 color = baseColorWithAlpha.rgb;\nvec3 dirVectorEC = normalize(czm_lightDirectionEC);\nfloat dotProduct = dot( normal, dirVectorEC );\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\ndirDiffuseWeight = dirDiffuseWeight * 0.5 + 0.5;\ncolor += color * uDiffuseColor.rgb * dirDiffuseWeight;\n#ifdef TexCoord\ncolor = LINEARtoSRGB(color);\n#endif\ngl_FragColor = vec4(color, baseColorWithAlpha.a);\n}\n"; function rt() { this.context = void 0, this.model = void 0, this.index = void 0 } function nt() { this.model = void 0, this.context = void 0, this.index = 0 } rt.prototype.set = function (e, t, i) { this.context = e, this.model = t, this.index = i }, rt.prototype.execute = function () { var e = this.context, t = this.index, i = this.model.vertexPackage; let o = i.vertexAttributes[t]; if (!Cesium.defined(o)) throw new Cesium.DeveloperError("attribute is null"); if (-1 !== i.instanceIndex && !Cesium.defined(this.model.instanceBuffer)) { if (!Cesium.defined(i.instanceBuffer)) throw new Cesium.DeveloperError("instance buffer is null"); this.model.instanceBuffer = Cesium.Buffer.createVertexBuffer({ context: e, typedArray: i.instanceBuffer, usage: Cesium.BufferUsage.STATIC_DRAW }) } 1 !== o.instanceDivisor || Cesium.defined(o.typedArray) ? Cesium.defined(o.vertexBuffer) || (o.vertexBuffer = Cesium.Buffer.createVertexBuffer({ context: e, typedArray: o.typedArray, usage: Cesium.BufferUsage.STATIC_DRAW }), o.typedArray = null, delete o.typedArray) : o.vertexBuffer = this.model.instanceBuffer }, nt.prototype.set = function (e, t, i) { this.model = t, this.context = e, this.index = i }, nt.prototype.execute = function () { var t = this.context; let i = this.model.arrIndexPackage[this.index]; var o = this.model.vertexPackage.verticesCount; if (!Cesium.defined(i)) throw new Cesium.DeveloperError("index package is null"); if (!Cesium.defined(i.indexBuffer)) { if (!Cesium.defined(i.indicesTypedArray)) throw new Cesium.DeveloperError("index buffer is null"); let e = Cesium.IndexDatatype.UNSIGNED_SHORT; (1 === i.indexType || 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 at = 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" }), st = Object.freeze({ SVC_Vertex: 1, SVC_Normal: 2, SVC_VertexColor: 4, SVC_SecondColor: 8, SVC_TexutreCoord: 16, SVC_TexutreCoordIsW: 32 }), lt = Object.freeze({ BIM: 17, PIPELINE: 29 }); function ct() { this.model = void 0, this.context = void 0 } function ut(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; t < i; t++)this.vertexBufferToCreate.enqueue(t); for (t = 0, i = this.arrIndexPackage.length; t < i; t++)this.indexBufferToCreate.enqueue(t); this.shaderProgramToCreate.enqueue(0), this.boundingVolume = e.boundingVolume, this.material = Cesium.defaultValue(e.material, new tt), this.geoName = e.geoName, this.modelMatrix = e.modelMatrix, this.geoMatrix = e.geoMatrix, this.invGeoMatrix = Cesium.Matrix4.inverse(this.geoMatrix, new Cesium.Matrix4), this.instanceCount = e.vertexPackage.instanceCount, this.attributeLocations = e.vertexPackage.attrLocation, this.shaderProgram = void 0, this.vertexArray = void 0, this.colorCommand = void 0, this.pickInfo = Cesium.defaultValue(e.pickInfo, {}), this.selectionInfoMap = new Cesium.AssociativeArray, this.batchTable = void 0, this.batchTableDirty = !1, this.idsOperationMap = new Cesium.AssociativeArray, this.pickColorIdentifier = "vSecondColor", this.createBoundingBoxForInstance(), this.ready = !1 } ct.prototype.set = function (e, t) { this.model = t, this.context = e }, ct.prototype.execute = function () { const e = this.context, t = this.model; var i = t.layer, o = t.vs, r = t.fs, n = t.attributeLocations, a = t.material, s = t.vertexPackage, o = t.batchTable ? t.batchTable.getVertexShaderCallback()(o) : o; void 0 === e.texturelod && (e.texturelod = Cesium.defaultValue(function (t, i) { var o = i.length; for (let e = 0; e < o; ++e) { var r = t.getExtension(i[e]); if (r) return r } }(e._gl, ["EXT_shader_texture_lod"]), !1)); let l = new Cesium.ShaderSource({ sources: [o] }), c = new Cesium.ShaderSource({ sources: [r] }); Cesium.defined(n.aNormal) && (l.defines.push(at.VertexNormal), c.defines.push(at.VertexNormal)), Cesium.defined(n.aColor) && l.defines.push(at.VertexColor), a && 0 < a.textures.length && (l.defines.push(at.COMPUTE_TEXCOORD), c.defines.push(at.COMPUTE_TEXCOORD)), a && 2 === a.textures.length && (l.defines.push(at.TexCoord2), c.defines.push(at.TexCoord2)), Cesium.defined(n.aTexCoord0) && (l.defines.push("TexCoord"), c.defines.push("TexCoord")), -1 < s.instanceIndex && l.defines.push(at.Instance), s.instanceMode === lt.BIM && l.defines.push(at.InstanceBim), s.instanceMode === lt.PIPELINE && l.defines.push(at.InstancePipe), Cesium.defined(s.compressOptions) && (((o = s.compressOptions) & st.SVC_Vertex) === st.SVC_Vertex && l.defines.push(at.COMPRESS_VERTEX), (o & st.SVC_Normal) === st.SVC_Normal && l.defines.push(at.COMPRESS_NORMAL), (o & st.SVC_VertexColor) === st.SVC_VertexColor && l.defines.push(at.COMPRESS_COLOR), (o & st.SVC_TexutreCoord) === st.SVC_TexutreCoord && l.defines.push(at.COMPRESS_TEXCOORD)), Cesium.defined(t.arrIndexPackage) && 0 < t.arrIndexPackage.length && 2 === t.arrIndexPackage[0].primitiveType && c.defines.push(at.UseLineColor), Cesium.defined(s.customVertexAttribute) && Cesium.defined(s.customVertexAttribute.TextureCoordMatrix) && l.defines.push("USE_TextureCoordMatrix"), Cesium.defined(s.customVertexAttribute) && Cesium.defined(s.customVertexAttribute.VertexWeight) && l.defines.push("USE_VertexWeight"), "MESHOPT" === i._vertexCompressionType && l.defines.push("MeshOPT_Compress"), t.shaderProgram = Cesium.ShaderProgram.fromCache({ context: e, vertexShaderSource: l, fragmentShaderSource: c, attributeLocations: n }) }; const ht = new rt, mt = new nt, dt = new ct; function pt(e) { ut.call(this, e), this.vs = it, this.fs = ot, this.useLineColor = !1 } ut.prototype.createBuffers = function (t) { { var i = this, o = t, r = i.layer.context; let e = i.vertexBufferToCreate; for (; e.length;) { var n = e.peek(); if (ht.set(r, i, n), !o.jobScheduler.execute(ht, Cesium.JobType.BUFFER)) break; e.dequeue() } } { var a = this, s = t, l = a.layer.context; let e = a.indexBufferToCreate; for (; e.length;) { var c = e.peek(); if (mt.set(l, a, c), !s.jobScheduler.execute(mt, Cesium.JobType.BUFFER)) break; e.dequeue() } } }, ut.prototype.createShaderProgram = function (t) { { var i = this, o = t, r = i.layer.context; let e = i.shaderProgramToCreate; for (; e.length && (e.peek(), dt.set(r, i), o.jobScheduler.execute(dt, Cesium.JobType.PROGRAM));)e.dequeue() } }, ut.prototype.createBatchTable = function (e) { var t = this; if (!Cesium.defined(t.batchTable) && t.pickInfo) { var i = t.layer.context; let e = []; e.push({ functionName: "batchTable_operation", componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 4 }, { functionName: "batchTable_pickColor", componentDatatype: Cesium.ComponentDatatype.UNSIGNED_BYTE, componentsPerAttribute: 4, normalize: !0 }); var o = t.pickInfo, o = Object.keys(o), o = 0 < t.instanceCount ? t.instanceCount : o.length; t.batchTable = new Cesium.BatchTable(i, e, o) } }, ut.prototype.createBoundingBoxForInstance = function () { var e, t, i = new Cesium.Cartesian3; const o = this.vertexPackage; Cesium.defined(o) && -1 !== o.instanceIndex && Cesium.defined(o.instanceBounds) && (e = o.instanceBounds, t = new Cesium.Cartesian3(e[0], e[1], e[2]), e = new Cesium.Cartesian3(e[3], e[4], e[5]), e = Cesium.Cartesian3.lerp(t, e, .5, i), i = Cesium.Cartesian3.distance(e, t), t = new Cesium.Cartesian3, Cesium.Matrix4.multiplyByPoint(this.modelMatrix, e, t), this.boundingVolume.center = t, this.boundingVolume.radius = i, o.instanceBounds = void 0) }, ut.prototype.initLayerSetting = function (e) { 0 < Object.keys(e._objsOperationList).length && this.updateObjsOperation(e._objsOperationList) }, ut.prototype.createPickIds = function () { let r = new Cesium.Cartesian4; var n = this.layer; const a = n.context, t = this.pickInfo; if (Cesium.defined(t)) { for (var s in t) t.hasOwnProperty(s) && this.selectionInfoMap.set(s, t[s]); let i = this.batchTable, o = this.selectionInfoMap, e = o._hash; for (var l in e) if (e.hasOwnProperty(l)) { var c = o.get(l); let e; var l = (e = Cesium.defined(e) ? e : a.createPickId({ primitive: n, id: l })).color; r.x = Cesium.Color.floatToByte(l.red), r.y = Cesium.Color.floatToByte(l.green), r.z = Cesium.Color.floatToByte(l.blue), r.w = Cesium.Color.floatToByte(l.alpha); let t = c.instanceIds; 0 < this.instanceCount ? t.map(function (e) { i.setBatchedAttribute(e, 1, r) }) : (l = c[0].batchId, i.setBatchedAttribute(l, 1, r)) } this.pickInfo = void 0 } }, ut.prototype.updateBatchTableAttributes = function () { let i = this; var o = this.idsOperationMap; for (let e = 0, t = o.length; e < t; e++) { let t = o.values[e]; t.dirty && (t.dirty = !1, 0 < this.instanceCount ? Array.isArray(t.instanceIds) && t.instanceIds.map(function (e) { i.batchTable.setBatchedAttribute(e, 0, t.operationValue) }) : Cesium.defined(t.batchId) && this.batchTable.setBatchedAttribute(t.batchId, 0, t.operationValue)) } }, ut.prototype.updateObjsOperation = function (e) { if (this.ready && !(this.selectionInfoMap.length < 1)) { let t = this.selectionInfoMap._hash; for (var i in t) if (t.hasOwnProperty(i)) { var o = e[i]; if (Cesium.defined(o)) { var r = t[i][0], n = r.batchId, r = r.instanceIds; let e = this.idsOperationMap.get(i); (e = Cesium.defined(e) ? e : { batchId: n, instanceIds: r, operationValue: new Cesium.Cartesian4, dirty: !0 }).dirty = !0, e.operationValue.x = 1 & e.operationValue.x | o, this.idsOperationMap.set(i, e), this.batchTableDirty = !0 } } } }, (pt.prototype = Object.create(ut.prototype)).constructor = ut, pt.prototype.createCommand = function () { if (!Cesium.defined(this.colorCommand) && 0 === this.vertexBufferToCreate.length && 0 === this.indexBufferToCreate.length && 0 === this.shaderProgramToCreate.length) { var i = this.layer, o = i.context, r = this.vertexPackage, n = this.arrIndexPackage, a = r.vertexAttributes; if (!(n.length < 1)) { var n = n[0], s = this.material; this.vertexArray = new Cesium.VertexArray({ context: o, attributes: a, indexBuffer: n.indexBuffer }); let e = Cesium.PrimitiveType.TRIANGLES; switch (n.primitiveType) { case 1: e = Cesium.PrimitiveType.POINTS; break; case 2: e = Cesium.PrimitiveType.LINES; break; case 4: e = Cesium.PrimitiveType.TRIANGLES }this.useLineColor = e === Cesium.PrimitiveType.LINES, this.colorCommand = new Cesium.DrawCommand({ primitiveType: e, modelMatrix: this.modelMatrix, boundingVolume: Cesium.BoundingSphere.clone(this.boundingVolume), pickId: this.pickColorIdentifier, vertexArray: this.vertexArray, shaderProgram: this.shaderProgram, pass: s.bTransparentSorting ? Cesium.Pass.TRANSLUCENT : Cesium.Pass.OPAQUE, renderState: s.bTransparentSorting ? Cesium.RenderState.fromCache({ cull: { enabled: !0 }, depthTest: { enabled: !0, func: Cesium.DepthFunction.LESS_OR_EQUAL }, blending: Cesium.BlendingState.ALPHA_BLEND }) : Cesium.RenderState.fromCache({ cull: { enabled: !1 }, depthTest: { enabled: !0, func: Cesium.DepthFunction.LESS_OR_EQUAL }, blending: Cesium.BlendingState.ALPHA_BLEND }), instanceCount: r.instanceCount }); let t = function (e, t, i) { const o = { uGeoMatrix: function () { return i.geoMatrix }, uTexMatrix: function () { return e.texMatrix }, uFillForeColor: function () { return i.useLineColor ? t.style3D.lineColor : t.style3D.fillForeColor }, uInverseGeoMatrix: function () { return i.invGeoMatrix }, uTexture: function () { return e.textures[0] }, uTexture2: function () { return e.textures[1] }, uTexture0Width: function () { return e.textures[0].width }, uTexture1Width: function () { return e.textures[1].width }, uDiffuseColor: function () { return e.diffuseColor }, uSelectedColor: function () { return t._selectedColor } }, r = i.vertexPackage; var n = r.compressOptions; return (n & st.SVC_Vertex) === st.SVC_Vertex && (o.decode_position_min = function () { return r.minVerticesValue }, o.decode_position_normConstant = function () { return r.vertCompressConstant }), (n & st.SVC_Normal) === st.SVC_Normal && (o.normal_rangeConstant = function () { return r.normalRangeConstant }), (n & st.SVC_TexutreCoord) === st.SVC_TexutreCoord && (0 < r.texCoordCompressConstant.length && (o.decode_texCoord0_min = function () { return r.minTexCoordValue[0] }, o.decode_texCoord0_normConstant = function () { return r.texCoordCompressConstant[0] }, o.decode_texCoord0_vNormConstant = function () { return r.texCoordCompressConstant[0] }), 1 < r.texCoordCompressConstant.length && (o.decode_texCoord1_min = function () { return r.minTexCoordValue[1] }, o.decode_texCoord1_normConstant = function () { return r.texCoordCompressConstant[1] }, o.decode_texCoord1_vNormConstant = function () { return r.texCoordCompressConstant[1] }), 2 < r.texCoordCompressConstant.length && (o.decode_texCoord2_min = function () { return r.minTexCoordValue[2] }, o.decode_texCoord2_normConstant = function () { return r.texCoordCompressConstant[2] }), 3 < r.texCoordCompressConstant.length && (o.decode_texCoord3_min = function () { return r.minTexCoordValue[3] }, o.decode_texCoord3_normConstant = function () { return r.texCoordCompressConstant[3] }), 4 < r.texCoordCompressConstant.length && (o.decode_texCoord4_min = function () { return r.minTexCoordValue[4] }, o.decode_texCoord4_normConstant = function () { return r.texCoordCompressConstant[4] }), 5 < r.texCoordCompressConstant.length && (o.decode_texCoord5_min = function () { return r.minTexCoordValue[5] }, o.decode_texCoord5_normConstant = function () { return r.texCoordCompressConstant[5] }), 6 < r.texCoordCompressConstant.length && (o.decode_texCoord6_min = function () { return r.minTexCoordValue[6] }, o.decode_texCoord6_normConstant = function () { return r.texCoordCompressConstant[6] }), 7 < r.texCoordCompressConstant.length && (o.decode_texCoord7_min = function () { return r.minTexCoordValue[7] }, o.decode_texCoord7_normConstant = function () { return r.texCoordCompressConstant[7] })), o }(s, i, this); this.batchTable && (t = this.batchTable.getUniformMapCallback()(t)), this.colorCommand.uniformMap = t, this.vertexPackage = void 0, this.arrIndexPackage = void 0, this.vs = void 0, this.fs = void 0, this.ready = !0 } } }, pt.prototype.update = function (e, t) { this.ready ? (this.batchTableDirty && (this.updateBatchTableAttributes(), this.batchTableDirty = !1), this.batchTable && this.batchTable.update(e), e.commandList.push(this.colorCommand)) : (this.createBatchTable(e), this.createPickIds(), this.createBuffers(e), this.createShaderProgram(e), this.createCommand(e), this.initLayerSetting(t)) }, pt.prototype.isDestroyed = function () { return !1 }, pt.prototype.destroy = function () { return this.shaderProgram = this.shaderProgram && !this.shaderProgram.isDestroyed() && this.shaderProgram.destroy(), this.vertexArray = this.vertexArray && !this.vertexArray.isDestroyed() && this.vertexArray.destroy(), this.material = this.material && !this.material.isDestroyed() && this.material.destroy(), this.batchTable = this.batchTable && !this.batchTable.isDestroyed() && this.batchTable.destroy(), this.colorCommand = void 0, this.vertexPackage = null, this.arrIndexPackage = null, this.modelMatrix = void 0, this.pickInfo = void 0, this.selectionInfoMap = void 0, this.vs = void 0, this.fs = void 0, Cesium.destroyObject(this) }; var gt = "attribute vec4 aPosition;\nattribute vec4 aColor;\n#ifdef TexCoord\nattribute vec4 aTexCoord0;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexMatrix;\nvarying vec4 vTexCoordTransform;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT4 = 1.0 / 16.0;\nconst float SHIFT_LEFT4 = 16.0;\nvoid getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale)\n{\nif(nZ <= 0.0)\n{\nreturn;\n}\nfloat nDel8 = floor(nZ * SHIFT_RIGHT8);\nfloat nDel16 = floor(nDel8 * SHIFT_RIGHT8);\nfloat nDel20 = floor(nDel16 * SHIFT_RIGHT4);\nYTran = nZ - nDel8 * SHIFT_LEFT8;\nXTran = nDel8 - nDel16 * SHIFT_LEFT8;\nfloat nLevel = nDel16 - nDel20 * SHIFT_LEFT4;\nscale = 1.0 / pow(2.0, nLevel);\n}\nvoid main()\n{\n#ifdef TexCoord\nvTexCoord.xy = aTexCoord0.xy;\nvTexMatrix = vec4(0.0,0.0,1.0,0.0);\nvTexCoordTransform.x = aTexCoord0.z;\nif(vTexCoordTransform.x < -90000.0)\n{\nvTexMatrix.z = -1.0;\n}\ngetTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z);\nvTexMatrix.w = log2(uTexture0Width * vTexMatrix.z);\n#endif\nvec4 vertexPos = aPosition;\n#ifdef VertexColor\nvColor = aColor;\n#endif\ngl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0);\n}\n", ft = "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef TexCoord\nuniform sampler2D uTexture;\nuniform float uTexture0Width;\nvarying vec4 vTexCoord;\nvarying vec4 vTexCoordTransform;\nvarying vec4 vTexMatrix;\n#endif\n#ifdef VertexColor\nvarying vec4 vColor;\n#endif\n#ifdef TexCoord\nvoid calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate)\n{\nvec4 color = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\ncalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\ncalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n}\nreturn color;\n}\nvec4 getTextureColor()\n{\nif(vTexMatrix.z < 0.0)\n{\nreturn vec4(1.0);\n}\nfloat texTileWidth0 = vTexMatrix.z * uTexture0Width;\nvec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x);\nreturn getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy);\n}\n#endif\nvoid main()\n{\nvec4 baseColorWithAlpha = vec4(1.0);\n#ifdef VertexColor\nvec4 baseColorWithAlpha = vColor;\n#endif\n#ifdef TexCoord\nbaseColorWithAlpha *= getTextureColor();\n#endif\ngl_FragColor = baseColorWithAlpha;\n}\n"; function _t(e) { ut.call(this, e), this.vs = gt, this.fs = ft } (_t.prototype = Object.create(ut.prototype)).constructor = ut, _t.prototype.createCommand = function () { var e, t, i, o, r, n, a; Cesium.defined(this.colorCommand) || 0 !== this.vertexBufferToCreate.length || 0 !== this.indexBufferToCreate.length || 0 !== this.shaderProgramToCreate.length || (e = this.layer.context, t = this.vertexPackage, o = this.arrIndexPackage, i = t.vertexAttributes, o.length < 1 || (o = o[0], r = this.material, this.vertexArray = new Cesium.VertexArray({ context: e, attributes: i, indexBuffer: o.indexBuffer }), this.colorCommand = new Cesium.DrawCommand({ primitiveType: o.primitiveType, modelMatrix: this.modelMatrix, boundingVolume: Cesium.BoundingSphere.clone(this.boundingVolume), vertexArray: this.vertexArray, shaderProgram: this.shaderProgram, pass: r.bTransparentSorting ? Cesium.Pass.TRANSLUCENT : Cesium.Pass.OPAQUE, renderState: Cesium.RenderState.fromCache({ cull: { enabled: !0 }, depthTest: { enabled: !0, func: Cesium.DepthFunction.LESS_OR_EQUAL }, blending: Cesium.BlendingState.ALPHA_BLEND }), instanceCount: t.instanceCount }), this.colorCommand.uniformMap = (n = r, a = this, { uGeoMatrix: function () { return a.geoMatrix }, uInverseGeoMatrix: function () { return a.invGeoMatrix }, uTexture: function () { return n.textures[0] }, uTexture0Width: function () { return n.textures[0].width } }), this.vertexPackage = void 0, this.arrIndexPackage = void 0, this.vs = void 0, this.fs = void 0, this.ready = !0)) }, _t.prototype.update = function (e, t) { this.ready ? e.commandList.push(this.colorCommand) : (this.createBuffers(e), this.createShaderProgram(e), this.createCommand(e), this.initLayerSetting(t)) }, _t.prototype.isDestroyed = function () { return !1 }, _t.prototype.destroy = function () { return this.shaderProgram = this.shaderProgram && !this.shaderProgram.isDestroyed() && this.shaderProgram.destroy(), this.vertexArray = this.vertexArray && !this.vertexArray.isDestroyed() && this.vertexArray.destroy(), this.material = this.material && !this.material.isDestroyed() && this.material.destroy(), this.colorCommand = void 0, this.vertexPackage = null, this.arrIndexPackage = null, this.modelMatrix = void 0, this.pickInfo = void 0, this.selectionInfoMap = void 0, this.vs = void 0, this.fs = void 0, Cesium.destroyObject(this) }; let Ct = { OSGBFile: function (e) { return new _t(e) }, OSGBCacheFile: function (e) { return new pt(e) } }; function yt() { } function vt(a, e) { if (-1 < a.instanceIndex) { var s = a; var l = new Cesium.Cartesian3; let e = new Cesium.BoundingSphere; var s = s.instanceBounds; return Cesium.defined(s) && (u = new Cesium.Cartesian3(s[0], s[1], s[2]), s = new Cesium.Carteisan3(s[3], s[4], s[5]), s = new Cesium.Cartesian3.lerp(u, s, .5, l), l = new Cesium.Cartesian3.distance(s, u), e.center = s, e.radius = l), e } { var c = a; var u = e; s = new Cesium.BoundingSphere; let t = new Cesium.Cartesian3; var l = c.vertexAttributes[0], h = l.componentsPerAttribute, m = Cesium.defined(c.compressOptions) && (c.compressOptions & st.SVC_Vertex) === st.SVC_Vertex; let i = 1, o, r, n = (r = m ? (i = c.vertCompressConstant, o = new Cesium.Cartesian3(c.minVerticesValue.x, c.minVerticesValue.y, c.minVerticesValue.z), new Uint16Array(l.typedArray.buffer, l.typedArray.byteOffset, l.typedArray.byteLength / 2)) : new Float32Array(l.typedArray.buffer, l.typedArray.byteOffset, l.typedArray.byteLength / 4), []); for (let e = 0; e < c.verticesCount; e++)Cesium.Cartesian3.fromArray(r, h * e, t), m && (t = Cesium.Cartesian3.multiplyByScalar(t, i, t), t = Cesium.Cartesian3.add(t, o, t)), n.push(Cesium.Cartesian3.clone(t)); return Cesium.BoundingSphere.fromPoints(n, s), Cesium.BoundingSphere.transform(s, u, s), n.length = 0, s; return } } function wt(o, r, n) { var i = r.groupNode; let a = []; for (let t = 0, e = i.pageLods.length; t < e; t++) { let e = {}; var s, l = i.pageLods[t]; e.rangeMode = l.rangeMode, e.rangeDataList = l.childTile, e.rangeList = l.rangeList, l.obb ? e.boundingVolume = { box: { center: l.obb.obbCenter, xExtent: l.obb.xExtent, yExtent: l.obb.yExtent, zExtent: l.obb.zExtent } } : (m = l.boundingSphere.center, s = l.boundingSphere.radius, "" !== e.rangeDataList ? e.boundingVolume = { sphere: { center: new Cesium.Cartesian3(m.x, m.y, m.z), radius: s } } : e.isLeafTile = !0); { c = void 0; u = void 0; h = void 0; m = void 0; d = void 0; p = void 0; g = void 0; w = void 0; b = void 0; T = void 0; C = void 0; f = void 0; y = void 0; _ = void 0; C = void 0; v = void 0; y = void 0; S = void 0; E = void 0; P = void 0; x = void 0; D = void 0; I = void 0; A = void 0; L = void 0; var c = o; var u = r; var h = n; var m = l; var d = e; var p = new Cesium.Matrix3; let i = {}; var g = m.geodes; for (let t = 0, e = g.length; t < e; t++) { var f, _, C, y, v, w = g[t], b = w.matrix, T = Cesium.Matrix4.multiply(c.modelMatrix, b, new Cesium.Matrix4); let e; Cesium.defined(d.boundingVolume) && (d.boundingVolume.sphere ? (e = new Cesium.BoundingSphere(d.boundingVolume.sphere.center, d.boundingVolume.sphere.radius), Cesium.BoundingSphere.transform(e, c.modelMatrix, e)) : d.boundingVolume.box && (C = d.boundingVolume.box, f = new Cesium.Cartesian3(C.center.x, C.center.y, C.center.z), y = new Cesium.Cartesian4(C.xExtent.x, C.xExtent.y, C.xExtent.z, 0), _ = new Cesium.Cartesian4(C.yExtent.x, C.yExtent.y, C.yExtent.z, 0), C = new Cesium.Cartesian4(C.zExtent.x, C.zExtent.y, C.zExtent.z, 0), v = new Cesium.Matrix3, Cesium.Matrix3.setColumn(v, 0, y, v), Cesium.Matrix3.setColumn(v, 1, _, v), Cesium.Matrix3.setColumn(v, 2, C, v), f = Cesium.Matrix4.multiplyByPoint(c.modelMatrix, f, f), y = Cesium.Matrix4.getMatrix3(c.modelMatrix, p), v = Cesium.Matrix3.multiply(y, v, v), e = new Cesium.OrientedBoundingBox(f, v))); var S = w.skeletonNames; for (let t = 0, e = S.length; t < e; t++) { var E = S[t], P = u.geoPackage[E], x = P.vertexPackage, D = P.arrIndexPackage, I = P.pickInfo; let e; 0 < D.length && (e = h[D[0].materialCode]); var A = vt(x, T); i[E] = Ct[c.fileType]({ layer: c, vertexPackage: x, arrIndexPackage: D, pickInfo: I, modelMatrix: T, geoMatrix: b, boundingVolume: A, material: e, edgeGeometry: P.edgeGeometry, geoName: E }) } } if (!(Object.keys(i).length < 1)) { if (!Cesium.defined(d.boundingVolume)) { let e = []; for (var L in i) i.hasOwnProperty(L) && e.push(i[L].boundingVolume); d.boundingVolume = { sphere: Cesium.BoundingSphere.fromBoundingSpheres(e) } } d.geoMap = i } } Cesium.defined(e.geoMap) && a.push(e) } return a } yt.parse = function (e, t, i) { if (Cesium.defined(t)) return wt(e, t, function (o, r, n) { let a = {}; var s = r.materials.material; for (let e = 0, t = s.length; e < t; e++) { var l = s[e].material, c = l.id; let i = new tt; a[c] = i; var c = l.ambient, c = (i.ambientColor = new Cesium.Color(c.r, c.g, c.b, c.a), l.diffuse), c = (i.diffuseColor = new Cesium.Color(c.r, c.g, c.b, c.a), l.specular), u = (i.specularColor = new Cesium.Color(c.r, c.g, c.b, c.a), i.shininess = l.shininess, i.bTransparentSorting = l.transparentsorting, l.textureunitstates), h = u.length; for (let e = 0; e < h; e++) { var m = u[e].textureunitstate, d = m.id, p = 0 === m.addressmode.u ? Cesium.TextureWrap.REPEAT : Cesium.TextureWrap.CLAMP_TO_EDGE, g = 0 === m.addressmode.v ? Cesium.TextureWrap.REPEAT : Cesium.TextureWrap.CLAMP_TO_EDGE; i.texMatrix = Cesium.Matrix4.unpack(m.texmodmatrix); let t = r.texturePackage[d]; if (Cesium.defined(t) && 0 < t.arrayBufferView.byteLength) { t.wrapS = p, t.wrapT = g; m = n.fileName + d; let e = o.textureCache.getTexture(m); Cesium.defined(e) || (Cesium.PixelFormat.isCompressedFormat(t.internalFormat) ? e = new et(o, d, t) : (d = Cesium.Math.isPowerOfTwo(t.width) && Cesium.Math.isPowerOfTwo(t.height), e = new Cesium.Texture({ context: o, source: { width: t.width, height: t.height, arrayBufferView: t.arrayBufferView }, sampler: new Cesium.Sampler({ minificationFilter: d ? o._gl.LINEAR_MIPMAP_LINEAR : o._gl.LINEAR, wrapS: p, wrapT: g }) }), d && e.generateMipmap(Cesium.MipmapHint.NICEST)), o.textureCache.addTexture(m, e)), i.textures.push(e) } } } return a }(e.context, t, i)) }; var bt = Object.freeze({ Distance: 0, Pixel: 1, GeometryError: 2 }); function Tt(e, t, i, o, r, n) { this.layer = e, this.parent = t; var a = o.replace(/\\/g, "/"); this.fileExtension = Cesium.getExtensionFromUri(o), this.relativePath = function (e, t) { e = e.replace(/\+/g, "%2B"); let i = t._basePath, o = -1 < t._basePath.indexOf("realspace"); if (!o) return e; var t = i.replace(/(.*realspace)/, ""), r = i.replace(/\/rest\/realspace/g, "").replace(t, ""); return r + "/rest/realspace" + t + "data/path/" + e.replace(/^\.*/, "").replace(/^\//, "").replace(/\/$/, "") }(a, e), this.relativePath = this.relativePath.replace("data/path/data/path", "data/path"), this.fileName = o, this.isLeafTile = 0 === r, this.isRootTile = !1, this.boundingVolume = this.createBoundingVolume(i, e.modelMatrix); let s = Cesium.Resource.createIfNeeded(e._baseResource); if (Cesium.defined(t)) this.baseUri = t.baseUri; else { let e = new Cesium.Resource(a); this.baseUri = e.getBaseUri() } this.contentResource = s.getDerivedResource({ url: this.relativePath }), this.serverKey = Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()), this.request = void 0, this.cacheNode = void 0, this.distanceToCamera = 0, this.centerZDepth = 0, this.pixel = 0, this.depth = t ? t.depth + 1 : 0, this.visibilityPlaneMask = 0, this.visible = !1, this.children = [], this.renderEntities = [], this.lodRangeData = Cesium.defaultValue(r, 16), this.lodRangeMode = Cesium.defaultValue(n, bt.Pixel), this.contentState = this.isLeafTile ? Ce.READY : Ce.UNLOADED, this.touchedFrame = 0, this.requestedFrame = 0, this.processFrame = 0, this.selectedFrame = 0, this.updatedVisibilityFrame = 0, this.foveatedFactor = 0, this.priority = 0, (this.priorityHolder = this).wasMinPriorityChild = !1, this.shouldSelect = !1, this.selected = !1, this.finalResolution = !0, this.refines = !1 } function St(e) { return e.boundingVolume } function Et(e, t, i) { e._cache.add(t), Me.s3tc = e.context.s3tc, Me.pvrtc = e.context.pvrtc, Me.etc1 = e.context.etc1; i = Me.parseBuffer(i); if (i) { e = yt.parse(e, i, t); { var a = t; var s = e; let i = a.layer; var l = s.length; let o = Number.MAX_VALUE, r = 0, n = bt.Pixel; for (let t = 0; t < l; t++) { var c, u = s[t], h = u.boundingVolume, m = u.rangeDataList, m = a.baseUri + m, d = u.rangeList, p = u.rangeMode; let e = u.geoMap; for (c in 0 !== d && (u = new Tt(i, a, h, m, d, p), a.children.push(u), i._cache.add(u)), e) e.hasOwnProperty(c) && a.renderEntities.push(e[c]); o = Math.min(o, d), r = Math.max(r, d), n = p } a.isRootTile && (a.lodRangeData = n === bt.Pixel ? o / 2 : 2 * r, a.lodRangeMode = n) } t.selectedFrame = 0, t.contentState = Ce.READY, t.contentReadyPromise.resolve(i) } else t.contentState = Ce.FAILED, t.contentReadyPromise.reject() } function Pt(e, t, i) { return Math.max(Cesium.Math.normalize(e, t, i) - Cesium.Math.EPSILON7, 0) } function xt(e, t, i) { e *= Math.pow(10, t); return parseInt(e) * Math.pow(10, i) } function Dt() { this._stack = [] } function It(e, t) { return 0 === t.distanceToCamera && 0 === e.distanceToCamera ? t.centerZDepth - e.centerZDepth : t.distanceToCamera - e.distanceToCamera } function At(e, t, i) { t.requestedFrame !== i.frameNumber && t.contentState === Ce.UNLOADED && (e._requestTiles.push(t), t.requestedFrame = i.frameNumber) } function Lt(e, t, i) { t.processFrame === i.frameNumber || t.contentState !== Ce.READY || t.renderable || (t.processFrame = i.frameNumber, e._processTiles.push(t)) } function Mt(e, t, i) { t.touchedFrame !== i.frameNumber && (e._cache.touch(t), t.touchedFrame = i.frameNumber) } function Rt(e, t, i) { var o, r; o = o = t, e = e = e, (r = r = i).updatedVisibilityFrame !== e.frameNumber && (r.updatedVisibilityFrame = e.frameNumber, r.updateVisibility(e, o)), i.wasMinPriorityChild = !1, i.priorityHolder = i, r = i, (e = t)._maximumPriority.distance = Math.max(r.distanceToCamera, e._maximumPriority.distance), e._minimumPriority.distance = Math.min(r.distanceToCamera, e._minimumPriority.distance), e._maximumPriority.depth = Math.max(r.depth, e._maximumPriority.depth), e._minimumPriority.depth = Math.min(r.depth, e._minimumPriority.depth), e._maximumPriority.foveatedFactor = Math.max(r.foveatedFactor, e._maximumPriority.foveatedFactor), e._minimumPriority.foveatedFactor = Math.min(r.foveatedFactor, e._minimumPriority.foveatedFactor), e._maximumPriority.pixel = Math.max(r.pixel, e._maximumPriority.pixel), e._minimumPriority.pixel = Math.min(r.pixel, e._minimumPriority.pixel), i.shouldSelect = !1, i.selected = !1 } function Ot(i, o, r) { for (; o.length;) { let e = o.pop(); var n = e.parent, n = !Cesium.defined(n) || n.refines; let t = !1; a = i; a = !(t = 0 !== (s = e).children.length && (s.lodRangeMode === bt.Pixel ? s.pixel / a.lodRangeScale > s.lodRangeData : s.lodRangeMode === bt.GeometryError ? 16 < s.geometryError : s.distanceToCamera * a.lodRangeScale < s.lodRangeData) ? function (e, i, t, o) { let r, n = i.children; var a = n.length; for (r = 0; r < a; ++r)Rt(o, e, n[r]); n.sort(It); let s = !0, l = !1, c = -1, u = Number.MAX_VALUE; for (r = 0; r < a; ++r) { var h = n[r], h = (h.foveatedFactor < u && (c = r, u = h.foveatedFactor), h.visible ? (t.push(h), l = !0) : (At(e, h, o), Mt(e, h, o), Lt(e, h, o)), h.renderable); s = s && h } if (l || (s = !1), -1 !== c) { let e = n[c], t = (e.wasMinPriorityChild = !0, (i.wasMinPriorityChild || i.isRootTile) && u <= i.priorityHolder.foveatedFactor ? i.priorityHolder : i); for (t.foveatedFactor = Math.min(e.foveatedFactor, t.foveatedFactor), t.distanceToCamera = Math.min(e.distanceToCamera, t.distanceToCamera), r = 0; r < a; ++r) { let e = n[r]; e.priorityHolder = t } } return s }(i, e, o, r) && n : t) && n; At(i, e, r), Lt(i, e, r), a && (s = i, n = e, a = r, n.selectedFrame !== a.frameNumber && n.renderable && (s._selectedTiles.push(n), n.selectedFrame = a.frameNumber)), Mt(i, e, r), e.refines = t } var a, s } function Bt() { this._list = new Cesium.DoublyLinkedList, this._sentinel = this._list.add(), this._trimTiles = !1 } Object.defineProperties(Tt.prototype, { renderable: { get: function () { var t = this.renderEntities, i = t.length; if (0 === i) return !1; for (let e = 0; e < i; e++)if (!t[e].ready) return !1; return !0 } } }), Tt.prototype.createBoundingVolume = function (e, t) { return Cesium.defined(e.sphere) ? (s = e.sphere, l = t, c = new Cesium.Cartesian3, u = Cesium.Cartesian3.clone(s.center), s = s.radius, u = Cesium.Matrix4.multiplyByPoint(l, u, u), l = Cesium.Matrix4.getScale(l, c), s *= Cesium.Cartesian3.maximumComponent(l), new Cesium.TileBoundingSphere(u, s)) : Cesium.defined(e.box) ? (c = e.box, l = t, u = new Cesium.Matrix3, s = new Cesium.Cartesian3, Cesium.defined(c.center) ? (n = new Cesium.Cartesian3(c.center.x, c.center.y, c.center.z), r = new Cesium.Cartesian4(c.xExtent.x, c.xExtent.y, c.xExtent.z, 0), i = new Cesium.Cartesian4(c.yExtent.x, c.yExtent.y, c.yExtent.z, 0), o = new Cesium.Cartesian4(c.zExtent.x, c.zExtent.y, c.zExtent.z, 0), a = new Cesium.Matrix3, Cesium.Matrix3.setColumn(a, 0, r, a), Cesium.Matrix3.setColumn(a, 1, i, a), Cesium.Matrix3.setColumn(a, 2, o, a), n = Cesium.Matrix4.multiplyByPoint(l, n, n), r = Cesium.Matrix4.getMatrix3(l, u), a = Cesium.Matrix3.multiply(r, a, a), new Cesium.TileOrientedBoundingBox(n, a)) : (i = new Cesium.Cartesian3(c.min.x, c.min.y, c.min.z), Cesium.Matrix4.multiplyByPoint(l, i, i), o = new Cesium.Cartesian3(c.max.x, c.max.y, c.max.z), Cesium.Matrix4.multiplyByPoint(l, o, o), r = (u = Cesium.BoundingSphere.fromCornerPoints(i, o, new Cesium.BoundingSphere)).center, n = u.radius, a = Cesium.Matrix4.getScale(l, s), n *= Cesium.Cartesian3.maximumComponent(a), new Cesium.TileBoundingSphere(r, n))) : void 0; var i, o, r, n, a, s, l, c, u }, Tt.prototype.canTraverse = function () { return 0 !== this.children.length && !this.isLeafTile && (!Cesium.defined(this.lodRangeData) || this.pixel > this.lodRangeData) }, Tt.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 }, Tt.prototype.getGeometryError = function (e) { var t = e.camera, i = this.layer.context.drawingBufferHeight; return this.lodRangeData * i / (this.boundingVolume.distanceToCamera(e) * t.frustum.sseDenominator) }, Tt.prototype.distanceToTile = function (e) { let t = St(this); return t.distanceToCamera(e) }, Tt.prototype.distanceToTileCenter = function (e) { var t = new Cesium.Cartesian3, i = St(this).boundingVolume, i = Cesium.Cartesian3.subtract(i.center, e.camera.positionWC, t); return Cesium.Cartesian3.dot(e.camera.directionWC, i) }, Tt.prototype.visibility = function (e, t) { var i = St(this); return e.cullingVolume.computeVisibilityWithPlaneMask(i, t) }, Tt.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 (o < Cesium.Cartesian3.magnitude(r) ? (r = Cesium.Cartesian3.normalize(r, e), r = Cesium.Cartesian3.multiplyByScalar(r, o, e), o = Cesium.Cartesian3.add(i.center, r, e), i = Cesium.Cartesian3.subtract(o, t.positionWC, e), r = Cesium.Cartesian3.normalize(i, e), n.foveatedFactor = 1 - Math.abs(Cesium.Cartesian3.dot(t.directionWC, r))) : n.foveatedFactor = 0)) }, Tt.prototype.requestContent = function () { let t = this, i = this.layer, e = this.contentResource.clone(), o = new Cesium.Request({ throttle: !0, throttleByServer: !0, type: Cesium.RequestType.TILES3D, priorityFunction: function () { return r.priority }, serverKey: (r = this).serverKey }); var r, n; this.request = o, e.request = o; let a = e.fetchArrayBuffer(); if (!Cesium.defined(a)) return !1; this.contentState = Ce.LOADING, this.contentReadyPromise = Cesium.when.defer(); n = this; let s = function (e) { n.contentState = Ce.FAILED, n.contentReadyPromise && n.contentReadyPromise.reject(e) }; return a.then(function (e) { t.isDestroyed() ? s() : Et(i, t, e) }).catch(function (e) { o.state === Cesium.RequestState.CANCELLED ? t.contentState = Ce.UNLOADED : s(e) }), !0 }, Tt.prototype.updatePriority = function (e, t) { var i = e._minimumPriority, e = e._maximumPriority, o = xt(Pt(this.foveatedFactor, i.foveatedFactor, e.foveatedFactor), 4, 4), r = xt(1 - Pt(this.pixel, i.pixel, e.pixel), 4, 8), i = Pt(this.distanceToCamera, i.distance, e.distance), e = xt(i, 4, 0); this.priority = o + r + e }, Tt.prototype.update = function (i, o) { for (let e = 0, t = this.renderEntities.length; e < t; e++)this.renderEntities[e].update(i, o) }, Tt.prototype.free = function () { this.contentState = Ce.UNLOADED, this.request = void 0, this.cacheNode = void 0, this.priorityHolder = void 0, this.contentReadyPromise = void 0, this.priorityHolder = void 0; for (let e = 0, t = this.renderEntities.length; e < t; e++)this.renderEntities[e].destroy(); this.renderEntities.length = 0, this.children.length = 0 }, Tt.prototype.isDestroyed = function () { return !1 }, Tt.prototype.destroy = function () { return this.free(), Cesium.destroyObject(this) }, Dt.prototype.schedule = function (e, i) { var t = this._stack, o = e, r = t, n = i; for (let e = r.length = 0, t = o._rootTiles.length; e < t; e++) { var a = o._rootTiles[e]; Rt(n, o, a), a.visible && r.push(a) } Ot(e, t, i); { var s = e, l = i; let t = s._requestTiles; var c = t.length; for (let e = 0; e < c; ++e)t[e].updatePriority(s, l) } }, Bt.prototype.reset = function () { this._list.splice(this._list.tail, this._sentinel) }, Bt.prototype.touch = function (e) { e = e.cacheNode; Cesium.defined(e) && this._list.splice(this._sentinel, e) }, Bt.prototype.add = function (e) { Cesium.defined(e.cacheNode) || (e.cacheNode = this._list.add(e)) }, Bt.prototype.unloadTile = function (e, t, i) { var o = t.cacheNode; Cesium.defined(o) && (this._list.remove(o), t.cacheNode = void 0, i(e, t)) }, Bt.prototype.unloadTiles = function (e, t) { var i = this._trimTiles, o = (this._trimTiles = !1, this._list), r = 1024 * e.maximumMemoryUsage * 1024, n = this._sentinel; let a = o.head; for (; a && a !== n && (e.totalMemoryUsageInBytes > r || i);) { var s = a.item; a = a.next, this.unloadTile(e, s, t) } }, Bt.prototype.trim = function () { this._trimTiles = !0 }; var Vt = Object.freeze({ RESET: 0, SetColor: 1, SELECTED: 2, HIDE: 4, OFFSET: 8, CLIP: 16, BLOOM: 32, ALL: 255 }); function Ft() { 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 Ht(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 Dt, this._selections = [], this._objsOperationList = {}, this._requestTiles = [], this._processTiles = [], this._selectedTiles = [], this._cache = new Bt, this._maximumMemoryUsage = -1, this._totalMemoryUsageInBytes = 0, this._vertexCompressionType = void 0, this._style3D = new Ft, 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 Gt(e, t) { e.updateObjsOperation(t.ids, t) } function kt(e, t) { return e.priority - t.priority } function Nt(e, t) { t.free() } function jt(e) { e._cache.unloadTiles(e, Nt) } Object.defineProperties(Ft.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(Ht.prototype, { ready: { get: function () { return 0 < this._rootTiles.length } }, readyPromise: { get: function () { return this._readyPromise } }, rectangle: { get: function () { return this._rectangle } }, visibleDistanceMax: { get: function () { return this._visibleDistanceMax }, set: function (e) { Cesium.Check.typeOf.number("max visible distance", e), this._visibleDistanceMax = e } }, visibleDistanceMin: { get: function () { return this._visibleDistanceMin }, set: function (e) { Cesium.Check.typeOf.number("min visible distance", e), this._visibleDistanceMin = e } }, lodRangeScale: { get: function () { return this._lodRangeScale }, set: function (e) { Cesium.Check.typeOf.number("set layer lod range scale", e), this._lodRangeScale = e } }, totalMemoryUsageInBytes: { get: function () { return this._totalMemoryUsageInBytes }, set: function (e) { this._totalMemoryUsageInBytes = e } }, maximumMemoryUsage: { get: function () { return this._maximumMemoryUsage }, set: function (e) { this._maximumMemoryUsage = e } }, style3D: { get: function () { return this._style3D }, set: function (e) { this._style3D = e } } }), Ht.prototype.loadConfig = function (t, s) { let l = this; Cesium.when(t).then(function (e) { let t = Cesium.Resource.createIfNeeded(e); return e = t.getBaseUri(!0), l._url = t.url, l._basePath = e, l._baseResource = t, s ? t.fetchXML() : t.fetchJson() }).then(function (e) { var t = (e = s ? _e(e) : e).extensions, t = (t ? (l.fileType = t["s3m:FileType"], l._vertexCompressionType = t["s3m:VertexCompressionType"]) : l.fileType = e.FileType, e.position || e.Position), i = t.x || t.X, o = t.y || t.Y, t = t.z || t.Z, r = (l._position = Cesium.Cartesian3.fromDegrees(i, o, t), l.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(l._position), l.invModelMatrix = Cesium.Matrix4.inverse(l.modelMatrix, l.invModelMatrix), e.heightRange ? (l._minHeight = e.heightRange.min, l._maxHeight = e.heightRange.max) : e.HeightRange && (l._minHeight = e.HeightRange.MinHeight, l._maxHeight = e.HeightRange.MaxHeight), e.geoBounds ? l._rectangle = Cesium.Rectangle.fromDegrees(e.geoBounds.left, e.geoBounds.bottom, e.geoBounds.right, e.geoBounds.top) : l.viewPosition = Cesium.Cartesian3.fromDegrees(i, o, l._maxHeight), e.wDescript && (t = e.wDescript.range, l._minWValue = t.min, l._maxWValue = t.max), e.tiles || e.rootTiles || e.OSGFiles && e.OSGFiles.Files); for (let e = 0, t = r.length; e < t; e++) { var n = r[e]; if (n) { var a = n.url || n.FileName; let e = { box: n.boundingbox }, t = (n.BoundingSphere && (e.sphere = { radius: n.BoundingSphere.Radius, center: new Cesium.Cartesian3(n.BoundingSphere.CenterX, n.BoundingSphere.CenterY, n.BoundingSphere.CenterZ) }), new Tt(l, void 0, e, a)); t.isRootTile = !0, l._cache.add(t), l._rootTiles.push(t) } } l._readyPromise.resolve(l) }).otherwise(function (e) { s ? l._readyPromise.reject(e) : l.loadConfig(t, !0) }) }, Ht.prototype._tranverseRenderEntity = function (i, o) { let r = []; for (let e = 0, t = this._rootTiles.length; e < t; e++) { var n = this._rootTiles[e]; r.push(n) } for (; r.length;) { var a = r.pop(); for (let e = 0, t = a.renderEntities.length; e < t; e++) { var s = a.renderEntities[e]; s.ready && o(s, i) } for (let e = 0, t = a.children.length; e < t; e++)r.push(a.children[e]) } }, Ht.prototype._updateObjsOperation = function (e) { this._tranverseRenderEntity({ ids: e }, Gt) }, Ht.prototype._setObjsOperationType = function (i, o) { Cesium.Check.defined("set Objs Operation ids", i), Cesium.Check.defined("set Objs Operation operationType", o), Array.isArray(i) || (i = [i]); let r = new Cesium.AssociativeArray; for (let e = 0, t = i.length; e < t; e++) { var n, a = i[e]; Cesium.defined(a) && ((n = Cesium.defaultValue(this._objsOperationList[a], 0)) !== o && (n |= o, this._objsOperationList[a] = n, r.set(a, n))) } 0 < r.length && this._updateObjsOperation(r._hash) }, Ht.prototype._removeObjsOperationType = function (i, e) { Cesium.Check.defined("set Objs Operation ids", i), Array.isArray(i) || (i = [i]); var o = Vt.ALL ^ e; let r = new Cesium.AssociativeArray; for (let e = 0, t = i.length; e < t; e++) { var n = i[e], a = this._objsOperationList[n]; Cesium.defined(a) && ((a &= o) === Vt.RESET ? delete this._objsOperationList[n] : this._objsOperationList[n] = a, r.set(n, a)) } 0 < r.length && this._updateObjsOperation(r._hash) }, Ht.prototype.releaseSelection = function () { this._selections.length < 1 || (this._removeObjsOperationType(this._selections, Vt.SELECTED), this._selections.length = 0) }, Ht.prototype.setSelection = function (e) { Cesium.Check.defined("setSelection ids", e), Array.isArray(e) || (e = [e]), this.releaseSelection(), this._selections = this._selections.concat(e), this._setObjsOperationType(e, Vt.SELECTED) }, Ht.prototype.prePassesUpdate = function (e) { this.ready && e.newFrame && (this._cache.reset(), this._requestTiles.length = 0, this._processTiles.length = 0, this._selectedTiles.length = 0) }, Ht.prototype.postPassesUpdate = function (e) { this.ready && jt(this) }, Ht.prototype.update = function (e) { if (this.ready && this.show) { this._schuduler.schedule(this, e); { let i = this._requestTiles; var o = i.length; i.sort(kt); for (let t = 0; t < o; ++t) { let e = i[t]; e.requestContent() } } var i = this, r = e, n = i._processTiles, a = n.length; for (let t = 0; t < a; ++t) { let e = n[t]; e.update(r, i) } { var s = this, l = e; let t = s._selectedTiles; var c = t.length; for (let e = 0; e < c; e++)t[e].update(l, s) } } }, Ht.prototype.isDestroyed = function () { return !1 }, Ht.prototype.deleteObject = function () { this.scene.primitives.remove(this) }, Ht.prototype.destroy = function () { return this._cache.reset(), jt(this), this._rootTiles.length = 0, this._requestTiles.length = 0, this._processTiles.length = 0, this._selectedTiles.length = 0, Cesium.destroyObject(this) }, Ht.prototype.setVisibility = function (e) { this.show = e }; var Ut = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nif(plus && st.s < time && time - st.s <= 0.1){\nmaterial.alpha = 1.0 - (time - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){\nmaterial.alpha = ((1.0-time) - st.s) / 0.1;\nif(material.alpha < 0.3){\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}else{\nmaterial.diffuse = lightSpotColor.rgb;\n}\n}else{\nmaterial.alpha = 0.3;\nmaterial.diffuse = color.rgb;\n}\nreturn material;\n}\n"; let zt = new Map; function f(e) { this._viewer = e } f.prototype.defaultValue = X, f.prototype.createRandomId = function () { return (1e7 * Math.random()).toString(16).substr(0, 4) + "-" + (new Date).getTime() + "-" + Math.random().toString().substr(2, 5) }, f.prototype.mouse = function (e, t, i) { e.style.cursor = 1 == t ? "url(" + i + "),auto" : "default" }, f.prototype.CreateTooltip = function (e = {}, t, i) { (o = "object" == typeof e ? e : o) && o.origin && ("center" === o.origin && (r = 15, n = -12), "top" === o.origin && (r = 15, n = -44), "bottom" !== o.origin) || (r = 15, n = 20), o && o.color ? ("white" === o.color && (a = "background: rgba(255, 255, 255, 0.8);color: black;"), "black" === o.color && (a = "background: rgba(0, 0, 0, 0.5);color: white;"), "yellow" === o.color && (a = "color: black;background-color: #ffcc33;border: 1px solid white;")) : a = "background: rgba(0, 0, 0, 0.5);color: white;", s = o && o.id ? "toolTip" + o.id : "toolTip"; var o, r, n, a, s, l, c = (this._viewer ? this._viewer.container : document).querySelector("#" + s); return c || (l = document.createElement("div"), $(".cesium-viewer").append(l), l = '<div id="' + s + '" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;' + a + '"></div>', $(".cesium-viewer").append(l), c = document.getElementById(s)), i ? (c.innerHTML = e, c.style.left = t.x + r + "px", c.style.top = t.y + n + "px", c.style.display = "block") : c.style.display = "none", { tooltip: c, 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" } } }, f.prototype.getWMTSData = function (c, t) { ge(c.url + "?service=WMTS&request=GetCapabilities").then(o => { let r = o.xmlObj, e, n, a, s = {}; if (c.gisserverTMS) e = _e(r), n = e.Contents && e.Contents.Layer; else { let i = r.getElementsByTagName("Layer"); for (let e = 0, t; e < i.length; e++)if ((t = i[e].getElementsByTagName("ows:Identifier")) && t[0] && t[0].innerHTML === c.layer) { r = i[e]; break } n = _e(r) } if (n) { let e = n.TileMatrixSetLink, t = n.WGS84BoundingBox; var l; t && (o = t.LowerCorner.split(" "), l = t.UpperCorner.split(" "), a = Cesium.BoundingSphere.fromPoints([Cesium.Cartesian3.fromDegrees(o[0], o[1]), Cesium.Cartesian3.fromDegrees(l[0], l[1])])); let i; if (c.gisserverTMS) i = e; else { let t = c.srs || "EPSG:4326"; i = e.filter(e => e.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 }) }) }, f.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) }, f.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] }, f.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 } }, f.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;"), s || (e = '<div id="' + a + '" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:黑体;color:white;font-weight: bolder;font-size: 14px;' + e + '"></div>', $(i.container).append(e), s = document.getElementById(a)), t.addX || 0), c = t.addY || 0, u = this; function h() { if (n) { if (void 0 !== t.far || void 0 !== t.near) { var e = u.getPointToCameraDistance(i, n); if (e > t.far) return void (s.style.display = "none"); if (e < t.near) return void (s.style.display = "none"); s.style.display = "block" } e = i.scene.cartesianToCanvasCoordinates(n); e && (o = -s.offsetWidth / 2 + l, r = -s.offsetHeight + c, s.style.left = e.x + o + "px", s.style.top = e.y + r + "px") } } return t.closeBtn && (s.className = "resultToolTip resultToolTipClose", s.onclick = () => { 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 + c, 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() } } }, f.prototype.CombineEcharts = function (e, t, i) { return this._CombineEcharts || (this._CombineEcharts = new re(e)), this._CombineEcharts.setOption(t, i) }, f.prototype.getHeatmapData = function (t, i, o = 600) { let r = []; for (let e = 0; e < o; e++) { var n = Math.random() * (t.east - t.west) + t.west, a = Math.random() * (t.north - t.south) + t.south, s = i.value || Math.random() * (i.max - i.min) + i.min; r.push({ x: n, y: a, value: s }) } return r }, f.prototype.pickFromRay = function (e, t, i, o = []) { if (!t.equals(i)) return i = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3), new Cesium.Cartesian3), t = new Cesium.Ray(t, i), e.scene.pickFromRay(t, o) }, f.prototype.openLocalFile = function (e = {}) { let o = document.createElement("input"); o.accept = e.accept, o.type = "file", e.multiple && (o.multiple = "multiple"), o.onchange = function () { if ("function" == typeof e.callback && o.files.length) if (e.multiple) { let t = [], i = []; for (let e = 0; e < o.files.length; e++)t.push(URL.createObjectURL(o.files[e])), i.push(o.files[e]); e.callback(t, i) } else e.callback(URL.createObjectURL(o.files[0]), o.files[0]) }, o.click() }, f.prototype.openShapeFile = function (i, o) { this.openLocalFile({ multiple: !0, accept: ".shp,.dbf", callback: (r, 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文件") }) } }) }, f.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)) }, f.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 < t * (r.length - 1) ? n++ : n = 0, r[Math.floor(n / t) === r.length - 1 ? 0 : Math.floor(n / t)]) : e }, !1) }, f.prototype.isDOM = function (e) { return "object" == typeof HTMLElement ? e instanceof HTMLElement : e && "object" == typeof e && 1 === e.nodeType && "string" == typeof e.nodeName }, f.prototype.getJSON = function (e, t) { const i = new XMLHttpRequest; i.responseType = "json", i.open("get", e, !0), i.onload = function () { if (!(200 <= i.status && i.status < 300)) throw new Error(i.statusText); t(i.response) }, i.send() }, f.prototype.getPositionFromWKT = function (e) { let t = e + "!", n, a = []; return -1 < t.indexOf("MULTIPOLYGON") ? (n = (n = (n = t.replace("MULTIPOLYGON(", "")).replace(")!", "")).split(")),((")).forEach((e, t) => { 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 < t.indexOf("POLYGON") && (n = (n = (n = t.replace("POLYGON(", "")).replace(")!", "")).split("),(")).forEach((e, t) => { 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 }, f.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) } }, f.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 }, f.prototype.isClockwise = function (e) { e = Cesium_turf.lineString(e); return Cesium_turf.booleanClockwise(e) }, f.prototype.saveAs = function (e, t) { if (!window.saveAs) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/FileSaver.js") } saveAs(e, t) }, f.prototype.getEntityProp = function (e) { var t = e.properties && e.properties.getValue(); return { id: e.id, properties: t } }, f.prototype.getEntityPropValue = function (e, t) { e = e.properties && e.properties.getValue(); return -1 < t.indexOf("[") && -1 < t.indexOf("]") && (t = t.replace("[", "").replace("]", "")), e && e[t] }, f.prototype.setheight = function (e, t) { e = Cesium.Cartographic.fromCartesian(e); return Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t) }, f.prototype.setpolylineheight = function (e, t) { let i = []; return e.forEach(function (e) { e = Cesium.Cartographic.fromCartesian(e); i.push(Cesium.Cartesian3.fromRadians(e.longitude, e.latitude, t)) }), i }, f.prototype.StyleContrastGeoJson = function (e, t) { var i = { color: t.Color.WHITE, pixelSize: 1, outlineColor: t.Color.BLACK, outlineWidth: 0, show: !0, distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, o = { id: "my label", text: "", font: "30px sans-serif", fillColor: t.Color.WHITE, outlineColor: t.Color.WHITE, outlineWidth: "10", scale: 1, distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, r = { show: !0, scale: 1, width: void 0, height: void 0, pixelOffset: void 0, color: t.Color.WHITE, image: "", distanceDisplayCondition: new t.DistanceDisplayCondition(0, 999999999) }, n = { positions: [], arcType: t.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: t.Color.RED, height: 30 }, a = { height: 0, heightReference: t.HeightReference.NONE, show: !0, fill: !0, material: t.Color.WHITE, outline: !1, outlineColor: t.Color.BLACK, outlineWidth: 1, stRotation: 0, granularity: t.Math.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, shadows: t.ShadowMode.ENABLED, clampToGround: !0 }, s = (this.isnull(e.near) && (e.near = 0), this.isnull(e.far) && (e.far = 999999999), parseFloat(e.near)), l = parseFloat(e.far); return delete e.near, delete e.far, null != e.point && (e.point = this.extend(i, e.point, !0), e.point.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.label && (e.label = this.extend(o, e.label, !0), e.label.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.billboard && (e.billboard = this.extend(r, e.billboard, !0), e.billboard.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.polyline && (e.polyline = this.extend(n, e.polyline, !0), e.polyline.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), null != e.polygon && (e.polygon = this.extend(a, e.polygon, !0), e.polygon.distanceDisplayCondition = new t.DistanceDisplayCondition(s, l)), e }, f.prototype.getCatesian3FromPX = function (e, t, i, o) { var r, n = t.scene.pick(e), a = t.scene.drillPick(e), s = null; if (o) { for (var l = 0; l < a.length; l++)if (a[l].id._id != (o && o[0] && o[0].id) && a[l].id._id != (o && o[1] && o[1].id)) { s = a[l].id; break } } else s = n; if (t.scene.pickPositionSupported && i.defined(s)) r = t.scene.pickPosition(e); else { n = t.camera.getPickRay(e); if (!n) return; r = t.scene.globe.pick(n, t.scene) } return r }, f.prototype.StyleContrast = function (e, t, i) { var o = { text: "", font: " 30px sans-serif", style: i.LabelStyle.FILL_AND_OUTLINE, fillColor: i.Color.WHITE, outlineColor: i.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new i.Color(.165, .165, .165, .8), backgroundPadding: new i.Cartesian2(7, 5), scale: 1, horizontalOrigin: i.HorizontalOrigin.CENTER, verticalOrigin: i.VerticalOrigin.CENTER, eyeOffset: i.Cartesian3.ZERO, pixelOffset: i.Cartesian2.ZERO, heightReference: i.HeightReference.NONE, scaleByDistance: void 0, distanceDisplayCondition: void 0 }, r = { show: !0, position: i.Cartesian3.ZERO, pixelOffset: i.Cartesian2.ZERO, eyeOffset: i.Cartesian3.ZERO, heightReference: i.HeightReference.NONE, horizontalOrigin: i.HorizontalOrigin.CENTER, verticalOrigin: i.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: i.Color.WHITE, rotation: 0, alignedAxis: i.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, n = { show: !0, pixelSize: 1, heightReference: i.HeightReference.NONE, color: i.WHITE, outlineColor: i.Color.BLACK, outlineWidth: 1, scaleByDistance: void 0, translucencyByDistance: void 0, distanceDisplayCondition: void 0 }, a = { positions: [], width: 5, material: i.Color.ALICEBLUE, arcType: i.ArcType.GEODESIC }, s = { polygonHierarchy: new i.PolygonHierarchy(i.Cartesian3.fromDegreesArray([-72, 40, -70, 35, -75, 30, -70, 30, -68, 40])), height: 0, extrudedHeight: 0, material: "rgba(245, 20, 20, 0.91)" }, l = (this.isnull(t.near) && (t.near = 0), this.isnull(t.far) && (t.far = 999999999), parseFloat(t.near)), c = parseFloat(t.far); return delete t.near, delete t.far, t.distanceDisplayCondition = new i.DistanceDisplayCondition(l, c), "lable" == e ? t = this.extend(o, t, !0) : "billboard" == e ? t = this.extend(r, t, !0) : "point" == e ? t = this.extend(n, t, !0) : "polyline" == e ? t = this.extend(a, t, !0) : "polygon" == e && (t = this.extend(s, t, !0)), t }, f.prototype.createPolyline = function (e, t, i, o) { var r; return -1 == t ? (r = new o.PolylineGeometry(e), new o.GeometryInstance({ id: i, geometry: r })) : (r = new o.GroundPolylineGeometry(e), new o.GeometryInstance({ geometry: r, id: i })) }, f.prototype.createPolygon = function (e, t, i, o) { var r = e.material, n = new o.PolygonGeometry(e); return delete e.material, new o.GeometryInstance({ id: i, geometry: n, attributes: { color: new o.ColorGeometryInstanceAttribute.fromColor(r) } }) }, f.prototype.coordinate = function (e, t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? this.coordinate(e, t[i]) : e.push(t[i]); return e }, f.prototype.Analysis = function (e, t) { var i; return /^\[/.test(e) && /\]$/.test(e) && (i = e.replace(/\[/, "").replace(/\]/, ""), null != t.properties[i] && (e = t.properties[i])), e }, f.prototype.unique = function (e) { for (var t = [], i = 0; i < e.length; i++)-1 === t.indexOf(e[i]) && t.push(e[i]); return t }, f.prototype.extend = function (e, t, i = !1, o = !1) { for (var r in t) o ? e.hasOwnProperty(r) && (e[r] = t[r]) : e.hasOwnProperty(r) && !i || (e[r] = t[r]); return e }, f.prototype.setPositionOffset = (e, t, i) => { e = Cesium.Transforms.headingPitchRollToFixedFrame(e, i || new Cesium.HeadingPitchRoll), i = new Cesium.Cartesian3(0, 0, 0); return Cesium.Matrix4.multiplyByPoint(e, t, i), i }, f.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 }, f.prototype.trackedEntity = function (n, a, e = {}) {
        let u = { type: "tracked", heading: 0, pitch: -45, distance: 1e3, minDistance: 0 }; Object.assign(u, e); let h, m, d; if (u.tooltip) {
            u.tooltip = Object.assign({ innerHTML: "", drag: !1, near: 0, far: 1e3, addX: 0, addY: 0 }, u.tooltip); e = `<div id="trackedTooltip${a.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;"><div class="trackedTooltipContainer"></div></div>`; if ($(n.container).append(e), h = document.getElementById("trackedTooltip" + a.id), (m = h.firstElementChild).innerHTML = u.tooltip.innerHTML, m.style.left = u.tooltip.addX + "px", m.style.top = u.tooltip.addY + "px", m.style.position = "relative", u.tooltip.drag) {
                (d = document.createElement("div")).className = "trackedTooltip-arrow", h.appendChild(d); let n, a, s, l, c = (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 < t ? 90 : -90, l = `rotate(${i}deg)` }; c(u.tooltip.addX, u.tooltip.addY), d.style.cssText = `
                position: absolute;
                bottom: ${s};
                left: ${a};
@@ -12,7 +16,15 @@
                height: 0px;
                transform: ${l};
                border-top: 2px dashed #f00;
            `,m.style.pointerEvents="all",m.addEventListener("mousedown",function(e){let t=e.pageX-m.offsetLeft,i=e.pageY-m.offsetTop,o,r;document.onmousemove=e=>{o=e.pageX-t,r=e.pageY-i,m.style.left=o+"px",m.style.top=r+"px",c(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(),u.start&&"function"==typeof u.start&&u.start();let s=new Cesium.ScreenSpaceEventHandler(n.scene.canvas),l;if("setView"===u.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(u.heading),pitch:Cesium.Math.toRadians(u.pitch)}}),n.scene.camera.moveBackward(u.distance),u.tooltip){u.distance<=u.tooltip.far&&u.distance>=u.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"}u.position=e,u.update&&"function"==typeof u.update&&u.update()},n.scene.preRender.addEventListener(l);let t,i,o,r;s.setInputAction(e=>{t={position:e.position,heading:u.heading,pitch:u.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,u.heading=t.heading+o/8,u.pitch=t.pitch-r/6)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(e=>{u.distance-=e*u.distance/1e3,u.distance<u.minDistance&&(u.distance=u.minDistance)},Cesium.ScreenSpaceEventType.WHEEL)}else u.viewFrom&&(a.viewFrom=u.viewFrom),n.trackedEntity=a;return s.setInputAction(e=>{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,u.end&&"function"==typeof u.end&&u.end()},u.destroy=this.endTrackedEntity,u.updataTooltip=e=>{m.innerHTML=u.tooltip.innerHTML=e},u},f.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))},f.prototype.isnull=function(e){return null==e||""===e},f.prototype.getuid=function(){return this.uuid(8,16)},f.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},f.prototype.customGeometry=function(t){if(t.scale)for(let e=0;e<t.position.length-2;e+=3)t.position[e]*=t.scale[0],t.position[e+1]*=t.scale[1],t.position[e+2]*=t.scale[2];return new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t.position}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t.st})},indices:t.indices,primitiveType:t.grid?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,boundingSphere:t.boundingSphere})},f.prototype.getLevel=function(e){let t=0,i=e.scene.globe._surface._tilesToRender;return i&&i.forEach(e=>{e.level>t&&(t=e.level)}),t},f.prototype.getViewRectangle=function(e){e=e.camera.computeViewRectangle();return this.toDegreesRectangle(e)},f.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},f.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},f.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 Ht&&(e.primitive._selections.length?e.primitive.releaseSelection():e.primitive.setSelection(e.id)))},remove(){this.changeOtherHighlight(),i.selected=[]},destroy(){e.scene.postProcessStages.remove(i)}}},f.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}}},f.prototype.uuid=function(e,t){var i,o,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],n=[];if(t=t||r.length,e)for(i=0;i<e;i++)n[i]=r[0|Math.random()*t];else for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",i=0;i<36;i++)n[i]||(o=0|16*Math.random(),n[i]=r[19==i?3&o|8:o]);return n.join("")},f.prototype.Shaders=function(e){var t="";return"VSHADER_SOURCE "==e?t="attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nuniform mat4 u_MvpMatrix;\nvarying vec2 v_TexCoord;\nvoid main(){\ngl_Position = u_MvpMatrix * a_Position;\nv_TexCoord = a_TexCoord;\n}\n":"TRIANGLE_FSHADER_SOURCE"==e?t="#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec4 v_Color;\nvoid main() {\ngl_FragColor = v_Color;\n'}\n":"TRIANGLE_VSHADER_SOURCE"==e?t="attribute vec4 a_Position;\nattribute vec4 a_Normal;\nuniform mat4 u_MvpMatrix;\nuniform mat4 u_NormalMatrix;\nvarying vec4 v_Color;\nvoid main() {\nvec3 lightDirection = vec3(0.0, 0.0, 1.0);\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\ngl_Position = u_MvpMatrix * a_Position;\nvec3 normal = normalize(vec3(u_NormalMatrix * a_Normal));\nfloat nDotL = max(dot(normal, lightDirection), 0.0);\nv_Color = vec4(color.rgb * nDotL, color.a);\n}\n":"vertexShaderSource"==e?t="attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute vec4 color;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_color = color;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n":"fragmentShaderSource"==e&&(t="varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\n\r\nvec4 czm_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n    diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}void main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nvec4 color = czm_gammaCorrect(v_color);\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nczm_material material = czm_getDefaultMaterial(materialInput);\r\nmaterial.diffuse = color.rgb;\r\nmaterial.alpha = color.a;\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n"),t},f.prototype.isHtmlColor=function(e){return/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)},f.prototype.isUrl=function(e){return!this.isnull(e)&&/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.test(e)},f.prototype.dateTimespan=function(){return(new Date).toTimeString()},f.prototype.getPointFromTwoPointCenter=function(e,t,i){var o,r,n,a,s,l=this.getSpaceDistancem(e,Cesium);if(!(l<t))return n=e[0],e=e[1],n=Cesium.Cartographic.fromCartesian(n),o=Cesium.Math.toDegrees(n.longitude),r=Cesium.Math.toDegrees(n.latitude),n=n.height,e=Cesium.Cartographic.fromCartesian(e),a=Cesium.Math.toDegrees(e.longitude),s=Cesium.Math.toDegrees(e.latitude),e=e.height,l=parseFloat(l/t),t=Cesium.Math.lerp(o,a,1/l)-o,a=Cesium.Math.lerp(r,s,1/l)-r,s=Cesium.Math.lerp(n,e,1/l)-n,Cesium.Cartesian3.fromDegrees(o+t,r+a,i||n+s)},f.prototype.getSpaceDistance=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic,a=(a.setEndPoints(r,n),a.surfaceDistance);i+=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return 1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},f.prototype.getSpaceDistancem=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic,a=(a.setEndPoints(r,n),a.surfaceDistance);i+=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return i.toFixed(2)},f.prototype.getHorizontalDistance=function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n),i+=a.surfaceDistance}return i=1e3<=i?(i/1e3).toFixed(2)+"千米":i.toFixed(2)+"米"},f.prototype.getPointsInPolygon=function(o,r=50,e=!0){if(!(o.length<3)){o.push(o[0]);var t=Cesium_turf.lineString(o),t=Cesium_turf.bbox(t),t=Cesium_turf.pointGrid(t,r,{units:"meters"}),n=Cesium_turf.polygon([o]);let i=Cesium_turf.pointsWithinPolygon(t,n);if(e)for(let e=0;e<o.length-1;e++){var a=Cesium_turf.lineString([o[e],o[e+1]]),s={units:"meters"},l=Cesium_turf.length(a,s);let t;for(let e=r;;e+=r){1;{if(!(e<=l)){t=Cesium_turf.along(a,l,s),i.features.push(t);break}t=Cesium_turf.along(a,e,s),i.features.push(t)}}}return i}},f.prototype.tinFromPoints=function(e,t={}){let{polygon:r,getArea:n}=t,i=Cesium_turf.tin(e),a=0;return i&&i.features&&i.features.forEach(e=>{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}},f.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{area:t=n?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()},f.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},f.prototype.computeCircle=function(t){let i=zt.get(t);if(!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)))}zt.set(t,i)}return i},f.prototype.getArea=function(t,c,i){if(!(t.length<3)){let r=Array.concat(t,[t[0]]);var u=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(c[a],c[s]),t=this.getdistance(c[s],c[l]),i=this.getdistance(c[a],c[l]),o=(e+t+i)/2;u+=Math.sqrt((o-e)*(o-t)*(o-i)*o)}),u=i?u:u<1e6?u.toFixed(2)+"平方米":(u/1e6).toFixed(2)+"平方千米"}},f.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))},f.prototype.Angle=function(e,t,i){e=this.Bearing(t,e)-this.Bearing(t,i);return e<0&&(e+=360),e},f.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},f.prototype.getHeight=function(e,t){try{var i;return 1<e.length?(i=t.Cartographic.fromCartesian(e[0]),((t.Cartographic.fromCartesian(e[1]).height-i.height)/1e3).toFixed(2)):0}catch(e){console.log(e)}},f.prototype.getPmfx=function(e,t,i,o,r,n){var a={gcs:[],min:99999,max:0,juli:0,cys:t},s=this.getSpaceDistancem(e,o),s=(a.juli=s,0!=i&&(t=parseInt(s/i)),a.cys=t,e[0]),i=e[e.length-1],e=o.Cartographic.fromCartesian(s),l=o.Math.toDegrees(e.longitude),c=o.Math.toDegrees(e.latitude),s=(e.height,o.Cartographic.fromCartesian(i)),i=o.Math.toDegrees(s.longitude),u=o.Math.toDegrees(s.latitude),h=(s.height,t),m=o.Math.lerp(l,i,1/h)-l,d=o.Math.lerp(c,u,1/h)-c,p=[],g=[];p.push(e);for(var f=0;f<h;f++){var _=l+(f+1)*m,C=c+(f+1)*d,_=o.Cartesian3.fromDegrees(_,C);p.push(o.Cartographic.fromCartesian(_))}var y=this;this.getHeightsFromLonLat(r,p).then(e=>{if(e){g=e;e=!1;for(!0!==r.scene.globe.depthTestAgainstTerrain&&(e=r.scene.globe.depthTestAgainstTerrain=!0),f=0;f<g.length;f++){var t=y.get3DTileOrPrimitivesHeights(p[f],r),t=(void 0!==t&&(g[f]=t),g[f].toFixed(2));parseFloat(t)<parseFloat(a.min)&&(a.min=parseFloat(t)),parseFloat(t)>parseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}e&&(r.scene.globe.depthTestAgainstTerrain=!1),""!=n&&null!=n&&"function"==typeof n&&n(a)}})},f.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<m.length-1;e++){var l=n.getSpaceDistancem([m[e],m[e+1]],d),l=parseFloat(l);a.juli+=l,0!=i&&(t=parseInt(l/i)),s.push(t),a.cys+=t}let c=()=>{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,c=d.Math.lerp(n,o,1/s)-n;0===t&&p.push(i);for(let e=0;e<s;e++){var u=r+(e+1)*l,h=n+(e+1)*c,u=d.Cartesian3.fromDegrees(u,h);p.push(d.Cartographic.fromCartesian(u))}}),p.push(d.Cartographic.fromCartesian(m[m.length-1]));let i=[];a.allPoint=p,this.getHeightsFromLonLat(o,p).then(e=>{if(e){i=e;e=o.scene.globe.depthTestAgainstTerrain;o.scene.globe.depthTestAgainstTerrain=!0;for(let e=0;e<i.length;e++){var t=n.get3DTileOrPrimitivesHeights(p[e],o),t=(void 0!==t&&(i[e]=t),i[e].toFixed(2));parseFloat(t)<parseFloat(a.min)&&(a.min=parseFloat(t)),parseFloat(t)>parseFloat(a.max)&&(a.max=parseFloat(t)),a.gcs.push(t)}o.scene.globe.depthTestAgainstTerrain=e,r&&"function"==typeof r&&r(a)}})};1e3<a.cys?layuiLayer&&layuiLayer.msg("当前采样点数过多,是否继续分析?",{time:0,btn:["继续","取消"],btnAlign:"c",yes:e=>{layuiLayer.close(e),setTimeout(()=>{c()},10)},btn2:()=>{r&&"function"==typeof r&&r(a)}}):setTimeout(()=>{c()},10)},f.prototype.get3DTileOrPrimitivesHeights=function(e,t){return t.scene.sampleHeight(e)},f.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)})},f.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 c=(o-t)/6;if(90==o){for(var u=1;u<=5;u++)n.push((t+u*c)/90);n.push(1),n.forEach(function(e,t){l.addColorStop(e,i[t])})}else{for(u=1;u<=5;u++)n.push((t+u*c)/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},f.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)),c=Math.pow(r,4),u=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*u+4*h)+Math.pow(e,6)/720*r*s*d*(61-58*r*r+c+270*u-330*r*r*u),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+c+14*u-58*u*l);return new o.Cartesian2(h,t)},f.prototype.to_Radian=function(e){return e*Math.PI/180},f.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))},f.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))},f.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<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic,a=(a.setEndPoints(r,n),a.surfaceDistance);i+=Math.sqrt(Math.pow(a,2)+Math.pow(n.height-r.height,2))}return i}([e,t],i)),e=(parseFloat(function(e,t){for(var i=0,o=0;o<e.length-1;o++){var r=t.Cartographic.fromCartesian(e[o]),n=t.Cartographic.fromCartesian(e[o+1]),a=new t.EllipsoidGeodesic;a.setEndPoints(r,n),i+=a.surfaceDistance}return i}([e,r],i)),parseFloat(function(e,t){try{var i;return 1<e.length?(i=t.Cartographic.fromCartesian(e[0]),t.Cartographic.fromCartesian(e[1]).height-i.height):0}catch(e){console.log(e)}}([r,t],i)));return 180*Math.asin(e/o)/3.14},f.prototype.TwoPointAzimuth=function(e,t,i,o){function r(e){return e*Math.PI/180}var n=0,a=Math.round(.5+36e4*t),s=Math.round(.5+36e4*o),l=Math.round(.5+36e4*e),c=Math.round(.5+36e4*i);return t=r(t),e=r(e),o=r(o),i=r(i),a===s&&l===c||(l===c?s<a&&(n=180):(t=Math.acos(Math.sin(o)*Math.sin(t)+Math.cos(o)*Math.cos(t)*Math.cos(i-e)),n=180*Math.asin(Math.cos(o)*Math.sin(i-e)/Math.sin(t))/Math.PI,a<s&&l<c||(s<a&&c<l||s<a&&l<c?n=180-n:a<s&&c<l&&(n+=360)))),n},f.prototype.twoPointsHeadingPitchRoll=function(e,t,i){let o=new Cesium.Camera(e.scene);o.position=t,o.direction=Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),o.up=Cesium.Cartesian3.normalize(t,new Cesium.Cartesian3);var e=Cesium.Cartesian3.distance(t,i),i=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i,t,new Cesium.Cartesian3),new Cesium.Cartesian3),{heading:t,pitch:i,roll:r}=(o.direction=i,o.frustum.near=0,o.frustum.far=e,o);return o=null,{heading:t,pitch:i,roll:r,radius:e}},f.prototype.ThreePointAzimuth=function(e,t,i,o){var r=Math.PI/180,n=180/Math.PI,e=o.Cartographic.fromCartesian(e),a=o.Cartographic.fromCartesian(t),s=o.Cartographic.fromCartesian(i);function l(e,t){var i=e.latitude*r,e=e.longitude*r,o=t.latitude*r,t=t.longitude*r,i=-Math.atan2(Math.sin(e-t)*Math.cos(o),Math.cos(i)*Math.sin(o)-Math.sin(i)*Math.cos(o)*Math.cos(e-t));return i<0&&(i+=2*Math.PI),i*=n}t=o.Cartesian3.fromDegrees(o.Math.toDegrees(a.longitude),o.Math.toDegrees(a.latitude),e.height),i=o.Cartesian3.fromDegrees(o.Math.toDegrees(s.longitude),o.Math.toDegrees(s.latitude),e.height);a=o.Cartographic.fromCartesian(t),s=o.Cartographic.fromCartesian(i);return t=s,(i=l(o=a,i=e)-l(o,t))<0&&(i+=360),i},f.prototype.setDepthTest=function(e,t){"open"===e&&void 0===this.defaultDepthTest?(this.defaultDepthTest=!!t.scene.globe.depthTestAgainstTerrain,t.scene.globe.depthTestAgainstTerrain=!0):"close"===e&&void 0!==this.defaultDepthTest&&(t.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0)},f.prototype.setImageMaterialProperty=function(e,t,i,o){this.id=o;var n=this,o=document.createElement("canvas"),r=(o.id=this.id+"-a",o.width=700,o.height=100,document.createElement("canvas")),o=(r.id=this.id+"-b",r.width=700,r.height=100,document.body.appendChild(o),document.body.appendChild(r),e&&(n.images=e),new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),o=i.getContext("2d"),r=new Image;return r.src=n.images,o.clearRect(0,0,700,100),r.onload=function(){n.i<=700?(o.drawImage(r,n.i,0),o.drawImage(r,n.i+100,0)):n.i=0,n.i+=5},n.curCanvas="a"===n.curCanvas?"b":"a",i},!1));return 1==i&&(o=new t.CallbackProperty(function(e,t){var i=document.getElementById(n.id+"-"+n.curCanvas),o=i.getContext("2d"),r=o.createLinearGradient(0,100,0,0);return r.addColorStop(0,"red"),1<n.i&&(n.i=1),r.addColorStop(n.i,"rgb(255,0,0,0.6)"),r.addColorStop(1,"rgb(255,0,0,0.1)"),o.clearRect(0,0,700,100),o.fillStyle=r,o.fillRect(0,0,700,100),n.i<1?n.i+=.01:n.i=0,n.curCanvas="a"===n.curCanvas?"b":"a",i},!1)),new t.ImageMaterialProperty({image:o,transparent:!0})},f.prototype.setDrawCanvasImage=function(e,t){var o=document.getElementById("canvas-"+curCanvas),r=o.getContext("2d"),n=new Image;return n.src=images,r.clearRect(0,0,700,100),n.onload=function(){i<=700?(r.drawImage(n,i,0),r.drawImage(n,i+100,0)):i=0,i+=5},curCanvas="a"===curCanvas?"b":"a",o},f.prototype.setDrawCanvasColorUpdown=function(e,t){var o=document.getElementById("canvas-"+curCanvas),r=o.getContext("2d"),n=r.createLinearGradient(0,100,0,0);return n.addColorStop(0,"red"),1<i&&(i=1),n.addColorStop(i,"rgb(255,0,0,0.6)"),n.addColorStop(1,"rgb(255,0,0,0.1)"),r.clearRect(0,0,700,100),r.fillStyle=n,r.fillRect(0,0,700,100),i<1?i+=.01:i=0,curCanvas="a"===curCanvas?"b":"a",o},f.prototype.toDegrees=function(e){e=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(e.longitude),lat:Cesium.Math.toDegrees(e.latitude),height:e.height}},f.prototype.fromDegrees=function(e){return Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)},f.prototype.LineInterpolation=function(i,e){let t,o,r=!1,n=(t=e.positions||e,o=e.num||100,e.getHeight&&(r=!0),{positions:[],cartographic:[],lon_lat:[],height:[]});for(let e=0;e<t.length-1;e++){var a=this.toDegrees(t[e]),s=this.toDegrees(t[e+1]);{l=void 0;c=void 0;u=void 0;h=void 0;m=void 0;d=void 0;p=void 0;g=void 0;f=void 0;_=void 0;var l=a.lon;var c=a.lat;var u=s.lon;var h=s.lat;var m=Cesium.Math.lerp(l,u,1/o)-l,d=Cesium.Math.lerp(c,h,1/o)-c;n.lon_lat.push(l,c);let t;if(r){t=C(l,c),n.height.push(t),n.positions.push(Cesium.Cartesian3.fromDegrees(l,c,t));for(let e=0;e<o;e++){var p=l+(e+1)*m,g=c+(e+1)*d;n.lon_lat.push(p,g),t=C(p,g),n.height.push(t),n.positions.push(Cesium.Cartesian3.fromDegrees(p,g,t))}n.lon_lat.push(u,h),t=C(u,h),n.height.push(t),n.positions.push(Cesium.Cartesian3.fromDegrees(u,h,t))}else{n.positions.push(Cesium.Cartesian3.fromDegrees(l,c));for(let e=0;e<o;e++){var f=l+(e+1)*m,_=c+(e+1)*d;n.lon_lat.push(f,_),n.positions.push(Cesium.Cartesian3.fromDegrees(f,_))}n.lon_lat.push(u,h),n.positions.push(Cesium.Cartesian3.fromDegrees(u,h))}}}function C(e,t){e=Cesium.Cartographic.fromDegrees(e,t);return i.scene.globe.getHeight(e)}return n},f.prototype.CIMServerTool=function(e){return new ne(e)},f.prototype.Recorder=function(e,t){return this._Recorder?(this._Recorder.mediaOutputPath=this.defaultValue(e,"test.mp4"),t&&(this._Recorder.videoBPS=t)):this._Recorder=new ae(e,t),this._Recorder},f.prototype.getLinkMaterial=function(e,t,i){function o(e,t,i){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.lightSpotColor=t,this.duration=i,this.old=void 0,this._time=(new Date).getTime()}return Cesium.PolylineLinkMaterialProperty||(Object.defineProperties(o.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),o.prototype.getType=function(e){return"PolylineLink"},o.prototype.getValue=function(e,t){return(t=Cesium.defined(t)?t:{}).color=Cesium.Property.getValueOrClonedDefault(this._color,e,Cesium.Color.WHITE,t.color),t.lightSpotColor=this.lightSpotColor,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,void 0===this.old&&(this.old=t.time),.5<this.old&&t.time<.5&&(t.plus=!t.plus,t.inverse=!t.inverse),this.old=t.time,t.plus?t.time=1.1*t.time:t.time=1.2*t.time-.1,t},o.prototype.equals=function(e){return this===e||e instanceof o&&Cesium.Property.equals(this._color,e._color)},Cesium.PolylineLinkMaterialProperty=o,Cesium.Material.PolylineLinkType="PolylineLink",Cesium.Material.PolylineLinkSource=Ut,Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineLinkType,{fabric:{type:Cesium.Material.PolylineLinkType,uniforms:{color:new Cesium.Color(1,0,0,.5),lightSpotColor:new Cesium.Color(1,1,1,.5),time:0,plus:!0,inverse:!1},source:Cesium.Material.PolylineLinkSource},translucent:function(e){return!0}})),new Cesium.PolylineLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),Cesium.Color.fromCssColorString(this.defaultValue(t,"#ffffff")),this.defaultValue(i,3e3))},f.prototype.getTrailLinkMaterial=function(e,t,i){return new te(e,t,i)},f.prototype.getConeRadarMaterial=function(e){function t(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.ConeRadarMaterialProperty||(Object.defineProperties(t.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Cesium.createPropertyDescriptor("color")}),t.prototype.getType=function(e){return"ConeRadar"},t.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},t.prototype.equals=function(e){return this===e||e instanceof t&&Cesium.Property.equals(this._color,e._color)},Cesium.ConeRadarMaterialProperty=t,Cesium.Material.ConeRadarType="ConeRadar",Cesium.Material.ConeRadarSource="\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                                                    material.alpha = 0.0;\n                                                    float intensity = step(0.001,ripple(dis, 80.0, 15.0));\n                                                    if(intensity == 1.0)\n                                                    {\n                                                        material.alpha = 1.0;\n                                                    }\n                                                    return material;\n                                                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.ConeRadarType,{fabric:{type:Cesium.Material.ConeRadarType,uniforms:{color:new Cesium.Color(1,0,0,.5),time:0},source:Cesium.Material.ConeRadarSource},translucent:function(e){return!0}})),new Cesium.ConeRadarMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#0000ff")),3e3)},f.prototype.getMultiCircleScanMaterial=function(e,t){function i(e,t){this._definitionChanged=new Cesium.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()}return Cesium.CircleScanMultiMaterialProperty||(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"CircleScanMulti"},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.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=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))},f.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))},f.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<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanType,{fabric:{type:Cesium.Material.CircleScanType,uniforms:{color:new Cesium.Color(1,0,0,1),time:0},source:Cesium.Material.CircleScanSource},translucent:function(e){return!0}})),new Cesium.CircleScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e,"#ff0000")),this.defaultValue(t,3e3))},f.prototype.getRadarScanMaterial=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.RadarScanMaterialProperty||(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"RadarScan"},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.angle1=360*t.time,t.angle2=360*t.time+60,360<t.angle2&&(t.angle2=t.angle2-360),t},i.prototype.equals=function(e){return this===e||e instanceof i&&Cesium.Property.equals(this._color,e._color)},Cesium.RadarScanMaterialProperty=i,Cesium.Material.RadarScanType="RadarScan",Cesium.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                        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))},f.prototype.gradientColor=function(e,t,i){return new me(e,t,i)},f.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,Wt="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 f}function Yt(e,t){this._viewer=e,this._cesium=t,this._core=new f}function Jt(e){this._viewer=e,this.editType="Entity",this._core=new f,this.tooltip=this._core.CreateTooltip({id:"ModelEdit"})}f.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Wt(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},f.prototype.xml2json=_e,f.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=0<t.indexOf("android")?"android":navigator.platform.toLowerCase(),{version:(t.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],plat:e,type:i,pc:o,prefix:r,isMobile:"pc"!=o}},m.prototype.VectorColorTransformation=function(e,t){var i;return e&&"["==e.toString().charAt(0)&&"]"==e.toString().charAt(e.length-1)&&(i=styleOption.fillColor.replace(/\[/,"").replace(/\]/,""),e=t.properties[i]),this._core.isnull(e)||(this._core.isHtmlColor(e)?e=this.colorFromHtmlColor(e):null!=(e=/^rgb/.test(e)?this.rgbaStringToRgbaObj(e):e).r?(1<e.r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this.createColor(e.r,e.g,e.b,e.a)):null!=e.red&&(1<e.red&&(e.red=e.red/255),1<e.green&&(e.green=e.green/255),1<e.blue&&(e.blue=e.blue/255),1<e.alpha&&(e.alpha=e.alpha/255),e=this.createColor(e.red,e.green,e.blue,e.alpha))),e},m.prototype.createColorTransformation=function(e){return e=this._core.isnull(e)||"["==e.toString().charAt(0)&&"]"==e.toString().charAt(e.length-1)?e:this._core.isHtmlColor(e)?this.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this.createColor(e.r,e.g,e.b,e.a))},m.prototype.createColor=function(e,t,i,o){return new this._cesium.Color(e,t,i,o)},m.prototype.colorFromHtmlColor=function(e){if("object"==typeof e)return e.color||void 0;if(e=e.toLowerCase(),/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)){if(4==e.length){for(var t="#",i=1;i<4;i+=1)t+=e.slice(i,i+1).concat(e.slice(i,i+1));e=t}for(var o,r=[],i=1;i<7;i+=2)r.push(parseInt("0x"+e.slice(i,i+2)));return 9==e.length?(o=parseInt(e.substr(7,2))/100,this.createColor(r[0]/255,r[1]/255,r[2]/255,o)):this.createColor(r[0]/255,r[1]/255,r[2]/255,1)}console.log("不是有效的html颜色",e)},m.prototype.toHtmlColor=function(e){e=e.split(",");return"#"+((1<<24)+(parseInt(e[0].split("(")[1])<<16)+(parseInt(e[1])<<8)+parseInt(e[2].split(")")[0])).toString(16).slice(1)},m.prototype.rgbaStringToRgbaObj=function(e){var t;return/^rgb/.test(e)&&(t=(e=(e=(e=e.replace(/rgba\(/g,"")).replace(/rgb\(/g,"")).replace(/\)/g,"")).split(","),e={},3==t.length?(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=1):4==t.length&&(e.r=parseFloat(t[0]),e.g=parseFloat(t[1]),e.b=parseFloat(t[2]),e.a=parseFloat(t[3]))),e},m.prototype.CreateColor=function(e,t,i,o){return new this._cesium.Color(e,t,i,o)},Yt.prototype.createElevationContour=function(e,t,i){var o,r=this,n=(r.item={},this._core.defaultValue(i.min,-414)),a=r._core.defaultValue(i.max,8844),s=(r.item.selectedShading=t,r._viewer.scene.globe);return e?("elevation"===t?(o=new r._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.elevationRampMaterial.uniforms,r.item.shadingUniforms.minimumHeight=n,r.item.shadingUniforms.maximumHeight=a,r.item.contourUniforms=o.materials.contourMaterial.uniforms):"slope"===t?(o=new r._cesium.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.slopeRampMaterial.uniforms,r.item.contourUniforms=o.materials.contourMaterial.uniforms):"aspect"===t?(o=new r._cesium.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1}),r.item.shadingUniforms=o.materials.aspectRampMaterial.uniforms,r.item.contourUniforms=o.materials.contourMaterial.uniforms):(o=r._cesium.Material.fromType("ElevationContour"),r.item.contourUniforms=o.uniforms),r.item.contourUniforms.width=r._core.defaultValue(i.width,2),r.item.contourUniforms.spacing=r._core.defaultValue(i.spacing,150),r.item.contourUniforms.color=r._cesium.Color.fromCssColorString(r._core.defaultValue(i.lineColor,"#ff0000"))):"elevation"===t?(o=r._cesium.Material.fromType("ElevationRamp"),r.item.shadingUniforms=o.uniforms,r.item.shadingUniforms.minimumHeight=n,r.item.shadingUniforms.maximumHeight=a):"slope"===t?(o=r._cesium.Material.fromType("SlopeRamp"),r.item.shadingUniforms=o.uniforms):"aspect"===t&&(o=r._cesium.Material.fromType("AspectRamp"),r.item.shadingUniforms=o.uniforms),"none"!==t&&(r.item.shadingUniforms.image=i?r._core.getColorRamp(t,i.colorArr,i.min,i.max):r._core.getColorRamp(t)),s.material=void 0,r._viewer.render(),s.material=o,r.item.material=s.material,this},Yt.prototype.executeMaterial=function(e){var t,i=this,e=(i.item={},i.item.selectedShading=e,i.item.shadingUniforms={},this._viewer.scene.globe);return"elevation"===i.item.selectedShading?(t=this._cesium.Material.fromType("ElevationRamp"),i.item.shadingUniforms=t.uniforms,i.item.shadingUniforms.minHeight=-414,i.item.shadingUniforms.maxHeight=8777):"slope"===i.item.selectedShading?(t=this._cesium.Material.fromType("SlopeRamp"),i.item.shadingUniforms=t.uniforms):"aspect"===i.item.selectedShading&&(t=this._cesium.Material.fromType("AspectRamp"),i.item.shadingUniforms=t.uniforms),"none"!==i.item.selectedShading&&(i.item.shadingUniforms.image=this._core.getColorRamp(i.item.selectedShading)),e.material=t,i.item.material=e.material,this},Yt.prototype.setSpacing=function(e){try{this.item.contourUniforms.spacing=parseFloat(e)}catch(e){console.log(e)}return this},Yt.prototype.setMaterialColor=function(e){try{this.item.contourUniforms.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Yt.prototype.setWidth=function(e){try{this.item.contourUniforms.width=parseFloat(e)}catch(e){console.log(e)}return this},Yt.prototype.executeContourMaterial=function(e){var t,i=this,e=(i.item={},i.item.selectedShading=e,i._viewer.scene.globe);return"elevation"===i.item.selectedShading?(t=new this._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),i.item.shadingUniforms=t.materials.elevationRampMaterial.uniforms,i.item.shadingUniforms.minHeight=-414,i.item.shadingUniforms.maxHeight=8777,i.item.contourUniforms=t.materials.contourMaterial.uniforms):"slope"===i.item.selectedShading?(t=getSlopeContourMaterial(),i.item.shadingUniforms=t.materials.slopeRampMaterial.uniforms,i.item.contourUniforms=t.materials.contourMaterial.uniforms):"aspect"===i.item.selectedShading?(t=getAspectContourMaterial(),i.item.shadingUniforms=t.materials.aspectRampMaterial.uniforms,i.item.contourUniforms=t.materials.contourMaterial.uniforms):(t=this._cesium.Material.fromType("ElevationContour"),i.item.contourUniforms=t.uniforms),"none"!==i.item.selectedShading&&(i.item.shadingUniforms.image=this._core.getColorRamp(i.item.selectedShading)),i.item.contourUniforms.width=2,i.item.contourUniforms.spacing=150,i.item.contourUniforms.color=this._cesium.Color.fromRandom({alpha:1},this._cesium.Color.RED.clone()),e.material=t,i.item.material=e.material,this},Object.defineProperties(Yt.prototype,{elevation:{get:function(){return this.item},set:function(e){this.item=e}}}),Jt.prototype.start=function(i,o={}){if(this.end(),i){let e,t;if(i.item&&i.item instanceof Cesium.Cesium3DTileset)this.editType="SE3DTiles",t=i.boundingSphereRadius,e=Cesium.Cartesian3.fromDegrees(i.modelEditData.lon,i.modelEditData.lat,i.modelEditData.height);else{this.editType="Entity";var r=this._viewer.scene.primitives._primitives.findIndex(e=>e.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=>{var t;r?(this.mouseTooltip(o,e),this.edit(o,r,e.endPosition),i.callback&&i.callback(o)):(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<l?e+=a:e-=a,this.setRotate("pitch",e)}else if("roll"===e){s=(n.lat-t.lat)/(i.x-r.x);let e=this.originRoll;l=this._core.arge(r,i,o,"+-",!0);s<0?e-=l:e+=l,this.setRotate("roll",e)}}},Jt.prototype.setPosition=function(e){var t=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);"Entity"===this.editType?(this.model.position=t,window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="height"]').value=e.height.toFixed(2))):this.model.setEditData(e),this.axis.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(t)},Jt.prototype.setRotate=function(o,r){if(this.model)if("Entity"===this.editType){let e=this.model.heading,t=this.model.pitch,i=this.model.roll;"heading"===o?this.model.heading=e=r:"pitch"===o?this.model.pitch=t=r:"roll"===o&&(this.model.roll=i=r),this.model.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.model.position.getValue(),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e),Cesium.Math.toRadians(t),Cesium.Math.toRadians(i))),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`)&&(SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`).value=r)}else switch(o){case"heading":this.model.setEditData({heading:-r});break;case"pitch":this.model.setEditData({pitch:r});break;case"roll":this.model.setEditData({roll:r})}},Jt.prototype.mouseTooltip=function(e,t){e?(t=t.endPosition||t.position,"x"===e?this.tooltip.showAt(t,"X方向平移"):"y"===e?this.tooltip.showAt(t,"Y方向平移"):"z"===e?this.tooltip.showAt(t,"Z方向平移"):"heading"===e?this.tooltip.showAt(t,"绕Z轴旋转"):"pitch"===e?this.tooltip.showAt(t,"绕Y轴旋转"):"roll"===e?this.tooltip.showAt(t,"绕X轴旋转"):this.tooltip.show(!1)):this.tooltip.show(!1)},Jt.prototype.end=function(){this.axis&&this._viewer.scene.primitives.remove(this.axis),this.axis=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0,this.model&&(this.model.ModelEdit=void 0),this.model=void 0,this.tooltip&&this.tooltip.show(!1)};var Un="Expected a function",zn="__lodash_hash_undefined__",Wn="__lodash_placeholder__",Yn=128,Jn=9007199254740991,Kn=NaN,Qn=4294967295,qn=[["ary",Yn],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],Xn="[object Arguments]",Zn="[object Array]",$n="[object Boolean]",ea="[object Date]",ta="[object Error]",ia="[object Function]",oa="[object GeneratorFunction]",ra="[object Map]",na="[object Number]",aa="[object Object]",sa="[object Promise]",la="[object RegExp]",ca="[object Set]",ua="[object String]",ha="[object Symbol]",ma="[object WeakMap]",da="[object ArrayBuffer]",pa="[object DataView]",ga="[object Float32Array]",fa="[object Float64Array]",_a="[object Int8Array]",Ca="[object Int16Array]",ya="[object Int32Array]",va="[object Uint8Array]",wa="[object Uint8ClampedArray]",ba="[object Uint16Array]",Ta="[object Uint32Array]",Sa=/\b__p \+= '';/g,Ea=/\b(__p \+=) '' \+/g,Pa=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xa=/&(?:amp|lt|gt|quot|#39);/g,Da=/[&<>"']/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*$/,Va=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fa=/[\\^$.*+?()[\]{}|]/g,Ha=RegExp(Fa.source),Ga=/^\s+/,Kt=/\s/,ka=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Na=/\{\n\/\* \[wrapped with (.+)\] \*/,ja=/,? & /,Ua=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,za=/[()=,{}\[\]\/\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,Qt="\\ud800-\\udfff",qt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xt="\\u2700-\\u27bf",Zt="a-z\\xdf-\\xf6\\xf8-\\xff",$t="A-Z\\xc0-\\xd6\\xd8-\\xde",ei="\\ufe0e\\ufe0f",ti="\\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",ii="['’]",oi="["+Qt+"]",ri="["+ti+"]",ni="["+qt+"]",ai="["+Xt+"]",si="["+Zt+"]",ti="[^"+Qt+ti+"\\d+"+Xt+Zt+$t+"]",Xt="\\ud83c[\\udffb-\\udfff]",Zt="[^"+Qt+"]",li="(?:\\ud83c[\\udde6-\\uddff]){2}",ci="[\\ud800-\\udbff][\\udc00-\\udfff]",$t="["+$t+"]",ui="\\u200d",hi="(?:"+si+"|"+ti+")",ti="(?:"+$t+"|"+ti+")",mi="(?:['’](?:d|ll|m|re|s|t|ve))?",di="(?:['’](?:D|LL|M|RE|S|T|VE))?",pi="(?:"+ni+"|"+Xt+")"+"?",gi="["+ei+"]?",gi=gi+pi+("(?:"+ui+"(?:"+[Zt,li,ci].join("|")+")"+gi+pi+")*"),pi="(?:"+[ai,li,ci].join("|")+")"+gi,ai="(?:"+[Zt+ni+"?",ni,li,ci,oi].join("|")+")",is=RegExp(ii,"g"),os=RegExp(ni,"g"),fi=RegExp(Xt+"(?="+Xt+")|"+ai+gi,"g"),rs=RegExp([$t+"?"+si+"+"+mi+"(?="+[ri,$t,"$"].join("|")+")",ti+"+"+di+"(?="+[ri,$t+hi,"$"].join("|")+")",$t+"?"+hi+"+"+mi,$t+"+"+di,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",pi].join("|"),"g"),_i=RegExp("["+ui+Qt+qt+ei+"]"),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={},cs=(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[ca]=ls[ua]=ls[ma]=!1,{}),Ci=(cs[Xn]=cs[Zn]=cs[da]=cs[pa]=cs[$n]=cs[ea]=cs[ga]=cs[fa]=cs[_a]=cs[Ca]=cs[ya]=cs[ra]=cs[na]=cs[aa]=cs[la]=cs[ca]=cs[ua]=cs[ha]=cs[va]=cs[wa]=cs[ba]=cs[Ta]=!0,cs[ta]=cs[ia]=cs[ma]=!1,{"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"}),us=parseFloat,hs=parseInt,Zt="object"==typeof global&&global&&global.Object===Object&&global,li="object"==typeof self&&self&&self.Object===Object&&self,ms=Zt||li||Function("return this")(),ci="object"==typeof o&&o&&!o.nodeType&&o,yi=ci&&"object"==typeof module&&module&&!module.nodeType&&module,ds=yi&&yi.exports===ci,vi=ds&&Zt.process,oi=function(){try{var e=yi&&yi.require&&yi.require("util").types;return e?e:vi&&vi.binding&&vi.binding("util")}catch(e){}}(),gs=oi&&oi.isArrayBuffer,fs=oi&&oi.isDate,_s=oi&&oi.isMap,Cs=oi&&oi.isRegExp,ys=oi&&oi.isSet,vs=oi&&oi.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<n;){var a=e[r];t(o,a,i(a),e)}return o}function Ts(e,t){for(var i=-1,o=null==e?0:e.length;++i<o&&!1!==t(e[i],i,e););return e}function Ss(e,t){for(var i=null==e?0:e.length;i--&&!1!==t(e[i],i,e););return e}function Es(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(!t(e[i],i,e))return!1;return!0}function Ps(e,t){for(var i=-1,o=null==e?0:e.length,r=0,n=[];++i<o;){var a=e[i];t(a,i,e)&&(n[r++]=a)}return n}function xs(e,t){return!!(null==e?0:e.length)&&-1<Vs(e,t,0)}function Ds(e,t,i){for(var o=-1,r=null==e?0:e.length;++o<r;)if(i(t,e[o]))return!0;return!1}function Is(e,t){for(var i=-1,o=null==e?0:e.length,r=Array(o);++i<o;)r[i]=t(e[i],i,e);return r}function As(e,t){for(var i=-1,o=t.length,r=e.length;++i<o;)e[r+i]=t[i];return e}function Ls(e,t,i,o){var r=-1,n=null==e?0:e.length;for(o&&n&&(i=e[++r]);++r<n;)i=t(i,e[r],r,e);return i}function Ms(e,t,i,o){var r=null==e?0:e.length;for(o&&r&&(i=e[--r]);r--;)i=t(i,e[r],r,e);return i}function Rs(e,t){for(var i=-1,o=null==e?0:e.length;++i<o;)if(t(e[i],i,e))return!0;return!1}var wi=ks("length");function Os(e,o,t){var r;return t(e,function(e,t,i){if(o(e,t,i))return r=t,!1}),r}function Bs(e,t,i,o){for(var r=e.length,n=i+(o?1:-1);o?n--:++n<r;)if(t(e[n],n,e))return n;return-1}function Vs(e,t,i){if(t!=t)return Bs(e,Hs,i);for(var o=e,r=t,n=i-1,a=o.length;++n<a;)if(o[n]===r)return n;return-1}function Fs(e,t,i,o){for(var r=i-1,n=e.length;++r<n;)if(o(e[r],t))return r;return-1}function Hs(e){return e!=e}function Gs(e,t){var i=null==e?0:e.length;return i?js(e,t)/i:Kn}function ks(t){return function(e){return null==e?jn:e[t]}}function bi(t){return function(e){return null==t?jn:t[e]}}function Ns(e,o,r,n,t){return t(e,function(e,t,i){r=n?(n=!1,e):o(r,e,t,i)}),r}function js(e,t){for(var i,o=-1,r=e.length;++o<r;){var n=t(e[o]);n!==jn&&(i=i===jn?n:i+n)}return i}function Us(e,t){for(var i=-1,o=Array(e);++i<e;)o[i]=t(i);return o}function zs(e){return e&&e.slice(0,al(e)+1).replace(Ga,"")}function Ws(t){return function(e){return t(e)}}function Ys(t,e){return Is(e,function(e){return t[e]})}function Js(e,t){return e.has(t)}function Ks(e,t){for(var i=-1,o=e.length;++i<o&&-1<Vs(t,e[i],0););return i}function Qs(e,t){for(var i=e.length;i--&&-1<Vs(t,e[i],0););return i}var qs=bi({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Xs=bi({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Zs(e){return"\\"+Ci[e]}function $s(e){return _i.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<o;){var a=e[i];a!==t&&a!==Wn||(e[i]=Wn,n[r++]=i)}return n}function ol(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}function rl(e){return($s(e)?function(e){var t=fi.lastIndex=0;for(;fi.test(e);)++t;return t}:wi)(e)}function nl(e){return $s(e)?e.match(fi)||[]:e.split("")}function al(e){for(var t=e.length;t--&&Kt.test(e.charAt(t)););return t}var sl=bi({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var C=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,U=e.String,T=e.TypeError,z=b.prototype,W=O.prototype,Y=g.prototype,J=e["__core-js_shared__"],K=W.toString,V=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(V).replace(Fa,"\\$&").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=z.splice,se=t?t.isConcatSpreadable:jn,le=t?t.iterator:jn,ce=t?t.toStringTag:jn,ue=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=z.join,ye=tl(g.keys,g),S=B.max,E=B.min,ve=n.now,we=e.parseInt,be=B.random,Te=z.reverse,n=Zi(e,"DataView"),Se=Zi(e,"Map"),Ee=Zi(e,"Promise"),Pe=Zi(e,"Set"),e=Zi(e,"WeakMap"),xe=Zi(g,"create"),De=e&&new e,Ie={},Ae=So(n),Le=So(Se),Me=So(Ee),Re=So(Pe),Oe=So(e),t=t?t.prototype:jn,Be=t?t.valueOf:jn,Ve=t?t.toString:jn;function p(e){if(N(e)&&!k(e)&&!(e instanceof C)){if(e instanceof f)return e;if(V.call(e,"__wrapped__"))return Eo(e)}return new f(e)}var Fe=function(e){if(!w(e))return{};if(re)return re(e);He.prototype=e;e=new He;return He.prototype=jn,e};function He(){}function Ge(){}function f(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=jn}function C(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<i;){var o=e[t];this.set(o[0],o[1])}}function Ne(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}function je(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var o=e[t];this.set(o[0],o[1])}}function Ue(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new je;++t<i;)this.add(e[t])}function F(e){e=this.__data__=new Ne(e);this.size=e.size}function ze(e,t){var i,o=k(e),r=!o&&Cr(e),n=!o&&!r&&vr(e),a=!o&&!r&&!n&&Lr(e),s=o||r||n||a,l=s?Us(e.length,U):[],c=l.length;for(i in e)!t&&!V.call(e,i)||s&&("length"==i||n&&("offset"==i||"parent"==i)||a&&("buffer"==i||"byteLength"==i||"byteOffset"==i)||ro(i,c))||l.push(i);return l}function We(e){var t=e.length;return t?e[Gt(0,t-1)]:jn}function Ye(e,t){return vo(P(e),tt(t,0,e.length))}function Je(e){return vo(P(e))}function Ke(e,t,i){(i===jn||G(e[t],i))&&(i!==jn||t in e)||$e(e,t,i)}function Qe(e,t,i){var o=e[t];V.call(e,t)&&G(o,i)&&(i!==jn||t in e)||$e(e,t,i)}function qe(e,t){for(var i=e.length;i--;)if(G(e[i][0],t))return i;return-1}function Xe(e,o,r,n){return nt(e,function(e,t,i){o(n,e,r(e),i)}),n}function Ze(e,t){return e&&fi(t,A(t),e)}function $e(e,t,i){"__proto__"==t&&ue?ue(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function et(e,t){for(var i=-1,o=t.length,r=b(o),n=null==e;++i<o;)r[i]=n?jn:Wr(e,t[i]);return r}function tt(e,t,i){return e==e&&(i!==jn&&(e=e<=i?e:i),t!==jn&&(e=t<=e?e:t)),e}function y(i,o,r,e,t,n){var a,s=1&o,l=2&o,c=4&o;if((a=r?t?r(i,e,t,n):r(i):a)===jn){if(!w(i))return i;var u,e=k(i);if(e){if(a=function(e){var t=e.length,i=new e.constructor(t);t&&"string"==typeof e[0]&&V.call(e,"index")&&(i.index=e.index,i.input=e.input);return i}(i),!s)return P(i,a)}else{var h=H(i),m=h==ia||h==oa;if(vr(i))return ui(i,s);if(h==aa||h==Xn||m&&!t){if(a=l||m?{}:io(i),!s)return l?(d=m=i,d=(u=a)&&fi(d,L(d),u),fi(m,eo(m),d)):(m=Ze(a,u=i),fi(u,$i(u),m))}else{if(!cs[h])return t?i:{};a=function(e,t,i){var o=e.constructor;switch(t){case da:return hi(e);case $n:case ea:return new o(+e);case pa:return function(e,t){t=t?hi(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}(e,i);case ga:case fa:case _a:case Ca:case ya:case va:case wa:case ba:case Ta:return mi(e,i);case ra:return new o;case na:case ua:return new o(e);case la:return function(e){var t=new e.constructor(e.source,Ja.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ca:return new o;case ha:return function(e){return Be?g(Be.call(e)):{}}(e)}}(i,h,s)}}var d=(n=n||new F).get(i);if(d)return d;n.set(i,a),Ir(i)?i.forEach(function(e){a.add(y(e,o,r,e,i,n))}):Er(i)&&i.forEach(function(e,t){a.set(t,y(e,o,r,t,i,n))});var p=e?jn:(c?l?Yi:Wi:l?L:A)(i);Ts(p||i,function(e,t){p&&(e=i[t=e]),Qe(a,t,y(e,o,r,t,i,n))})}return a}function it(e,t,i){var o=i.length;if(null==e)return!o;for(e=g(e);o--;){var r=i[o],n=t[r],a=e[r];if(a===jn&&!(r in e)||!n(a))return!1}return!0}function ot(e,t,i){if("function"!=typeof e)throw new T(Un);return fo(function(){e.apply(jn,i)},t)}function rt(e,t,i,o){var r=-1,n=xs,a=!0,s=e.length,l=[],c=t.length;if(s){i&&(t=Is(t,Ws(i))),o?(n=Ds,a=!1):200<=t.length&&(n=Js,a=!1,t=new Ue(t));e:for(;++r<s;){var u=e[r],h=null==i?u:i(u),u=o||0!==u?u:0;if(a&&h==h){for(var m=c;m--;)if(t[m]===h)continue e;l.push(u)}else n(t,h,o)||l.push(u)}}return l}p.templateSettings={escape:La,evaluate:Ma,interpolate:Ra,variable:"",imports:{_:p}},(p.prototype=Ge.prototype).constructor=p,(f.prototype=Fe(Ge.prototype)).constructor=f,(C.prototype=Fe(Ge.prototype)).constructor=C,ke.prototype.clear=function(){this.__data__=xe?xe(null):{},this.size=0},ke.prototype.delete=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},ke.prototype.get=function(e){var t,i=this.__data__;return xe?(t=i[e])===zn?jn:t:V.call(i,e)?i[e]:jn},ke.prototype.has=function(e){var t=this.__data__;return xe?t[e]!==jn:V.call(t,e)},ke.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=xe&&t===jn?zn:t,this},Ne.prototype.clear=function(){this.__data__=[],this.size=0},Ne.prototype.delete=function(e){var t=this.__data__;return!((e=qe(t,e))<0)&&(e==t.length-1?t.pop():ae.call(t,e,1),--this.size,!0)},Ne.prototype.get=function(e){var t=this.__data__;return(e=qe(t,e))<0?jn:t[e][1]},Ne.prototype.has=function(e){return-1<qe(this.__data__,e)},Ne.prototype.set=function(e,t){var i=this.__data__,o=qe(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this},je.prototype.clear=function(){this.size=0,this.__data__={hash:new ke,map:new(Se||Ne),string:new ke}},je.prototype.delete=function(e){return e=qi(this,e).delete(e),this.size-=e?1:0,e},je.prototype.get=function(e){return qi(this,e).get(e)},je.prototype.has=function(e){return qi(this,e).has(e)},je.prototype.set=function(e,t){var i=qi(this,e),o=i.size;return i.set(e,t),this.size+=i.size==o?0:1,this},Ue.prototype.add=Ue.prototype.push=function(e){return this.__data__.set(e,zn),this},Ue.prototype.has=function(e){return this.__data__.has(e)},F.prototype.clear=function(){this.__data__=new Ne,this.size=0},F.prototype.delete=function(e){var t=this.__data__,e=t.delete(e);return this.size=t.size,e},F.prototype.get=function(e){return this.__data__.get(e)},F.prototype.has=function(e){return this.__data__.has(e)},F.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Ne){var o=i.__data__;if(!Se||o.length<199)return o.push([e,t]),this.size=++i.size,this;i=this.__data__=new je(o)}return i.set(e,t),this.size=i.size,this};var nt=yi(mt),at=yi(dt,!0);function st(e,o){var r=!0;return nt(e,function(e,t,i){return r=!!o(e,t,i)}),r}function lt(e,t,i){for(var o=-1,r=e.length;++o<r;){var n,a,s=e[o],l=t(s);null!=l&&(n===jn?l==l&&!x(l):i(l,n))&&(n=l,a=s)}return a}function ct(e,o){var r=[];return nt(e,function(e,t,i){o(e,t,i)&&r.push(e)}),r}function l(e,t,i,o,r){var n=-1,a=e.length;for(i=i||oo,r=r||[];++n<a;){var s=e[n];0<t&&i(s)?1<t?l(s,t-1,i,o,r):As(r,s):o||(r[r.length]=s)}return r}var ut=vi(),ht=vi(!0);function mt(e,t){return e&&ut(e,t,A)}function dt(e,t){return e&&ht(e,t,A)}function pt(t,e){return Ps(e,function(e){return br(t[e])})}function gt(e,t){for(var i=0,o=(t=ai(t,e)).length;null!=e&&i<o;)e=e[To(t[i++])];return i&&i==o?e:jn}function ft(e,t,i){t=t(e);return k(e)?t:As(t,i(e))}function i(e){if(null==e)return e===jn?"[object Undefined]":"[object Null]";if(ce&&ce in g(e)){var t=e,i=V.call(t,ce),o=t[ce];try{t[ce]=jn;var r=!0}catch(e){}var n=X.call(t);return r&&(i?t[ce]=o:delete t[ce]),n}return X.call(e)}function _t(e,t){return t<e}function Ct(e,t){return null!=e&&V.call(e,t)}function yt(e,t){return null!=e&&t in g(e)}function vt(e,t,i){for(var o=i?Ds:xs,r=e[0].length,n=e.length,a=n,s=b(n),l=1/0,c=[];a--;){var u=e[a];a&&t&&(u=Is(u,Ws(t))),l=E(u.length,l),s[a]=!i&&(t||120<=r&&120<=u.length)?new Ue(a&&u):jn}var u=e[0],h=-1,m=s[0];e:for(;++h<r&&c.length<l;){var d=u[h],p=t?t(d):d,d=i||0!==d?d:0;if(!(m?Js(m,p):o(c,p,i))){for(a=n;--a;){var g=s[a];if(!(g?Js(g,p):o(e[a],p,i)))continue e}m&&m.push(p),c.push(d)}}return c}function wt(e,t,i){t=null==(e=mo(e,t=ai(t,e)))?e:e[To(o(t))];return null==t?jn:ws(t,e,i)}function bt(e){return N(e)&&i(e)==Xn}function Tt(e,t,i,o,r){if(e===t)return!0;if(null==e||null==t||!N(e)&&!N(t))return e!=e&&t!=t;var n=Tt,a=k(e),s=k(t),l=a?Zn:H(e),s=s?Zn:H(t),c=(l=l==Xn?aa:l)==aa,u=(s=s==Xn?aa:s)==aa;if((s=l==s)&&vr(e)){if(!vr(t))return!1;c=!(a=!0)}if(s&&!c){r=r||new F;if(a||Lr(e))return Ui(e,t,i,o,n,r);else{var h=e;var m=t;var d=l;var p=i;var g=o;var f=n;var _=r;switch(d){case pa:if(h.byteLength!=m.byteLength||h.byteOffset!=m.byteOffset)return!1;h=h.buffer,m=m.buffer;case da:return h.byteLength==m.byteLength&&f(new te(h),new te(m))?!0:!1;case $n:case ea:case na:return G(+h,+m);case ta:return h.name==m.name&&h.message==m.message;case la:case ua:return h==m+"";case ra:var C=el;case ca:var y=1&p;if(C=C||ol,h.size!=m.size&&!y)return!1;y=_.get(h);if(y)return y==m;p|=2,_.set(h,m);y=Ui(C(h),C(m),p,g,f,_);return _.delete(h),y;case ha:if(Be)return Be.call(h)==Be.call(m)}return!1;return}}if(!(1&i)){a=c&&V.call(e,"__wrapped__"),l=u&&V.call(t,"__wrapped__");if(a||l)return c=a?e.value():e,u=l?t.value():t,r=r||new F,n(c,u,i,o,r)}if(s){r=r||new F;var v=e,w=t,b=i,T=o,S=n,E=r,P=1&b,x=Wi(v),D=x.length,a=Wi(w).length;if(D!=a&&!P)return!1;for(var I=D;I--;){var A=x[I];if(!(P?A in w:V.call(w,A)))return!1}a=E.get(v),l=E.get(w);if(a&&l)return a==w&&l==v;for(var L=!0,M=(E.set(v,w),E.set(w,v),P);++I<D;){A=x[I];var R,O=v[A],B=w[A];if(!((R=T?P?T(B,O,A,w,v,E):T(O,B,A,v,w,E):R)===jn?O===B||S(O,B,b,T,E):R)){L=!1;break}M=M||"constructor"==A}return L&&!M&&(a=v.constructor,l=w.constructor,a!=l&&"constructor"in v&&"constructor"in w&&!("function"==typeof a&&a instanceof a&&"function"==typeof l&&l instanceof l)&&(L=!1)),E.delete(v),E.delete(w),L}return!1}function St(e,t,i,o){var r=i.length,n=r,a=!o;if(null==e)return!n;for(e=g(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<n;){var l=(s=i[r])[0],c=e[l],u=s[1];if(a&&s[2]){if(c===jn&&!(l in e))return!1}else{var h,m=new F;if(!((h=o?o(c,u,l,e,t,m):h)===jn?Tt(u,c,3,o,m):h))return!1}}return!0}function Et(e){var t;return!(!w(e)||(t=e,q&&q in t))&&(br(e)?ee:qa).test(So(e))}function Pt(e){return"function"==typeof e?e:null==e?M:"object"==typeof e?k(e)?Mt(e[0],e[1]):Lt(e):In(e)}function xt(e){if(!lo(e))return ye(e);var t,i=[];for(t in g(e))V.call(e,t)&&"constructor"!=t&&i.push(t);return i}function Dt(e){if(!w(e)){var t=e,i=[];if(null!=t)for(var o in g(t))i.push(o);return i}var r,n=lo(e),a=[];for(r in e)("constructor"!=r||!n&&V.call(e,r))&&a.push(r);return a}function It(e,t){return e<t}function At(e,o){var r=-1,n=u(e)?b(e.length):[];return nt(e,function(e,t,i){n[++r]=o(e,t,i)}),n}function Lt(t){var i=Xi(t);return 1==i.length&&i[0][2]?uo(i[0][0],i[0][1]):function(e){return e===t||St(e,t,i)}}function Mt(i,o){return no(i)&&co(o)?uo(To(i),o):function(e){var t=Wr(e,i);return t===jn&&t===o?Yr(e,i):Tt(o,t,3)}}function Rt(g,f,_,C,y){g!==f&&ut(f,function(e,t){var i,o,r,n,a,s,l,c,u,h,m,d,p;y=y||new F,w(e)?(o=f,n=_,a=Rt,s=C,l=y,m=po(i=g,r=t),d=po(o,r),(p=l.get(d))?Ke(i,r,p):(p=s?s(m,d,r+"",i,o,l):jn,(o=p===jn)&&(c=k(d),u=!c&&vr(d),h=!c&&!u&&Lr(d),p=d,c||u||h?p=k(m)?m:v(m)?P(m):u?ui(d,!(o=!1)):h?mi(d,!(o=!1)):[]:xr(d)||Cr(d)?Cr(p=m)?p=Fr(m):w(m)&&!br(m)||(p=io(d)):o=!1),o&&(l.set(d,p),a(p,d,n,s,l),l.delete(d)),Ke(i,r,p))):(c=C?C(po(g,t),e,t+"",g,f,y):jn,Ke(g,t,c=c===jn?e:c))},L)}function Ot(e,t){var i=e.length;if(i)return ro(t+=t<0?i:0,i)?e[t]:jn}function Bt(e,o,u){o=o.length?Is(o,function(t){return k(t)?function(e){return gt(e,1===t.length?t[0]:t)}:t}):[M];var r=-1;o=Is(o,Ws(h()));var t=At(e,function(t,e,i){return{criteria:Is(o,function(e){return e(t)}),index:++r,value:t}}),e=function(e,t){for(var i=u,o=-1,r=e.criteria,n=t.criteria,a=r.length,s=i.length;++o<a;){var l,c=di(r[o],n[o]);if(c)return s<=o?c:(l=i[o],c*("desc"==l?-1:1))}return e.index-t.index},i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}function Vt(e,t,i){for(var o=-1,r=t.length,n={};++o<r;){var a=t[o],s=gt(e,a);i(s,a)&&Ut(n,ai(a,e),s)}return n}function Ft(e,t,i,o){var r=o?Fs:Vs,n=-1,a=t.length,s=e;for(e===t&&(t=P(t)),i&&(s=Is(e,Ws(i)));++n<a;)for(var l=0,c=t[n],u=i?i(c):c;-1<(l=r(s,u,l,o));)s!==e&&ae.call(s,l,1),ae.call(e,l,1);return e}function Ht(e,t){for(var i=e?t.length:0,o=i-1;i--;){var r,n=t[i];i!=o&&n===r||(ro(r=n)?ae.call(e,n,1):Zt(e,n))}}function Gt(e,t){return e+ge(be()*(t-e+1))}function kt(e,t){var i="";if(!(!e||t<1||Jn<t))for(;t%2&&(i+=e),(t=ge(t/2))&&(e+=e),t;);return i}function a(e,t){return _o(ho(e,t,M),e+"")}function Nt(e){return We(rn(e))}function jt(e,t){e=rn(e);return vo(e,tt(t,0,e.length))}function Ut(e,t,i,o){if(w(e))for(var r=-1,n=(t=ai(t,e)).length,a=n-1,s=e;null!=s&&++r<n;){var l,c=To(t[r]),u=i;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;r!=a&&(l=s[c],(u=o?o(l,c,s):jn)===jn&&(u=w(l)?l:ro(t[r+1])?[]:{})),Qe(s,c,u),s=s[c]}return e}var zt=De?function(e,t){return De.set(e,t),e}:M,t=ue?function(e,t){return ue(e,"toString",{configurable:!0,enumerable:!1,value:Cn(t),writable:!0})}:M;function Wt(e){return vo(rn(e))}function s(e,t,i){for(var o=-1,r=e.length,n=((i=r<i?r:i)<0&&(i+=r),r=i<(t=t<0?r<-t?0:r+t:t)?0:i-t>>>0,t>>>=0,b(r));++o<r;)n[o]=e[o+t];return n}function Yt(e,o){var r;return nt(e,function(e,t,i){return!(r=o(e,t,i))}),!!r}function Jt(e,t,i){var o=0,r=null==e?o:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;o<r;){var n=o+r>>>1,a=e[n];null!==a&&!x(a)&&(i?a<=t:a<t)?o=1+n:r=n}return r}return Kt(e,t,M,i)}function Kt(e,t,i,o){var r=0,n=null==e?0:e.length;if(0===n)return 0;for(var a=(t=i(t))!=t,s=null===t,l=x(t),c=t===jn;r<n;){var u=ge((r+n)/2),h=i(e[u]),m=h!==jn,d=null===h,p=h==h,g=x(h),p=a?o||p:c?p&&(o||m):s?p&&m&&(o||!d):l?p&&m&&!d&&(o||!g):!d&&!g&&(o?h<=t:h<t);p?r=u+1:n=u}return E(n,4294967294)}function Qt(e,t){for(var i=-1,o=e.length,r=0,n=[];++i<o;){var a,s=e[i],l=t?t(s):s;i&&G(l,a)||(a=l,n[r++]=0===s?0:s)}return n}function qt(e){return"number"==typeof e?e:x(e)?Kn:+e}function c(e){var t;return"string"==typeof e?e:k(e)?Is(e,c)+"":x(e)?Ve?Ve.call(e):"":"0"==(t=e+"")&&1/e==-1/0?"-0":t}function Xt(e,t,i){var o=-1,r=xs,n=e.length,a=!0,s=[],l=s;if(i)a=!1,r=Ds;else if(200<=n){var c=t?null:Fi(e);if(c)return ol(c);a=!1,r=Js,l=new Ue}else l=t?[]:s;e:for(;++o<n;){var u=e[o],h=t?t(u):u,u=i||0!==u?u:0;if(a&&h==h){for(var m=l.length;m--;)if(l[m]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,i)||(l!==s&&l.push(h),s.push(u))}return s}function Zt(e,t){return null==(e=mo(e,t=ai(t,e)))||delete e[To(o(t))]}function $t(e,t,i,o){return Ut(e,t,i(gt(e,t)),o)}function ei(e,t,i,o){for(var r=e.length,n=o?r:-1;(o?n--:++n<r)&&t(e[n],n,e););return i?s(e,o?0:n,o?n+1:r):s(e,o?n+1:0,o?r:n)}function ti(e,t){var i=e;return Ls(t,function(e,t){return t.func.apply(t.thisArg,As([e],t.args))},i=e instanceof C?e.value():i)}function ii(e,t,i){var o=e.length;if(o<2)return o?Xt(e[0]):[];for(var r=-1,n=b(o);++r<o;)for(var a=e[r],s=-1;++s<o;)s!=r&&(n[r]=rt(n[r]||a,e[s],t,i));return Xt(l(n,1),t,i)}function oi(e,t,i){for(var o=-1,r=e.length,n=t.length,a={};++o<r;){var s=o<n?t[o]:jn;i(a,e[o],s)}return a}function ri(e){return v(e)?e:[]}function ni(e){return"function"==typeof e?e:M}function ai(e,t){return k(e)?e:no(e,t)?[e]:bo(d(e))}var si=a;function li(e,t,i){var o=e.length;return i=i===jn?o:i,!t&&o<=i?e:s(e,t,i)}var ci=he||function(e){return ms.clearTimeout(e)};function ui(e,t){return t?e.slice():(t=e.length,t=ie?ie(t):new e.constructor(t),e.copy(t),t)}function hi(e){var t=new e.constructor(e.byteLength);return new te(t).set(new te(e)),t}function mi(e,t){t=t?hi(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function di(e,t){if(e!==t){var i=e!==jn,o=null===e,r=e==e,n=x(e),a=t!==jn,s=null===t,l=t==t,c=x(t);if(!s&&!c&&!n&&t<e||n&&a&&l&&!s&&!c||o&&a&&l||!i&&l||!r)return 1;if(!o&&!n&&!c&&e<t||c&&i&&r&&!o&&!n||s&&i&&r||!a&&r||!l)return-1}return 0}function pi(e,t,i,o){for(var r=-1,n=e.length,a=i.length,s=-1,l=t.length,c=S(n-a,0),u=b(l+c),h=!o;++s<l;)u[s]=t[s];for(;++r<a;)(h||r<n)&&(u[i[r]]=e[r]);for(;c--;)u[s++]=e[r++];return u}function gi(e,t,i,o){for(var r=-1,n=e.length,a=-1,s=i.length,l=-1,c=t.length,u=S(n-s,0),h=b(u+c),m=!o;++r<u;)h[r]=e[r];for(var d=r;++l<c;)h[d+l]=t[l];for(;++a<s;)(m||r<n)&&(h[d+i[a]]=e[r++]);return h}function P(e,t){var i=-1,o=e.length;for(t=t||b(o);++i<o;)t[i]=e[i];return t}function fi(e,t,i,o){for(var r=!i,n=(i=i||{},-1),a=t.length;++n<a;){var s=t[n],l=o?o(i[s],e[s],s,i,e):jn;(r?$e:Qe)(i,s,l=l===jn?e[s]:l)}return i}function _i(r,n){return function(e,t){var i=k(e)?bs:Xe,o=n?n():{};return i(e,r,h(t,2),o)}}function Ci(s){return a(function(e,t){var i=-1,o=t.length,r=1<o?t[o-1]:jn,n=2<o?t[2]:jn,r=3<s.length&&"function"==typeof r?(o--,r):jn;for(n&&m(t[0],t[1],n)&&(r=o<3?jn:r,o=1),e=g(e);++i<o;){var a=t[i];a&&s(e,a,i,r)}return e})}function yi(n,a){return function(e,t){if(null!=e){if(!u(e))return n(e,t);for(var i=e.length,o=a?i:-1,r=g(e);(a?o--:++o<i)&&!1!==t(r[o],o,r););}return e}}function vi(l){return function(e,t,i){for(var o=-1,r=g(e),n=i(e),a=n.length;a--;){var s=n[l?a:++o];if(!1===t(r[s],s,r))break}return e}}function wi(o){return function(e){var t=$s(e=d(e))?nl(e):jn,i=t?t[0]:e.charAt(0),t=t?li(t,1).join(""):e.slice(1);return i[o]()+t}}function bi(t){return function(e){return Ls(gn(sn(e).replace(is,"")),t,"")}}function Ti(o){return function(){var e=arguments;switch(e.length){case 0:return new o;case 1:return new o(e[0]);case 2:return new o(e[0],e[1]);case 3:return new o(e[0],e[1],e[2]);case 4:return new o(e[0],e[1],e[2],e[3]);case 5:return new o(e[0],e[1],e[2],e[3],e[4]);case 6:return new o(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new o(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Fe(o.prototype),i=o.apply(t,e);return w(i)?i:t}}function Si(n,a,s){var l=Ti(n);return function e(){for(var t=arguments.length,i=b(t),o=t,r=Qi(e);o--;)i[o]=arguments[o];r=t<3&&i[0]!==r&&i[t-1]!==r?[]:il(i,r);return(t-=r.length)<s?Bi(n,a,xi,e.placeholder,jn,i,r,jn,jn,s-t):ws(this&&this!==ms&&this instanceof e?l:n,this,i)}}function Ei(n){return function(e,t,i){var o,r=g(e),t=(u(e)||(o=h(t,3),e=A(e),t=function(e){return o(r[e],e,r)}),n(e,t,i));return-1<t?r[o?e[t]:t]:jn}}function Pi(l){return zi(function(r){var n=r.length,e=n,t=f.prototype.thru;for(l&&r.reverse();e--;){var i=r[e];if("function"!=typeof i)throw new T(Un);t&&!s&&"wrapper"==Ki(i)&&(s=new f([],!0))}for(e=s?e:n;++e<n;)var o=Ki(i=r[e]),a="wrapper"==o?Ji(i):jn,s=a&&ao(a[0])&&424==a[1]&&!a[4].length&&1==a[9]?s[Ki(a[0])].apply(s,a[3]):1==i.length&&ao(i)?s[o]():s.thru(i);return function(){var e=arguments,t=e[0];if(s&&1==e.length&&k(t))return s.plant(t).value();for(var i=0,o=n?r[i].apply(this,e):t;++i<n;)o=r[i].call(this,o);return o}})}function xi(a,s,l,c,u,h,m,d,p,g){var f=s&Yn,_=1&s,C=2&s,y=24&s,v=512&s,w=C?jn:Ti(a);return function e(){for(var t,i,o,r=b(o=arguments.length),n=o;n--;)r[n]=arguments[n];return y&&(i=function(e,t){for(var i=e.length,o=0;i--;)e[i]===t&&++o;return o}(r,t=Qi(e))),c&&(r=pi(r,c,u,y)),h&&(r=gi(r,h,m,y)),o-=i,y&&o<g?(i=il(r,t),Bi(a,s,xi,e.placeholder,l,r,i,d,p,g-o)):(t=_?l:this,i=C?t[a]:a,o=r.length,d?r=function(e,t){for(var i=e.length,o=E(t.length,i),r=P(e);o--;){var n=t[o];e[o]=ro(n,i)?r[n]:jn}return e}(r,d):v&&1<o&&r.reverse(),f&&p<o&&(r.length=p),(i=this&&this!==ms&&this instanceof e?w||Ti(i):i).apply(t,r))}}function Di(i,a){return function(e,t){return e=e,o=i,r=a(t),n={},mt(e,function(e,t,i){o(n,r(e),t,i)}),n;var o,r,n}}function Ii(o,r){return function(e,t){var i;if(e===jn&&t===jn)return r;if(e!==jn&&(i=e),t!==jn){if(i===jn)return t;t=("string"==typeof e||"string"==typeof t?(e=c(e),c):(e=qt(e),qt))(t),i=o(e,t)}return i}}function Ai(o){return zi(function(e){return e=Is(e,Ws(h())),a(function(t){var i=this;return o(e,function(e){return ws(e,i,t)})})})}function Li(e,t){var i=(t=t===jn?" ":c(t)).length;return i<2?i?kt(t,e):t:(i=kt(t,pe(e/rl(t))),$s(t)?li(nl(i),0,e).join(""):i.slice(0,e))}function Mi(s,e,l,c){var u=1&e,h=Ti(s);return function e(){for(var t=-1,i=arguments.length,o=-1,r=c.length,n=b(r+i),a=this&&this!==ms&&this instanceof e?h:s;++o<r;)n[o]=c[o];for(;i--;)n[o++]=arguments[++t];return ws(a,u?l:this,n)}}function Ri(c){return function(e,t,i){i&&"number"!=typeof i&&m(e,t,i)&&(t=i=jn),e=Br(e),t===jn?(t=e,e=0):t=Br(t),i=i===jn?e<t?1:-1:Br(i);for(var o=e,r=i,n=c,a=-1,s=S(pe((t-o)/(r||1)),0),l=b(s);s--;)l[n?s:++a]=o,o+=r;return l}}function Oi(i){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=I(e),t=I(t)),i(e,t)}}function Bi(e,t,i,o,r,n,a,s,l,c){var u=8&t,r=(4&(t=(t|(u?32:64))&~(u?64:32))||(t&=-4),[e,t,r,u?n:jn,u?a:jn,u?jn:n,u?jn:a,s,l,c]),n=i.apply(jn,r);return ao(e)&&go(n,r),n.placeholder=o,Co(n,e,t)}function Vi(e){var o=B[e];return function(e,t){var i;return e=I(e),(t=null==t?0:E(D(t),292))&&_e(e)?(i=(d(e)+"e").split("e"),+((i=(d(o(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))):o(e)}}var Fi=Pe&&1/ol(new Pe([,-0]))[1]==1/0?function(e){return new Pe(e)}:En;function Hi(n){return function(e){var t,i,o,r=H(e);return r==ra?el(e):r==ca?(r=e,t=-1,i=Array(r.size),r.forEach(function(e){i[++t]=[e,e]}),i):Is(n(o=e),function(e){return[e,o[e]]})}}function Gi(e,t,i,o,r,n,a,s){var l,c,u,h,m,d,p,g,f,_,C,y,v,w=2&t;if(w||"function"==typeof e)return(l=o?o.length:0)||(t&=-97,o=r=jn),a=a===jn?a:S(D(a),0),s=s===jn?s:D(s),l-=r?r.length:0,64&t&&(u=o,h=r,o=r=jn),c=w?jn:Ji(e),u=[e,t,i,o,r,u,h,n,a,s],c&&(h=c,a=(n=u)[1],d=h[1],g=(p=a|d)<131,f=d==Yn&&8==a||d==Yn&&256==a&&n[7].length<=h[8]||384==d&&h[7].length<=h[8]&&8==a,(g||f)&&(1&d&&(n[2]=h[2],p|=1&a?0:4),(g=h[3])&&(m=n[3],n[3]=m?pi(m,g,h[4]):g,n[4]=m?il(n[3],Wn):h[4]),(g=h[5])&&(m=n[5],n[5]=m?gi(m,g,h[6]):g,n[6]=m?il(n[5],Wn):h[6]),(g=h[7])&&(n[7]=g),d&Yn&&(n[8]=null==n[8]?h[8]:E(n[8],h[8])),null==n[9]&&(n[9]=h[9]),n[0]=h[0],n[1]=p)),e=u[0],t=u[1],i=u[2],o=u[3],r=u[4],!(s=u[9]=u[9]===jn?w?0:e.length:S(u[9]-l,0))&&24&t&&(t&=-25),f=t&&1!=t?8==t||16==t?Si(e,t,s):32!=t&&33!=t||r.length?xi.apply(jn,u):Mi(e,t,i,o):(C=i,y=1&t,v=Ti(_=e),function e(){return(this&&this!==ms&&this instanceof e?v:_).apply(y?C:this,arguments)}),Co((c?zt:go)(f,u),e,t);throw new T(Un)}function ki(e,t,i,o){return e===jn||G(e,Y[i])&&!V.call(o,i)?t:e}function Ni(e,t,i,o,r,n){return w(e)&&w(t)&&(n.set(t,e),Rt(e,t,jn,Ni,n),n.delete(t)),e}function ji(e){return xr(e)?jn:e}function Ui(e,t,i,o,r,n){var a=1&i,s=e.length,l=t.length;if(s!=l&&!(a&&s<l))return!1;var l=n.get(e),c=n.get(t);if(l&&c)return l==t&&c==e;var u=-1,h=!0,m=2&i?new Ue:jn;for(n.set(e,t),n.set(t,e);++u<s;){var d,p=e[u],g=t[u];if((d=o?a?o(g,p,u,t,e,n):o(p,g,u,e,t,n):d)!==jn){if(d)continue;h=!1;break}if(m){if(!Rs(t,function(e,t){return!Js(m,t)&&(p===e||r(p,e,i,o,n))&&m.push(t)})){h=!1;break}}else if(p!==g&&!r(p,g,i,o,n)){h=!1;break}}return n.delete(e),n.delete(t),h}function zi(e){return _o(ho(e,jn,Do),e+"")}function Wi(e){return ft(e,A,$i)}function Yi(e){return ft(e,L,eo)}var Ji=De?function(e){return De.get(e)}:En;function Ki(e){for(var t=e.name+"",i=Ie[t],o=V.call(Ie,t)?i.length:0;o--;){var r=i[o],n=r.func;if(null==n||n==e)return r.name}return t}function Qi(e){return(V.call(p,"placeholder")?p:e).placeholder}function h(){var e=(e=p.iteratee||wn)===wn?Pt:e;return arguments.length?e(arguments[0],arguments[1]):e}function qi(e,t){var i,o,e=e.__data__;return("string"==(o=typeof(i=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==i:null===i)?e["string"==typeof t?"string":"hash"]:e.map}function Xi(e){for(var t=A(e),i=t.length;i--;){var o=t[i],r=e[o];t[i]=[o,r,co(r)]}return t}function Zi(e,t){t=t;e=null==(e=e)?jn:e[t];return Et(e)?e:jn}var $i=fe?function(t){return null==t?[]:(t=g(t),Ps(fe(t),function(e){return ne.call(t,e)}))}:Mn,eo=fe?function(e){for(var t=[];e;)As(t,$i(e)),e=oe(e);return t}:Mn,H=i;function to(e,t,i){for(var o=-1,r=(t=ai(t,e)).length,n=!1;++o<r;){var a=To(t[o]);if(!(n=null!=e&&i(e,a)))break;e=e[a]}return n||++o!=r?n:!!(r=null==e?0:e.length)&&Sr(r)&&ro(a,r)&&(k(e)||Cr(e))}function io(e){return"function"!=typeof e.constructor||lo(e)?{}:Fe(oe(e))}function oo(e){return k(e)||Cr(e)||!!(se&&e&&e[se])}function ro(e,t){var i=typeof e;return!!(t=null==t?Jn:t)&&("number"==i||"symbol"!=i&&Za.test(e))&&-1<e&&e%1==0&&e<t}function m(e,t,i){var o;if(w(i))return("number"==(o=typeof t)?u(i)&&ro(t,i.length):"string"==o&&t in i)&&G(i[t],e)}function no(e,t){var i;if(!k(e))return"number"==(i=typeof e)||"symbol"==i||"boolean"==i||null==e||x(e)||(Ba.test(e)||!Oa.test(e)||null!=t&&e in g(t))}function ao(e){var t=Ki(e),i=p[t];return"function"==typeof i&&t in C.prototype&&(e===i||(t=Ji(i))&&e===t[0])}(n&&H(new n(new ArrayBuffer(1)))!=pa||Se&&H(new Se)!=ra||Ee&&H(Ee.resolve())!=sa||Pe&&H(new Pe)!=ca||e&&H(new e)!=ma)&&(H=function(e){var t=i(e),e=t==aa?e.constructor:jn,e=e?So(e):"";if(e)switch(e){case Ae:return pa;case Le:return ra;case Me:return sa;case Re:return ca;case Oe:return ma}return t});var so=J?br:Rn;function lo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function co(e){return e==e&&!w(e)}function uo(t,i){return function(e){return null!=e&&(e[t]===i&&(i!==jn||t in g(e)))}}function ho(n,a,s){return a=S(a===jn?n.length-1:a,0),function(){for(var e=arguments,t=-1,i=S(e.length-a,0),o=b(i);++t<i;)o[t]=e[a+t];for(var t=-1,r=b(a+1);++t<a;)r[t]=e[t];return r[a]=s(o),ws(n,this,r)}}function mo(e,t){return t.length<2?e:gt(e,s(t,0,-1))}function po(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=yo(zt),fo=de||function(e,t){return ms.setTimeout(e,t)},_o=yo(t);function Co(e,t,i){var o,r,n,t=t+"";return _o(e,(r=(t=(t=e=t).match(Na))?t[1].split(ja):[],n=i,Ts(qn,function(e){var t="_."+e[0];n&e[1]&&!xs(r,t)&&r.push(t)}),t=r.sort(),(i=t.length)?(t[o=i-1]=(1<i?"& ":"")+t[o],t=t.join(2<i?", ":" "),e.replace(ka,"{\n/* [wrapped with "+t+"] */\n")):e))}function yo(i){var o=0,r=0;return function(){var e=ve(),t=16-(e-r);if(r=e,0<t){if(800<=++o)return arguments[0]}else o=0;return i.apply(jn,arguments)}}function vo(e,t){var i=-1,o=e.length,r=o-1;for(t=t===jn?o:t;++i<t;){var n=Gt(i,r),a=e[n];e[n]=e[i],e[i]=a}return e.length=t,e}wo=(he=hr(he=function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Va,function(e,t,i,o){r.push(i?o.replace(Wa,"$1"):t||e)}),r},function(e){return 500===wo.size&&wo.clear(),e})).cache;var wo,bo=he;function To(e){var t;return"string"==typeof e||x(e)?e:"0"==(t=e+"")&&1/e==-1/0?"-0":t}function So(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Eo(e){var t;return e instanceof C?e.clone():((t=new f(e.__wrapped__,e.__chain__)).__actions__=P(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t)}n=a(function(e,t){return v(e)?rt(e,l(t,1,v,!0)):[]}),Ee=a(function(e,t){var i=o(t);return v(i)&&(i=jn),v(e)?rt(e,l(t,1,v,!0),h(i,2)):[]}),e=a(function(e,t){var i=o(t);return v(i)&&(i=jn),v(e)?rt(e,l(t,1,v,!0),jn,i):[]});function Po(e,t,i){var o=null==e?0:e.length;return o?((i=null==i?0:D(i))<0&&(i=S(o+i,0)),Bs(e,h(t,3),i)):-1}function xo(e,t,i){var o,r=null==e?0:e.length;return r?(o=r-1,i!==jn&&(o=D(i),o=i<0?S(r+o,0):E(o,r-1)),Bs(e,h(t,3),o,!0)):-1}function Do(e){return(null==e?0:e.length)?l(e,1):[]}function Io(e){return e&&e.length?e[0]:jn}J=a(function(e){var t=Is(e,ri);return t.length&&t[0]===e[0]?vt(t):[]}),de=a(function(e){var t=o(e),i=Is(e,ri);return t===o(i)?t=jn:i.pop(),i.length&&i[0]===e[0]?vt(i,h(t,2)):[]}),t=a(function(e){var t=o(e),i=Is(e,ri);return(t="function"==typeof t?t:jn)&&i.pop(),i.length&&i[0]===e[0]?vt(i,jn,t):[]});function o(e){var t=null==e?0:e.length;return t?e[t-1]:jn}he=a(Ao);function Ao(e,t){return e&&e.length&&t&&t.length?Ft(e,t):e}var Lo=zi(function(e,t){var i=null==e?0:e.length,o=et(e,t);return Ht(e,Is(t,function(e){return ro(e,i)?+e:e}).sort(di)),o});function Mo(e){return null==e?e:Te.call(e)}var Ro=a(function(e){return Xt(l(e,1,v,!0))}),Oo=a(function(e){var t=o(e);return v(t)&&(t=jn),Xt(l(e,1,v,!0),h(t,2))}),Bo=a(function(e){var t="function"==typeof(t=o(e))?t:jn;return Xt(l(e,1,v,!0),jn,t)});function Vo(t){var i;return t&&t.length?(i=0,t=Ps(t,function(e){return v(e)&&(i=S(e.length,i),1)}),Us(i,function(e){return Is(t,ks(e))})):[]}function Fo(e,t){return e&&e.length?(e=Vo(e),null==t?e:Is(e,function(e){return ws(t,jn,e)})):[]}var Ho=a(function(e,t){return v(e)?rt(e,t):[]}),Go=a(function(e){return ii(Ps(e,v))}),ko=a(function(e){var t=o(e);return v(t)&&(t=jn),ii(Ps(e,v),h(t,2))}),No=a(function(e){var t="function"==typeof(t=o(e))?t:jn;return ii(Ps(e,v),jn,t)}),jo=a(Vo);var Uo=a(function(e){var t=e.length,t="function"==typeof(t=1<t?e[t-1]:jn)?(e.pop(),t):jn;return Fo(e,t)});function zo(e){e=p(e);return e.__chain__=!0,e}function Wo(e,t){return t(e)}var Yo=zi(function(t){function e(e){return et(e,t)}var i=t.length,o=i?t[0]:0,r=this.__wrapped__;return!(1<i||this.__actions__.length)&&r instanceof C&&ro(o)?((r=r.slice(o,+o+(i?1:0))).__actions__.push({func:Wo,args:[e],thisArg:jn}),new f(r,this.__chain__).thru(function(e){return i&&!e.length&&e.push(jn),e})):this.thru(e)});var Jo=_i(function(e,t,i){V.call(e,i)?++e[i]:$e(e,i,1)});var Ko=Ei(Po),Qo=Ei(xo);function qo(e,t){return(k(e)?Ts:nt)(e,h(t,3))}function Xo(e,t){return(k(e)?Ss:at)(e,h(t,3))}var Zo=_i(function(e,t,i){V.call(e,i)?e[i].push(t):$e(e,i,[t])});var $o=a(function(e,t,i){var o=-1,r="function"==typeof t,n=u(e)?b(e.length):[];return nt(e,function(e){n[++o]=r?ws(t,e,i):wt(e,t,i)}),n}),er=_i(function(e,t,i){$e(e,i,t)});function tr(e,t){return(k(e)?Is:At)(e,h(t,3))}var ir=_i(function(e,t,i){e[i?0:1].push(t)},function(){return[[],[]]});var or=a(function(e,t){var i;return null==e?[]:(1<(i=t.length)&&m(e,t[0],t[1])?t=[]:2<i&&m(t[0],t[1],t[2])&&(t=[t[0]]),Bt(e,l(t,1),[]))}),rr=me||function(){return ms.Date.now()};function nr(e,t,i){return t=i?jn:t,t=e&&null==t?e.length:t,Gi(e,Yn,jn,jn,jn,jn,t)}function ar(e,t){var i;if("function"!=typeof t)throw new T(Un);return e=D(e),function(){return 0<--e&&(i=t.apply(this,arguments)),e<=1&&(t=jn),i}}var sr=a(function(e,t,i){var o,r=1;return i.length&&(o=il(i,Qi(sr)),r|=32),Gi(e,r,t,i,o)}),lr=a(function(e,t,i){var o,r=3;return i.length&&(o=il(i,Qi(lr)),r|=32),Gi(t,r,e,i,o)});function cr(o,i,e){var r,n,a,s,l,c,u=0,h=!1,m=!1,t=!0;if("function"!=typeof o)throw new T(Un);function d(e){var t=r,i=n;return r=n=jn,u=e,s=o.apply(i,t)}function p(e){var t=e-c;return c===jn||i<=t||t<0||m&&a<=e-u}function g(){var e,t=rr();if(p(t))return f(t);l=fo(g,(e=i-((t=t)-c),m?E(e,a-(t-u)):e))}function f(e){return l=jn,t&&r?d(e):(r=n=jn,s)}function _(){var e=rr(),t=p(e);if(r=arguments,n=this,c=e,t){if(l===jn)return u=e=c,l=fo(g,i),h?d(e):s;if(m)return ci(l),l=fo(g,i),d(c)}return l===jn&&(l=fo(g,i)),s}return i=I(i)||0,w(e)&&(h=!!e.leading,m="maxWait"in e,a=m?S(I(e.maxWait)||0,i):a,t="trailing"in e?!!e.trailing:t),_.cancel=function(){l!==jn&&ci(l),u=0,r=c=n=l=jn},_.flush=function(){return l===jn?s:f(rr())},_}var me=a(function(e,t){return ot(e,1,t)}),ur=a(function(e,t,i){return ot(e,I(t)||0,i)});function hr(o,r){if("function"!=typeof o||null!=r&&"function"!=typeof r)throw new T(Un);function n(){var e=arguments,t=r?r.apply(this,e):e[0],i=n.cache;return i.has(t)?i.get(t):(e=o.apply(this,e),n.cache=i.set(t,e)||i,e)}return n.cache=new(hr.Cache||je),n}function mr(t){if("function"!=typeof t)throw new T(Un);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}hr.Cache=je;var si=si(function(o,r){var n=(r=1==r.length&&k(r[0])?Is(r[0],Ws(h())):Is(l(r,1),Ws(h()))).length;return a(function(e){for(var t=-1,i=E(e.length,n);++t<i;)e[t]=r[t].call(this,e[t]);return ws(o,this,e)})}),dr=a(function(e,t){var i=il(t,Qi(dr));return Gi(e,32,jn,t,i)}),pr=a(function(e,t){var i=il(t,Qi(pr));return Gi(e,64,jn,t,i)}),gr=zi(function(e,t){return Gi(e,256,jn,jn,jn,t)});function G(e,t){return e===t||e!=e&&t!=t}var fr=Oi(_t),_r=Oi(function(e,t){return t<=e}),Cr=bt(function(){return arguments}())?bt:function(e){return N(e)&&V.call(e,"callee")&&!ne.call(e,"callee")},k=b.isArray,yr=gs?Ws(gs):function(e){return N(e)&&i(e)==da};function u(e){return null!=e&&Sr(e.length)&&!br(e)}function v(e){return N(e)&&u(e)}var vr=W||Rn,W=fs?Ws(fs):function(e){return N(e)&&i(e)==ea};function wr(e){var t;return!!N(e)&&((t=i(e))==ta||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!xr(e))}function br(e){return!!w(e)&&((e=i(e))==ia||e==oa||"[object AsyncFunction]"==e||"[object Proxy]"==e)}function Tr(e){return"number"==typeof e&&e==D(e)}function Sr(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=Jn}function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function N(e){return null!=e&&"object"==typeof e}var Er=_s?Ws(_s):function(e){return N(e)&&H(e)==ra};function Pr(e){return"number"==typeof e||N(e)&&i(e)==na}function xr(e){return!(!N(e)||i(e)!=aa)&&(null===(e=oe(e))||"function"==typeof(e=V.call(e,"constructor")&&e.constructor)&&e instanceof e&&K.call(e)==Z)}var Dr=Cs?Ws(Cs):function(e){return N(e)&&i(e)==la};var Ir=ys?Ws(ys):function(e){return N(e)&&H(e)==ca};function Ar(e){return"string"==typeof e||!k(e)&&N(e)&&i(e)==ua}function x(e){return"symbol"==typeof e||N(e)&&i(e)==ha}var Lr=vs?Ws(vs):function(e){return N(e)&&Sr(e.length)&&!!ls[i(e)]};var Mr=Oi(It),Rr=Oi(function(e,t){return e<=t});function Or(e){if(!e)return[];if(u(e))return(Ar(e)?nl:P)(e);if(le&&e[le]){for(var t,i=e[le](),o=[];!(t=i.next()).done;)o.push(t.value);return o}var r=H(e);return(r==ra?el:r==ca?ol:rn)(e)}function Br(e){return e?(e=I(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function D(e){var e=Br(e),t=e%1;return e==e?t?e-t:e:0}function Vr(e){return e?tt(D(e),0,Qn):0}function I(e){if("number"==typeof e)return e;if(x(e))return Kn;if("string"!=typeof(e=w(e)?w(t="function"==typeof e.valueOf?e.valueOf():e)?t+"":t:e))return 0===e?e:+e;e=zs(e);var t=Qa.test(e);return t||Xa.test(e)?hs(e.slice(2),t?2:8):Ka.test(e)?Kn:+e}function Fr(e){return fi(e,L(e))}function d(e){return null==e?"":c(e)}var Hr=Ci(function(e,t){if(lo(t)||u(t))fi(t,A(t),e);else for(var i in t)V.call(t,i)&&Qe(e,i,t[i])}),Gr=Ci(function(e,t){fi(t,L(t),e)}),kr=Ci(function(e,t,i,o){fi(t,L(t),e,o)}),Nr=Ci(function(e,t,i,o){fi(t,A(t),e,o)}),jr=zi(et);var Ur=a(function(e,t){e=g(e);var i=-1,o=t.length,r=2<o?t[2]:jn;for(r&&m(t[0],t[1],r)&&(o=1);++i<o;)for(var n=t[i],a=L(n),s=-1,l=a.length;++s<l;){var c=a[s],u=e[c];(u===jn||G(u,Y[c])&&!V.call(e,c))&&(e[c]=n[c])}return e}),zr=a(function(e){return e.push(jn,Ni),ws(Xr,jn,e)});function Wr(e,t,i){e=null==e?jn:gt(e,t);return e===jn?i:e}function Yr(e,t){return null!=e&&to(e,t,yt)}var Jr=Di(function(e,t,i){e[t=null!=t&&"function"!=typeof t.toString?X.call(t):t]=i},Cn(M)),Kr=Di(function(e,t,i){null!=t&&"function"!=typeof t.toString&&(t=X.call(t)),V.call(e,t)?e[t].push(i):e[t]=[i]},h),Qr=a(wt);function A(e){return(u(e)?ze:xt)(e)}function L(e){return u(e)?ze(e,!0):Dt(e)}var qr=Ci(function(e,t,i){Rt(e,t,i)}),Xr=Ci(function(e,t,i,o){Rt(e,t,i,o)}),Zr=zi(function(t,e){var i={};if(null!=t)for(var o=!1,r=(e=Is(e,function(e){return e=ai(e,t),o=o||1<e.length,e}),fi(t,Yi(t),i),o&&(i=y(i,7,ji)),e.length);r--;)Zt(i,e[r]);return i});var $r=zi(function(e,t){return null==e?{}:Vt(i=e,t,function(e,t){return Yr(i,t)});var i});function en(e,i){var t;return null==e?{}:(t=Is(Yi(e),function(e){return[e]}),i=h(i),Vt(e,t,function(e,t){return i(e,t[0])}))}var tn=Hi(A),on=Hi(L);function rn(e){return null==e?[]:Ys(e,A(e))}var nn=bi(function(e,t,i){return t=t.toLowerCase(),e+(i?an(t):t)});function an(e){return pn(d(e).toLowerCase())}function sn(e){return(e=d(e))&&e.replace($a,qs).replace(os,"")}var ln=bi(function(e,t,i){return e+(i?"-":"")+t.toLowerCase()}),cn=bi(function(e,t,i){return e+(i?" ":"")+t.toLowerCase()}),un=wi("toLowerCase");var hn=bi(function(e,t,i){return e+(i?"_":"")+t.toLowerCase()});var mn=bi(function(e,t,i){return e+(i?" ":"")+pn(t)});var dn=bi(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),pn=wi("toUpperCase");function gn(e,t,i){return e=d(e),(t=i?jn:t)===jn?(i=e,ns.test(i)?e.match(rs)||[]:e.match(Ua)||[]):e.match(t)||[]}var fn=a(function(e,t){try{return ws(e,jn,t)}catch(e){return wr(e)?e:new R(e)}}),_n=zi(function(t,e){return Ts(e,function(e){e=To(e),$e(t,e,sr(t[e],t))}),t});function Cn(e){return function(){return e}}var yn=Pi(),vn=Pi(!0);function M(e){return e}function wn(e){return Pt("function"==typeof e?e:y(e,1))}var bn=a(function(t,i){return function(e){return wt(e,t,i)}}),Tn=a(function(t,i){return function(e){return wt(t,e,i)}});function Sn(o,t,e){var i=A(t),r=pt(t,i),n=(null!=e||w(t)&&(r.length||!i.length)||(e=t,t=o,o=this,r=pt(t,A(t))),!(w(e)&&"chain"in e&&!e.chain)),a=br(o);return Ts(r,function(e){var i=t[e];o[e]=i,a&&(o.prototype[e]=function(){var e,t=this.__chain__;return n||t?(((e=o(this.__wrapped__)).__actions__=P(this.__actions__)).push({func:i,args:arguments,thisArg:o}),e.__chain__=t,e):i.apply(o,As([this.value()],arguments))})}),o}function En(){}var Pn=Ai(Is),xn=Ai(Es),Dn=Ai(Rs);function In(e){return no(e)?ks(To(e)):(t=e,function(e){return gt(e,t)});var t}var An=Ri(),Ln=Ri(!0);function Mn(){return[]}function Rn(){return!1}var On=Ii(function(e,t){return e+t},0),Bn=Vi("ceil"),Vn=Ii(function(e,t){return e/t},1),Fn=Vi("floor");var Hn,Gn=Ii(function(e,t){return e*t},1),kn=Vi("round"),Nn=Ii(function(e,t){return e-t},0);return p.after=function(e,t){if("function"!=typeof t)throw new T(Un);return e=D(e),function(){if(--e<1)return t.apply(this,arguments)}},p.ary=nr,p.assign=Hr,p.assignIn=Gr,p.assignInWith=kr,p.assignWith=Nr,p.at=jr,p.before=ar,p.bind=sr,p.bindAll=_n,p.bindKey=lr,p.castArray=function(){var e;return arguments.length?k(e=arguments[0])?e:[e]:[]},p.chain=zo,p.chunk=function(e,t,i){t=(i?m(e,t,i):t===jn)?1:S(D(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var r=0,n=0,a=b(pe(o/t));r<o;)a[n++]=s(e,r,r+=t);return a},p.compact=function(e){for(var t=-1,i=null==e?0:e.length,o=0,r=[];++t<i;){var n=e[t];n&&(r[o++]=n)}return r},p.concat=function(){var e=arguments.length;if(!e)return[];for(var t=b(e-1),i=arguments[0],o=e;o--;)t[o-1]=arguments[o];return As(k(i)?P(i):[i],l(t,1))},p.cond=function(o){var r=null==o?0:o.length,t=h();return o=r?Is(o,function(e){if("function"!=typeof e[1])throw new T(Un);return[t(e[0]),e[1]]}):[],a(function(e){for(var t=-1;++t<r;){var i=o[t];if(ws(i[0],this,e))return ws(i[1],this,e)}})},p.conforms=function(e){return t=y(e,1),i=A(t),function(e){return it(e,t,i)};var t,i},p.constant=Cn,p.countBy=Jo,p.create=function(e,t){return e=Fe(e),null==t?e:Ze(e,t)},p.curry=function e(t,i,o){t=Gi(t,8,jn,jn,jn,jn,jn,i=o?jn:i);return t.placeholder=e.placeholder,t},p.curryRight=function e(t,i,o){t=Gi(t,16,jn,jn,jn,jn,jn,i=o?jn:i);return t.placeholder=e.placeholder,t},p.debounce=cr,p.defaults=Ur,p.defaultsDeep=zr,p.defer=me,p.delay=ur,p.difference=n,p.differenceBy=Ee,p.differenceWith=e,p.drop=function(e,t,i){var o=null==e?0:e.length;return o?s(e,(t=i||t===jn?1:D(t))<0?0:t,o):[]},p.dropRight=function(e,t,i){var o=null==e?0:e.length;return o?s(e,0,(t=o-(t=i||t===jn?1:D(t)))<0?0:t):[]},p.dropRightWhile=function(e,t){return e&&e.length?ei(e,h(t,3),!0,!0):[]},p.dropWhile=function(e,t){return e&&e.length?ei(e,h(t,3),!0):[]},p.fill=function(e,t,i,o){if(!(l=null==e?0:e.length))return[];i&&"number"!=typeof i&&m(e,t,i)&&(i=0,o=l);var r=e,n=t,a=i,s=o,l=r.length;for((a=D(a))<0&&(a=l<-a?0:l+a),(s=s===jn||l<s?l:D(s))<0&&(s+=l),s=s<a?0:Vr(s);a<s;)r[a++]=n;return r},p.filter=function(e,t){return(k(e)?Ps:ct)(e,h(t,3))},p.flatMap=function(e,t){return l(tr(e,t),1)},p.flatMapDeep=function(e,t){return l(tr(e,t),1/0)},p.flatMapDepth=function(e,t,i){return i=i===jn?1:D(i),l(tr(e,t),i)},p.flatten=Do,p.flattenDeep=function(e){return(null==e?0:e.length)?l(e,1/0):[]},p.flattenDepth=function(e,t){return(null==e?0:e.length)?l(e,t=t===jn?1:D(t)):[]},p.flip=function(e){return Gi(e,512)},p.flow=yn,p.flowRight=vn,p.fromPairs=function(e){for(var t=-1,i=null==e?0:e.length,o={};++t<i;){var r=e[t];o[r[0]]=r[1]}return o},p.functions=function(e){return null==e?[]:pt(e,A(e))},p.functionsIn=function(e){return null==e?[]:pt(e,L(e))},p.groupBy=Zo,p.initial=function(e){return(null==e?0:e.length)?s(e,0,-1):[]},p.intersection=J,p.intersectionBy=de,p.intersectionWith=t,p.invert=Jr,p.invertBy=Kr,p.invokeMap=$o,p.iteratee=wn,p.keyBy=er,p.keys=A,p.keysIn=L,p.map=tr,p.mapKeys=function(e,o){var r={};return o=h(o,3),mt(e,function(e,t,i){$e(r,o(e,t,i),e)}),r},p.mapValues=function(e,o){var r={};return o=h(o,3),mt(e,function(e,t,i){$e(r,t,o(e,t,i))}),r},p.matches=function(e){return Lt(y(e,1))},p.matchesProperty=function(e,t){return Mt(e,y(t,1))},p.memoize=hr,p.merge=qr,p.mergeWith=Xr,p.method=bn,p.methodOf=Tn,p.mixin=Sn,p.negate=mr,p.nthArg=function(t){return t=D(t),a(function(e){return Ot(e,t)})},p.omit=Zr,p.omitBy=function(e,t){return en(e,mr(h(t)))},p.once=function(e){return ar(2,e)},p.orderBy=function(e,t,i,o){return null==e?[]:Bt(e,t=k(t)?t:null==t?[]:[t],i=k(i=o?jn:i)?i:null==i?[]:[i])},p.over=Pn,p.overArgs=si,p.overEvery=xn,p.overSome=Dn,p.partial=dr,p.partialRight=pr,p.partition=ir,p.pick=$r,p.pickBy=en,p.property=In,p.propertyOf=function(t){return function(e){return null==t?jn:gt(t,e)}},p.pull=he,p.pullAll=Ao,p.pullAllBy=function(e,t,i){return e&&e.length&&t&&t.length?Ft(e,t,h(i,2)):e},p.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?Ft(e,t,jn,i):e},p.pullAt=Lo,p.range=An,p.rangeRight=Ln,p.rearg=gr,p.reject=function(e,t){return(k(e)?Ps:ct)(e,mr(h(t,3)))},p.remove=function(e,t){var i=[];if(e&&e.length){var o=-1,r=[],n=e.length;for(t=h(t,3);++o<n;){var a=e[o];t(a,o,e)&&(i.push(a),r.push(o))}Ht(e,r)}return i},p.rest=function(e,t){if("function"!=typeof e)throw new T(Un);return a(e,t=t===jn?t:D(t))},p.reverse=Mo,p.sampleSize=function(e,t,i){return t=(i?m(e,t,i):t===jn)?1:D(t),(k(e)?Ye:jt)(e,t)},p.set=function(e,t,i){return null==e?e:Ut(e,t,i)},p.setWith=function(e,t,i,o){return o="function"==typeof o?o:jn,null==e?e:Ut(e,t,i,o)},p.shuffle=function(e){return(k(e)?Je:Wt)(e)},p.slice=function(e,t,i){var o=null==e?0:e.length;return o?(i=i&&"number"!=typeof i&&m(e,t,i)?(t=0,o):(t=null==t?0:D(t),i===jn?o:D(i)),s(e,t,i)):[]},p.sortBy=or,p.sortedUniq=function(e){return e&&e.length?Qt(e):[]},p.sortedUniqBy=function(e,t){return e&&e.length?Qt(e,h(t,2)):[]},p.split=function(e,t,i){return i&&"number"!=typeof i&&m(e,t,i)&&(t=i=jn),(i=i===jn?Qn:i>>>0)?(e=d(e))&&("string"==typeof t||null!=t&&!Dr(t))&&!(t=c(t))&&$s(e)?li(nl(e),0,i):e.split(t,i):[]},p.spread=function(i,o){if("function"!=typeof i)throw new T(Un);return o=null==o?0:S(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 T(Un);return w(i)&&(o="leading"in i?!!i.leading:o,r="trailing"in i?!!i.trailing:r),cr(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]:P(bo(d(e)))},p.toPlainObject=Fr,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:[]:w(e)&&br(t)?Fe(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=Vo,p.unzipWith=Fo,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=Ho,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||[],Ut)},p.zipWith=Uo,p.entries=tn,p.entriesIn=on,p.extend=Gr,p.extendWith=kr,Sn(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 y(e,4)},p.cloneDeep=function(e){return y(e,5)},p.cloneDeepWith=function(e,t){return y(e,5,t="function"==typeof t?t:jn)},p.cloneWith=function(e,t){return y(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=Vn,p.endsWith=function(e,t,i){e=d(e),t=c(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))&&Ha.test(e)?e.replace(Fa,"\\$&"):e},p.every=function(e,t,i){return(k(e)?Es: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=Fn,p.forEach=qo,p.forEachRight=Xo,p.forIn=function(e,t){return null==e?e:ut(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=u(e)?e:rn(e),i=i&&!o?D(i):0,o=e.length,i<0&&(i=S(o+i,0)),Ar(e)?i<=o&&-1<e.indexOf(t,i):!!o&&-1<Vs(e,t,i)},p.indexOf=function(e,t,i){var o=null==e?0:e.length;return o?Vs(e,t,e=(e=null==i?0:D(i))<0?S(o+e,0):e):-1},p.inRange=function(e,t,i){return t=Br(t),i===jn?(i=t,t=0):i=Br(i),(e=e=I(e))>=E(t=t,i=i)&&e<S(t,i)},p.invoke=Qr,p.isArguments=Cr,p.isArray=k,p.isArrayBuffer=yr,p.isArrayLike=u,p.isArrayLikeObject=v,p.isBoolean=function(e){return!0===e||!1===e||N(e)&&i(e)==$n},p.isBuffer=vr,p.isDate=W,p.isElement=function(e){return N(e)&&1===e.nodeType&&!xr(e)},p.isEmpty=function(e){if(null!=e){if(u(e)&&(k(e)||"string"==typeof e||"function"==typeof e.splice||vr(e)||Lr(e)||Cr(e)))return!e.length;var t,i=H(e);if(i==ra||i==ca)return!e.size;if(lo(e))return!xt(e).length;for(t in e)if(V.call(e,t))return!1}return!0},p.isEqual=function(e,t){return Tt(e,t)},p.isEqualWith=function(e,t,i){var o=(i="function"==typeof i?i:jn)?i(e,t):jn;return o===jn?Tt(e,t,jn,i):!!o},p.isError=wr,p.isFinite=function(e){return"number"==typeof e&&_e(e)},p.isFunction=br,p.isInteger=Tr,p.isLength=Sr,p.isMap=Er,p.isMatch=function(e,t){return e===t||St(e,t,Xi(t))},p.isMatchWith=function(e,t,i){return i="function"==typeof i?i:jn,St(e,t,Xi(t),i)},p.isNaN=function(e){return Pr(e)&&e!=+e},p.isNative=function(e){if(so(e))throw new R("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Et(e)},p.isNil=function(e){return null==e},p.isNull=function(e){return null===e},p.isNumber=Pr,p.isObject=w,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)&&H(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?S(o+r,0):E(r,o-1)),t!=t)return Bs(e,Hs,r,!0);for(var n=e,a=t,s=r+1;s--;)if(n[s]===a)return s;return s},p.lowerCase=cn,p.lowerFirst=un,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=En,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<t?e+Li(t-o,i):e},p.padStart=function(e,t,i){e=d(e);var o=(t=D(t))?rl(e):0;return t&&o<t?Li(t-o,i)+e:e},p.parseInt=function(e,t,i){return t=i||null==t?0:t&&+t,we(d(e).replace(Ga,""),t||0)},p.random=function(e,t,i){var o;return i&&"boolean"!=typeof i&&m(e,t,i)&&(t=i=jn),i===jn&&("boolean"==typeof t?(i=t,t=jn):"boolean"==typeof e&&(i=e,e=jn)),e===jn&&t===jn?(e=0,t=1):(e=Br(e),t===jn?(t=e,e=0):t=Br(t)),t<e&&(o=e,e=t,t=o),i||e%1||t%1?(o=be(),E(e+o*(t-e+us("1e-"+((o+"").length-1))),t)):Gt(e,t)},p.reduce=function(e,t,i){var o=k(e)?Ls:Ns,r=arguments.length<3;return o(e,h(t,4),i,r,nt)},p.reduceRight=function(e,t,i){var o=k(e)?Ms:Ns,r=arguments.length<3;return o(e,h(t,4),i,r,at)},p.repeat=function(e,t,i){return t=(i?m(e,t,i):t===jn)?1:D(t),kt(d(e),t)},p.replace=function(){var e=arguments,t=d(e[0]);return e.length<3?t:t.replace(e[1],e[2])},p.result=function(e,t,i){var o=-1,r=(t=ai(t,e)).length;for(r||(r=1,e=jn);++o<r;){var n=null==e?jn:e[To(t[o])];n===jn&&(o=r,n=i),e=br(n)?n.call(e):n}return e},p.round=kn,p.runInContext=r,p.sample=function(e){return(k(e)?We:Nt)(e)},p.size=function(e){var t;return null==e?0:u(e)?Ar(e)?rl(e):e.length:(t=H(e))==ra||t==ca?e.size:xt(e).length},p.snakeCase=hn,p.some=function(e,t,i){return(k(e)?Rs:Yt)(e,h(t=i&&m(e,t,i)?jn:t,3))},p.sortedIndex=function(e,t){return Jt(e,t)},p.sortedIndexBy=function(e,t,i){return Kt(e,t,h(i,2))},p.sortedIndexOf=function(e,t){var i=null==e?0:e.length;if(i){var o=Jt(e,t);if(o<i&&G(e[o],t))return o}return-1},p.sortedLastIndex=function(e,t){return Jt(e,t,!0)},p.sortedLastIndexBy=function(e,t,i){return Kt(e,t,h(i,2),!0)},p.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var i=Jt(e,t,!0)-1;if(G(e[i],t))return i}return-1},p.startCase=mn,p.startsWith=function(e,t,i){return e=d(e),i=null==i?0:tt(D(i),0,e.length),t=c(t),e.slice(i,i+t.length)==t},p.subtract=Nn,p.sum=function(e){return e&&e.length?js(e,M):0},p.sumBy=function(e,t){return e&&e.length?js(e,h(t,2)):0},p.template=function(a,e,t){var s,l,i=p.templateSettings;t&&m(a,e,t)&&(e=jn),a=d(a),e=kr({},e,i,ki);var o=A(t=kr({},e.imports,i.imports,ki)),r=Ys(t,o),c=0,i=e.interpolate||es,u="__p += '",t=j((e.escape||es).source+"|"+i.source+"|"+(i===Ra?Ya:es).source+"|"+(e.evaluate||es).source+"|$","g"),n="//# sourceURL="+(V.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ss+"]")+"\n";if(a.replace(t,function(e,t,i,o,r,n){return i=i||o,u+=a.slice(c,n).replace(ts,Zs),t&&(s=!0,u+="' +\n__e("+t+") +\n'"),r&&(l=!0,u+="';\n"+r+";\n__p += '"),i&&(u+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=n+e.length,e}),u+="';\n",i=V.call(e,"variable")&&e.variable){if(za.test(i))throw new R("Invalid `variable` option passed into `_.template`")}else u="with (obj) {\n"+u+"\n}\n";if(u=(l?u.replace(Sa,""):u).replace(Ea,"$1").replace(Pa,"$1;"),u="function("+(i||"obj")+") {\n"+(i?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}",(t=fn(function(){return O(o,n+"return "+u).apply(jn,r)})).source=u,wr(t))throw t;return t},p.times=function(e,t){if((e=D(e))<1||Jn<e)return[];for(var i=Qn,o=E(e,Qn),o=(t=h(t),e-=Qn,Us(o,t));++i<e;)t(i);return o},p.toFinite=Br,p.toInteger=D,p.toLength=Vr,p.toLower=function(e){return d(e).toLowerCase()},p.toNumber=I,p.toSafeInteger=function(e){return e?tt(D(e),-Jn,Jn):0===e?e:0},p.toString=d,p.toUpper=function(e){return d(e).toUpperCase()},p.trim=function(e,t,i){return(e=d(e))&&(i||t===jn)?zs(e):e&&(t=c(t))?li(i=nl(e),Ks(i,t=nl(t)),Qs(i,t)+1).join(""):e},p.trimEnd=function(e,t,i){return(e=d(e))&&(i||t===jn)?e.slice(0,al(e)+1):e&&(t=c(t))?li(i=nl(e),0,Qs(i,nl(t))+1).join(""):e},p.trimStart=function(e,t,i){return(e=d(e))&&(i||t===jn)?e.replace(Ga,""):e&&(t=c(t))?li(i=nl(e),Ks(i,nl(t))).join(""):e},p.truncate=function(e,t){var i,o=30,r="...",t=(w(t)&&(i="separator"in t?t.separator:i,o="length"in t?D(t.length):o,r="omission"in t?c(t.omission):r),(e=d(e)).length);if((t=$s(e)?(n=nl(e)).length:t)<=o)return e;if((t=o-rl(r))<1)return r;var n,o=n?li(n,0,t).join(""):e.slice(0,t);if(i!==jn)if(n&&(t+=o.length-t),Dr(i)){if(e.slice(t).search(i)){var a,s=o;for((i=i.global?i:j(i.source,d(Ja.exec(i))+"g")).lastIndex=0;a=i.exec(s);)var l=a.index;o=o.slice(0,l===jn?t:l)}}else e.indexOf(c(i),t)==t||-1<(n=o.lastIndexOf(i))&&(o=o.slice(0,n));return o+r},p.unescape=function(e){return(e=d(e))&&Ia.test(e)?e.replace(xa,sl):e},p.uniqueId=function(e){var t=++Q;return d(e)+t},p.upperCase=dn,p.upperFirst=pn,p.each=qo,p.eachRight=Xo,p.first=Io,Sn(p,(Hn={},mt(p,function(e,t){V.call(p.prototype,t)||(Hn[t]=e)}),Hn),{chain:!1}),p.VERSION="4.17.21",Ts(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),Ts(["drop","take"],function(i,o){C.prototype[i]=function(e){e=e===jn?1:S(D(e),0);var t=this.__filtered__&&!o?new C(this):this.clone();return t.__filtered__?t.__takeCount__=E(e,t.__takeCount__):t.__views__.push({size:E(e,Qn),type:i+(t.__dir__<0?"Right":"")}),t},C.prototype[i+"Right"]=function(e){return this.reverse()[i](e).reverse()}}),Ts(["filter","map","takeWhile"],function(e,t){var i=t+1,o=1==i||3==i;C.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:h(e,3),type:i}),t.__filtered__=t.__filtered__||o,t}}),Ts(["head","last"],function(e,t){var i="take"+(t?"Right":"");C.prototype[e]=function(){return this[i](1).value()[0]}}),Ts(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");C.prototype[e]=function(){return this.__filtered__?new C(this):this[i](1)}}),C.prototype.compact=function(){return this.filter(M)},C.prototype.find=function(e){return this.filter(e).head()},C.prototype.findLast=function(e){return this.reverse().find(e)},C.prototype.invokeMap=a(function(t,i){return"function"==typeof t?new C(this):this.map(function(e){return wt(e,t,i)})}),C.prototype.reject=function(e){return this.filter(mr(h(e)))},C.prototype.slice=function(e,t){e=D(e);var i=this;return i.__filtered__&&(0<e||t<0)?new C(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==jn?(t=D(t))<0?i.dropRight(-t):i.take(t-e):i)},C.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},C.prototype.toArray=function(){return this.take(Qn)},mt(C.prototype,function(c,e){var u=/^(?:filter|find|map|reject)|While$/.test(e),h=/^(?:head|last)$/.test(e),m=p[h?"take"+("last"==e?"Right":""):e],d=h||/^find/.test(e);m&&(p.prototype[e]=function(){function e(e){return e=m.apply(p,As([e],o)),h&&s?e[0]:e}var t,i=this.__wrapped__,o=h?[1]:arguments,r=i instanceof C,n=o[0],a=r||k(i),s=(a&&u&&"function"==typeof n&&1!=n.length&&(r=a=!1),this.__chain__),n=!!this.__actions__.length,l=d&&!s,r=r&&!n;return!d&&a?(i=r?i:new C(this),(t=c.apply(i,o)).__actions__.push({func:Wo,args:[e],thisArg:jn}),new f(t,s)):l&&r?c.apply(this,o):(t=this.thru(e),l?h?t.value()[0]:t.value():t)})}),Ts(["pop","push","shift","sort","splice","unshift"],function(e){var i=z[e],o=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var e,t=arguments;return r&&!this.__chain__?(e=this.value(),i.apply(k(e)?e:[],t)):this[o](function(e){return i.apply(k(e)?e:[],t)})}}),mt(C.prototype,function(e,t){var i,o=p[t];o&&(i=o.name+"",V.call(Ie,i)||(Ie[i]=[]),Ie[i].push({name:t,func:o}))}),Ie[xi(jn,2).name]=[{name:"wrapper",func:jn}],C.prototype.clone=function(){var e=new C(this.__wrapped__);return e.__actions__=P(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=P(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=P(this.__views__),e},C.prototype.reverse=function(){var e;return this.__filtered__?((e=new C(this)).__dir__=-1,e.__filtered__=!0):(e=this.clone()).__dir__*=-1,e},C.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,i=k(e),o=t<0,r=i?e.length:0,n=function(e,t,i){var o=-1,r=i.length;for(;++o<r;){var n=i[o],a=n.size;switch(n.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=E(t,e+a);break;case"takeRight":e=S(e,t-a)}}return{start:e,end:t}}(0,r,this.__views__),a=n.start,s=(n=n.end)-a,l=o?n:a-1,c=this.__iteratees__,u=c.length,h=0,m=E(s,this.__takeCount__);if(!i||!o&&r==s&&m==s)return ti(e,this.__actions__);var d=[];e:for(;s--&&h<m;){for(var p=-1,g=e[l+=t];++p<u;){var f=c[p],_=f.iteratee,f=f.type,_=_(g);if(2==f)g=_;else if(!_){if(1==f)continue e;break e}}d[h++]=g}return d},p.prototype.at=Yo,p.prototype.chain=function(){return zo(this)},p.prototype.commit=function(){return new f(this.value(),this.__chain__)},p.prototype.next=function(){this.__values__===jn&&(this.__values__=Or(this.value()));var e=this.__index__>=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=Eo(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 C?(e=e,(e=(e=this.__actions__.length?new C(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}(),V={};function Ti(e){this._viewer=e,this._core=new f,this._tree=V}function y(e){this._viewer=e,this._cesium=Cesium,this._core=new f}function Si(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function Ei(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource(),this._core=new f}V.Source=[],V.TempSource=[],V.entity=[],V.lastSelectEntity=null,V.pointsId=[],V.states=0,V.PointSelectSource=[],V.currentObj=null,V.selectedItem=null,V.setSource=function(e){this.Source=e},V.setTempSource=function(e){this.TempSource=e},V.setPointSelectSource=function(e){this.PointSelectSource=e},V.getSource=function(){return this.Source},V.getTempSource=function(){return this.TempSource},V.getPointSelectSource=function(){return this.PointSelectSource},V.push=function(e){this.Source.push(e)},V.pusTemSource=function(e){this.TempSource.push(e)},V.pusPointSelectSource=function(e){this.PointSelectSource.push(e)},V.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(V.Source,t);if(i){for(var o=0,r=this.TempSource.length;o<r;o++)if(this.TempSource[o].id==t){e.checked&&!this.TempSource[o].checked&&(this.TempSource[o].checked=!0);break}i.children||(i.children=[]),i.children.push(e)}else this.push(e);i=C.clone(e);return i.item=null,V.currentObj=i,this.pusTemSource(i),e.id},V.getSourceById=function(e,t){if(e)for(var i=0;i<e.length;i++){if(e[i].id==t)return e[i];if(e[i]&&e[i].children&&0<e[i].children.length){var o=this.getSourceById(e[i].children,t);if(null!=o)return o}}},V.exitsGroup=function(e,t){if(e)for(var i=V.Source,o=0;o<i.length;o++){if(i[o].id==e){if("group"==i[o].type)for(var r=0;r<i[o].children.length;r++)if(i[o].children[r].name==t)return!0;return!1}i[o]&&i[o].children&&0<i[o].children.length&&this.getSourceById(i[o].children,e)}},V.getTempSourceById=function(e){for(var t=0;t<this.TempSource.length;t++)if(this.TempSource[t].id==e)return this.TempSource[t]},V.getPointSelectSourceById=function(e){for(var t=0;t<this.PointSelectSource.length;t++)if(this.PointSelectSource[t].id==e)return this.PointSelectSource[t]},V.getSourceByName=function(e,t){return C.find(e,function(e){return e.name==t})},V.delete=function(e,t,i){var o=this.getSourceById(V.Source,e);if(o&&o.children&&0<o.children.length){for(;0<o.children.length;)this.delete(o.children[0].id);if(o&&"group"==o.type)(0==o.pId||""==o.pId?(a=this.getIndex(V.Source,o),V.Source):(n=this.getSourceById(V.Source,o.pId),a=this.getIndex(n.children,o),n.children)).splice(a,1);else{if(o.item)o.item.deleteObject(e);else{try{t.entities.removeById(o.id)}catch(e){}try{(r=t.dataSources.get(o.id))&&t.dataSources.remove(r)}catch(e){}try{(r=t.imageryLayers.get(o.id))&&t.imageryLayers.remove(r)}catch(e){}try{var r=t.scene.primitives.get(o.id);t.scene.primitives.remove(r)}catch(e){}}var n=this.getSourceById(V.Source,o.pId),a=this.getIndex(n.children,o);n.children.splice(a,1)}this.delete1(o.id)}else if(o&&"group"==o.type)(0==o.pId||""==o.pId?(a=this.getIndex(V.Source,o),V.Source):(n=this.getSourceById(V.Source,o.pId),a=this.getIndex(n.children,o),n.children)).splice(a,1),this.delete1(o.id);else if(o){if(o.item&&o.item.deleteObject)o.item.deleteObject(e);else{try{t.entities.removeById(o.id)}catch(e){}try{(r=t.dataSources.get(o.id))&&t.dataSources.remove(r)}catch(e){}try{(r=t.imageryLayers.get(o.id))&&t.imageryLayers.remove(r)}catch(e){}try{r=t.scene.primitives.get(o.id);t.scene.primitives.remove(r)}catch(e){}}this.delete1(o.id),(n=this.getSourceById(V.Source,o.pId))&&(a=this.getIndex(n.children,o),n.children.splice(a,1))}},V.temporaryItem={obj:[],state:"start",operation:""},V.endtemporaryItem=function(){V.temporaryItem.obj=[],V.temporaryItem.state="end",V.temporaryItem.operation=""},V.starttemporaryItem=function(e){var t=null;try{t=document.getElementById("toolTip")}catch(e){}if(null!=t&&(t.style.display="none"),null!=V.handler&&(V.handler.destroy(),V.handler=null),0<V.temporaryItem.obj.length&&"start"==V.temporaryItem.state)for(var i=0;i<V.temporaryItem.obj.length;i++){try{V.temporaryItem.obj[i].destroy()}catch(e){}try{e.entities.remove(V.temporaryItem.obj[i])}catch(e){}}return V.temporaryItem.obj=[],V.temporaryItem.state="start",V.temporaryItem.operation},V.delete1=function(e){for(var t=0;t<this.TempSource.length;t++)this.TempSource[t].id==e&&this.TempSource.splice(t,1)},V.getIndex=function(e,t){for(var i=0;i<e.length;i++)if(e[i].id==t.id)return i;return-1},V.setVisibilityTemp=function(t,e){var i=C.filter(this.TempSource,function(e){return e.id==t});i&&i.length&&(i[0].checked=e)},V.setVisibility=function(e,t,i,o){this.setVisibilityTemp(e,t);var r=this.getSourceById(V.Source,e);if(r)if(r.children&&0<r.children.length){for(var n,a=0;a<r.children.length;a++)this.setVisibility(r.children[a].id,t);if("group"!=r.type)if(r.item&&r.item.setVisibility)r.item.setVisibility(t,e);else{try{(n=i.entities.getById(r.id))&&(n.show=t)}catch(e){}try{(n=i.dataSources.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.imageryLayers.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.scene.primitives.get(r.id))&&(n.show=t)}catch(e){}}}else if("group"!=r.type)if(r.item&&r.item.setVisibility)r.item.setVisibility(t,e);else{try{(n=i.entities.getById(r.id))&&(n.show=t)}catch(e){}try{(n=i.dataSources.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.imageryLayers.get(r.id))&&(n.show=t)}catch(e){}try{(n=i.scene.primitives.get(r.id))&&(n.show=t)}catch(e){}}},V.removeItem=function(e){if(e)for(var t=0;t<e.length;t++)e[t].item=null,e[t].children&&this.removeItem(e[t].children);return e},V.changeGroup=function(e,t){var i,o,r=this.getSourceById(this.Source,e),n=this.getSourceById(this.Source,t);r&&n&&n.children&&((0==r.id||null==r.id||null==r.id?(o=this.getIndex(this.Source,r),this.Source):(i=this.getSourceById(this.Source,r.pId),o=this.getIndex(i.children,r),i.children)).splice(o,1),r.pId=t,n.children.push(r)),(r=this.getTempSourceById(e))&&(r.pId=t)},V.handler=null,V.removeHandler=function(){V.handler&&(V.handler.destroy(),V.handler=null)},Ti.prototype.createDivPoint=function(e,t,i={}){var o,r=i.id||"DivPoint"+this._core.getuid(),t=(Array.isArray(t)?2===t.length?o=Cesium.Cartesian3.fromDegrees(t[0],t[1]):3===t.length&&(o=Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2])):t.x&&t.y?o=t instanceof Cesium.Cartesian3?t:Cesium.Cartesian3.fromDegrees(t.x,t.y,t.z):t.lon&&t.lat&&(o=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height)),this.item={id:r,show:!0,name:e,type:"default",offset:"l",position:o},Object.assign(this.item,i),this._viewer.clock.onTick.addEventListener(this.updateDivPointEvent,this),{id:this.item.id,name:e,pId:i.GroupID||0,type:"DivPoint",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,t.pId),this},Ti.prototype.updateDivPointEvent=function(){if(this.item){let o=this.item,r=document.getElementById(o.id),t=!1;if(o.show){var n=this._viewer.scene.mapProjection.ellipsoid,i=this._viewer.scene.camera.positionWC;let e=new Cesium.EllipsoidalOccluder(n,i);e.isPointVisible(o.position)&&(void 0===o.near&&void 0===o.far||(n=this._core.getPointToCameraDistance(this._viewer,o.position),i=o.near||0,a=o.far||1/0,i<=n&&n<=a))?(r&&(r.style.display="block"),t=!0):r&&(r.style.display="none"),e=void 0}else r&&(r.style.display="none");if(t){i=this._viewer.scene.cartesianToCanvasCoordinates(o.position);if(!i)return;if(o.name||(o.name="SmartEarth"),!r){let i;if("default"===o.type)if(o.description){let e=o.description;n=this._core.isDOM(e);n&&(e="");let t="";Array.isArray(e)?e.forEach(e=>{t+='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>"}):t='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+e+"</div>",i=`<div id="${o.id}" style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
            `, m.style.pointerEvents = "all", m.addEventListener("mousedown", function (e) { let t = e.pageX - m.offsetLeft, i = e.pageY - m.offsetTop, o, r; document.onmousemove = e => { o = e.pageX - t, r = e.pageY - i, m.style.left = o + "px", m.style.top = r + "px", c(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(), u.start && "function" == typeof u.start && u.start(); let s = new Cesium.ScreenSpaceEventHandler(n.scene.canvas), l; if ("setView" === u.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(u.heading), pitch: Cesium.Math.toRadians(u.pitch) } }), n.scene.camera.moveBackward(u.distance), u.tooltip) { u.distance <= u.tooltip.far && u.distance >= u.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" } u.position = e, u.update && "function" == typeof u.update && u.update() }, n.scene.preRender.addEventListener(l); let t, i, o, r; s.setInputAction(e => { t = { position: e.position, heading: u.heading, pitch: u.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, u.heading = t.heading + o / 8, u.pitch = t.pitch - r / 6) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), s.setInputAction(e => { u.distance -= e * u.distance / 1e3, u.distance < u.minDistance && (u.distance = u.minDistance) }, Cesium.ScreenSpaceEventType.WHEEL) } else u.viewFrom && (a.viewFrom = u.viewFrom), n.trackedEntity = a; return s.setInputAction(e => { 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, u.end && "function" == typeof u.end && u.end() }, u.destroy = this.endTrackedEntity, u.updataTooltip = e => { m.innerHTML = u.tooltip.innerHTML = e }, u
    }, f.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)) }, f.prototype.isnull = function (e) { return null == e || "" === e }, f.prototype.getuid = function () { return this.uuid(8, 16) }, f.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 }, f.prototype.customGeometry = function (t) { if (t.scale) for (let e = 0; e < t.position.length - 2; e += 3)t.position[e] *= t.scale[0], t.position[e + 1] *= t.scale[1], t.position[e + 2] *= t.scale[2]; return new Cesium.Geometry({ attributes: { position: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: t.position }), st: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: t.st }) }, indices: t.indices, primitiveType: t.grid ? Cesium.PrimitiveType.LINES : Cesium.PrimitiveType.TRIANGLES, boundingSphere: t.boundingSphere }) }, f.prototype.getLevel = function (e) { let t = 0, i = e.scene.globe._surface._tilesToRender; return i && i.forEach(e => { e.level > t && (t = e.level) }), t }, f.prototype.getViewRectangle = function (e) { e = e.camera.computeViewRectangle(); return this.toDegreesRectangle(e) }, f.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 }, f.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 }, f.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 Ht && (e.primitive._selections.length ? e.primitive.releaseSelection() : e.primitive.setSelection(e.id))) }, remove() { this.changeOtherHighlight(), i.selected = [] }, destroy() { e.scene.postProcessStages.remove(i) } } }, f.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 } } }, f.prototype.uuid = function (e, t) { var i, o, r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), n = [], n = []; if (t = t || r.length, e) for (i = 0; i < e; i++)n[i] = r[0 | Math.random() * t]; else for (n[8] = n[13] = n[18] = n[23] = "-", n[14] = "4", i = 0; i < 36; i++)n[i] || (o = 0 | 16 * Math.random(), n[i] = r[19 == i ? 3 & o | 8 : o]); return n.join("") }, f.prototype.Shaders = function (e) { var t = ""; return "VSHADER_SOURCE " == e ? t = "attribute vec4 a_Position;\nattribute vec2 a_TexCoord;\nuniform mat4 u_MvpMatrix;\nvarying vec2 v_TexCoord;\nvoid main(){\ngl_Position = u_MvpMatrix * a_Position;\nv_TexCoord = a_TexCoord;\n}\n" : "TRIANGLE_FSHADER_SOURCE" == e ? t = "#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec4 v_Color;\nvoid main() {\ngl_FragColor = v_Color;\n'}\n" : "TRIANGLE_VSHADER_SOURCE" == e ? t = "attribute vec4 a_Position;\nattribute vec4 a_Normal;\nuniform mat4 u_MvpMatrix;\nuniform mat4 u_NormalMatrix;\nvarying vec4 v_Color;\nvoid main() {\nvec3 lightDirection = vec3(0.0, 0.0, 1.0);\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\ngl_Position = u_MvpMatrix * a_Position;\nvec3 normal = normalize(vec3(u_NormalMatrix * a_Normal));\nfloat nDotL = max(dot(normal, lightDirection), 0.0);\nv_Color = vec4(color.rgb * nDotL, color.a);\n}\n" : "vertexShaderSource" == e ? t = "attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute vec4 color;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_color = color;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n" : "fragmentShaderSource" == e && (t = "varying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec4 v_color;\r\n\r\nvec4 czm_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n    diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}void main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nvec4 color = czm_gammaCorrect(v_color);\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nczm_material material = czm_getDefaultMaterial(materialInput);\r\nmaterial.diffuse = color.rgb;\r\nmaterial.alpha = color.a;\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n"), t }, f.prototype.isHtmlColor = function (e) { return /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e) }, f.prototype.isUrl = function (e) { return !this.isnull(e) && /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.test(e) }, f.prototype.dateTimespan = function () { return (new Date).toTimeString() }, f.prototype.getPointFromTwoPointCenter = function (e, t, i) { var o, r, n, a, s, l = this.getSpaceDistancem(e, Cesium); if (!(l < t)) return n = e[0], e = e[1], n = Cesium.Cartographic.fromCartesian(n), o = Cesium.Math.toDegrees(n.longitude), r = Cesium.Math.toDegrees(n.latitude), n = n.height, e = Cesium.Cartographic.fromCartesian(e), a = Cesium.Math.toDegrees(e.longitude), s = Cesium.Math.toDegrees(e.latitude), e = e.height, l = parseFloat(l / t), t = Cesium.Math.lerp(o, a, 1 / l) - o, a = Cesium.Math.lerp(r, s, 1 / l) - r, s = Cesium.Math.lerp(n, e, 1 / l) - n, Cesium.Cartesian3.fromDegrees(o + t, r + a, i || n + s) }, f.prototype.getSpaceDistance = function (e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return 1e3 <= i ? (i / 1e3).toFixed(2) + "千米" : i.toFixed(2) + "米" }, f.prototype.getSpaceDistancem = function (e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return i.toFixed(2) }, f.prototype.getHorizontalDistance = function (e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic; a.setEndPoints(r, n), i += a.surfaceDistance } return i = 1e3 <= i ? (i / 1e3).toFixed(2) + "千米" : i.toFixed(2) + "米" }, f.prototype.getPointsInPolygon = function (o, r = 50, e = !0) { if (!(o.length < 3)) { o.push(o[0]); var t = Cesium_turf.lineString(o), t = Cesium_turf.bbox(t), t = Cesium_turf.pointGrid(t, r, { units: "meters" }), n = Cesium_turf.polygon([o]); let i = Cesium_turf.pointsWithinPolygon(t, n); if (e) for (let e = 0; e < o.length - 1; e++) { var a = Cesium_turf.lineString([o[e], o[e + 1]]), s = { units: "meters" }, l = Cesium_turf.length(a, s); let t; for (let e = r; ; e += r) { 1; { if (!(e <= l)) { t = Cesium_turf.along(a, l, s), i.features.push(t); break } t = Cesium_turf.along(a, e, s), i.features.push(t) } } } return i } }, f.prototype.tinFromPoints = function (e, t = {}) { let { polygon: r, getArea: n } = t, i = Cesium_turf.tin(e), a = 0; return i && i.features && i.features.forEach(e => { 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 } }, f.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 { area: t = n ? 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() }, f.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 }, f.prototype.computeCircle = function (t) { let i = zt.get(t); if (!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))) } zt.set(t, i) } return i }, f.prototype.getArea = function (t, c, i) { if (!(t.length < 3)) { let r = Array.concat(t, [t[0]]); var u = 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(c[a], c[s]), t = this.getdistance(c[s], c[l]), i = this.getdistance(c[a], c[l]), o = (e + t + i) / 2; u += Math.sqrt((o - e) * (o - t) * (o - i) * o) }), u = i ? u : u < 1e6 ? u.toFixed(2) + "平方米" : (u / 1e6).toFixed(2) + "平方千米" } }, f.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)) }, f.prototype.Angle = function (e, t, i) { e = this.Bearing(t, e) - this.Bearing(t, i); return e < 0 && (e += 360), e }, f.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 }, f.prototype.getHeight = function (e, t) { try { var i; return 1 < e.length ? (i = t.Cartographic.fromCartesian(e[0]), ((t.Cartographic.fromCartesian(e[1]).height - i.height) / 1e3).toFixed(2)) : 0 } catch (e) { console.log(e) } }, f.prototype.getPmfx = function (e, t, i, o, r, n) { var a = { gcs: [], min: 99999, max: 0, juli: 0, cys: t }, s = this.getSpaceDistancem(e, o), s = (a.juli = s, 0 != i && (t = parseInt(s / i)), a.cys = t, e[0]), i = e[e.length - 1], e = o.Cartographic.fromCartesian(s), l = o.Math.toDegrees(e.longitude), c = o.Math.toDegrees(e.latitude), s = (e.height, o.Cartographic.fromCartesian(i)), i = o.Math.toDegrees(s.longitude), u = o.Math.toDegrees(s.latitude), h = (s.height, t), m = o.Math.lerp(l, i, 1 / h) - l, d = o.Math.lerp(c, u, 1 / h) - c, p = [], g = []; p.push(e); for (var f = 0; f < h; f++) { var _ = l + (f + 1) * m, C = c + (f + 1) * d, _ = o.Cartesian3.fromDegrees(_, C); p.push(o.Cartographic.fromCartesian(_)) } var y = this; this.getHeightsFromLonLat(r, p).then(e => { if (e) { g = e; e = !1; for (!0 !== r.scene.globe.depthTestAgainstTerrain && (e = r.scene.globe.depthTestAgainstTerrain = !0), f = 0; f < g.length; f++) { var t = y.get3DTileOrPrimitivesHeights(p[f], r), t = (void 0 !== t && (g[f] = t), g[f].toFixed(2)); parseFloat(t) < parseFloat(a.min) && (a.min = parseFloat(t)), parseFloat(t) > parseFloat(a.max) && (a.max = parseFloat(t)), a.gcs.push(t) } e && (r.scene.globe.depthTestAgainstTerrain = !1), "" != n && null != n && "function" == typeof n && n(a) } }) }, f.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 < m.length - 1; e++) { var l = n.getSpaceDistancem([m[e], m[e + 1]], d), l = parseFloat(l); a.juli += l, 0 != i && (t = parseInt(l / i)), s.push(t), a.cys += t } let c = () => { 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, c = d.Math.lerp(n, o, 1 / s) - n; 0 === t && p.push(i); for (let e = 0; e < s; e++) { var u = r + (e + 1) * l, h = n + (e + 1) * c, u = d.Cartesian3.fromDegrees(u, h); p.push(d.Cartographic.fromCartesian(u)) } }), p.push(d.Cartographic.fromCartesian(m[m.length - 1])); let i = []; a.allPoint = p, this.getHeightsFromLonLat(o, p).then(e => { if (e) { i = e; e = o.scene.globe.depthTestAgainstTerrain; o.scene.globe.depthTestAgainstTerrain = !0; for (let e = 0; e < i.length; e++) { var t = n.get3DTileOrPrimitivesHeights(p[e], o), t = (void 0 !== t && (i[e] = t), i[e].toFixed(2)); parseFloat(t) < parseFloat(a.min) && (a.min = parseFloat(t)), parseFloat(t) > parseFloat(a.max) && (a.max = parseFloat(t)), a.gcs.push(t) } o.scene.globe.depthTestAgainstTerrain = e, r && "function" == typeof r && r(a) } }) }; 1e3 < a.cys ? layuiLayer && layuiLayer.msg("当前采样点数过多,是否继续分析?", { time: 0, btn: ["继续", "取消"], btnAlign: "c", yes: e => { layuiLayer.close(e), setTimeout(() => { c() }, 10) }, btn2: () => { r && "function" == typeof r && r(a) } }) : setTimeout(() => { c() }, 10) }, f.prototype.get3DTileOrPrimitivesHeights = function (e, t) { return t.scene.sampleHeight(e) }, f.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) }) }, f.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 c = (o - t) / 6; if (90 == o) { for (var u = 1; u <= 5; u++)n.push((t + u * c) / 90); n.push(1), n.forEach(function (e, t) { l.addColorStop(e, i[t]) }) } else { for (u = 1; u <= 5; u++)n.push((t + u * c) / 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 }, f.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)), c = Math.pow(r, 4), u = 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 * u + 4 * h) + Math.pow(e, 6) / 720 * r * s * d * (61 - 58 * r * r + c + 270 * u - 330 * r * r * u), 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 + c + 14 * u - 58 * u * l); return new o.Cartesian2(h, t) }, f.prototype.to_Radian = function (e) { return e * Math.PI / 180 }, f.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)) }, f.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)) }, f.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 < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic, a = (a.setEndPoints(r, n), a.surfaceDistance); i += Math.sqrt(Math.pow(a, 2) + Math.pow(n.height - r.height, 2)) } return i }([e, t], i)), e = (parseFloat(function (e, t) { for (var i = 0, o = 0; o < e.length - 1; o++) { var r = t.Cartographic.fromCartesian(e[o]), n = t.Cartographic.fromCartesian(e[o + 1]), a = new t.EllipsoidGeodesic; a.setEndPoints(r, n), i += a.surfaceDistance } return i }([e, r], i)), parseFloat(function (e, t) { try { var i; return 1 < e.length ? (i = t.Cartographic.fromCartesian(e[0]), t.Cartographic.fromCartesian(e[1]).height - i.height) : 0 } catch (e) { console.log(e) } }([r, t], i))); return 180 * Math.asin(e / o) / 3.14 }, f.prototype.TwoPointAzimuth = function (e, t, i, o) { function r(e) { return e * Math.PI / 180 } var n = 0, a = Math.round(.5 + 36e4 * t), s = Math.round(.5 + 36e4 * o), l = Math.round(.5 + 36e4 * e), c = Math.round(.5 + 36e4 * i); return t = r(t), e = r(e), o = r(o), i = r(i), a === s && l === c || (l === c ? s < a && (n = 180) : (t = Math.acos(Math.sin(o) * Math.sin(t) + Math.cos(o) * Math.cos(t) * Math.cos(i - e)), n = 180 * Math.asin(Math.cos(o) * Math.sin(i - e) / Math.sin(t)) / Math.PI, a < s && l < c || (s < a && c < l || s < a && l < c ? n = 180 - n : a < s && c < l && (n += 360)))), n }, f.prototype.twoPointsHeadingPitchRoll = function (e, t, i) { let o = new Cesium.Camera(e.scene); o.position = t, o.direction = Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3), o.up = Cesium.Cartesian3.normalize(t, new Cesium.Cartesian3); var e = Cesium.Cartesian3.distance(t, i), i = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(i, t, new Cesium.Cartesian3), new Cesium.Cartesian3), { heading: t, pitch: i, roll: r } = (o.direction = i, o.frustum.near = 0, o.frustum.far = e, o); return o = null, { heading: t, pitch: i, roll: r, radius: e } }, f.prototype.ThreePointAzimuth = function (e, t, i, o) { var r = Math.PI / 180, n = 180 / Math.PI, e = o.Cartographic.fromCartesian(e), a = o.Cartographic.fromCartesian(t), s = o.Cartographic.fromCartesian(i); function l(e, t) { var i = e.latitude * r, e = e.longitude * r, o = t.latitude * r, t = t.longitude * r, i = -Math.atan2(Math.sin(e - t) * Math.cos(o), Math.cos(i) * Math.sin(o) - Math.sin(i) * Math.cos(o) * Math.cos(e - t)); return i < 0 && (i += 2 * Math.PI), i *= n } t = o.Cartesian3.fromDegrees(o.Math.toDegrees(a.longitude), o.Math.toDegrees(a.latitude), e.height), i = o.Cartesian3.fromDegrees(o.Math.toDegrees(s.longitude), o.Math.toDegrees(s.latitude), e.height); a = o.Cartographic.fromCartesian(t), s = o.Cartographic.fromCartesian(i); return t = s, (i = l(o = a, i = e) - l(o, t)) < 0 && (i += 360), i }, f.prototype.setDepthTest = function (e, t) { "open" === e && void 0 === this.defaultDepthTest ? (this.defaultDepthTest = !!t.scene.globe.depthTestAgainstTerrain, t.scene.globe.depthTestAgainstTerrain = !0) : "close" === e && void 0 !== this.defaultDepthTest && (t.scene.globe.depthTestAgainstTerrain = !!this.defaultDepthTest, this.defaultDepthTest = void 0) }, f.prototype.setImageMaterialProperty = function (e, t, i, o) { this.id = o; var n = this, o = document.createElement("canvas"), r = (o.id = this.id + "-a", o.width = 700, o.height = 100, document.createElement("canvas")), o = (r.id = this.id + "-b", r.width = 700, r.height = 100, document.body.appendChild(o), document.body.appendChild(r), e && (n.images = e), new t.CallbackProperty(function (e, t) { var i = document.getElementById(n.id + "-" + n.curCanvas), o = i.getContext("2d"), r = new Image; return r.src = n.images, o.clearRect(0, 0, 700, 100), r.onload = function () { n.i <= 700 ? (o.drawImage(r, n.i, 0), o.drawImage(r, n.i + 100, 0)) : n.i = 0, n.i += 5 }, n.curCanvas = "a" === n.curCanvas ? "b" : "a", i }, !1)); return 1 == i && (o = new t.CallbackProperty(function (e, t) { var i = document.getElementById(n.id + "-" + n.curCanvas), o = i.getContext("2d"), r = o.createLinearGradient(0, 100, 0, 0); return r.addColorStop(0, "red"), 1 < n.i && (n.i = 1), r.addColorStop(n.i, "rgb(255,0,0,0.6)"), r.addColorStop(1, "rgb(255,0,0,0.1)"), o.clearRect(0, 0, 700, 100), o.fillStyle = r, o.fillRect(0, 0, 700, 100), n.i < 1 ? n.i += .01 : n.i = 0, n.curCanvas = "a" === n.curCanvas ? "b" : "a", i }, !1)), new t.ImageMaterialProperty({ image: o, transparent: !0 }) }, f.prototype.setDrawCanvasImage = function (e, t) { var o = document.getElementById("canvas-" + curCanvas), r = o.getContext("2d"), n = new Image; return n.src = images, r.clearRect(0, 0, 700, 100), n.onload = function () { i <= 700 ? (r.drawImage(n, i, 0), r.drawImage(n, i + 100, 0)) : i = 0, i += 5 }, curCanvas = "a" === curCanvas ? "b" : "a", o }, f.prototype.setDrawCanvasColorUpdown = function (e, t) { var o = document.getElementById("canvas-" + curCanvas), r = o.getContext("2d"), n = r.createLinearGradient(0, 100, 0, 0); return n.addColorStop(0, "red"), 1 < i && (i = 1), n.addColorStop(i, "rgb(255,0,0,0.6)"), n.addColorStop(1, "rgb(255,0,0,0.1)"), r.clearRect(0, 0, 700, 100), r.fillStyle = n, r.fillRect(0, 0, 700, 100), i < 1 ? i += .01 : i = 0, curCanvas = "a" === curCanvas ? "b" : "a", o }, f.prototype.toDegrees = function (e) { e = Cesium.Cartographic.fromCartesian(e); return { lon: Cesium.Math.toDegrees(e.longitude), lat: Cesium.Math.toDegrees(e.latitude), height: e.height } }, f.prototype.fromDegrees = function (e) { return Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height) }, f.prototype.LineInterpolation = function (i, e) { let t, o, r = !1, n = (t = e.positions || e, o = e.num || 100, e.getHeight && (r = !0), { positions: [], cartographic: [], lon_lat: [], height: [] }); for (let e = 0; e < t.length - 1; e++) { var a = this.toDegrees(t[e]), s = this.toDegrees(t[e + 1]); { l = void 0; c = void 0; u = void 0; h = void 0; m = void 0; d = void 0; p = void 0; g = void 0; f = void 0; _ = void 0; var l = a.lon; var c = a.lat; var u = s.lon; var h = s.lat; var m = Cesium.Math.lerp(l, u, 1 / o) - l, d = Cesium.Math.lerp(c, h, 1 / o) - c; n.lon_lat.push(l, c); let t; if (r) { t = C(l, c), n.height.push(t), n.positions.push(Cesium.Cartesian3.fromDegrees(l, c, t)); for (let e = 0; e < o; e++) { var p = l + (e + 1) * m, g = c + (e + 1) * d; n.lon_lat.push(p, g), t = C(p, g), n.height.push(t), n.positions.push(Cesium.Cartesian3.fromDegrees(p, g, t)) } n.lon_lat.push(u, h), t = C(u, h), n.height.push(t), n.positions.push(Cesium.Cartesian3.fromDegrees(u, h, t)) } else { n.positions.push(Cesium.Cartesian3.fromDegrees(l, c)); for (let e = 0; e < o; e++) { var f = l + (e + 1) * m, _ = c + (e + 1) * d; n.lon_lat.push(f, _), n.positions.push(Cesium.Cartesian3.fromDegrees(f, _)) } n.lon_lat.push(u, h), n.positions.push(Cesium.Cartesian3.fromDegrees(u, h)) } } } function C(e, t) { e = Cesium.Cartographic.fromDegrees(e, t); return i.scene.globe.getHeight(e) } return n }, f.prototype.CIMServerTool = function (e) { return new ne(e) }, f.prototype.Recorder = function (e, t) { return this._Recorder ? (this._Recorder.mediaOutputPath = this.defaultValue(e, "test.mp4"), t && (this._Recorder.videoBPS = t)) : this._Recorder = new ae(e, t), this._Recorder }, f.prototype.getLinkMaterial = function (e, t, i) { function o(e, t, i) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.lightSpotColor = t, this.duration = i, this.old = void 0, this._time = (new Date).getTime() } return Cesium.PolylineLinkMaterialProperty || (Object.defineProperties(o.prototype, { isConstant: { get: function () { return !1 } }, definitionChanged: { get: function () { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), o.prototype.getType = function (e) { return "PolylineLink" }, o.prototype.getValue = function (e, t) { return (t = Cesium.defined(t) ? t : {}).color = Cesium.Property.getValueOrClonedDefault(this._color, e, Cesium.Color.WHITE, t.color), t.lightSpotColor = this.lightSpotColor, t.time = ((new Date).getTime() - this._time) % this.duration / this.duration, void 0 === this.old && (this.old = t.time), .5 < this.old && t.time < .5 && (t.plus = !t.plus, t.inverse = !t.inverse), this.old = t.time, t.plus ? t.time = 1.1 * t.time : t.time = 1.2 * t.time - .1, t }, o.prototype.equals = function (e) { return this === e || e instanceof o && Cesium.Property.equals(this._color, e._color) }, Cesium.PolylineLinkMaterialProperty = o, Cesium.Material.PolylineLinkType = "PolylineLink", Cesium.Material.PolylineLinkSource = Ut, Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineLinkType, { fabric: { type: Cesium.Material.PolylineLinkType, uniforms: { color: new Cesium.Color(1, 0, 0, .5), lightSpotColor: new Cesium.Color(1, 1, 1, .5), time: 0, plus: !0, inverse: !1 }, source: Cesium.Material.PolylineLinkSource }, translucent: function (e) { return !0 } })), new Cesium.PolylineLinkMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e, "#0000ff")), Cesium.Color.fromCssColorString(this.defaultValue(t, "#ffffff")), this.defaultValue(i, 3e3)) }, f.prototype.getTrailLinkMaterial = function (e, t, i) { return new te(e, t, i) }, f.prototype.getConeRadarMaterial = function (e) { function t(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.ConeRadarMaterialProperty || (Object.defineProperties(t.prototype, { isConstant: { get: function () { return !1 } }, definitionChanged: { get: function () { return this._definitionChanged } }, color: Cesium.createPropertyDescriptor("color") }), t.prototype.getType = function (e) { return "ConeRadar" }, t.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 }, t.prototype.equals = function (e) { return this === e || e instanceof t && Cesium.Property.equals(this._color, e._color) }, Cesium.ConeRadarMaterialProperty = t, Cesium.Material.ConeRadarType = "ConeRadar", Cesium.Material.ConeRadarSource = "\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                                                    material.alpha = 0.0;\n                                                    float intensity = step(0.001,ripple(dis, 80.0, 15.0));\n                                                    if(intensity == 1.0)\n                                                    {\n                                                        material.alpha = 1.0;\n                                                    }\n                                                    return material;\n                                                }", Cesium.Material._materialCache.addMaterial(Cesium.Material.ConeRadarType, { fabric: { type: Cesium.Material.ConeRadarType, uniforms: { color: new Cesium.Color(1, 0, 0, .5), time: 0 }, source: Cesium.Material.ConeRadarSource }, translucent: function (e) { return !0 } })), new Cesium.ConeRadarMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e, "#0000ff")), 3e3) }, f.prototype.getMultiCircleScanMaterial = function (e, t) { function i(e, t) { this._definitionChanged = new Cesium.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.u_radius1 = 0, this.u_radius2 = 0, this.u_radius3 = 0, this.duration = t, this._time = (new Date).getTime() } return Cesium.CircleScanMultiMaterialProperty || (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 "CircleScanMulti" }, 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.time < 1 / 3 && 0 === this.u_radius2 && 0 === this.u_radius1 ? this.u_radius3 = t.time : t.time >= 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)) }, f.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)) }, f.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<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }", Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleScanType, { fabric: { type: Cesium.Material.CircleScanType, uniforms: { color: new Cesium.Color(1, 0, 0, 1), time: 0 }, source: Cesium.Material.CircleScanSource }, translucent: function (e) { return !0 } })), new Cesium.CircleScanMaterialProperty(Cesium.Color.fromCssColorString(this.defaultValue(e, "#ff0000")), this.defaultValue(t, 3e3)) }, f.prototype.getRadarScanMaterial = 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.RadarScanMaterialProperty || (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 "RadarScan" }, 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.angle1 = 360 * t.time, t.angle2 = 360 * t.time + 60, 360 < t.angle2 && (t.angle2 = t.angle2 - 360), t }, i.prototype.equals = function (e) { return this === e || e instanceof i && Cesium.Property.equals(this._color, e._color) }, Cesium.RadarScanMaterialProperty = i, Cesium.Material.RadarScanType = "RadarScan", Cesium.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                        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)) }, f.prototype.gradientColor = function (e, t, i) { return new me(e, t, i) }, f.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, Wt = "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 f } function Yt(e, t) { this._viewer = e, this._cesium = t, this._core = new f } function Jt(e) { this._viewer = e, this.editType = "Entity", this._core = new f, this.tooltip = this._core.CreateTooltip({ id: "ModelEdit" }) } f.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Wt(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, f.prototype.xml2json = _e, f.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 = 0 < t.indexOf("android") ? "android" : navigator.platform.toLowerCase(), { version: (t.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], plat: e, type: i, pc: o, prefix: r, isMobile: "pc" != o } }, m.prototype.VectorColorTransformation = function (e, t) { var i; return e && "[" == e.toString().charAt(0) && "]" == e.toString().charAt(e.length - 1) && (i = styleOption.fillColor.replace(/\[/, "").replace(/\]/, ""), e = t.properties[i]), this._core.isnull(e) || (this._core.isHtmlColor(e) ? e = this.colorFromHtmlColor(e) : null != (e = /^rgb/.test(e) ? this.rgbaStringToRgbaObj(e) : e).r ? (1 < e.r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), e = this.createColor(e.r, e.g, e.b, e.a)) : null != e.red && (1 < e.red && (e.red = e.red / 255), 1 < e.green && (e.green = e.green / 255), 1 < e.blue && (e.blue = e.blue / 255), 1 < e.alpha && (e.alpha = e.alpha / 255), e = this.createColor(e.red, e.green, e.blue, e.alpha))), e }, m.prototype.createColorTransformation = function (e) { return e = this._core.isnull(e) || "[" == e.toString().charAt(0) && "]" == e.toString().charAt(e.length - 1) ? e : this._core.isHtmlColor(e) ? this.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this.createColor(e.r, e.g, e.b, e.a)) }, m.prototype.createColor = function (e, t, i, o) { return new this._cesium.Color(e, t, i, o) }, m.prototype.colorFromHtmlColor = function (e) { if ("object" == typeof e) return e.color || void 0; if (e = e.toLowerCase(), /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e)) { if (4 == e.length) { for (var t = "#", i = 1; i < 4; i += 1)t += e.slice(i, i + 1).concat(e.slice(i, i + 1)); e = t } for (var o, r = [], i = 1; i < 7; i += 2)r.push(parseInt("0x" + e.slice(i, i + 2))); return 9 == e.length ? (o = parseInt(e.substr(7, 2)) / 100, this.createColor(r[0] / 255, r[1] / 255, r[2] / 255, o)) : this.createColor(r[0] / 255, r[1] / 255, r[2] / 255, 1) } console.log("不是有效的html颜色", e) }, m.prototype.toHtmlColor = function (e) { e = e.split(","); return "#" + ((1 << 24) + (parseInt(e[0].split("(")[1]) << 16) + (parseInt(e[1]) << 8) + parseInt(e[2].split(")")[0])).toString(16).slice(1) }, m.prototype.rgbaStringToRgbaObj = function (e) { var t; return /^rgb/.test(e) && (t = (e = (e = (e = e.replace(/rgba\(/g, "")).replace(/rgb\(/g, "")).replace(/\)/g, "")).split(","), e = {}, 3 == t.length ? (e.r = parseFloat(t[0]), e.g = parseFloat(t[1]), e.b = parseFloat(t[2]), e.a = 1) : 4 == t.length && (e.r = parseFloat(t[0]), e.g = parseFloat(t[1]), e.b = parseFloat(t[2]), e.a = parseFloat(t[3]))), e }, m.prototype.CreateColor = function (e, t, i, o) { return new this._cesium.Color(e, t, i, o) }, Yt.prototype.createElevationContour = function (e, t, i) { var o, r = this, n = (r.item = {}, this._core.defaultValue(i.min, -414)), a = r._core.defaultValue(i.max, 8844), s = (r.item.selectedShading = t, r._viewer.scene.globe); return e ? ("elevation" === t ? (o = new r._cesium.Material({ fabric: { type: "ElevationColorContour", materials: { contourMaterial: { type: "ElevationContour" }, elevationRampMaterial: { type: "ElevationRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, elevationRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.elevationRampMaterial.uniforms, r.item.shadingUniforms.minimumHeight = n, r.item.shadingUniforms.maximumHeight = a, r.item.contourUniforms = o.materials.contourMaterial.uniforms) : "slope" === t ? (o = new r._cesium.Material({ fabric: { type: "SlopeColorContour", materials: { contourMaterial: { type: "ElevationContour" }, slopeRampMaterial: { type: "SlopeRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, slopeRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.slopeRampMaterial.uniforms, r.item.contourUniforms = o.materials.contourMaterial.uniforms) : "aspect" === t ? (o = new r._cesium.Material({ fabric: { type: "AspectColorContour", materials: { contourMaterial: { type: "ElevationContour" }, aspectRampMaterial: { type: "AspectRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, aspectRampMaterial.alpha)" } }, translucent: !1 }), r.item.shadingUniforms = o.materials.aspectRampMaterial.uniforms, r.item.contourUniforms = o.materials.contourMaterial.uniforms) : (o = r._cesium.Material.fromType("ElevationContour"), r.item.contourUniforms = o.uniforms), r.item.contourUniforms.width = r._core.defaultValue(i.width, 2), r.item.contourUniforms.spacing = r._core.defaultValue(i.spacing, 150), r.item.contourUniforms.color = r._cesium.Color.fromCssColorString(r._core.defaultValue(i.lineColor, "#ff0000"))) : "elevation" === t ? (o = r._cesium.Material.fromType("ElevationRamp"), r.item.shadingUniforms = o.uniforms, r.item.shadingUniforms.minimumHeight = n, r.item.shadingUniforms.maximumHeight = a) : "slope" === t ? (o = r._cesium.Material.fromType("SlopeRamp"), r.item.shadingUniforms = o.uniforms) : "aspect" === t && (o = r._cesium.Material.fromType("AspectRamp"), r.item.shadingUniforms = o.uniforms), "none" !== t && (r.item.shadingUniforms.image = i ? r._core.getColorRamp(t, i.colorArr, i.min, i.max) : r._core.getColorRamp(t)), s.material = void 0, r._viewer.render(), s.material = o, r.item.material = s.material, this }, Yt.prototype.executeMaterial = function (e) { var t, i = this, e = (i.item = {}, i.item.selectedShading = e, i.item.shadingUniforms = {}, this._viewer.scene.globe); return "elevation" === i.item.selectedShading ? (t = this._cesium.Material.fromType("ElevationRamp"), i.item.shadingUniforms = t.uniforms, i.item.shadingUniforms.minHeight = -414, i.item.shadingUniforms.maxHeight = 8777) : "slope" === i.item.selectedShading ? (t = this._cesium.Material.fromType("SlopeRamp"), i.item.shadingUniforms = t.uniforms) : "aspect" === i.item.selectedShading && (t = this._cesium.Material.fromType("AspectRamp"), i.item.shadingUniforms = t.uniforms), "none" !== i.item.selectedShading && (i.item.shadingUniforms.image = this._core.getColorRamp(i.item.selectedShading)), e.material = t, i.item.material = e.material, this }, Yt.prototype.setSpacing = function (e) { try { this.item.contourUniforms.spacing = parseFloat(e) } catch (e) { console.log(e) } return this }, Yt.prototype.setMaterialColor = function (e) { try { this.item.contourUniforms.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, Yt.prototype.setWidth = function (e) { try { this.item.contourUniforms.width = parseFloat(e) } catch (e) { console.log(e) } return this }, Yt.prototype.executeContourMaterial = function (e) { var t, i = this, e = (i.item = {}, i.item.selectedShading = e, i._viewer.scene.globe); return "elevation" === i.item.selectedShading ? (t = new this._cesium.Material({ fabric: { type: "ElevationColorContour", materials: { contourMaterial: { type: "ElevationContour" }, elevationRampMaterial: { type: "ElevationRamp" } }, components: { diffuse: "contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse", alpha: "max(contourMaterial.alpha, elevationRampMaterial.alpha)" } }, translucent: !1 }), i.item.shadingUniforms = t.materials.elevationRampMaterial.uniforms, i.item.shadingUniforms.minHeight = -414, i.item.shadingUniforms.maxHeight = 8777, i.item.contourUniforms = t.materials.contourMaterial.uniforms) : "slope" === i.item.selectedShading ? (t = getSlopeContourMaterial(), i.item.shadingUniforms = t.materials.slopeRampMaterial.uniforms, i.item.contourUniforms = t.materials.contourMaterial.uniforms) : "aspect" === i.item.selectedShading ? (t = getAspectContourMaterial(), i.item.shadingUniforms = t.materials.aspectRampMaterial.uniforms, i.item.contourUniforms = t.materials.contourMaterial.uniforms) : (t = this._cesium.Material.fromType("ElevationContour"), i.item.contourUniforms = t.uniforms), "none" !== i.item.selectedShading && (i.item.shadingUniforms.image = this._core.getColorRamp(i.item.selectedShading)), i.item.contourUniforms.width = 2, i.item.contourUniforms.spacing = 150, i.item.contourUniforms.color = this._cesium.Color.fromRandom({ alpha: 1 }, this._cesium.Color.RED.clone()), e.material = t, i.item.material = e.material, this }, Object.defineProperties(Yt.prototype, { elevation: { get: function () { return this.item }, set: function (e) { this.item = e } } }), Jt.prototype.start = function (i, o = {}) { if (this.end(), i) { let e, t; if (i.item && i.item instanceof Cesium.Cesium3DTileset) this.editType = "SE3DTiles", t = i.boundingSphereRadius, e = Cesium.Cartesian3.fromDegrees(i.modelEditData.lon, i.modelEditData.lat, i.modelEditData.height); else { this.editType = "Entity"; var r = this._viewer.scene.primitives._primitives.findIndex(e => e.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 => { var t; r ? (this.mouseTooltip(o, e), this.edit(o, r, e.endPosition), i.callback && i.callback(o)) : (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 < l ? e += a : e -= a, this.setRotate("pitch", e) } else if ("roll" === e) { s = (n.lat - t.lat) / (i.x - r.x); let e = this.originRoll; l = this._core.arge(r, i, o, "+-", !0); s < 0 ? e -= l : e += l, this.setRotate("roll", e) } } }, Jt.prototype.setPosition = function (e) { var t = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); "Entity" === this.editType ? (this.model.position = t, window.SmartEarthPopupData && window.SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector('.model input[name="height"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="height"]').value = e.height.toFixed(2))) : this.model.setEditData(e), this.axis.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(t) }, Jt.prototype.setRotate = function (o, r) { if (this.model) if ("Entity" === this.editType) { let e = this.model.heading, t = this.model.pitch, i = this.model.roll; "heading" === o ? this.model.heading = e = r : "pitch" === o ? this.model.pitch = t = r : "roll" === o && (this.model.roll = i = r), this.model.orientation = Cesium.Transforms.headingPitchRollQuaternion(this.model.position.getValue(), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e), Cesium.Math.toRadians(t), Cesium.Math.toRadians(i))), window.SmartEarthPopupData && window.SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`) && (SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`).value = r) } else switch (o) { case "heading": this.model.setEditData({ heading: -r }); break; case "pitch": this.model.setEditData({ pitch: r }); break; case "roll": this.model.setEditData({ roll: r }) } }, Jt.prototype.mouseTooltip = function (e, t) { e ? (t = t.endPosition || t.position, "x" === e ? this.tooltip.showAt(t, "X方向平移") : "y" === e ? this.tooltip.showAt(t, "Y方向平移") : "z" === e ? this.tooltip.showAt(t, "Z方向平移") : "heading" === e ? this.tooltip.showAt(t, "绕Z轴旋转") : "pitch" === e ? this.tooltip.showAt(t, "绕Y轴旋转") : "roll" === e ? this.tooltip.showAt(t, "绕X轴旋转") : this.tooltip.show(!1)) : this.tooltip.show(!1) }, Jt.prototype.end = function () { this.axis && this._viewer.scene.primitives.remove(this.axis), this.axis = void 0, this.editHandler && this.editHandler.destroy(), this.editHandler = void 0, this.model && (this.model.ModelEdit = void 0), this.model = void 0, this.tooltip && this.tooltip.show(!1) }; var Un = "Expected a function", zn = "__lodash_hash_undefined__", Wn = "__lodash_placeholder__", Yn = 128, Jn = 9007199254740991, Kn = NaN, Qn = 4294967295, qn = [["ary", Yn], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256]], Xn = "[object Arguments]", Zn = "[object Array]", $n = "[object Boolean]", ea = "[object Date]", ta = "[object Error]", ia = "[object Function]", oa = "[object GeneratorFunction]", ra = "[object Map]", na = "[object Number]", aa = "[object Object]", sa = "[object Promise]", la = "[object RegExp]", ca = "[object Set]", ua = "[object String]", ha = "[object Symbol]", ma = "[object WeakMap]", da = "[object ArrayBuffer]", pa = "[object DataView]", ga = "[object Float32Array]", fa = "[object Float64Array]", _a = "[object Int8Array]", Ca = "[object Int16Array]", ya = "[object Int32Array]", va = "[object Uint8Array]", wa = "[object Uint8ClampedArray]", ba = "[object Uint16Array]", Ta = "[object Uint32Array]", Sa = /\b__p \+= '';/g, Ea = /\b(__p \+=) '' \+/g, Pa = /(__e\(.*?\)|\b__t\)) \+\n'';/g, xa = /&(?:amp|lt|gt|quot|#39);/g, Da = /[&<>"']/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*$/, Va = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Fa = /[\\^$.*+?()[\]{}|]/g, Ha = RegExp(Fa.source), Ga = /^\s+/, Kt = /\s/, ka = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Na = /\{\n\/\* \[wrapped with (.+)\] \*/, ja = /,? & /, Ua = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, za = /[()=,{}\[\]\/\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, Qt = "\\ud800-\\udfff", qt = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", Xt = "\\u2700-\\u27bf", Zt = "a-z\\xdf-\\xf6\\xf8-\\xff", $t = "A-Z\\xc0-\\xd6\\xd8-\\xde", ei = "\\ufe0e\\ufe0f", ti = "\\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", ii = "['’]", oi = "[" + Qt + "]", ri = "[" + ti + "]", ni = "[" + qt + "]", ai = "[" + Xt + "]", si = "[" + Zt + "]", ti = "[^" + Qt + ti + "\\d+" + Xt + Zt + $t + "]", Xt = "\\ud83c[\\udffb-\\udfff]", Zt = "[^" + Qt + "]", li = "(?:\\ud83c[\\udde6-\\uddff]){2}", ci = "[\\ud800-\\udbff][\\udc00-\\udfff]", $t = "[" + $t + "]", ui = "\\u200d", hi = "(?:" + si + "|" + ti + ")", ti = "(?:" + $t + "|" + ti + ")", mi = "(?:['’](?:d|ll|m|re|s|t|ve))?", di = "(?:['’](?:D|LL|M|RE|S|T|VE))?", pi = "(?:" + ni + "|" + Xt + ")" + "?", gi = "[" + ei + "]?", gi = gi + pi + ("(?:" + ui + "(?:" + [Zt, li, ci].join("|") + ")" + gi + pi + ")*"), pi = "(?:" + [ai, li, ci].join("|") + ")" + gi, ai = "(?:" + [Zt + ni + "?", ni, li, ci, oi].join("|") + ")", is = RegExp(ii, "g"), os = RegExp(ni, "g"), fi = RegExp(Xt + "(?=" + Xt + ")|" + ai + gi, "g"), rs = RegExp([$t + "?" + si + "+" + mi + "(?=" + [ri, $t, "$"].join("|") + ")", ti + "+" + di + "(?=" + [ri, $t + hi, "$"].join("|") + ")", $t + "?" + hi + "+" + mi, $t + "+" + di, "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", "\\d+", pi].join("|"), "g"), _i = RegExp("[" + ui + Qt + qt + ei + "]"), 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 = {}, cs = (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[ca] = ls[ua] = ls[ma] = !1, {}), Ci = (cs[Xn] = cs[Zn] = cs[da] = cs[pa] = cs[$n] = cs[ea] = cs[ga] = cs[fa] = cs[_a] = cs[Ca] = cs[ya] = cs[ra] = cs[na] = cs[aa] = cs[la] = cs[ca] = cs[ua] = cs[ha] = cs[va] = cs[wa] = cs[ba] = cs[Ta] = !0, cs[ta] = cs[ia] = cs[ma] = !1, { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }), us = parseFloat, hs = parseInt, Zt = "object" == typeof global && global && global.Object === Object && global, li = "object" == typeof self && self && self.Object === Object && self, ms = Zt || li || Function("return this")(), ci = "object" == typeof o && o && !o.nodeType && o, yi = ci && "object" == typeof module && module && !module.nodeType && module, ds = yi && yi.exports === ci, vi = ds && Zt.process, oi = function () { try { var e = yi && yi.require && yi.require("util").types; return e ? e : vi && vi.binding && vi.binding("util") } catch (e) { } }(), gs = oi && oi.isArrayBuffer, fs = oi && oi.isDate, _s = oi && oi.isMap, Cs = oi && oi.isRegExp, ys = oi && oi.isSet, vs = oi && oi.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 < n;) { var a = e[r]; t(o, a, i(a), e) } return o } function Ts(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o && !1 !== t(e[i], i, e);); return e } function Ss(e, t) { for (var i = null == e ? 0 : e.length; i-- && !1 !== t(e[i], i, e);); return e } function Es(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o;)if (!t(e[i], i, e)) return !1; return !0 } function Ps(e, t) { for (var i = -1, o = null == e ? 0 : e.length, r = 0, n = []; ++i < o;) { var a = e[i]; t(a, i, e) && (n[r++] = a) } return n } function xs(e, t) { return !!(null == e ? 0 : e.length) && -1 < Vs(e, t, 0) } function Ds(e, t, i) { for (var o = -1, r = null == e ? 0 : e.length; ++o < r;)if (i(t, e[o])) return !0; return !1 } function Is(e, t) { for (var i = -1, o = null == e ? 0 : e.length, r = Array(o); ++i < o;)r[i] = t(e[i], i, e); return r } function As(e, t) { for (var i = -1, o = t.length, r = e.length; ++i < o;)e[r + i] = t[i]; return e } function Ls(e, t, i, o) { var r = -1, n = null == e ? 0 : e.length; for (o && n && (i = e[++r]); ++r < n;)i = t(i, e[r], r, e); return i } function Ms(e, t, i, o) { var r = null == e ? 0 : e.length; for (o && r && (i = e[--r]); r--;)i = t(i, e[r], r, e); return i } function Rs(e, t) { for (var i = -1, o = null == e ? 0 : e.length; ++i < o;)if (t(e[i], i, e)) return !0; return !1 } var wi = ks("length"); function Os(e, o, t) { var r; return t(e, function (e, t, i) { if (o(e, t, i)) return r = t, !1 }), r } function Bs(e, t, i, o) { for (var r = e.length, n = i + (o ? 1 : -1); o ? n-- : ++n < r;)if (t(e[n], n, e)) return n; return -1 } function Vs(e, t, i) { if (t != t) return Bs(e, Hs, i); for (var o = e, r = t, n = i - 1, a = o.length; ++n < a;)if (o[n] === r) return n; return -1 } function Fs(e, t, i, o) { for (var r = i - 1, n = e.length; ++r < n;)if (o(e[r], t)) return r; return -1 } function Hs(e) { return e != e } function Gs(e, t) { var i = null == e ? 0 : e.length; return i ? js(e, t) / i : Kn } function ks(t) { return function (e) { return null == e ? jn : e[t] } } function bi(t) { return function (e) { return null == t ? jn : t[e] } } function Ns(e, o, r, n, t) { return t(e, function (e, t, i) { r = n ? (n = !1, e) : o(r, e, t, i) }), r } function js(e, t) { for (var i, o = -1, r = e.length; ++o < r;) { var n = t(e[o]); n !== jn && (i = i === jn ? n : i + n) } return i } function Us(e, t) { for (var i = -1, o = Array(e); ++i < e;)o[i] = t(i); return o } function zs(e) { return e && e.slice(0, al(e) + 1).replace(Ga, "") } function Ws(t) { return function (e) { return t(e) } } function Ys(t, e) { return Is(e, function (e) { return t[e] }) } function Js(e, t) { return e.has(t) } function Ks(e, t) { for (var i = -1, o = e.length; ++i < o && -1 < Vs(t, e[i], 0);); return i } function Qs(e, t) { for (var i = e.length; i-- && -1 < Vs(t, e[i], 0);); return i } var qs = bi({ "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "Ç": "C", "ç": "c", "Ð": "D", "ð": "d", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "è": "e", "é": "e", "ê": "e", "ë": "e", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "ì": "i", "í": "i", "î": "i", "ï": "i", "Ñ": "N", "ñ": "n", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "ù": "u", "ú": "u", "û": "u", "ü": "u", "Ý": "Y", "ý": "y", "ÿ": "y", "Æ": "Ae", "æ": "ae", "Þ": "Th", "þ": "th", "ß": "ss", "Ā": "A", "Ă": "A", "Ą": "A", "ā": "a", "ă": "a", "ą": "a", "Ć": "C", "Ĉ": "C", "Ċ": "C", "Č": "C", "ć": "c", "ĉ": "c", "ċ": "c", "č": "c", "Ď": "D", "Đ": "D", "ď": "d", "đ": "d", "Ē": "E", "Ĕ": "E", "Ė": "E", "Ę": "E", "Ě": "E", "ē": "e", "ĕ": "e", "ė": "e", "ę": "e", "ě": "e", "Ĝ": "G", "Ğ": "G", "Ġ": "G", "Ģ": "G", "ĝ": "g", "ğ": "g", "ġ": "g", "ģ": "g", "Ĥ": "H", "Ħ": "H", "ĥ": "h", "ħ": "h", "Ĩ": "I", "Ī": "I", "Ĭ": "I", "Į": "I", "İ": "I", "ĩ": "i", "ī": "i", "ĭ": "i", "į": "i", "ı": "i", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "ĸ": "k", "Ĺ": "L", "Ļ": "L", "Ľ": "L", "Ŀ": "L", "Ł": "L", "ĺ": "l", "ļ": "l", "ľ": "l", "ŀ": "l", "ł": "l", "Ń": "N", "Ņ": "N", "Ň": "N", "Ŋ": "N", "ń": "n", "ņ": "n", "ň": "n", "ŋ": "n", "Ō": "O", "Ŏ": "O", "Ő": "O", "ō": "o", "ŏ": "o", "ő": "o", "Ŕ": "R", "Ŗ": "R", "Ř": "R", "ŕ": "r", "ŗ": "r", "ř": "r", "Ś": "S", "Ŝ": "S", "Ş": "S", "Š": "S", "ś": "s", "ŝ": "s", "ş": "s", "š": "s", "Ţ": "T", "Ť": "T", "Ŧ": "T", "ţ": "t", "ť": "t", "ŧ": "t", "Ũ": "U", "Ū": "U", "Ŭ": "U", "Ů": "U", "Ű": "U", "Ų": "U", "ũ": "u", "ū": "u", "ŭ": "u", "ů": "u", "ű": "u", "ų": "u", "Ŵ": "W", "ŵ": "w", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Ź": "Z", "Ż": "Z", "Ž": "Z", "ź": "z", "ż": "z", "ž": "z", "IJ": "IJ", "ij": "ij", "Œ": "Oe", "œ": "oe", "ʼn": "'n", "ſ": "s" }), Xs = bi({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }); function Zs(e) { return "\\" + Ci[e] } function $s(e) { return _i.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 < o;) { var a = e[i]; a !== t && a !== Wn || (e[i] = Wn, n[r++] = i) } return n } function ol(e) { var t = -1, i = Array(e.size); return e.forEach(function (e) { i[++t] = e }), i } function rl(e) { return ($s(e) ? function (e) { var t = fi.lastIndex = 0; for (; fi.test(e);)++t; return t } : wi)(e) } function nl(e) { return $s(e) ? e.match(fi) || [] : e.split("") } function al(e) { for (var t = e.length; t-- && Kt.test(e.charAt(t));); return t } var sl = bi({ "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'" }); var C = 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, U = e.String, T = e.TypeError, z = b.prototype, W = O.prototype, Y = g.prototype, J = e["__core-js_shared__"], K = W.toString, V = 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(V).replace(Fa, "\\$&").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 = z.splice, se = t ? t.isConcatSpreadable : jn, le = t ? t.iterator : jn, ce = t ? t.toStringTag : jn, ue = 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 = z.join, ye = tl(g.keys, g), S = B.max, E = B.min, ve = n.now, we = e.parseInt, be = B.random, Te = z.reverse, n = Zi(e, "DataView"), Se = Zi(e, "Map"), Ee = Zi(e, "Promise"), Pe = Zi(e, "Set"), e = Zi(e, "WeakMap"), xe = Zi(g, "create"), De = e && new e, Ie = {}, Ae = So(n), Le = So(Se), Me = So(Ee), Re = So(Pe), Oe = So(e), t = t ? t.prototype : jn, Be = t ? t.valueOf : jn, Ve = t ? t.toString : jn; function p(e) { if (N(e) && !k(e) && !(e instanceof C)) { if (e instanceof f) return e; if (V.call(e, "__wrapped__")) return Eo(e) } return new f(e) } var Fe = function (e) { if (!w(e)) return {}; if (re) return re(e); He.prototype = e; e = new He; return He.prototype = jn, e }; function He() { } function Ge() { } function f(e, t) { this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = jn } function C(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 < i;) { var o = e[t]; this.set(o[0], o[1]) } } function Ne(e) { var t = -1, i = null == e ? 0 : e.length; for (this.clear(); ++t < i;) { var o = e[t]; this.set(o[0], o[1]) } } function je(e) { var t = -1, i = null == e ? 0 : e.length; for (this.clear(); ++t < i;) { var o = e[t]; this.set(o[0], o[1]) } } function Ue(e) { var t = -1, i = null == e ? 0 : e.length; for (this.__data__ = new je; ++t < i;)this.add(e[t]) } function F(e) { e = this.__data__ = new Ne(e); this.size = e.size } function ze(e, t) { var i, o = k(e), r = !o && Cr(e), n = !o && !r && vr(e), a = !o && !r && !n && Lr(e), s = o || r || n || a, l = s ? Us(e.length, U) : [], c = l.length; for (i in e) !t && !V.call(e, i) || s && ("length" == i || n && ("offset" == i || "parent" == i) || a && ("buffer" == i || "byteLength" == i || "byteOffset" == i) || ro(i, c)) || l.push(i); return l } function We(e) { var t = e.length; return t ? e[Gt(0, t - 1)] : jn } function Ye(e, t) { return vo(P(e), tt(t, 0, e.length)) } function Je(e) { return vo(P(e)) } function Ke(e, t, i) { (i === jn || G(e[t], i)) && (i !== jn || t in e) || $e(e, t, i) } function Qe(e, t, i) { var o = e[t]; V.call(e, t) && G(o, i) && (i !== jn || t in e) || $e(e, t, i) } function qe(e, t) { for (var i = e.length; i--;)if (G(e[i][0], t)) return i; return -1 } function Xe(e, o, r, n) { return nt(e, function (e, t, i) { o(n, e, r(e), i) }), n } function Ze(e, t) { return e && fi(t, A(t), e) } function $e(e, t, i) { "__proto__" == t && ue ? ue(e, t, { configurable: !0, enumerable: !0, value: i, writable: !0 }) : e[t] = i } function et(e, t) { for (var i = -1, o = t.length, r = b(o), n = null == e; ++i < o;)r[i] = n ? jn : Wr(e, t[i]); return r } function tt(e, t, i) { return e == e && (i !== jn && (e = e <= i ? e : i), t !== jn && (e = t <= e ? e : t)), e } function y(i, o, r, e, t, n) { var a, s = 1 & o, l = 2 & o, c = 4 & o; if ((a = r ? t ? r(i, e, t, n) : r(i) : a) === jn) { if (!w(i)) return i; var u, e = k(i); if (e) { if (a = function (e) { var t = e.length, i = new e.constructor(t); t && "string" == typeof e[0] && V.call(e, "index") && (i.index = e.index, i.input = e.input); return i }(i), !s) return P(i, a) } else { var h = H(i), m = h == ia || h == oa; if (vr(i)) return ui(i, s); if (h == aa || h == Xn || m && !t) { if (a = l || m ? {} : io(i), !s) return l ? (d = m = i, d = (u = a) && fi(d, L(d), u), fi(m, eo(m), d)) : (m = Ze(a, u = i), fi(u, $i(u), m)) } else { if (!cs[h]) return t ? i : {}; a = function (e, t, i) { var o = e.constructor; switch (t) { case da: return hi(e); case $n: case ea: return new o(+e); case pa: return function (e, t) { t = t ? hi(e.buffer) : e.buffer; return new e.constructor(t, e.byteOffset, e.byteLength) }(e, i); case ga: case fa: case _a: case Ca: case ya: case va: case wa: case ba: case Ta: return mi(e, i); case ra: return new o; case na: case ua: return new o(e); case la: return function (e) { var t = new e.constructor(e.source, Ja.exec(e)); return t.lastIndex = e.lastIndex, t }(e); case ca: return new o; case ha: return function (e) { return Be ? g(Be.call(e)) : {} }(e) } }(i, h, s) } } var d = (n = n || new F).get(i); if (d) return d; n.set(i, a), Ir(i) ? i.forEach(function (e) { a.add(y(e, o, r, e, i, n)) }) : Er(i) && i.forEach(function (e, t) { a.set(t, y(e, o, r, t, i, n)) }); var p = e ? jn : (c ? l ? Yi : Wi : l ? L : A)(i); Ts(p || i, function (e, t) { p && (e = i[t = e]), Qe(a, t, y(e, o, r, t, i, n)) }) } return a } function it(e, t, i) { var o = i.length; if (null == e) return !o; for (e = g(e); o--;) { var r = i[o], n = t[r], a = e[r]; if (a === jn && !(r in e) || !n(a)) return !1 } return !0 } function ot(e, t, i) { if ("function" != typeof e) throw new T(Un); return fo(function () { e.apply(jn, i) }, t) } function rt(e, t, i, o) { var r = -1, n = xs, a = !0, s = e.length, l = [], c = t.length; if (s) { i && (t = Is(t, Ws(i))), o ? (n = Ds, a = !1) : 200 <= t.length && (n = Js, a = !1, t = new Ue(t)); e: for (; ++r < s;) { var u = e[r], h = null == i ? u : i(u), u = o || 0 !== u ? u : 0; if (a && h == h) { for (var m = c; m--;)if (t[m] === h) continue e; l.push(u) } else n(t, h, o) || l.push(u) } } return l } p.templateSettings = { escape: La, evaluate: Ma, interpolate: Ra, variable: "", imports: { _: p } }, (p.prototype = Ge.prototype).constructor = p, (f.prototype = Fe(Ge.prototype)).constructor = f, (C.prototype = Fe(Ge.prototype)).constructor = C, ke.prototype.clear = function () { this.__data__ = xe ? xe(null) : {}, this.size = 0 }, ke.prototype.delete = function (e) { return e = this.has(e) && delete this.__data__[e], this.size -= e ? 1 : 0, e }, ke.prototype.get = function (e) { var t, i = this.__data__; return xe ? (t = i[e]) === zn ? jn : t : V.call(i, e) ? i[e] : jn }, ke.prototype.has = function (e) { var t = this.__data__; return xe ? t[e] !== jn : V.call(t, e) }, ke.prototype.set = function (e, t) { var i = this.__data__; return this.size += this.has(e) ? 0 : 1, i[e] = xe && t === jn ? zn : t, this }, Ne.prototype.clear = function () { this.__data__ = [], this.size = 0 }, Ne.prototype.delete = function (e) { var t = this.__data__; return !((e = qe(t, e)) < 0) && (e == t.length - 1 ? t.pop() : ae.call(t, e, 1), --this.size, !0) }, Ne.prototype.get = function (e) { var t = this.__data__; return (e = qe(t, e)) < 0 ? jn : t[e][1] }, Ne.prototype.has = function (e) { return -1 < qe(this.__data__, e) }, Ne.prototype.set = function (e, t) { var i = this.__data__, o = qe(i, e); return o < 0 ? (++this.size, i.push([e, t])) : i[o][1] = t, this }, je.prototype.clear = function () { this.size = 0, this.__data__ = { hash: new ke, map: new (Se || Ne), string: new ke } }, je.prototype.delete = function (e) { return e = qi(this, e).delete(e), this.size -= e ? 1 : 0, e }, je.prototype.get = function (e) { return qi(this, e).get(e) }, je.prototype.has = function (e) { return qi(this, e).has(e) }, je.prototype.set = function (e, t) { var i = qi(this, e), o = i.size; return i.set(e, t), this.size += i.size == o ? 0 : 1, this }, Ue.prototype.add = Ue.prototype.push = function (e) { return this.__data__.set(e, zn), this }, Ue.prototype.has = function (e) { return this.__data__.has(e) }, F.prototype.clear = function () { this.__data__ = new Ne, this.size = 0 }, F.prototype.delete = function (e) { var t = this.__data__, e = t.delete(e); return this.size = t.size, e }, F.prototype.get = function (e) { return this.__data__.get(e) }, F.prototype.has = function (e) { return this.__data__.has(e) }, F.prototype.set = function (e, t) { var i = this.__data__; if (i instanceof Ne) { var o = i.__data__; if (!Se || o.length < 199) return o.push([e, t]), this.size = ++i.size, this; i = this.__data__ = new je(o) } return i.set(e, t), this.size = i.size, this }; var nt = yi(mt), at = yi(dt, !0); function st(e, o) { var r = !0; return nt(e, function (e, t, i) { return r = !!o(e, t, i) }), r } function lt(e, t, i) { for (var o = -1, r = e.length; ++o < r;) { var n, a, s = e[o], l = t(s); null != l && (n === jn ? l == l && !x(l) : i(l, n)) && (n = l, a = s) } return a } function ct(e, o) { var r = []; return nt(e, function (e, t, i) { o(e, t, i) && r.push(e) }), r } function l(e, t, i, o, r) { var n = -1, a = e.length; for (i = i || oo, r = r || []; ++n < a;) { var s = e[n]; 0 < t && i(s) ? 1 < t ? l(s, t - 1, i, o, r) : As(r, s) : o || (r[r.length] = s) } return r } var ut = vi(), ht = vi(!0); function mt(e, t) { return e && ut(e, t, A) } function dt(e, t) { return e && ht(e, t, A) } function pt(t, e) { return Ps(e, function (e) { return br(t[e]) }) } function gt(e, t) { for (var i = 0, o = (t = ai(t, e)).length; null != e && i < o;)e = e[To(t[i++])]; return i && i == o ? e : jn } function ft(e, t, i) { t = t(e); return k(e) ? t : As(t, i(e)) } function i(e) { if (null == e) return e === jn ? "[object Undefined]" : "[object Null]"; if (ce && ce in g(e)) { var t = e, i = V.call(t, ce), o = t[ce]; try { t[ce] = jn; var r = !0 } catch (e) { } var n = X.call(t); return r && (i ? t[ce] = o : delete t[ce]), n } return X.call(e) } function _t(e, t) { return t < e } function Ct(e, t) { return null != e && V.call(e, t) } function yt(e, t) { return null != e && t in g(e) } function vt(e, t, i) { for (var o = i ? Ds : xs, r = e[0].length, n = e.length, a = n, s = b(n), l = 1 / 0, c = []; a--;) { var u = e[a]; a && t && (u = Is(u, Ws(t))), l = E(u.length, l), s[a] = !i && (t || 120 <= r && 120 <= u.length) ? new Ue(a && u) : jn } var u = e[0], h = -1, m = s[0]; e: for (; ++h < r && c.length < l;) { var d = u[h], p = t ? t(d) : d, d = i || 0 !== d ? d : 0; if (!(m ? Js(m, p) : o(c, p, i))) { for (a = n; --a;) { var g = s[a]; if (!(g ? Js(g, p) : o(e[a], p, i))) continue e } m && m.push(p), c.push(d) } } return c } function wt(e, t, i) { t = null == (e = mo(e, t = ai(t, e))) ? e : e[To(o(t))]; return null == t ? jn : ws(t, e, i) } function bt(e) { return N(e) && i(e) == Xn } function Tt(e, t, i, o, r) { if (e === t) return !0; if (null == e || null == t || !N(e) && !N(t)) return e != e && t != t; var n = Tt, a = k(e), s = k(t), l = a ? Zn : H(e), s = s ? Zn : H(t), c = (l = l == Xn ? aa : l) == aa, u = (s = s == Xn ? aa : s) == aa; if ((s = l == s) && vr(e)) { if (!vr(t)) return !1; c = !(a = !0) } if (s && !c) { r = r || new F; if (a || Lr(e)) return Ui(e, t, i, o, n, r); else { var h = e; var m = t; var d = l; var p = i; var g = o; var f = n; var _ = r; switch (d) { case pa: if (h.byteLength != m.byteLength || h.byteOffset != m.byteOffset) return !1; h = h.buffer, m = m.buffer; case da: return h.byteLength == m.byteLength && f(new te(h), new te(m)) ? !0 : !1; case $n: case ea: case na: return G(+h, +m); case ta: return h.name == m.name && h.message == m.message; case la: case ua: return h == m + ""; case ra: var C = el; case ca: var y = 1 & p; if (C = C || ol, h.size != m.size && !y) return !1; y = _.get(h); if (y) return y == m; p |= 2, _.set(h, m); y = Ui(C(h), C(m), p, g, f, _); return _.delete(h), y; case ha: if (Be) return Be.call(h) == Be.call(m) }return !1; return } } if (!(1 & i)) { a = c && V.call(e, "__wrapped__"), l = u && V.call(t, "__wrapped__"); if (a || l) return c = a ? e.value() : e, u = l ? t.value() : t, r = r || new F, n(c, u, i, o, r) } if (s) { r = r || new F; var v = e, w = t, b = i, T = o, S = n, E = r, P = 1 & b, x = Wi(v), D = x.length, a = Wi(w).length; if (D != a && !P) return !1; for (var I = D; I--;) { var A = x[I]; if (!(P ? A in w : V.call(w, A))) return !1 } a = E.get(v), l = E.get(w); if (a && l) return a == w && l == v; for (var L = !0, M = (E.set(v, w), E.set(w, v), P); ++I < D;) { A = x[I]; var R, O = v[A], B = w[A]; if (!((R = T ? P ? T(B, O, A, w, v, E) : T(O, B, A, v, w, E) : R) === jn ? O === B || S(O, B, b, T, E) : R)) { L = !1; break } M = M || "constructor" == A } return L && !M && (a = v.constructor, l = w.constructor, a != l && "constructor" in v && "constructor" in w && !("function" == typeof a && a instanceof a && "function" == typeof l && l instanceof l) && (L = !1)), E.delete(v), E.delete(w), L } return !1 } function St(e, t, i, o) { var r = i.length, n = r, a = !o; if (null == e) return !n; for (e = g(e); r--;) { var s = i[r]; if (a && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1 } for (; ++r < n;) { var l = (s = i[r])[0], c = e[l], u = s[1]; if (a && s[2]) { if (c === jn && !(l in e)) return !1 } else { var h, m = new F; if (!((h = o ? o(c, u, l, e, t, m) : h) === jn ? Tt(u, c, 3, o, m) : h)) return !1 } } return !0 } function Et(e) { var t; return !(!w(e) || (t = e, q && q in t)) && (br(e) ? ee : qa).test(So(e)) } function Pt(e) { return "function" == typeof e ? e : null == e ? M : "object" == typeof e ? k(e) ? Mt(e[0], e[1]) : Lt(e) : In(e) } function xt(e) { if (!lo(e)) return ye(e); var t, i = []; for (t in g(e)) V.call(e, t) && "constructor" != t && i.push(t); return i } function Dt(e) { if (!w(e)) { var t = e, i = []; if (null != t) for (var o in g(t)) i.push(o); return i } var r, n = lo(e), a = []; for (r in e) ("constructor" != r || !n && V.call(e, r)) && a.push(r); return a } function It(e, t) { return e < t } function At(e, o) { var r = -1, n = u(e) ? b(e.length) : []; return nt(e, function (e, t, i) { n[++r] = o(e, t, i) }), n } function Lt(t) { var i = Xi(t); return 1 == i.length && i[0][2] ? uo(i[0][0], i[0][1]) : function (e) { return e === t || St(e, t, i) } } function Mt(i, o) { return no(i) && co(o) ? uo(To(i), o) : function (e) { var t = Wr(e, i); return t === jn && t === o ? Yr(e, i) : Tt(o, t, 3) } } function Rt(g, f, _, C, y) { g !== f && ut(f, function (e, t) { var i, o, r, n, a, s, l, c, u, h, m, d, p; y = y || new F, w(e) ? (o = f, n = _, a = Rt, s = C, l = y, m = po(i = g, r = t), d = po(o, r), (p = l.get(d)) ? Ke(i, r, p) : (p = s ? s(m, d, r + "", i, o, l) : jn, (o = p === jn) && (c = k(d), u = !c && vr(d), h = !c && !u && Lr(d), p = d, c || u || h ? p = k(m) ? m : v(m) ? P(m) : u ? ui(d, !(o = !1)) : h ? mi(d, !(o = !1)) : [] : xr(d) || Cr(d) ? Cr(p = m) ? p = Fr(m) : w(m) && !br(m) || (p = io(d)) : o = !1), o && (l.set(d, p), a(p, d, n, s, l), l.delete(d)), Ke(i, r, p))) : (c = C ? C(po(g, t), e, t + "", g, f, y) : jn, Ke(g, t, c = c === jn ? e : c)) }, L) } function Ot(e, t) { var i = e.length; if (i) return ro(t += t < 0 ? i : 0, i) ? e[t] : jn } function Bt(e, o, u) { o = o.length ? Is(o, function (t) { return k(t) ? function (e) { return gt(e, 1 === t.length ? t[0] : t) } : t }) : [M]; var r = -1; o = Is(o, Ws(h())); var t = At(e, function (t, e, i) { return { criteria: Is(o, function (e) { return e(t) }), index: ++r, value: t } }), e = function (e, t) { for (var i = u, o = -1, r = e.criteria, n = t.criteria, a = r.length, s = i.length; ++o < a;) { var l, c = di(r[o], n[o]); if (c) return s <= o ? c : (l = i[o], c * ("desc" == l ? -1 : 1)) } return e.index - t.index }, i = t.length; for (t.sort(e); i--;)t[i] = t[i].value; return t } function Vt(e, t, i) { for (var o = -1, r = t.length, n = {}; ++o < r;) { var a = t[o], s = gt(e, a); i(s, a) && Ut(n, ai(a, e), s) } return n } function Ft(e, t, i, o) { var r = o ? Fs : Vs, n = -1, a = t.length, s = e; for (e === t && (t = P(t)), i && (s = Is(e, Ws(i))); ++n < a;)for (var l = 0, c = t[n], u = i ? i(c) : c; -1 < (l = r(s, u, l, o));)s !== e && ae.call(s, l, 1), ae.call(e, l, 1); return e } function Ht(e, t) { for (var i = e ? t.length : 0, o = i - 1; i--;) { var r, n = t[i]; i != o && n === r || (ro(r = n) ? ae.call(e, n, 1) : Zt(e, n)) } } function Gt(e, t) { return e + ge(be() * (t - e + 1)) } function kt(e, t) { var i = ""; if (!(!e || t < 1 || Jn < t)) for (; t % 2 && (i += e), (t = ge(t / 2)) && (e += e), t;); return i } function a(e, t) { return _o(ho(e, t, M), e + "") } function Nt(e) { return We(rn(e)) } function jt(e, t) { e = rn(e); return vo(e, tt(t, 0, e.length)) } function Ut(e, t, i, o) { if (w(e)) for (var r = -1, n = (t = ai(t, e)).length, a = n - 1, s = e; null != s && ++r < n;) { var l, c = To(t[r]), u = i; if ("__proto__" === c || "constructor" === c || "prototype" === c) return e; r != a && (l = s[c], (u = o ? o(l, c, s) : jn) === jn && (u = w(l) ? l : ro(t[r + 1]) ? [] : {})), Qe(s, c, u), s = s[c] } return e } var zt = De ? function (e, t) { return De.set(e, t), e } : M, t = ue ? function (e, t) { return ue(e, "toString", { configurable: !0, enumerable: !1, value: Cn(t), writable: !0 }) } : M; function Wt(e) { return vo(rn(e)) } function s(e, t, i) { for (var o = -1, r = e.length, n = ((i = r < i ? r : i) < 0 && (i += r), r = i < (t = t < 0 ? r < -t ? 0 : r + t : t) ? 0 : i - t >>> 0, t >>>= 0, b(r)); ++o < r;)n[o] = e[o + t]; return n } function Yt(e, o) { var r; return nt(e, function (e, t, i) { return !(r = o(e, t, i)) }), !!r } function Jt(e, t, i) { var o = 0, r = null == e ? o : e.length; if ("number" == typeof t && t == t && r <= 2147483647) { for (; o < r;) { var n = o + r >>> 1, a = e[n]; null !== a && !x(a) && (i ? a <= t : a < t) ? o = 1 + n : r = n } return r } return Kt(e, t, M, i) } function Kt(e, t, i, o) { var r = 0, n = null == e ? 0 : e.length; if (0 === n) return 0; for (var a = (t = i(t)) != t, s = null === t, l = x(t), c = t === jn; r < n;) { var u = ge((r + n) / 2), h = i(e[u]), m = h !== jn, d = null === h, p = h == h, g = x(h), p = a ? o || p : c ? p && (o || m) : s ? p && m && (o || !d) : l ? p && m && !d && (o || !g) : !d && !g && (o ? h <= t : h < t); p ? r = u + 1 : n = u } return E(n, 4294967294) } function Qt(e, t) { for (var i = -1, o = e.length, r = 0, n = []; ++i < o;) { var a, s = e[i], l = t ? t(s) : s; i && G(l, a) || (a = l, n[r++] = 0 === s ? 0 : s) } return n } function qt(e) { return "number" == typeof e ? e : x(e) ? Kn : +e } function c(e) { var t; return "string" == typeof e ? e : k(e) ? Is(e, c) + "" : x(e) ? Ve ? Ve.call(e) : "" : "0" == (t = e + "") && 1 / e == -1 / 0 ? "-0" : t } function Xt(e, t, i) { var o = -1, r = xs, n = e.length, a = !0, s = [], l = s; if (i) a = !1, r = Ds; else if (200 <= n) { var c = t ? null : Fi(e); if (c) return ol(c); a = !1, r = Js, l = new Ue } else l = t ? [] : s; e: for (; ++o < n;) { var u = e[o], h = t ? t(u) : u, u = i || 0 !== u ? u : 0; if (a && h == h) { for (var m = l.length; m--;)if (l[m] === h) continue e; t && l.push(h), s.push(u) } else r(l, h, i) || (l !== s && l.push(h), s.push(u)) } return s } function Zt(e, t) { return null == (e = mo(e, t = ai(t, e))) || delete e[To(o(t))] } function $t(e, t, i, o) { return Ut(e, t, i(gt(e, t)), o) } function ei(e, t, i, o) { for (var r = e.length, n = o ? r : -1; (o ? n-- : ++n < r) && t(e[n], n, e);); return i ? s(e, o ? 0 : n, o ? n + 1 : r) : s(e, o ? n + 1 : 0, o ? r : n) } function ti(e, t) { var i = e; return Ls(t, function (e, t) { return t.func.apply(t.thisArg, As([e], t.args)) }, i = e instanceof C ? e.value() : i) } function ii(e, t, i) { var o = e.length; if (o < 2) return o ? Xt(e[0]) : []; for (var r = -1, n = b(o); ++r < o;)for (var a = e[r], s = -1; ++s < o;)s != r && (n[r] = rt(n[r] || a, e[s], t, i)); return Xt(l(n, 1), t, i) } function oi(e, t, i) { for (var o = -1, r = e.length, n = t.length, a = {}; ++o < r;) { var s = o < n ? t[o] : jn; i(a, e[o], s) } return a } function ri(e) { return v(e) ? e : [] } function ni(e) { return "function" == typeof e ? e : M } function ai(e, t) { return k(e) ? e : no(e, t) ? [e] : bo(d(e)) } var si = a; function li(e, t, i) { var o = e.length; return i = i === jn ? o : i, !t && o <= i ? e : s(e, t, i) } var ci = he || function (e) { return ms.clearTimeout(e) }; function ui(e, t) { return t ? e.slice() : (t = e.length, t = ie ? ie(t) : new e.constructor(t), e.copy(t), t) } function hi(e) { var t = new e.constructor(e.byteLength); return new te(t).set(new te(e)), t } function mi(e, t) { t = t ? hi(e.buffer) : e.buffer; return new e.constructor(t, e.byteOffset, e.length) } function di(e, t) { if (e !== t) { var i = e !== jn, o = null === e, r = e == e, n = x(e), a = t !== jn, s = null === t, l = t == t, c = x(t); if (!s && !c && !n && t < e || n && a && l && !s && !c || o && a && l || !i && l || !r) return 1; if (!o && !n && !c && e < t || c && i && r && !o && !n || s && i && r || !a && r || !l) return -1 } return 0 } function pi(e, t, i, o) { for (var r = -1, n = e.length, a = i.length, s = -1, l = t.length, c = S(n - a, 0), u = b(l + c), h = !o; ++s < l;)u[s] = t[s]; for (; ++r < a;)(h || r < n) && (u[i[r]] = e[r]); for (; c--;)u[s++] = e[r++]; return u } function gi(e, t, i, o) { for (var r = -1, n = e.length, a = -1, s = i.length, l = -1, c = t.length, u = S(n - s, 0), h = b(u + c), m = !o; ++r < u;)h[r] = e[r]; for (var d = r; ++l < c;)h[d + l] = t[l]; for (; ++a < s;)(m || r < n) && (h[d + i[a]] = e[r++]); return h } function P(e, t) { var i = -1, o = e.length; for (t = t || b(o); ++i < o;)t[i] = e[i]; return t } function fi(e, t, i, o) { for (var r = !i, n = (i = i || {}, -1), a = t.length; ++n < a;) { var s = t[n], l = o ? o(i[s], e[s], s, i, e) : jn; (r ? $e : Qe)(i, s, l = l === jn ? e[s] : l) } return i } function _i(r, n) { return function (e, t) { var i = k(e) ? bs : Xe, o = n ? n() : {}; return i(e, r, h(t, 2), o) } } function Ci(s) { return a(function (e, t) { var i = -1, o = t.length, r = 1 < o ? t[o - 1] : jn, n = 2 < o ? t[2] : jn, r = 3 < s.length && "function" == typeof r ? (o--, r) : jn; for (n && m(t[0], t[1], n) && (r = o < 3 ? jn : r, o = 1), e = g(e); ++i < o;) { var a = t[i]; a && s(e, a, i, r) } return e }) } function yi(n, a) { return function (e, t) { if (null != e) { if (!u(e)) return n(e, t); for (var i = e.length, o = a ? i : -1, r = g(e); (a ? o-- : ++o < i) && !1 !== t(r[o], o, r);); } return e } } function vi(l) { return function (e, t, i) { for (var o = -1, r = g(e), n = i(e), a = n.length; a--;) { var s = n[l ? a : ++o]; if (!1 === t(r[s], s, r)) break } return e } } function wi(o) { return function (e) { var t = $s(e = d(e)) ? nl(e) : jn, i = t ? t[0] : e.charAt(0), t = t ? li(t, 1).join("") : e.slice(1); return i[o]() + t } } function bi(t) { return function (e) { return Ls(gn(sn(e).replace(is, "")), t, "") } } function Ti(o) { return function () { var e = arguments; switch (e.length) { case 0: return new o; case 1: return new o(e[0]); case 2: return new o(e[0], e[1]); case 3: return new o(e[0], e[1], e[2]); case 4: return new o(e[0], e[1], e[2], e[3]); case 5: return new o(e[0], e[1], e[2], e[3], e[4]); case 6: return new o(e[0], e[1], e[2], e[3], e[4], e[5]); case 7: return new o(e[0], e[1], e[2], e[3], e[4], e[5], e[6]) }var t = Fe(o.prototype), i = o.apply(t, e); return w(i) ? i : t } } function Si(n, a, s) { var l = Ti(n); return function e() { for (var t = arguments.length, i = b(t), o = t, r = Qi(e); o--;)i[o] = arguments[o]; r = t < 3 && i[0] !== r && i[t - 1] !== r ? [] : il(i, r); return (t -= r.length) < s ? Bi(n, a, xi, e.placeholder, jn, i, r, jn, jn, s - t) : ws(this && this !== ms && this instanceof e ? l : n, this, i) } } function Ei(n) { return function (e, t, i) { var o, r = g(e), t = (u(e) || (o = h(t, 3), e = A(e), t = function (e) { return o(r[e], e, r) }), n(e, t, i)); return -1 < t ? r[o ? e[t] : t] : jn } } function Pi(l) { return zi(function (r) { var n = r.length, e = n, t = f.prototype.thru; for (l && r.reverse(); e--;) { var i = r[e]; if ("function" != typeof i) throw new T(Un); t && !s && "wrapper" == Ki(i) && (s = new f([], !0)) } for (e = s ? e : n; ++e < n;)var o = Ki(i = r[e]), a = "wrapper" == o ? Ji(i) : jn, s = a && ao(a[0]) && 424 == a[1] && !a[4].length && 1 == a[9] ? s[Ki(a[0])].apply(s, a[3]) : 1 == i.length && ao(i) ? s[o]() : s.thru(i); return function () { var e = arguments, t = e[0]; if (s && 1 == e.length && k(t)) return s.plant(t).value(); for (var i = 0, o = n ? r[i].apply(this, e) : t; ++i < n;)o = r[i].call(this, o); return o } }) } function xi(a, s, l, c, u, h, m, d, p, g) { var f = s & Yn, _ = 1 & s, C = 2 & s, y = 24 & s, v = 512 & s, w = C ? jn : Ti(a); return function e() { for (var t, i, o, r = b(o = arguments.length), n = o; n--;)r[n] = arguments[n]; return y && (i = function (e, t) { for (var i = e.length, o = 0; i--;)e[i] === t && ++o; return o }(r, t = Qi(e))), c && (r = pi(r, c, u, y)), h && (r = gi(r, h, m, y)), o -= i, y && o < g ? (i = il(r, t), Bi(a, s, xi, e.placeholder, l, r, i, d, p, g - o)) : (t = _ ? l : this, i = C ? t[a] : a, o = r.length, d ? r = function (e, t) { for (var i = e.length, o = E(t.length, i), r = P(e); o--;) { var n = t[o]; e[o] = ro(n, i) ? r[n] : jn } return e }(r, d) : v && 1 < o && r.reverse(), f && p < o && (r.length = p), (i = this && this !== ms && this instanceof e ? w || Ti(i) : i).apply(t, r)) } } function Di(i, a) { return function (e, t) { return e = e, o = i, r = a(t), n = {}, mt(e, function (e, t, i) { o(n, r(e), t, i) }), n; var o, r, n } } function Ii(o, r) { return function (e, t) { var i; if (e === jn && t === jn) return r; if (e !== jn && (i = e), t !== jn) { if (i === jn) return t; t = ("string" == typeof e || "string" == typeof t ? (e = c(e), c) : (e = qt(e), qt))(t), i = o(e, t) } return i } } function Ai(o) { return zi(function (e) { return e = Is(e, Ws(h())), a(function (t) { var i = this; return o(e, function (e) { return ws(e, i, t) }) }) }) } function Li(e, t) { var i = (t = t === jn ? " " : c(t)).length; return i < 2 ? i ? kt(t, e) : t : (i = kt(t, pe(e / rl(t))), $s(t) ? li(nl(i), 0, e).join("") : i.slice(0, e)) } function Mi(s, e, l, c) { var u = 1 & e, h = Ti(s); return function e() { for (var t = -1, i = arguments.length, o = -1, r = c.length, n = b(r + i), a = this && this !== ms && this instanceof e ? h : s; ++o < r;)n[o] = c[o]; for (; i--;)n[o++] = arguments[++t]; return ws(a, u ? l : this, n) } } function Ri(c) { return function (e, t, i) { i && "number" != typeof i && m(e, t, i) && (t = i = jn), e = Br(e), t === jn ? (t = e, e = 0) : t = Br(t), i = i === jn ? e < t ? 1 : -1 : Br(i); for (var o = e, r = i, n = c, a = -1, s = S(pe((t - o) / (r || 1)), 0), l = b(s); s--;)l[n ? s : ++a] = o, o += r; return l } } function Oi(i) { return function (e, t) { return "string" == typeof e && "string" == typeof t || (e = I(e), t = I(t)), i(e, t) } } function Bi(e, t, i, o, r, n, a, s, l, c) { var u = 8 & t, r = (4 & (t = (t | (u ? 32 : 64)) & ~(u ? 64 : 32)) || (t &= -4), [e, t, r, u ? n : jn, u ? a : jn, u ? jn : n, u ? jn : a, s, l, c]), n = i.apply(jn, r); return ao(e) && go(n, r), n.placeholder = o, Co(n, e, t) } function Vi(e) { var o = B[e]; return function (e, t) { var i; return e = I(e), (t = null == t ? 0 : E(D(t), 292)) && _e(e) ? (i = (d(e) + "e").split("e"), +((i = (d(o(i[0] + "e" + (+i[1] + t))) + "e").split("e"))[0] + "e" + (+i[1] - t))) : o(e) } } var Fi = Pe && 1 / ol(new Pe([, -0]))[1] == 1 / 0 ? function (e) { return new Pe(e) } : En; function Hi(n) { return function (e) { var t, i, o, r = H(e); return r == ra ? el(e) : r == ca ? (r = e, t = -1, i = Array(r.size), r.forEach(function (e) { i[++t] = [e, e] }), i) : Is(n(o = e), function (e) { return [e, o[e]] }) } } function Gi(e, t, i, o, r, n, a, s) { var l, c, u, h, m, d, p, g, f, _, C, y, v, w = 2 & t; if (w || "function" == typeof e) return (l = o ? o.length : 0) || (t &= -97, o = r = jn), a = a === jn ? a : S(D(a), 0), s = s === jn ? s : D(s), l -= r ? r.length : 0, 64 & t && (u = o, h = r, o = r = jn), c = w ? jn : Ji(e), u = [e, t, i, o, r, u, h, n, a, s], c && (h = c, a = (n = u)[1], d = h[1], g = (p = a | d) < 131, f = d == Yn && 8 == a || d == Yn && 256 == a && n[7].length <= h[8] || 384 == d && h[7].length <= h[8] && 8 == a, (g || f) && (1 & d && (n[2] = h[2], p |= 1 & a ? 0 : 4), (g = h[3]) && (m = n[3], n[3] = m ? pi(m, g, h[4]) : g, n[4] = m ? il(n[3], Wn) : h[4]), (g = h[5]) && (m = n[5], n[5] = m ? gi(m, g, h[6]) : g, n[6] = m ? il(n[5], Wn) : h[6]), (g = h[7]) && (n[7] = g), d & Yn && (n[8] = null == n[8] ? h[8] : E(n[8], h[8])), null == n[9] && (n[9] = h[9]), n[0] = h[0], n[1] = p)), e = u[0], t = u[1], i = u[2], o = u[3], r = u[4], !(s = u[9] = u[9] === jn ? w ? 0 : e.length : S(u[9] - l, 0)) && 24 & t && (t &= -25), f = t && 1 != t ? 8 == t || 16 == t ? Si(e, t, s) : 32 != t && 33 != t || r.length ? xi.apply(jn, u) : Mi(e, t, i, o) : (C = i, y = 1 & t, v = Ti(_ = e), function e() { return (this && this !== ms && this instanceof e ? v : _).apply(y ? C : this, arguments) }), Co((c ? zt : go)(f, u), e, t); throw new T(Un) } function ki(e, t, i, o) { return e === jn || G(e, Y[i]) && !V.call(o, i) ? t : e } function Ni(e, t, i, o, r, n) { return w(e) && w(t) && (n.set(t, e), Rt(e, t, jn, Ni, n), n.delete(t)), e } function ji(e) { return xr(e) ? jn : e } function Ui(e, t, i, o, r, n) { var a = 1 & i, s = e.length, l = t.length; if (s != l && !(a && s < l)) return !1; var l = n.get(e), c = n.get(t); if (l && c) return l == t && c == e; var u = -1, h = !0, m = 2 & i ? new Ue : jn; for (n.set(e, t), n.set(t, e); ++u < s;) { var d, p = e[u], g = t[u]; if ((d = o ? a ? o(g, p, u, t, e, n) : o(p, g, u, e, t, n) : d) !== jn) { if (d) continue; h = !1; break } if (m) { if (!Rs(t, function (e, t) { return !Js(m, t) && (p === e || r(p, e, i, o, n)) && m.push(t) })) { h = !1; break } } else if (p !== g && !r(p, g, i, o, n)) { h = !1; break } } return n.delete(e), n.delete(t), h } function zi(e) { return _o(ho(e, jn, Do), e + "") } function Wi(e) { return ft(e, A, $i) } function Yi(e) { return ft(e, L, eo) } var Ji = De ? function (e) { return De.get(e) } : En; function Ki(e) { for (var t = e.name + "", i = Ie[t], o = V.call(Ie, t) ? i.length : 0; o--;) { var r = i[o], n = r.func; if (null == n || n == e) return r.name } return t } function Qi(e) { return (V.call(p, "placeholder") ? p : e).placeholder } function h() { var e = (e = p.iteratee || wn) === wn ? Pt : e; return arguments.length ? e(arguments[0], arguments[1]) : e } function qi(e, t) { var i, o, e = e.__data__; return ("string" == (o = typeof (i = t)) || "number" == o || "symbol" == o || "boolean" == o ? "__proto__" !== i : null === i) ? e["string" == typeof t ? "string" : "hash"] : e.map } function Xi(e) { for (var t = A(e), i = t.length; i--;) { var o = t[i], r = e[o]; t[i] = [o, r, co(r)] } return t } function Zi(e, t) { t = t; e = null == (e = e) ? jn : e[t]; return Et(e) ? e : jn } var $i = fe ? function (t) { return null == t ? [] : (t = g(t), Ps(fe(t), function (e) { return ne.call(t, e) })) } : Mn, eo = fe ? function (e) { for (var t = []; e;)As(t, $i(e)), e = oe(e); return t } : Mn, H = i; function to(e, t, i) { for (var o = -1, r = (t = ai(t, e)).length, n = !1; ++o < r;) { var a = To(t[o]); if (!(n = null != e && i(e, a))) break; e = e[a] } return n || ++o != r ? n : !!(r = null == e ? 0 : e.length) && Sr(r) && ro(a, r) && (k(e) || Cr(e)) } function io(e) { return "function" != typeof e.constructor || lo(e) ? {} : Fe(oe(e)) } function oo(e) { return k(e) || Cr(e) || !!(se && e && e[se]) } function ro(e, t) { var i = typeof e; return !!(t = null == t ? Jn : t) && ("number" == i || "symbol" != i && Za.test(e)) && -1 < e && e % 1 == 0 && e < t } function m(e, t, i) { var o; if (w(i)) return ("number" == (o = typeof t) ? u(i) && ro(t, i.length) : "string" == o && t in i) && G(i[t], e) } function no(e, t) { var i; if (!k(e)) return "number" == (i = typeof e) || "symbol" == i || "boolean" == i || null == e || x(e) || (Ba.test(e) || !Oa.test(e) || null != t && e in g(t)) } function ao(e) { var t = Ki(e), i = p[t]; return "function" == typeof i && t in C.prototype && (e === i || (t = Ji(i)) && e === t[0]) } (n && H(new n(new ArrayBuffer(1))) != pa || Se && H(new Se) != ra || Ee && H(Ee.resolve()) != sa || Pe && H(new Pe) != ca || e && H(new e) != ma) && (H = function (e) { var t = i(e), e = t == aa ? e.constructor : jn, e = e ? So(e) : ""; if (e) switch (e) { case Ae: return pa; case Le: return ra; case Me: return sa; case Re: return ca; case Oe: return ma }return t }); var so = J ? br : Rn; function lo(e) { var t = e && e.constructor; return e === ("function" == typeof t && t.prototype || Y) } function co(e) { return e == e && !w(e) } function uo(t, i) { return function (e) { return null != e && (e[t] === i && (i !== jn || t in g(e))) } } function ho(n, a, s) { return a = S(a === jn ? n.length - 1 : a, 0), function () { for (var e = arguments, t = -1, i = S(e.length - a, 0), o = b(i); ++t < i;)o[t] = e[a + t]; for (var t = -1, r = b(a + 1); ++t < a;)r[t] = e[t]; return r[a] = s(o), ws(n, this, r) } } function mo(e, t) { return t.length < 2 ? e : gt(e, s(t, 0, -1)) } function po(e, t) { if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t] } var go = yo(zt), fo = de || function (e, t) { return ms.setTimeout(e, t) }, _o = yo(t); function Co(e, t, i) { var o, r, n, t = t + ""; return _o(e, (r = (t = (t = e = t).match(Na)) ? t[1].split(ja) : [], n = i, Ts(qn, function (e) { var t = "_." + e[0]; n & e[1] && !xs(r, t) && r.push(t) }), t = r.sort(), (i = t.length) ? (t[o = i - 1] = (1 < i ? "& " : "") + t[o], t = t.join(2 < i ? ", " : " "), e.replace(ka, "{\n/* [wrapped with " + t + "] */\n")) : e)) } function yo(i) { var o = 0, r = 0; return function () { var e = ve(), t = 16 - (e - r); if (r = e, 0 < t) { if (800 <= ++o) return arguments[0] } else o = 0; return i.apply(jn, arguments) } } function vo(e, t) { var i = -1, o = e.length, r = o - 1; for (t = t === jn ? o : t; ++i < t;) { var n = Gt(i, r), a = e[n]; e[n] = e[i], e[i] = a } return e.length = t, e } wo = (he = hr(he = function (e) { var r = []; return 46 === e.charCodeAt(0) && r.push(""), e.replace(Va, function (e, t, i, o) { r.push(i ? o.replace(Wa, "$1") : t || e) }), r }, function (e) { return 500 === wo.size && wo.clear(), e })).cache; var wo, bo = he; function To(e) { var t; return "string" == typeof e || x(e) ? e : "0" == (t = e + "") && 1 / e == -1 / 0 ? "-0" : t } function So(e) { if (null != e) { try { return K.call(e) } catch (e) { } try { return e + "" } catch (e) { } } return "" } function Eo(e) { var t; return e instanceof C ? e.clone() : ((t = new f(e.__wrapped__, e.__chain__)).__actions__ = P(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t) } n = a(function (e, t) { return v(e) ? rt(e, l(t, 1, v, !0)) : [] }), Ee = a(function (e, t) { var i = o(t); return v(i) && (i = jn), v(e) ? rt(e, l(t, 1, v, !0), h(i, 2)) : [] }), e = a(function (e, t) { var i = o(t); return v(i) && (i = jn), v(e) ? rt(e, l(t, 1, v, !0), jn, i) : [] }); function Po(e, t, i) { var o = null == e ? 0 : e.length; return o ? ((i = null == i ? 0 : D(i)) < 0 && (i = S(o + i, 0)), Bs(e, h(t, 3), i)) : -1 } function xo(e, t, i) { var o, r = null == e ? 0 : e.length; return r ? (o = r - 1, i !== jn && (o = D(i), o = i < 0 ? S(r + o, 0) : E(o, r - 1)), Bs(e, h(t, 3), o, !0)) : -1 } function Do(e) { return (null == e ? 0 : e.length) ? l(e, 1) : [] } function Io(e) { return e && e.length ? e[0] : jn } J = a(function (e) { var t = Is(e, ri); return t.length && t[0] === e[0] ? vt(t) : [] }), de = a(function (e) { var t = o(e), i = Is(e, ri); return t === o(i) ? t = jn : i.pop(), i.length && i[0] === e[0] ? vt(i, h(t, 2)) : [] }), t = a(function (e) { var t = o(e), i = Is(e, ri); return (t = "function" == typeof t ? t : jn) && i.pop(), i.length && i[0] === e[0] ? vt(i, jn, t) : [] }); function o(e) { var t = null == e ? 0 : e.length; return t ? e[t - 1] : jn } he = a(Ao); function Ao(e, t) { return e && e.length && t && t.length ? Ft(e, t) : e } var Lo = zi(function (e, t) { var i = null == e ? 0 : e.length, o = et(e, t); return Ht(e, Is(t, function (e) { return ro(e, i) ? +e : e }).sort(di)), o }); function Mo(e) { return null == e ? e : Te.call(e) } var Ro = a(function (e) { return Xt(l(e, 1, v, !0)) }), Oo = a(function (e) { var t = o(e); return v(t) && (t = jn), Xt(l(e, 1, v, !0), h(t, 2)) }), Bo = a(function (e) { var t = "function" == typeof (t = o(e)) ? t : jn; return Xt(l(e, 1, v, !0), jn, t) }); function Vo(t) { var i; return t && t.length ? (i = 0, t = Ps(t, function (e) { return v(e) && (i = S(e.length, i), 1) }), Us(i, function (e) { return Is(t, ks(e)) })) : [] } function Fo(e, t) { return e && e.length ? (e = Vo(e), null == t ? e : Is(e, function (e) { return ws(t, jn, e) })) : [] } var Ho = a(function (e, t) { return v(e) ? rt(e, t) : [] }), Go = a(function (e) { return ii(Ps(e, v)) }), ko = a(function (e) { var t = o(e); return v(t) && (t = jn), ii(Ps(e, v), h(t, 2)) }), No = a(function (e) { var t = "function" == typeof (t = o(e)) ? t : jn; return ii(Ps(e, v), jn, t) }), jo = a(Vo); var Uo = a(function (e) { var t = e.length, t = "function" == typeof (t = 1 < t ? e[t - 1] : jn) ? (e.pop(), t) : jn; return Fo(e, t) }); function zo(e) { e = p(e); return e.__chain__ = !0, e } function Wo(e, t) { return t(e) } var Yo = zi(function (t) { function e(e) { return et(e, t) } var i = t.length, o = i ? t[0] : 0, r = this.__wrapped__; return !(1 < i || this.__actions__.length) && r instanceof C && ro(o) ? ((r = r.slice(o, +o + (i ? 1 : 0))).__actions__.push({ func: Wo, args: [e], thisArg: jn }), new f(r, this.__chain__).thru(function (e) { return i && !e.length && e.push(jn), e })) : this.thru(e) }); var Jo = _i(function (e, t, i) { V.call(e, i) ? ++e[i] : $e(e, i, 1) }); var Ko = Ei(Po), Qo = Ei(xo); function qo(e, t) { return (k(e) ? Ts : nt)(e, h(t, 3)) } function Xo(e, t) { return (k(e) ? Ss : at)(e, h(t, 3)) } var Zo = _i(function (e, t, i) { V.call(e, i) ? e[i].push(t) : $e(e, i, [t]) }); var $o = a(function (e, t, i) { var o = -1, r = "function" == typeof t, n = u(e) ? b(e.length) : []; return nt(e, function (e) { n[++o] = r ? ws(t, e, i) : wt(e, t, i) }), n }), er = _i(function (e, t, i) { $e(e, i, t) }); function tr(e, t) { return (k(e) ? Is : At)(e, h(t, 3)) } var ir = _i(function (e, t, i) { e[i ? 0 : 1].push(t) }, function () { return [[], []] }); var or = a(function (e, t) { var i; return null == e ? [] : (1 < (i = t.length) && m(e, t[0], t[1]) ? t = [] : 2 < i && m(t[0], t[1], t[2]) && (t = [t[0]]), Bt(e, l(t, 1), [])) }), rr = me || function () { return ms.Date.now() }; function nr(e, t, i) { return t = i ? jn : t, t = e && null == t ? e.length : t, Gi(e, Yn, jn, jn, jn, jn, t) } function ar(e, t) { var i; if ("function" != typeof t) throw new T(Un); return e = D(e), function () { return 0 < --e && (i = t.apply(this, arguments)), e <= 1 && (t = jn), i } } var sr = a(function (e, t, i) { var o, r = 1; return i.length && (o = il(i, Qi(sr)), r |= 32), Gi(e, r, t, i, o) }), lr = a(function (e, t, i) { var o, r = 3; return i.length && (o = il(i, Qi(lr)), r |= 32), Gi(t, r, e, i, o) }); function cr(o, i, e) { var r, n, a, s, l, c, u = 0, h = !1, m = !1, t = !0; if ("function" != typeof o) throw new T(Un); function d(e) { var t = r, i = n; return r = n = jn, u = e, s = o.apply(i, t) } function p(e) { var t = e - c; return c === jn || i <= t || t < 0 || m && a <= e - u } function g() { var e, t = rr(); if (p(t)) return f(t); l = fo(g, (e = i - ((t = t) - c), m ? E(e, a - (t - u)) : e)) } function f(e) { return l = jn, t && r ? d(e) : (r = n = jn, s) } function _() { var e = rr(), t = p(e); if (r = arguments, n = this, c = e, t) { if (l === jn) return u = e = c, l = fo(g, i), h ? d(e) : s; if (m) return ci(l), l = fo(g, i), d(c) } return l === jn && (l = fo(g, i)), s } return i = I(i) || 0, w(e) && (h = !!e.leading, m = "maxWait" in e, a = m ? S(I(e.maxWait) || 0, i) : a, t = "trailing" in e ? !!e.trailing : t), _.cancel = function () { l !== jn && ci(l), u = 0, r = c = n = l = jn }, _.flush = function () { return l === jn ? s : f(rr()) }, _ } var me = a(function (e, t) { return ot(e, 1, t) }), ur = a(function (e, t, i) { return ot(e, I(t) || 0, i) }); function hr(o, r) { if ("function" != typeof o || null != r && "function" != typeof r) throw new T(Un); function n() { var e = arguments, t = r ? r.apply(this, e) : e[0], i = n.cache; return i.has(t) ? i.get(t) : (e = o.apply(this, e), n.cache = i.set(t, e) || i, e) } return n.cache = new (hr.Cache || je), n } function mr(t) { if ("function" != typeof t) throw new T(Un); return function () { var e = arguments; switch (e.length) { case 0: return !t.call(this); case 1: return !t.call(this, e[0]); case 2: return !t.call(this, e[0], e[1]); case 3: return !t.call(this, e[0], e[1], e[2]) }return !t.apply(this, e) } } hr.Cache = je; var si = si(function (o, r) { var n = (r = 1 == r.length && k(r[0]) ? Is(r[0], Ws(h())) : Is(l(r, 1), Ws(h()))).length; return a(function (e) { for (var t = -1, i = E(e.length, n); ++t < i;)e[t] = r[t].call(this, e[t]); return ws(o, this, e) }) }), dr = a(function (e, t) { var i = il(t, Qi(dr)); return Gi(e, 32, jn, t, i) }), pr = a(function (e, t) { var i = il(t, Qi(pr)); return Gi(e, 64, jn, t, i) }), gr = zi(function (e, t) { return Gi(e, 256, jn, jn, jn, t) }); function G(e, t) { return e === t || e != e && t != t } var fr = Oi(_t), _r = Oi(function (e, t) { return t <= e }), Cr = bt(function () { return arguments }()) ? bt : function (e) { return N(e) && V.call(e, "callee") && !ne.call(e, "callee") }, k = b.isArray, yr = gs ? Ws(gs) : function (e) { return N(e) && i(e) == da }; function u(e) { return null != e && Sr(e.length) && !br(e) } function v(e) { return N(e) && u(e) } var vr = W || Rn, W = fs ? Ws(fs) : function (e) { return N(e) && i(e) == ea }; function wr(e) { var t; return !!N(e) && ((t = i(e)) == ta || "[object DOMException]" == t || "string" == typeof e.message && "string" == typeof e.name && !xr(e)) } function br(e) { return !!w(e) && ((e = i(e)) == ia || e == oa || "[object AsyncFunction]" == e || "[object Proxy]" == e) } function Tr(e) { return "number" == typeof e && e == D(e) } function Sr(e) { return "number" == typeof e && -1 < e && e % 1 == 0 && e <= Jn } function w(e) { var t = typeof e; return null != e && ("object" == t || "function" == t) } function N(e) { return null != e && "object" == typeof e } var Er = _s ? Ws(_s) : function (e) { return N(e) && H(e) == ra }; function Pr(e) { return "number" == typeof e || N(e) && i(e) == na } function xr(e) { return !(!N(e) || i(e) != aa) && (null === (e = oe(e)) || "function" == typeof (e = V.call(e, "constructor") && e.constructor) && e instanceof e && K.call(e) == Z) } var Dr = Cs ? Ws(Cs) : function (e) { return N(e) && i(e) == la }; var Ir = ys ? Ws(ys) : function (e) { return N(e) && H(e) == ca }; function Ar(e) { return "string" == typeof e || !k(e) && N(e) && i(e) == ua } function x(e) { return "symbol" == typeof e || N(e) && i(e) == ha } var Lr = vs ? Ws(vs) : function (e) { return N(e) && Sr(e.length) && !!ls[i(e)] }; var Mr = Oi(It), Rr = Oi(function (e, t) { return e <= t }); function Or(e) { if (!e) return []; if (u(e)) return (Ar(e) ? nl : P)(e); if (le && e[le]) { for (var t, i = e[le](), o = []; !(t = i.next()).done;)o.push(t.value); return o } var r = H(e); return (r == ra ? el : r == ca ? ol : rn)(e) } function Br(e) { return e ? (e = I(e)) === 1 / 0 || e === -1 / 0 ? 17976931348623157e292 * (e < 0 ? -1 : 1) : e == e ? e : 0 : 0 === e ? e : 0 } function D(e) { var e = Br(e), t = e % 1; return e == e ? t ? e - t : e : 0 } function Vr(e) { return e ? tt(D(e), 0, Qn) : 0 } function I(e) { if ("number" == typeof e) return e; if (x(e)) return Kn; if ("string" != typeof (e = w(e) ? w(t = "function" == typeof e.valueOf ? e.valueOf() : e) ? t + "" : t : e)) return 0 === e ? e : +e; e = zs(e); var t = Qa.test(e); return t || Xa.test(e) ? hs(e.slice(2), t ? 2 : 8) : Ka.test(e) ? Kn : +e } function Fr(e) { return fi(e, L(e)) } function d(e) { return null == e ? "" : c(e) } var Hr = Ci(function (e, t) { if (lo(t) || u(t)) fi(t, A(t), e); else for (var i in t) V.call(t, i) && Qe(e, i, t[i]) }), Gr = Ci(function (e, t) { fi(t, L(t), e) }), kr = Ci(function (e, t, i, o) { fi(t, L(t), e, o) }), Nr = Ci(function (e, t, i, o) { fi(t, A(t), e, o) }), jr = zi(et); var Ur = a(function (e, t) { e = g(e); var i = -1, o = t.length, r = 2 < o ? t[2] : jn; for (r && m(t[0], t[1], r) && (o = 1); ++i < o;)for (var n = t[i], a = L(n), s = -1, l = a.length; ++s < l;) { var c = a[s], u = e[c]; (u === jn || G(u, Y[c]) && !V.call(e, c)) && (e[c] = n[c]) } return e }), zr = a(function (e) { return e.push(jn, Ni), ws(Xr, jn, e) }); function Wr(e, t, i) { e = null == e ? jn : gt(e, t); return e === jn ? i : e } function Yr(e, t) { return null != e && to(e, t, yt) } var Jr = Di(function (e, t, i) { e[t = null != t && "function" != typeof t.toString ? X.call(t) : t] = i }, Cn(M)), Kr = Di(function (e, t, i) { null != t && "function" != typeof t.toString && (t = X.call(t)), V.call(e, t) ? e[t].push(i) : e[t] = [i] }, h), Qr = a(wt); function A(e) { return (u(e) ? ze : xt)(e) } function L(e) { return u(e) ? ze(e, !0) : Dt(e) } var qr = Ci(function (e, t, i) { Rt(e, t, i) }), Xr = Ci(function (e, t, i, o) { Rt(e, t, i, o) }), Zr = zi(function (t, e) { var i = {}; if (null != t) for (var o = !1, r = (e = Is(e, function (e) { return e = ai(e, t), o = o || 1 < e.length, e }), fi(t, Yi(t), i), o && (i = y(i, 7, ji)), e.length); r--;)Zt(i, e[r]); return i }); var $r = zi(function (e, t) { return null == e ? {} : Vt(i = e, t, function (e, t) { return Yr(i, t) }); var i }); function en(e, i) { var t; return null == e ? {} : (t = Is(Yi(e), function (e) { return [e] }), i = h(i), Vt(e, t, function (e, t) { return i(e, t[0]) })) } var tn = Hi(A), on = Hi(L); function rn(e) { return null == e ? [] : Ys(e, A(e)) } var nn = bi(function (e, t, i) { return t = t.toLowerCase(), e + (i ? an(t) : t) }); function an(e) { return pn(d(e).toLowerCase()) } function sn(e) { return (e = d(e)) && e.replace($a, qs).replace(os, "") } var ln = bi(function (e, t, i) { return e + (i ? "-" : "") + t.toLowerCase() }), cn = bi(function (e, t, i) { return e + (i ? " " : "") + t.toLowerCase() }), un = wi("toLowerCase"); var hn = bi(function (e, t, i) { return e + (i ? "_" : "") + t.toLowerCase() }); var mn = bi(function (e, t, i) { return e + (i ? " " : "") + pn(t) }); var dn = bi(function (e, t, i) { return e + (i ? " " : "") + t.toUpperCase() }), pn = wi("toUpperCase"); function gn(e, t, i) { return e = d(e), (t = i ? jn : t) === jn ? (i = e, ns.test(i) ? e.match(rs) || [] : e.match(Ua) || []) : e.match(t) || [] } var fn = a(function (e, t) { try { return ws(e, jn, t) } catch (e) { return wr(e) ? e : new R(e) } }), _n = zi(function (t, e) { return Ts(e, function (e) { e = To(e), $e(t, e, sr(t[e], t)) }), t }); function Cn(e) { return function () { return e } } var yn = Pi(), vn = Pi(!0); function M(e) { return e } function wn(e) { return Pt("function" == typeof e ? e : y(e, 1)) } var bn = a(function (t, i) { return function (e) { return wt(e, t, i) } }), Tn = a(function (t, i) { return function (e) { return wt(t, e, i) } }); function Sn(o, t, e) { var i = A(t), r = pt(t, i), n = (null != e || w(t) && (r.length || !i.length) || (e = t, t = o, o = this, r = pt(t, A(t))), !(w(e) && "chain" in e && !e.chain)), a = br(o); return Ts(r, function (e) { var i = t[e]; o[e] = i, a && (o.prototype[e] = function () { var e, t = this.__chain__; return n || t ? (((e = o(this.__wrapped__)).__actions__ = P(this.__actions__)).push({ func: i, args: arguments, thisArg: o }), e.__chain__ = t, e) : i.apply(o, As([this.value()], arguments)) }) }), o } function En() { } var Pn = Ai(Is), xn = Ai(Es), Dn = Ai(Rs); function In(e) { return no(e) ? ks(To(e)) : (t = e, function (e) { return gt(e, t) }); var t } var An = Ri(), Ln = Ri(!0); function Mn() { return [] } function Rn() { return !1 } var On = Ii(function (e, t) { return e + t }, 0), Bn = Vi("ceil"), Vn = Ii(function (e, t) { return e / t }, 1), Fn = Vi("floor"); var Hn, Gn = Ii(function (e, t) { return e * t }, 1), kn = Vi("round"), Nn = Ii(function (e, t) { return e - t }, 0); return p.after = function (e, t) { if ("function" != typeof t) throw new T(Un); return e = D(e), function () { if (--e < 1) return t.apply(this, arguments) } }, p.ary = nr, p.assign = Hr, p.assignIn = Gr, p.assignInWith = kr, p.assignWith = Nr, p.at = jr, p.before = ar, p.bind = sr, p.bindAll = _n, p.bindKey = lr, p.castArray = function () { var e; return arguments.length ? k(e = arguments[0]) ? e : [e] : [] }, p.chain = zo, p.chunk = function (e, t, i) { t = (i ? m(e, t, i) : t === jn) ? 1 : S(D(t), 0); var o = null == e ? 0 : e.length; if (!o || t < 1) return []; for (var r = 0, n = 0, a = b(pe(o / t)); r < o;)a[n++] = s(e, r, r += t); return a }, p.compact = function (e) { for (var t = -1, i = null == e ? 0 : e.length, o = 0, r = []; ++t < i;) { var n = e[t]; n && (r[o++] = n) } return r }, p.concat = function () { var e = arguments.length; if (!e) return []; for (var t = b(e - 1), i = arguments[0], o = e; o--;)t[o - 1] = arguments[o]; return As(k(i) ? P(i) : [i], l(t, 1)) }, p.cond = function (o) { var r = null == o ? 0 : o.length, t = h(); return o = r ? Is(o, function (e) { if ("function" != typeof e[1]) throw new T(Un); return [t(e[0]), e[1]] }) : [], a(function (e) { for (var t = -1; ++t < r;) { var i = o[t]; if (ws(i[0], this, e)) return ws(i[1], this, e) } }) }, p.conforms = function (e) { return t = y(e, 1), i = A(t), function (e) { return it(e, t, i) }; var t, i }, p.constant = Cn, p.countBy = Jo, p.create = function (e, t) { return e = Fe(e), null == t ? e : Ze(e, t) }, p.curry = function e(t, i, o) { t = Gi(t, 8, jn, jn, jn, jn, jn, i = o ? jn : i); return t.placeholder = e.placeholder, t }, p.curryRight = function e(t, i, o) { t = Gi(t, 16, jn, jn, jn, jn, jn, i = o ? jn : i); return t.placeholder = e.placeholder, t }, p.debounce = cr, p.defaults = Ur, p.defaultsDeep = zr, p.defer = me, p.delay = ur, p.difference = n, p.differenceBy = Ee, p.differenceWith = e, p.drop = function (e, t, i) { var o = null == e ? 0 : e.length; return o ? s(e, (t = i || t === jn ? 1 : D(t)) < 0 ? 0 : t, o) : [] }, p.dropRight = function (e, t, i) { var o = null == e ? 0 : e.length; return o ? s(e, 0, (t = o - (t = i || t === jn ? 1 : D(t))) < 0 ? 0 : t) : [] }, p.dropRightWhile = function (e, t) { return e && e.length ? ei(e, h(t, 3), !0, !0) : [] }, p.dropWhile = function (e, t) { return e && e.length ? ei(e, h(t, 3), !0) : [] }, p.fill = function (e, t, i, o) { if (!(l = null == e ? 0 : e.length)) return []; i && "number" != typeof i && m(e, t, i) && (i = 0, o = l); var r = e, n = t, a = i, s = o, l = r.length; for ((a = D(a)) < 0 && (a = l < -a ? 0 : l + a), (s = s === jn || l < s ? l : D(s)) < 0 && (s += l), s = s < a ? 0 : Vr(s); a < s;)r[a++] = n; return r }, p.filter = function (e, t) { return (k(e) ? Ps : ct)(e, h(t, 3)) }, p.flatMap = function (e, t) { return l(tr(e, t), 1) }, p.flatMapDeep = function (e, t) { return l(tr(e, t), 1 / 0) }, p.flatMapDepth = function (e, t, i) { return i = i === jn ? 1 : D(i), l(tr(e, t), i) }, p.flatten = Do, p.flattenDeep = function (e) { return (null == e ? 0 : e.length) ? l(e, 1 / 0) : [] }, p.flattenDepth = function (e, t) { return (null == e ? 0 : e.length) ? l(e, t = t === jn ? 1 : D(t)) : [] }, p.flip = function (e) { return Gi(e, 512) }, p.flow = yn, p.flowRight = vn, p.fromPairs = function (e) { for (var t = -1, i = null == e ? 0 : e.length, o = {}; ++t < i;) { var r = e[t]; o[r[0]] = r[1] } return o }, p.functions = function (e) { return null == e ? [] : pt(e, A(e)) }, p.functionsIn = function (e) { return null == e ? [] : pt(e, L(e)) }, p.groupBy = Zo, p.initial = function (e) { return (null == e ? 0 : e.length) ? s(e, 0, -1) : [] }, p.intersection = J, p.intersectionBy = de, p.intersectionWith = t, p.invert = Jr, p.invertBy = Kr, p.invokeMap = $o, p.iteratee = wn, p.keyBy = er, p.keys = A, p.keysIn = L, p.map = tr, p.mapKeys = function (e, o) { var r = {}; return o = h(o, 3), mt(e, function (e, t, i) { $e(r, o(e, t, i), e) }), r }, p.mapValues = function (e, o) { var r = {}; return o = h(o, 3), mt(e, function (e, t, i) { $e(r, t, o(e, t, i)) }), r }, p.matches = function (e) { return Lt(y(e, 1)) }, p.matchesProperty = function (e, t) { return Mt(e, y(t, 1)) }, p.memoize = hr, p.merge = qr, p.mergeWith = Xr, p.method = bn, p.methodOf = Tn, p.mixin = Sn, p.negate = mr, p.nthArg = function (t) { return t = D(t), a(function (e) { return Ot(e, t) }) }, p.omit = Zr, p.omitBy = function (e, t) { return en(e, mr(h(t))) }, p.once = function (e) { return ar(2, e) }, p.orderBy = function (e, t, i, o) { return null == e ? [] : Bt(e, t = k(t) ? t : null == t ? [] : [t], i = k(i = o ? jn : i) ? i : null == i ? [] : [i]) }, p.over = Pn, p.overArgs = si, p.overEvery = xn, p.overSome = Dn, p.partial = dr, p.partialRight = pr, p.partition = ir, p.pick = $r, p.pickBy = en, p.property = In, p.propertyOf = function (t) { return function (e) { return null == t ? jn : gt(t, e) } }, p.pull = he, p.pullAll = Ao, p.pullAllBy = function (e, t, i) { return e && e.length && t && t.length ? Ft(e, t, h(i, 2)) : e }, p.pullAllWith = function (e, t, i) { return e && e.length && t && t.length ? Ft(e, t, jn, i) : e }, p.pullAt = Lo, p.range = An, p.rangeRight = Ln, p.rearg = gr, p.reject = function (e, t) { return (k(e) ? Ps : ct)(e, mr(h(t, 3))) }, p.remove = function (e, t) { var i = []; if (e && e.length) { var o = -1, r = [], n = e.length; for (t = h(t, 3); ++o < n;) { var a = e[o]; t(a, o, e) && (i.push(a), r.push(o)) } Ht(e, r) } return i }, p.rest = function (e, t) { if ("function" != typeof e) throw new T(Un); return a(e, t = t === jn ? t : D(t)) }, p.reverse = Mo, p.sampleSize = function (e, t, i) { return t = (i ? m(e, t, i) : t === jn) ? 1 : D(t), (k(e) ? Ye : jt)(e, t) }, p.set = function (e, t, i) { return null == e ? e : Ut(e, t, i) }, p.setWith = function (e, t, i, o) { return o = "function" == typeof o ? o : jn, null == e ? e : Ut(e, t, i, o) }, p.shuffle = function (e) { return (k(e) ? Je : Wt)(e) }, p.slice = function (e, t, i) { var o = null == e ? 0 : e.length; return o ? (i = i && "number" != typeof i && m(e, t, i) ? (t = 0, o) : (t = null == t ? 0 : D(t), i === jn ? o : D(i)), s(e, t, i)) : [] }, p.sortBy = or, p.sortedUniq = function (e) { return e && e.length ? Qt(e) : [] }, p.sortedUniqBy = function (e, t) { return e && e.length ? Qt(e, h(t, 2)) : [] }, p.split = function (e, t, i) { return i && "number" != typeof i && m(e, t, i) && (t = i = jn), (i = i === jn ? Qn : i >>> 0) ? (e = d(e)) && ("string" == typeof t || null != t && !Dr(t)) && !(t = c(t)) && $s(e) ? li(nl(e), 0, i) : e.split(t, i) : [] }, p.spread = function (i, o) { if ("function" != typeof i) throw new T(Un); return o = null == o ? 0 : S(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 T(Un); return w(i) && (o = "leading" in i ? !!i.leading : o, r = "trailing" in i ? !!i.trailing : r), cr(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] : P(bo(d(e))) }, p.toPlainObject = Fr, 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 : [] : w(e) && br(t) ? Fe(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 = Vo, p.unzipWith = Fo, 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 = Ho, 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 || [], Ut) }, p.zipWith = Uo, p.entries = tn, p.entriesIn = on, p.extend = Gr, p.extendWith = kr, Sn(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 y(e, 4) }, p.cloneDeep = function (e) { return y(e, 5) }, p.cloneDeepWith = function (e, t) { return y(e, 5, t = "function" == typeof t ? t : jn) }, p.cloneWith = function (e, t) { return y(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 = Vn, p.endsWith = function (e, t, i) { e = d(e), t = c(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)) && Ha.test(e) ? e.replace(Fa, "\\$&") : e }, p.every = function (e, t, i) { return (k(e) ? Es : 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 = Fn, p.forEach = qo, p.forEachRight = Xo, p.forIn = function (e, t) { return null == e ? e : ut(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 = u(e) ? e : rn(e), i = i && !o ? D(i) : 0, o = e.length, i < 0 && (i = S(o + i, 0)), Ar(e) ? i <= o && -1 < e.indexOf(t, i) : !!o && -1 < Vs(e, t, i) }, p.indexOf = function (e, t, i) { var o = null == e ? 0 : e.length; return o ? Vs(e, t, e = (e = null == i ? 0 : D(i)) < 0 ? S(o + e, 0) : e) : -1 }, p.inRange = function (e, t, i) { return t = Br(t), i === jn ? (i = t, t = 0) : i = Br(i), (e = e = I(e)) >= E(t = t, i = i) && e < S(t, i) }, p.invoke = Qr, p.isArguments = Cr, p.isArray = k, p.isArrayBuffer = yr, p.isArrayLike = u, p.isArrayLikeObject = v, p.isBoolean = function (e) { return !0 === e || !1 === e || N(e) && i(e) == $n }, p.isBuffer = vr, p.isDate = W, p.isElement = function (e) { return N(e) && 1 === e.nodeType && !xr(e) }, p.isEmpty = function (e) { if (null != e) { if (u(e) && (k(e) || "string" == typeof e || "function" == typeof e.splice || vr(e) || Lr(e) || Cr(e))) return !e.length; var t, i = H(e); if (i == ra || i == ca) return !e.size; if (lo(e)) return !xt(e).length; for (t in e) if (V.call(e, t)) return !1 } return !0 }, p.isEqual = function (e, t) { return Tt(e, t) }, p.isEqualWith = function (e, t, i) { var o = (i = "function" == typeof i ? i : jn) ? i(e, t) : jn; return o === jn ? Tt(e, t, jn, i) : !!o }, p.isError = wr, p.isFinite = function (e) { return "number" == typeof e && _e(e) }, p.isFunction = br, p.isInteger = Tr, p.isLength = Sr, p.isMap = Er, p.isMatch = function (e, t) { return e === t || St(e, t, Xi(t)) }, p.isMatchWith = function (e, t, i) { return i = "function" == typeof i ? i : jn, St(e, t, Xi(t), i) }, p.isNaN = function (e) { return Pr(e) && e != +e }, p.isNative = function (e) { if (so(e)) throw new R("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); return Et(e) }, p.isNil = function (e) { return null == e }, p.isNull = function (e) { return null === e }, p.isNumber = Pr, p.isObject = w, 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) && H(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 ? S(o + r, 0) : E(r, o - 1)), t != t) return Bs(e, Hs, r, !0); for (var n = e, a = t, s = r + 1; s--;)if (n[s] === a) return s; return s }, p.lowerCase = cn, p.lowerFirst = un, 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 = En, 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 < t ? e + Li(t - o, i) : e }, p.padStart = function (e, t, i) { e = d(e); var o = (t = D(t)) ? rl(e) : 0; return t && o < t ? Li(t - o, i) + e : e }, p.parseInt = function (e, t, i) { return t = i || null == t ? 0 : t && +t, we(d(e).replace(Ga, ""), t || 0) }, p.random = function (e, t, i) { var o; return i && "boolean" != typeof i && m(e, t, i) && (t = i = jn), i === jn && ("boolean" == typeof t ? (i = t, t = jn) : "boolean" == typeof e && (i = e, e = jn)), e === jn && t === jn ? (e = 0, t = 1) : (e = Br(e), t === jn ? (t = e, e = 0) : t = Br(t)), t < e && (o = e, e = t, t = o), i || e % 1 || t % 1 ? (o = be(), E(e + o * (t - e + us("1e-" + ((o + "").length - 1))), t)) : Gt(e, t) }, p.reduce = function (e, t, i) { var o = k(e) ? Ls : Ns, r = arguments.length < 3; return o(e, h(t, 4), i, r, nt) }, p.reduceRight = function (e, t, i) { var o = k(e) ? Ms : Ns, r = arguments.length < 3; return o(e, h(t, 4), i, r, at) }, p.repeat = function (e, t, i) { return t = (i ? m(e, t, i) : t === jn) ? 1 : D(t), kt(d(e), t) }, p.replace = function () { var e = arguments, t = d(e[0]); return e.length < 3 ? t : t.replace(e[1], e[2]) }, p.result = function (e, t, i) { var o = -1, r = (t = ai(t, e)).length; for (r || (r = 1, e = jn); ++o < r;) { var n = null == e ? jn : e[To(t[o])]; n === jn && (o = r, n = i), e = br(n) ? n.call(e) : n } return e }, p.round = kn, p.runInContext = r, p.sample = function (e) { return (k(e) ? We : Nt)(e) }, p.size = function (e) { var t; return null == e ? 0 : u(e) ? Ar(e) ? rl(e) : e.length : (t = H(e)) == ra || t == ca ? e.size : xt(e).length }, p.snakeCase = hn, p.some = function (e, t, i) { return (k(e) ? Rs : Yt)(e, h(t = i && m(e, t, i) ? jn : t, 3)) }, p.sortedIndex = function (e, t) { return Jt(e, t) }, p.sortedIndexBy = function (e, t, i) { return Kt(e, t, h(i, 2)) }, p.sortedIndexOf = function (e, t) { var i = null == e ? 0 : e.length; if (i) { var o = Jt(e, t); if (o < i && G(e[o], t)) return o } return -1 }, p.sortedLastIndex = function (e, t) { return Jt(e, t, !0) }, p.sortedLastIndexBy = function (e, t, i) { return Kt(e, t, h(i, 2), !0) }, p.sortedLastIndexOf = function (e, t) { if (null == e ? 0 : e.length) { var i = Jt(e, t, !0) - 1; if (G(e[i], t)) return i } return -1 }, p.startCase = mn, p.startsWith = function (e, t, i) { return e = d(e), i = null == i ? 0 : tt(D(i), 0, e.length), t = c(t), e.slice(i, i + t.length) == t }, p.subtract = Nn, p.sum = function (e) { return e && e.length ? js(e, M) : 0 }, p.sumBy = function (e, t) { return e && e.length ? js(e, h(t, 2)) : 0 }, p.template = function (a, e, t) { var s, l, i = p.templateSettings; t && m(a, e, t) && (e = jn), a = d(a), e = kr({}, e, i, ki); var o = A(t = kr({}, e.imports, i.imports, ki)), r = Ys(t, o), c = 0, i = e.interpolate || es, u = "__p += '", t = j((e.escape || es).source + "|" + i.source + "|" + (i === Ra ? Ya : es).source + "|" + (e.evaluate || es).source + "|$", "g"), n = "//# sourceURL=" + (V.call(e, "sourceURL") ? (e.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++ss + "]") + "\n"; if (a.replace(t, function (e, t, i, o, r, n) { return i = i || o, u += a.slice(c, n).replace(ts, Zs), t && (s = !0, u += "' +\n__e(" + t + ") +\n'"), r && (l = !0, u += "';\n" + r + ";\n__p += '"), i && (u += "' +\n((__t = (" + i + ")) == null ? '' : __t) +\n'"), c = n + e.length, e }), u += "';\n", i = V.call(e, "variable") && e.variable) { if (za.test(i)) throw new R("Invalid `variable` option passed into `_.template`") } else u = "with (obj) {\n" + u + "\n}\n"; if (u = (l ? u.replace(Sa, "") : u).replace(Ea, "$1").replace(Pa, "$1;"), u = "function(" + (i || "obj") + ") {\n" + (i ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (s ? ", __e = _.escape" : "") + (l ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + u + "return __p\n}", (t = fn(function () { return O(o, n + "return " + u).apply(jn, r) })).source = u, wr(t)) throw t; return t }, p.times = function (e, t) { if ((e = D(e)) < 1 || Jn < e) return []; for (var i = Qn, o = E(e, Qn), o = (t = h(t), e -= Qn, Us(o, t)); ++i < e;)t(i); return o }, p.toFinite = Br, p.toInteger = D, p.toLength = Vr, p.toLower = function (e) { return d(e).toLowerCase() }, p.toNumber = I, p.toSafeInteger = function (e) { return e ? tt(D(e), -Jn, Jn) : 0 === e ? e : 0 }, p.toString = d, p.toUpper = function (e) { return d(e).toUpperCase() }, p.trim = function (e, t, i) { return (e = d(e)) && (i || t === jn) ? zs(e) : e && (t = c(t)) ? li(i = nl(e), Ks(i, t = nl(t)), Qs(i, t) + 1).join("") : e }, p.trimEnd = function (e, t, i) { return (e = d(e)) && (i || t === jn) ? e.slice(0, al(e) + 1) : e && (t = c(t)) ? li(i = nl(e), 0, Qs(i, nl(t)) + 1).join("") : e }, p.trimStart = function (e, t, i) { return (e = d(e)) && (i || t === jn) ? e.replace(Ga, "") : e && (t = c(t)) ? li(i = nl(e), Ks(i, nl(t))).join("") : e }, p.truncate = function (e, t) { var i, o = 30, r = "...", t = (w(t) && (i = "separator" in t ? t.separator : i, o = "length" in t ? D(t.length) : o, r = "omission" in t ? c(t.omission) : r), (e = d(e)).length); if ((t = $s(e) ? (n = nl(e)).length : t) <= o) return e; if ((t = o - rl(r)) < 1) return r; var n, o = n ? li(n, 0, t).join("") : e.slice(0, t); if (i !== jn) if (n && (t += o.length - t), Dr(i)) { if (e.slice(t).search(i)) { var a, s = o; for ((i = i.global ? i : j(i.source, d(Ja.exec(i)) + "g")).lastIndex = 0; a = i.exec(s);)var l = a.index; o = o.slice(0, l === jn ? t : l) } } else e.indexOf(c(i), t) == t || -1 < (n = o.lastIndexOf(i)) && (o = o.slice(0, n)); return o + r }, p.unescape = function (e) { return (e = d(e)) && Ia.test(e) ? e.replace(xa, sl) : e }, p.uniqueId = function (e) { var t = ++Q; return d(e) + t }, p.upperCase = dn, p.upperFirst = pn, p.each = qo, p.eachRight = Xo, p.first = Io, Sn(p, (Hn = {}, mt(p, function (e, t) { V.call(p.prototype, t) || (Hn[t] = e) }), Hn), { chain: !1 }), p.VERSION = "4.17.21", Ts(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function (e) { p[e].placeholder = p }), Ts(["drop", "take"], function (i, o) { C.prototype[i] = function (e) { e = e === jn ? 1 : S(D(e), 0); var t = this.__filtered__ && !o ? new C(this) : this.clone(); return t.__filtered__ ? t.__takeCount__ = E(e, t.__takeCount__) : t.__views__.push({ size: E(e, Qn), type: i + (t.__dir__ < 0 ? "Right" : "") }), t }, C.prototype[i + "Right"] = function (e) { return this.reverse()[i](e).reverse() } }), Ts(["filter", "map", "takeWhile"], function (e, t) { var i = t + 1, o = 1 == i || 3 == i; C.prototype[e] = function (e) { var t = this.clone(); return t.__iteratees__.push({ iteratee: h(e, 3), type: i }), t.__filtered__ = t.__filtered__ || o, t } }), Ts(["head", "last"], function (e, t) { var i = "take" + (t ? "Right" : ""); C.prototype[e] = function () { return this[i](1).value()[0] } }), Ts(["initial", "tail"], function (e, t) { var i = "drop" + (t ? "" : "Right"); C.prototype[e] = function () { return this.__filtered__ ? new C(this) : this[i](1) } }), C.prototype.compact = function () { return this.filter(M) }, C.prototype.find = function (e) { return this.filter(e).head() }, C.prototype.findLast = function (e) { return this.reverse().find(e) }, C.prototype.invokeMap = a(function (t, i) { return "function" == typeof t ? new C(this) : this.map(function (e) { return wt(e, t, i) }) }), C.prototype.reject = function (e) { return this.filter(mr(h(e))) }, C.prototype.slice = function (e, t) { e = D(e); var i = this; return i.__filtered__ && (0 < e || t < 0) ? new C(i) : (e < 0 ? i = i.takeRight(-e) : e && (i = i.drop(e)), t !== jn ? (t = D(t)) < 0 ? i.dropRight(-t) : i.take(t - e) : i) }, C.prototype.takeRightWhile = function (e) { return this.reverse().takeWhile(e).reverse() }, C.prototype.toArray = function () { return this.take(Qn) }, mt(C.prototype, function (c, e) { var u = /^(?:filter|find|map|reject)|While$/.test(e), h = /^(?:head|last)$/.test(e), m = p[h ? "take" + ("last" == e ? "Right" : "") : e], d = h || /^find/.test(e); m && (p.prototype[e] = function () { function e(e) { return e = m.apply(p, As([e], o)), h && s ? e[0] : e } var t, i = this.__wrapped__, o = h ? [1] : arguments, r = i instanceof C, n = o[0], a = r || k(i), s = (a && u && "function" == typeof n && 1 != n.length && (r = a = !1), this.__chain__), n = !!this.__actions__.length, l = d && !s, r = r && !n; return !d && a ? (i = r ? i : new C(this), (t = c.apply(i, o)).__actions__.push({ func: Wo, args: [e], thisArg: jn }), new f(t, s)) : l && r ? c.apply(this, o) : (t = this.thru(e), l ? h ? t.value()[0] : t.value() : t) }) }), Ts(["pop", "push", "shift", "sort", "splice", "unshift"], function (e) { var i = z[e], o = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(e); p.prototype[e] = function () { var e, t = arguments; return r && !this.__chain__ ? (e = this.value(), i.apply(k(e) ? e : [], t)) : this[o](function (e) { return i.apply(k(e) ? e : [], t) }) } }), mt(C.prototype, function (e, t) { var i, o = p[t]; o && (i = o.name + "", V.call(Ie, i) || (Ie[i] = []), Ie[i].push({ name: t, func: o })) }), Ie[xi(jn, 2).name] = [{ name: "wrapper", func: jn }], C.prototype.clone = function () { var e = new C(this.__wrapped__); return e.__actions__ = P(this.__actions__), e.__dir__ = this.__dir__, e.__filtered__ = this.__filtered__, e.__iteratees__ = P(this.__iteratees__), e.__takeCount__ = this.__takeCount__, e.__views__ = P(this.__views__), e }, C.prototype.reverse = function () { var e; return this.__filtered__ ? ((e = new C(this)).__dir__ = -1, e.__filtered__ = !0) : (e = this.clone()).__dir__ *= -1, e }, C.prototype.value = function () { var e = this.__wrapped__.value(), t = this.__dir__, i = k(e), o = t < 0, r = i ? e.length : 0, n = function (e, t, i) { var o = -1, r = i.length; for (; ++o < r;) { var n = i[o], a = n.size; switch (n.type) { case "drop": e += a; break; case "dropRight": t -= a; break; case "take": t = E(t, e + a); break; case "takeRight": e = S(e, t - a) } } return { start: e, end: t } }(0, r, this.__views__), a = n.start, s = (n = n.end) - a, l = o ? n : a - 1, c = this.__iteratees__, u = c.length, h = 0, m = E(s, this.__takeCount__); if (!i || !o && r == s && m == s) return ti(e, this.__actions__); var d = []; e: for (; s-- && h < m;) { for (var p = -1, g = e[l += t]; ++p < u;) { var f = c[p], _ = f.iteratee, f = f.type, _ = _(g); if (2 == f) g = _; else if (!_) { if (1 == f) continue e; break e } } d[h++] = g } return d }, p.prototype.at = Yo, p.prototype.chain = function () { return zo(this) }, p.prototype.commit = function () { return new f(this.value(), this.__chain__) }, p.prototype.next = function () { this.__values__ === jn && (this.__values__ = Or(this.value())); var e = this.__index__ >= 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 = Eo(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 C ? (e = e, (e = (e = this.__actions__.length ? new C(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 }(), V = {}; function Ti(e) { this._viewer = e, this._core = new f, this._tree = V } function y(e) { this._viewer = e, this._cesium = Cesium, this._core = new f } function Si(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Ei(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource(), this._core = new f } V.Source = [], V.TempSource = [], V.entity = [], V.lastSelectEntity = null, V.pointsId = [], V.states = 0, V.PointSelectSource = [], V.currentObj = null, V.selectedItem = null, V.setSource = function (e) { this.Source = e }, V.setTempSource = function (e) { this.TempSource = e }, V.setPointSelectSource = function (e) { this.PointSelectSource = e }, V.getSource = function () { return this.Source }, V.getTempSource = function () { return this.TempSource }, V.getPointSelectSource = function () { return this.PointSelectSource }, V.push = function (e) { this.Source.push(e) }, V.pusTemSource = function (e) { this.TempSource.push(e) }, V.pusPointSelectSource = function (e) { this.PointSelectSource.push(e) }, V.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(V.Source, t); if (i) { for (var o = 0, r = this.TempSource.length; o < r; o++)if (this.TempSource[o].id == t) { e.checked && !this.TempSource[o].checked && (this.TempSource[o].checked = !0); break } i.children || (i.children = []), i.children.push(e) } else this.push(e); i = C.clone(e); return i.item = null, V.currentObj = i, this.pusTemSource(i), e.id }, V.getSourceById = function (e, t) { if (e) for (var i = 0; i < e.length; i++) { if (e[i].id == t) return e[i]; if (e[i] && e[i].children && 0 < e[i].children.length) { var o = this.getSourceById(e[i].children, t); if (null != o) return o } } }, V.exitsGroup = function (e, t) { if (e) for (var i = V.Source, o = 0; o < i.length; o++) { if (i[o].id == e) { if ("group" == i[o].type) for (var r = 0; r < i[o].children.length; r++)if (i[o].children[r].name == t) return !0; return !1 } i[o] && i[o].children && 0 < i[o].children.length && this.getSourceById(i[o].children, e) } }, V.getTempSourceById = function (e) { for (var t = 0; t < this.TempSource.length; t++)if (this.TempSource[t].id == e) return this.TempSource[t] }, V.getPointSelectSourceById = function (e) { for (var t = 0; t < this.PointSelectSource.length; t++)if (this.PointSelectSource[t].id == e) return this.PointSelectSource[t] }, V.getSourceByName = function (e, t) { return C.find(e, function (e) { return e.name == t }) }, V.delete = function (e, t, i) { var o = this.getSourceById(V.Source, e); if (o && o.children && 0 < o.children.length) { for (; 0 < o.children.length;)this.delete(o.children[0].id); if (o && "group" == o.type) (0 == o.pId || "" == o.pId ? (a = this.getIndex(V.Source, o), V.Source) : (n = this.getSourceById(V.Source, o.pId), a = this.getIndex(n.children, o), n.children)).splice(a, 1); else { if (o.item) o.item.deleteObject(e); else { try { t.entities.removeById(o.id) } catch (e) { } try { (r = t.dataSources.get(o.id)) && t.dataSources.remove(r) } catch (e) { } try { (r = t.imageryLayers.get(o.id)) && t.imageryLayers.remove(r) } catch (e) { } try { var r = t.scene.primitives.get(o.id); t.scene.primitives.remove(r) } catch (e) { } } var n = this.getSourceById(V.Source, o.pId), a = this.getIndex(n.children, o); n.children.splice(a, 1) } this.delete1(o.id) } else if (o && "group" == o.type) (0 == o.pId || "" == o.pId ? (a = this.getIndex(V.Source, o), V.Source) : (n = this.getSourceById(V.Source, o.pId), a = this.getIndex(n.children, o), n.children)).splice(a, 1), this.delete1(o.id); else if (o) { if (o.item && o.item.deleteObject) o.item.deleteObject(e); else { try { t.entities.removeById(o.id) } catch (e) { } try { (r = t.dataSources.get(o.id)) && t.dataSources.remove(r) } catch (e) { } try { (r = t.imageryLayers.get(o.id)) && t.imageryLayers.remove(r) } catch (e) { } try { r = t.scene.primitives.get(o.id); t.scene.primitives.remove(r) } catch (e) { } } this.delete1(o.id), (n = this.getSourceById(V.Source, o.pId)) && (a = this.getIndex(n.children, o), n.children.splice(a, 1)) } }, V.temporaryItem = { obj: [], state: "start", operation: "" }, V.endtemporaryItem = function () { V.temporaryItem.obj = [], V.temporaryItem.state = "end", V.temporaryItem.operation = "" }, V.starttemporaryItem = function (e) { var t = null; try { t = document.getElementById("toolTip") } catch (e) { } if (null != t && (t.style.display = "none"), null != V.handler && (V.handler.destroy(), V.handler = null), 0 < V.temporaryItem.obj.length && "start" == V.temporaryItem.state) for (var i = 0; i < V.temporaryItem.obj.length; i++) { try { V.temporaryItem.obj[i].destroy() } catch (e) { } try { e.entities.remove(V.temporaryItem.obj[i]) } catch (e) { } } return V.temporaryItem.obj = [], V.temporaryItem.state = "start", V.temporaryItem.operation }, V.delete1 = function (e) { for (var t = 0; t < this.TempSource.length; t++)this.TempSource[t].id == e && this.TempSource.splice(t, 1) }, V.getIndex = function (e, t) { for (var i = 0; i < e.length; i++)if (e[i].id == t.id) return i; return -1 }, V.setVisibilityTemp = function (t, e) { var i = C.filter(this.TempSource, function (e) { return e.id == t }); i && i.length && (i[0].checked = e) }, V.setVisibility = function (e, t, i, o) { this.setVisibilityTemp(e, t); var r = this.getSourceById(V.Source, e); if (r) if (r.children && 0 < r.children.length) { for (var n, a = 0; a < r.children.length; a++)this.setVisibility(r.children[a].id, t); if ("group" != r.type) if (r.item && r.item.setVisibility) r.item.setVisibility(t, e); else { try { (n = i.entities.getById(r.id)) && (n.show = t) } catch (e) { } try { (n = i.dataSources.get(r.id)) && (n.show = t) } catch (e) { } try { (n = i.imageryLayers.get(r.id)) && (n.show = t) } catch (e) { } try { (n = i.scene.primitives.get(r.id)) && (n.show = t) } catch (e) { } } } else if ("group" != r.type) if (r.item && r.item.setVisibility) r.item.setVisibility(t, e); else { try { (n = i.entities.getById(r.id)) && (n.show = t) } catch (e) { } try { (n = i.dataSources.get(r.id)) && (n.show = t) } catch (e) { } try { (n = i.imageryLayers.get(r.id)) && (n.show = t) } catch (e) { } try { (n = i.scene.primitives.get(r.id)) && (n.show = t) } catch (e) { } } }, V.removeItem = function (e) { if (e) for (var t = 0; t < e.length; t++)e[t].item = null, e[t].children && this.removeItem(e[t].children); return e }, V.changeGroup = function (e, t) { var i, o, r = this.getSourceById(this.Source, e), n = this.getSourceById(this.Source, t); r && n && n.children && ((0 == r.id || null == r.id || null == r.id ? (o = this.getIndex(this.Source, r), this.Source) : (i = this.getSourceById(this.Source, r.pId), o = this.getIndex(i.children, r), i.children)).splice(o, 1), r.pId = t, n.children.push(r)), (r = this.getTempSourceById(e)) && (r.pId = t) }, V.handler = null, V.removeHandler = function () { V.handler && (V.handler.destroy(), V.handler = null) }, Ti.prototype.createDivPoint = function (e, t, i = {}) { var o, r = i.id || "DivPoint" + this._core.getuid(), t = (Array.isArray(t) ? 2 === t.length ? o = Cesium.Cartesian3.fromDegrees(t[0], t[1]) : 3 === t.length && (o = Cesium.Cartesian3.fromDegrees(t[0], t[1], t[2])) : t.x && t.y ? o = t instanceof Cesium.Cartesian3 ? t : Cesium.Cartesian3.fromDegrees(t.x, t.y, t.z) : t.lon && t.lat && (o = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height)), this.item = { id: r, show: !0, name: e, type: "default", offset: "l", position: o }, Object.assign(this.item, i), this._viewer.clock.onTick.addEventListener(this.updateDivPointEvent, this), { id: this.item.id, name: e, pId: i.GroupID || 0, type: "DivPoint", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, t.pId), this }, Ti.prototype.updateDivPointEvent = function () {
        if (this.item) {
            let o = this.item, r = document.getElementById(o.id), t = !1; if (o.show) { var n = this._viewer.scene.mapProjection.ellipsoid, i = this._viewer.scene.camera.positionWC; let e = new Cesium.EllipsoidalOccluder(n, i); e.isPointVisible(o.position) && (void 0 === o.near && void 0 === o.far || (n = this._core.getPointToCameraDistance(this._viewer, o.position), i = o.near || 0, a = o.far || 1 / 0, i <= n && n <= a)) ? (r && (r.style.display = "block"), t = !0) : r && (r.style.display = "none"), e = void 0 } else r && (r.style.display = "none"); if (t) {
                i = this._viewer.scene.cartesianToCanvasCoordinates(o.position); if (!i) return; if (o.name || (o.name = "SmartEarth"), !r) {
                    let i; if ("default" === o.type) if (o.description) {
                        let e = o.description; n = this._core.isDOM(e); n && (e = ""); let t = ""; Array.isArray(e) ? e.forEach(e => { t += '<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">' + e + "</div>" }) : t = '<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">' + e + "</div>", i = `<div id="${o.id}" style="${o.onclick ? "cursor: pointer;" : "pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
                                <div class="divpoint">
                                    <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;">
                                        <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;">
@@ -34,7 +46,8 @@
                                    </div>
                                    <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div>
                                </div>
                            </div>`,$(this._viewer.container).append(i),r=document.getElementById(o.id),n&&r.querySelector(".divpoint-data-li").append(o.description)}else i=`<div id="${o.id}"  style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
                            </div>`, $(this._viewer.container).append(i), r = document.getElementById(o.id), n && r.querySelector(".divpoint-data-li").append(o.description)
                    } else i = `<div id="${o.id}"  style="${o.onclick ? "cursor: pointer;" : "pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;">
                                <div class="divpoint">
                                    <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;">
                                        <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;">
@@ -53,11 +66,19 @@
                                    </div>
                                    <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div>
                                </div>
                            </div>`,$(this._viewer.container).append(i),r=document.getElementById(o.id);else{let e=o.description;var a=this._core.isDOM(e);a&&(e=""),i=`<div id="${o.id}"  style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">
                            </div>`, $(this._viewer.container).append(i), r = document.getElementById(o.id); else {
                        let e = o.description; var a = this._core.isDOM(e); a && (e = ""), i = `<div id="${o.id}"  style="${o.onclick ? "cursor: pointer;" : "pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">
                            <div class="divpoint">
                                ${e}
                            </div>
                        </div>`,$(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()}},Ti.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()}},Ti.prototype.deleteObject=function(){this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent,this);let e=document.getElementById(this.item.id);e&&e.remove()},Ti.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Ti.prototype.getVisibility=function(){return this.item&&this.item.show},Ti.prototype.setTreeobj=function(e){this.treeobj=e},y.prototype.getPosition=function(){return this._viewer.camera.position},y.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}},y.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("未拾取到坐标!")},y.prototype.getMouseDegrees=function(e,t){e=this.getMousePosition(e,t);if(e)return this._core.toDegrees(e)},Si.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")},Si.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="<span aria-hidden='true'>×</span>",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")},Si.prototype.getBh=function(e,t){for(var i="",i="<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>符号库</label><div id='icons' class='mark-list'>",o=0;o<t.length;o++)i=i+"<div class='mark-list-item'><img title="+t[o].title+" src="+t[o].src+" id="+t[o].title+" onclick="+t[o].onclick+"></div>";e.innerHTML=i+="</div></div></div>"},Si.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")},Si.prototype.getLi=function(e,t){for(var i=0;i<t.length;i++){var o=document.createElement("li");o.innerHTML=`<img src="${t[i].img}" /><p>${t[i].text}</p>`,o.onclick=t[i].onclick,e.appendChild(o)}},Si.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:i<t&&(t=i),e<0?e=0:o<e&&(e=o),a.style.left=t+"px",a.style.top=e+"px")},document.onmouseup=function(){s=!1}},Si.prototype.createPopupProp=function(e,t){layuiLayer.close(SmartEarthPopupData.layerProp);var i,o=t.width,r=t.height,n=t.fn||{},a=(SmartEarthPopupData.propType=t.type,null),s=null,l=null;for(i in n)a="cancel"==i?n[i]:a,s="success"==i?n[i]:s,l="end"==i?n[i]:l;SmartEarthPopupData.layerProp=layuiLayer.open({title:e,type:2,skin:"other-class",shade:t.shade||0,shadeClose:!0,offset:t.offset||"r",resize:!1,area:["number"==typeof o?o+"px":o,"number"==typeof r?r+"px":r],content:SmartEarthRootUrl+t.url,success:function(e,t){s&&"function"==typeof s&&s(e,t)},cancel:function(){a&&"function"==typeof a&&a()},end:function(){l&&"function"==typeof l&&l()}})},Si.prototype.createModelLibrary=function(e){layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer);var t,i=(e=e||{}).width||342,o=e.height||"90%",r=e.offset||"r",n=e.fn||{},a=null,s=null,l=null;for(t in n)a="cancel"==t?n[t]:a,s="success"==t?n[t]:s,l="end"==t?n[t]:l;SmartEarthPopupData.ModelLibraryLayer=layuiLayer.open({title:"模型库",type:2,skin:"other-class",shade:0,shadeClose:!0,offset:r,resize:!1,area:[i+"px","number"==typeof o?o+"px":o],content:SmartEarthRootUrl+"Workers/Model/ModelLibrary.html",success:function(e,t){s&&"function"==typeof s&&s(e,t)},cancel:function(){a&&"function"==typeof a&&a()},end:function(){l&&"function"==typeof l&&l()}})},Ei.prototype.createGroup=function(e,t,i){if(0!=i&&(null==i||""==i)&&(i=this._core.isnull(V.selectedItem)?0:V.selectedItem.id,o=V.getSourceByName(this._tree,e)))return o.id;var o,r,n=V.getSourceById(this._tree,i);return n?(o=V.getSourceByName(n.children,e))?o.id:(r={id:this._core.getuid(),name:e,pId:i,checked:t,type:"group",item:this},this.item=r,V.insertGroupId(r,i)):(r={id:this._core.getuid(),name:e,pId:i,type:"group",checked:t,item:this},this.item=r,V.insertGroupId(r,i))},Ei.prototype.getVisibility=function(){return this.item.checked},Ei.prototype.changeGroup=function(e,t){V.changeGroup(e,t)},Ei.prototype.starttemporaryItem=function(){return V.starttemporaryItem(this._viewer)},Ei.prototype.pushtemporaryItem=function(e){V.temporaryItem.obj.push(e)},Ei.prototype.pushStateItem=function(e){V.temporaryItem.operation=e},Ei.prototype.endtemporaryItem=function(){V.endtemporaryItem()},Ei.prototype.export=function(){return{type:"group",style:{name:this.item.name,pId:this.item.pId,id:this.item.id}}};var Pi=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var i=t,o=[],r=!0,t=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(o.push(a.value),!i||o.length!==i);r=!0);}catch(e){t=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(t)throw n}}return o}throw new TypeError("Invalid attempt to destructure non-iterable instance")},xi="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 Di(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function v(e,t,i){this._viewer=e,this._cesium=t,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),c=this._lonLatToTileInWGS84([n,a],s),u=Math.min(l[0],c[0]),h=Math.max(l[0],c[0]),m=Math.min(l[1],c[1]),l=Math.max(l[1],c[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:l,minRow:u,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1,this._core=new f,this.tooltip=this._core.CreateTooltip(),this._getPosition=new y(this._viewer,this._cesium)}function Ii(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._Provider=void 0,this._cache=!1,this._forceRefreshPrvimitive=null}function Ai(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new f,this._getPosition=new y(e),this.num=100,this.buffs=[],this.tooltip=this._core.CreateTooltip()}function w(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._popupmessage=new Si(this._viewer,this._cesium),this._bufferAnalysis=new Ai(this._viewer,this._cesium),this.Legend=[],this.tooltip=this._core.CreateTooltip(),this.enty=null}function T(e,t,i){this._viewer=e,this._cesium=t,this._quadtree=void 0,this._tilingScheme=i||new Cesium.GeographicTilingScheme,this._errorEvent=new Cesium.Event,this._reTilesKey=[],this._state=!0,this._client=!0,this._reTiles=[],this._normalTile=16,this._minimumHeight=0,this._maximumHeight=0,this._PrimitiveCollection=new Cesium.PrimitiveCollection,this._levelZeroMaximumError=Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE),T.prototype.ready||Object.defineProperties(T.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}}}),this._core=new f,this.tooltip=this._core.CreateTooltip(),this._getPosition=new y(this._viewer,this._cesium)}function S(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.item={show:!0},this.model=[],this.Legend=[],this.sj=!0,this._cache=!1,this._forceRefreshPrvimitive=null}function Li(e,t,i,o){this.UrlTemplateGeojsonProvider=new t.UrlTemplateGeojsonProvider(i,1),this.UrlTemplateGeojsonProvider.loadtitle=o,this.ent=e.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider)}function Mi(e,t){var n=e,a=t;this.project=function(e,t){var i=t.xMax-t.xMin,o=t.yMin-t.yMax,r=Math.abs(e[0]-t.xMin),e=e[1]-t.yMax;return{x:r/i*n,y:e/o*a}},this.unproject=function(e,t){var i=t.xMax-t.xMin,t=t.yMin-t.yMax;return[e.x/n*i,e.y/a*t]},this.getBoundingRect=function(e){for(var t=Number.MAX_VALUE,i={xMin:t,yMin:t,xMax:-t,yMax:-t},o=0,r=e.length;o<r;o++){var n=e[o].getBoundingRect(),a={x:n.xMin,y:n.yMin},n={x:n.xMax,y:n.yMax};i.xMin=i.xMin<a.x?i.xMin:a.x,i.yMin=i.yMin<a.y?i.yMin:a.y,i.xMax=i.xMax>n.x?i.xMax:n.x,i.yMax=i.yMax>n.y?i.yMax:n.y}return i}}function E(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,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 Ri(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function Oi(e,t){var i=[];return(e.level>=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<t.children.length;r++)e(t.children[r],i,o)}return!0})(e,t,i),i}v.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":xi(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},v.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},v.prototype._lonLatToTileInWGS84=function(e,t){var e=Pi(e,2),i=e[0],e=e[1];return[Math.floor(Math.pow(2,t)*(90-e)/180),Math.floor(Math.pow(2,t)*(180+i)/180)]},v.prototype._radianToDegree=function(e){return e/Math.PI*180},v.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},v.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},v.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;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,Di(e))}):(t=o[i]).push.apply(t,Di(e))});var e=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),t=a._Cesium.BoundingSphere.fromPoints(e.positions).center,t=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:e,height:t,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),t=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(t)})):console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},v.prototype._cameraMoveEndHandler=function(){var o,r,e,t,i,n,a,s,l;this._stop||(o=this,r=Date.now(),t=(e=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),i=Math.min.apply(Math,Di(t)),(n=Math.max.apply(Math,Di(t)))<this._lowerLevelLimit||this._upperLevelLimit&&i>this._upperLevelLimit?(o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),e=[]):((e=2<n-i?e.filter(function(e){return e.level>=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,a=[],l=s=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}))})))},v.prototype._refineTiles=function(e,s){var l=[],c=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)c.includes(t)||(l.push(e),c.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);c.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),c.push(r))}else{var n,a=e.level-s;0==a?c.includes(t)||(l.push(e),c.push(t)):(t=2*a,a=Math.floor(e.x/t),t=Math.floor(e.y/t),c.includes(n="Z"+s+"X"+a+"Y"+t)||(l.push({x:a,y:t,level:s}),c.push(n)))}}),l},v.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},v.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection,this.availability),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},v.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},v.prototype.setStatus=function(e){this._stop=e,this._primitiveCollection._availability&&e?this._primitiveCollection._availability=void 0:this.availability&&!e&&(this._primitiveCollection._availability=this.availability)},v.prototype.isRemoved=function(){return this._isRemoved},v.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},v.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},v.prototype.edit=function(e,r){let c=this,u=this._viewer;if(r=r||{},this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),e=void 0===e?!0:e){var h,m,d,p;this.editHandler=new this._cesium.ScreenSpaceEventHandler(u.scene.canvas),this.isEditting=!1;let n;return this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(a(),c.defaultEvent(!1));else{var i=t.position,o=u.scene.pick(i);if((!o||!o.id||o.id.treeID===c.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;c.isEditting||0!=V.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||(u.container.style.cursor="crosshair",c.defaultEvent(!1),"_height_point"==e.name?(d={windowPosition:i,originHeight:c._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?(c.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=c.createEditEntity(p,e.VectorStyle)).feature=e,h.treeID=c.treeID,c.getSimpleGraphicData(p,h),"point"===p||"billboard"===p||"label"===p||"model"===p?(c.isEditting=!0,c.tooltip.showAt(t.position,"拖拽修改位置")):(c.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(c.treeID)),c.setStatus(!0),V.editVector=!0,c._primitiveCollection.show=!1)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(a(),c.defaultEvent(!1));else{var r=u.scene.pick(t.endPosition);if((!r||!r.id||r.id.treeID===c.treeID)&&(c._cesium.defined(r)?c.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<h.pottingPoint.length||"polygon"===p&&3<h.pottingPoint.length?c.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):c.tooltip.showAt(t.endPosition,"拖拽修改位置"):!r.id||"_move_point"!==r.id.name&&"_size_point"!==r.id.name?r.id&&"_add_point"===r.id.name?c.tooltip.showAt(t.endPosition,"拖拽增加节点"):r.id&&"_height_point"===r.id.name?c.tooltip.showAt(t.endPosition,"拖拽修改高度"):r.id==h&&c.tooltip.show(!1):c.tooltip.showAt(t.endPosition,"拖拽修改位置"):c.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除"):c.isEditting||0!==V.states||(r.id&&r.id.VectorType?c.tooltip.showAt(t.endPosition,"点击激活编辑"):c.tooltip.show(!1)):0!=V.states||m||c.tooltip.show(!1),c.isEditting&&m)){c.tooltip.showAt(t.endPosition,"释放后完成修改");let i=c._getPosition.getMousePosition(t);if(i||"_height_point"===n)if("_edit_point"===n){m.position=i;r=V.editPointID.edit.indexOf(m.id);if(void 0!==h[p].height?(l=c.toDegrees(i),h.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,h[p].height.getValue()),m.position=h.pottingPoint[r]):h.pottingPoint[r]=i,0<V.editPointID.add.length){if(0<r){let i=u.entities.getById(V.editPointID.add[r-1]);if(i){let e=u.entities.getById(V.editPointID.edit[r-1]),t=u.entities.getById(V.editPointID.edit[r]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(r<h.pottingPoint.length-1){let i=u.entities.getById(V.editPointID.add[r]);if(i){let e=u.entities.getById(V.editPointID.edit[r]),t=u.entities.getById(V.editPointID.edit[r+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===p&&(0===r||r===h.pottingPoint.length-1)){let i=u.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);if(i){let e=u.entities.getById(V.editPointID.edit[0]),t=u.entities.getById(V.editPointID.edit[h.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=h.pottingPoint.concat([]),t=new c._cesium.Cartesian3;var l=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=l,t.y/=l,t.z/=l,V.editPointID.move&&(V.editPointID.move.position=t),"polyline"!==p&&"wall"!==p&&"polygon"!==p&&"rectangle"!==p||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===n){r=V.editPointID.height.indexOf(m.id);let e=u.entities.getById(V.editPointID.edit[r]),i=("ellipse"!==p&&"cylinder"!==p&&"box"!==p||(e=V.editPointID.move),c.toDegrees(e.position.getValue()));l=d.originHeight-i.height,r=u.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);V.editPointID.height.forEach(e=>{let t=u.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))}),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=V.editPointID.add.indexOf(m.id),l=(u.entities.remove(m),u.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=(V.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=u.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=u.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=(V.editPointID.add.splice(r,1,t.id,e.id),SmartEarthPopupData.editGraphic.setTreeID(c.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=V.editPointID.move.position.getValue(),e=c._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=c.toDegrees(i),t=(d=m.position.getValue(),c.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=c.toDegrees(i).height,h[p].height=l,h.thisHeight=l),h.pottingPoint.forEach((e,t)=>{let i,o,r=u.entities.getById(V.editPointID.edit[t]);if(r=r||u.entities.getById(V.editPointID.size[t]),i=r?c.toDegrees(r.position.getValue()):c.toDegrees(e),o=c._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<V.editPointID.add.length&&V.editPointID.add[t]){let e=u.entities.getById(V.editPointID.add[t]);e&&(i=c.toDegrees(e.position.getValue()),e.position=c._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s))}});e=h.pottingPoint.concat([]);"polyline"===p||"wall"===p||"polygon"===p||"rectangle"===p?SmartEarthPopupData.editGraphic.setValue("positions",e):"ellipse"===p?(h.pottingPoint[1]=i,h.position=i.clone()):"box"===p?(h.pottingPoint[2]=i,r=h.box.dimensions.getValue(),t=c.toDegrees(i),h.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height+r.z/2)):"cylinder"===p?(h.pottingPoint[1]=i,l=h.cylinder.length.getValue(),e=c.toDegrees(h.pottingPoint[1]),h.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+l/2)):"ellipsoid"===p&&(h.pottingPoint[h.pottingPoint.length-1]=i,h.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?c.isEditting&&(a(),c.defaultEvent(!1)):(m&&"model"===m.VectorType&&(m.show=!0),m&&r.callBack&&r.callBack.updata&&r.callBack.updata(m.name,h),u.container.style.cursor="default",m=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&&(a(),c.defaultEvent(!1));else{e=u.scene.pick(e.position);if((!e||!e.id||e.id.treeID===c.treeID)&&c._cesium.defined(e)&&0==V.states){e=e.id;if(!e.VectorType&&-1<V.editPointID.edit.indexOf(e.id)&&(("polyline"===p||"wall"===p)&&2<V.editPointID.edit.length||"polygon"===p&&3<V.editPointID.edit.length)){var i=V.editPointID.edit.indexOf(e.id);if(u.entities.removeById(e.id),V.editPointID.edit.splice(i,1),h.pottingPoint.splice(i,1),0<V.editPointID.add.length)if(V.editPointID.add[i]){if(u.entities.removeById(V.editPointID.add[i]),V.editPointID.add.splice(i,1),0<=i-1){let e=u.entities.getById(V.editPointID.add[i-1]);e&&(e.position=Cesium.Cartesian3.midpoint(h.pottingPoint[i-1],h.pottingPoint[i===h.pottingPoint.length?0:i],new Cesium.Cartesian3))}else if(i-1==-1&&"polygon"===p){let e=u.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(h.pottingPoint[0],h.pottingPoint[h.pottingPoint.length-1],new Cesium.Cartesian3))}}else u.entities.removeById(V.editPointID.add[i-1]),V.editPointID.add.pop();let t=new c._cesium.Cartesian3;e=h.pottingPoint.length,i=(h.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,V.editPointID.move&&(V.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)}c.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(){c.defaultEvent(!0),V.editPointID.edit.forEach(e=>{u.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{u.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{u.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{u.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&u.entities.remove(V.editPointID.move),V.editPointID.move=void 0,h&&u.entities.remove(h),p=h=void 0,SmartEarthPopupData.editGraphic={},c.isEditting=!1,c.setStatus(!1),V.editVector=!1,c._primitiveCollection.show=!0,c.delButton(!1)}}else a()},v.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},v.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;
                        </div>`, $(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()
        }
    }, Ti.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() } }, Ti.prototype.deleteObject = function () { this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent, this); let e = document.getElementById(this.item.id); e && e.remove() }, Ti.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, Ti.prototype.getVisibility = function () { return this.item && this.item.show }, Ti.prototype.setTreeobj = function (e) { this.treeobj = e }, y.prototype.getPosition = function () { return this._viewer.camera.position }, y.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 } }, y.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("未拾取到坐标!") }, y.prototype.getMouseDegrees = function (e, t) { e = this.getMousePosition(e, t); if (e) return this._core.toDegrees(e) }, Si.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") }, Si.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 = "<span aria-hidden='true'>×</span>", 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") }, Si.prototype.getBh = function (e, t) { for (var i = "", i = "<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>符号库</label><div id='icons' class='mark-list'>", o = 0; o < t.length; o++)i = i + "<div class='mark-list-item'><img title=" + t[o].title + " src=" + t[o].src + " id=" + t[o].title + " onclick=" + t[o].onclick + "></div>"; e.innerHTML = i += "</div></div></div>" }, Si.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") }, Si.prototype.getLi = function (e, t) { for (var i = 0; i < t.length; i++) { var o = document.createElement("li"); o.innerHTML = `<img src="${t[i].img}" /><p>${t[i].text}</p>`, o.onclick = t[i].onclick, e.appendChild(o) } }, Si.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 : i < t && (t = i), e < 0 ? e = 0 : o < e && (e = o), a.style.left = t + "px", a.style.top = e + "px") }, document.onmouseup = function () { s = !1 } }, Si.prototype.createPopupProp = function (e, t) { layuiLayer.close(SmartEarthPopupData.layerProp); var i, o = t.width, r = t.height, n = t.fn || {}, a = (SmartEarthPopupData.propType = t.type, null), s = null, l = null; for (i in n) a = "cancel" == i ? n[i] : a, s = "success" == i ? n[i] : s, l = "end" == i ? n[i] : l; SmartEarthPopupData.layerProp = layuiLayer.open({ title: e, type: 2, skin: "other-class", shade: t.shade || 0, shadeClose: !0, offset: t.offset || "r", resize: !1, area: ["number" == typeof o ? o + "px" : o, "number" == typeof r ? r + "px" : r], content: SmartEarthRootUrl + t.url, success: function (e, t) { s && "function" == typeof s && s(e, t) }, cancel: function () { a && "function" == typeof a && a() }, end: function () { l && "function" == typeof l && l() } }) }, Si.prototype.createModelLibrary = function (e) { layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer); var t, i = (e = e || {}).width || 342, o = e.height || "90%", r = e.offset || "r", n = e.fn || {}, a = null, s = null, l = null; for (t in n) a = "cancel" == t ? n[t] : a, s = "success" == t ? n[t] : s, l = "end" == t ? n[t] : l; SmartEarthPopupData.ModelLibraryLayer = layuiLayer.open({ title: "模型库", type: 2, skin: "other-class", shade: 0, shadeClose: !0, offset: r, resize: !1, area: [i + "px", "number" == typeof o ? o + "px" : o], content: SmartEarthRootUrl + "Workers/Model/ModelLibrary.html", success: function (e, t) { s && "function" == typeof s && s(e, t) }, cancel: function () { a && "function" == typeof a && a() }, end: function () { l && "function" == typeof l && l() } }) }, Ei.prototype.createGroup = function (e, t, i) { if (0 != i && (null == i || "" == i) && (i = this._core.isnull(V.selectedItem) ? 0 : V.selectedItem.id, o = V.getSourceByName(this._tree, e))) return o.id; var o, r, n = V.getSourceById(this._tree, i); return n ? (o = V.getSourceByName(n.children, e)) ? o.id : (r = { id: this._core.getuid(), name: e, pId: i, checked: t, type: "group", item: this }, this.item = r, V.insertGroupId(r, i)) : (r = { id: this._core.getuid(), name: e, pId: i, type: "group", checked: t, item: this }, this.item = r, V.insertGroupId(r, i)) }, Ei.prototype.getVisibility = function () { return this.item.checked }, Ei.prototype.changeGroup = function (e, t) { V.changeGroup(e, t) }, Ei.prototype.starttemporaryItem = function () { return V.starttemporaryItem(this._viewer) }, Ei.prototype.pushtemporaryItem = function (e) { V.temporaryItem.obj.push(e) }, Ei.prototype.pushStateItem = function (e) { V.temporaryItem.operation = e }, Ei.prototype.endtemporaryItem = function () { V.endtemporaryItem() }, Ei.prototype.export = function () { return { type: "group", style: { name: this.item.name, pId: this.item.pId, id: this.item.id } } }; var Pi = function (e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o.length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, xi = "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 Di(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++)i[t] = e[t]; return i } return Array.from(e) } function v(e, t, i) { this._viewer = e, this._cesium = t, this._Cesium = i.Cesium, this._url = i.url, this._urlParams = i.urlParams, this._urlTemplate = this._url + "?" + this._serialize(this._urlParams), this._rectangle = i.rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i.minimumLevel || 1, this._tilingScheme = i.tilingScheme || new this._Cesium.GeographicTilingScheme, this._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = !1, this._isCameraMoving = !1, this._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i.upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), c = this._lonLatToTileInWGS84([n, a], s), u = Math.min(l[0], c[0]), h = Math.max(l[0], c[0]), m = Math.min(l[1], c[1]), l = Math.max(l[1], c[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: u, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1, this._core = new f, this.tooltip = this._core.CreateTooltip(), this._getPosition = new y(this._viewer, this._cesium) } function Ii(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this._cache = !1, this._forceRefreshPrvimitive = null } function Ai(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this._getPosition = new y(e), this.num = 100, this.buffs = [], this.tooltip = this._core.CreateTooltip() } function w(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._popupmessage = new Si(this._viewer, this._cesium), this._bufferAnalysis = new Ai(this._viewer, this._cesium), this.Legend = [], this.tooltip = this._core.CreateTooltip(), this.enty = null } function T(e, t, i) { this._viewer = e, this._cesium = t, this._quadtree = void 0, this._tilingScheme = i || new Cesium.GeographicTilingScheme, this._errorEvent = new Cesium.Event, this._reTilesKey = [], this._state = !0, this._client = !0, this._reTiles = [], this._normalTile = 16, this._minimumHeight = 0, this._maximumHeight = 0, this._PrimitiveCollection = new Cesium.PrimitiveCollection, this._levelZeroMaximumError = Cesium.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme), this.cartographicLimitRectangle = Cesium.Rectangle.clone(Cesium.Rectangle.MAX_VALUE), T.prototype.ready || Object.defineProperties(T.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 } } }), this._core = new f, this.tooltip = this._core.CreateTooltip(), this._getPosition = new y(this._viewer, this._cesium) } function S(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this.labelCollections1 = [], this.labelCollections2 = [], this.labelCollections = this._cesium.PointPrimitiveCollection(), this.gd = 0, this.item = { show: !0 }, this.model = [], this.Legend = [], this.sj = !0, this._cache = !1, this._forceRefreshPrvimitive = null } function Li(e, t, i, o) { this.UrlTemplateGeojsonProvider = new t.UrlTemplateGeojsonProvider(i, 1), this.UrlTemplateGeojsonProvider.loadtitle = o, this.ent = e.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider) } function Mi(e, t) { var n = e, a = t; this.project = function (e, t) { var i = t.xMax - t.xMin, o = t.yMin - t.yMax, r = Math.abs(e[0] - t.xMin), e = e[1] - t.yMax; return { x: r / i * n, y: e / o * a } }, this.unproject = function (e, t) { var i = t.xMax - t.xMin, t = t.yMin - t.yMax; return [e.x / n * i, e.y / a * t] }, this.getBoundingRect = function (e) { for (var t = Number.MAX_VALUE, i = { xMin: t, yMin: t, xMax: -t, yMax: -t }, o = 0, r = e.length; o < r; o++) { var n = e[o].getBoundingRect(), a = { x: n.xMin, y: n.yMin }, n = { x: n.xMax, y: n.yMax }; i.xMin = i.xMin < a.x ? i.xMin : a.x, i.yMin = i.yMin < a.y ? i.yMin : a.y, i.xMax = i.xMax > n.x ? i.xMax : n.x, i.yMax = i.yMax > n.y ? i.yMax : n.y } return i } } function E(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, 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 Ri(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++)i[t] = e[t]; return i } return Array.from(e) } function Oi(e, t) { var i = []; return (e.level >= 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 < t.children.length; r++)e(t.children[r], i, o) } return !0 })(e, t, i), i } v.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : xi(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, v.prototype._fetch = function (r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function (t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function () { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function (e) { i(e) }, o.onloadend = function (e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, v.prototype._lonLatToTileInWGS84 = function (e, t) { var e = Pi(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, v.prototype._radianToDegree = function (e) { return e / Math.PI * 180 }, v.prototype._isTileInRange = function (e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, v.prototype._cameraMoveStartHandler = function () { this._isCameraMoving = !0 }, v.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; 2 < e.length ? e.forEach(function (e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, Di(e)) }) : (t = o[i]).push.apply(t, Di(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProvider: geometry type "' + e.geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, v.prototype._cameraMoveEndHandler = function () { var o, r, e, t, i, n, a, s, l; this._stop || (o = this, r = Date.now(), t = (e = this._viewer.scene.globe._surface._tilesToRender).map(function (e) { return e.level }), i = Math.min.apply(Math, Di(t)), (n = Math.max.apply(Math, Di(t))) < this._lowerLevelLimit || this._upperLevelLimit && i > this._upperLevelLimit ? (o._tileKeys = [], o._removeObsoletePrimitives(o._primitiveByTile, []), e = []) : ((e = 2 < n - i ? e.filter(function (e) { return e.level >= 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, a = [], l = s = 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 })) }))) }, v.prototype._refineTiles = function (e, s) { var l = [], c = []; return e.forEach(function (e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) c.includes(t) || (l.push(e), c.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++)for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); c.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), c.push(r)) } else { var n, a = e.level - s; 0 == a ? c.includes(t) || (l.push(e), c.push(t)) : (t = 2 * a, a = Math.floor(e.x / t), t = Math.floor(e.y / t), c.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), c.push(n))) } }), l }, v.prototype._removeObsoletePrimitives = function (e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, v.prototype.addTo = function (e) { this._viewer = e, this._viewer.scene.primitives.add(this._primitiveCollection, this.availability), this._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler), this._cameraMoveEndHandler() }, v.prototype.remove = function () { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, v.prototype.setStatus = function (e) { this._stop = e, this._primitiveCollection._availability && e ? this._primitiveCollection._availability = void 0 : this.availability && !e && (this._primitiveCollection._availability = this.availability) }, v.prototype.isRemoved = function () { return this._isRemoved }, v.prototype.filterBy = function (e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, v.prototype.removeFilter = function () { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, v.prototype.edit = function (e, r) { let c = this, u = this._viewer; if (r = r || {}, this.editHandler && (this.editHandler.destroy(), this.editHandler = void 0), e = void 0 === e ? !0 : e) { var h, m, d, p; this.editHandler = new this._cesium.ScreenSpaceEventHandler(u.scene.canvas), this.isEditting = !1; let n; return this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) c.isEditting && (a(), c.defaultEvent(!1)); else { var i = t.position, o = u.scene.pick(i); if ((!o || !o.id || o.id.treeID === c.treeID) && o && o.id && (o.id instanceof Cesium.Entity || o.id.VectorType)) { let e = o.id; c.isEditting || 0 != V.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 || (u.container.style.cursor = "crosshair", c.defaultEvent(!1), "_height_point" == e.name ? (d = { windowPosition: i, originHeight: c._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 ? (c.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 = c.createEditEntity(p, e.VectorStyle)).feature = e, h.treeID = c.treeID, c.getSimpleGraphicData(p, h), "point" === p || "billboard" === p || "label" === p || "model" === p ? (c.isEditting = !0, c.tooltip.showAt(t.position, "拖拽修改位置")) : (c.isEditting = !0, SmartEarthPopupData.editGraphic.updataEditPoint(), SmartEarthPopupData.editGraphic.setTreeID(c.treeID)), c.setStatus(!0), V.editVector = !0, c._primitiveCollection.show = !1) } } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) c.isEditting && (a(), c.defaultEvent(!1)); else { var r = u.scene.pick(t.endPosition); if ((!r || !r.id || r.id.treeID === c.treeID) && (c._cesium.defined(r) ? c.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 < h.pottingPoint.length || "polygon" === p && 3 < h.pottingPoint.length ? c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : !r.id || "_move_point" !== r.id.name && "_size_point" !== r.id.name ? r.id && "_add_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽增加节点") : r.id && "_height_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽修改高度") : r.id == h && c.tooltip.show(!1) : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.isEditting || 0 !== V.states || (r.id && r.id.VectorType ? c.tooltip.showAt(t.endPosition, "点击激活编辑") : c.tooltip.show(!1)) : 0 != V.states || m || c.tooltip.show(!1), c.isEditting && m)) { c.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = c._getPosition.getMousePosition(t); if (i || "_height_point" === n) if ("_edit_point" === n) { m.position = i; r = V.editPointID.edit.indexOf(m.id); if (void 0 !== h[p].height ? (l = c.toDegrees(i), h.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(l.lon, l.lat, h[p].height.getValue()), m.position = h.pottingPoint[r]) : h.pottingPoint[r] = i, 0 < V.editPointID.add.length) { if (0 < r) { let i = u.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = u.entities.getById(V.editPointID.edit[r - 1]), t = u.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if (r < h.pottingPoint.length - 1) { let i = u.entities.getById(V.editPointID.add[r]); if (i) { let e = u.entities.getById(V.editPointID.edit[r]), t = u.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if ("polygon" === p && (0 === r || r === h.pottingPoint.length - 1)) { let i = u.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); if (i) { let e = u.entities.getById(V.editPointID.edit[0]), t = u.entities.getById(V.editPointID.edit[h.pottingPoint.length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } } let e = h.pottingPoint.concat([]), t = new c._cesium.Cartesian3; var l = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= l, t.y /= l, t.z /= l, V.editPointID.move && (V.editPointID.move.position = t), "polyline" !== p && "wall" !== p && "polygon" !== p && "rectangle" !== p || SmartEarthPopupData.editGraphic.setValue("positions", e) } else if ("_height_point" === n) { r = V.editPointID.height.indexOf(m.id); let e = u.entities.getById(V.editPointID.edit[r]), i = ("ellipse" !== p && "cylinder" !== p && "box" !== p || (e = V.editPointID.move), c.toDegrees(e.position.getValue())); l = d.originHeight - i.height, r = u.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); V.editPointID.height.forEach(e => { let t = u.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)) }), 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 = V.editPointID.add.indexOf(m.id), l = (u.entities.remove(m), u.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 = (V.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 = u.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 = u.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 = (V.editPointID.add.splice(r, 1, t.id, e.id), SmartEarthPopupData.editGraphic.setTreeID(c.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 = V.editPointID.move.position.getValue(), e = c._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 = c.toDegrees(i), t = (d = m.position.getValue(), c.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 = c.toDegrees(i).height, h[p].height = l, h.thisHeight = l), h.pottingPoint.forEach((e, t) => { let i, o, r = u.entities.getById(V.editPointID.edit[t]); if (r = r || u.entities.getById(V.editPointID.size[t]), i = r ? c.toDegrees(r.position.getValue()) : c.toDegrees(e), o = c._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 < V.editPointID.add.length && V.editPointID.add[t]) { let e = u.entities.getById(V.editPointID.add[t]); e && (i = c.toDegrees(e.position.getValue()), e.position = c._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i.height + s)) } }); e = h.pottingPoint.concat([]); "polyline" === p || "wall" === p || "polygon" === p || "rectangle" === p ? SmartEarthPopupData.editGraphic.setValue("positions", e) : "ellipse" === p ? (h.pottingPoint[1] = i, h.position = i.clone()) : "box" === p ? (h.pottingPoint[2] = i, r = h.box.dimensions.getValue(), t = c.toDegrees(i), h.position = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height + r.z / 2)) : "cylinder" === p ? (h.pottingPoint[1] = i, l = h.cylinder.length.getValue(), e = c.toDegrees(h.pottingPoint[1]), h.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height + l / 2)) : "ellipsoid" === p && (h.pottingPoint[h.pottingPoint.length - 1] = i, h.position = i.clone()) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? c.isEditting && (a(), c.defaultEvent(!1)) : (m && "model" === m.VectorType && (m.show = !0), m && r.callBack && r.callBack.updata && r.callBack.updata(m.name, h), u.container.style.cursor = "default", m = 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 && (a(), c.defaultEvent(!1)); else { e = u.scene.pick(e.position); if ((!e || !e.id || e.id.treeID === c.treeID) && c._cesium.defined(e) && 0 == V.states) { e = e.id; if (!e.VectorType && -1 < V.editPointID.edit.indexOf(e.id) && (("polyline" === p || "wall" === p) && 2 < V.editPointID.edit.length || "polygon" === p && 3 < V.editPointID.edit.length)) { var i = V.editPointID.edit.indexOf(e.id); if (u.entities.removeById(e.id), V.editPointID.edit.splice(i, 1), h.pottingPoint.splice(i, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[i]) { if (u.entities.removeById(V.editPointID.add[i]), V.editPointID.add.splice(i, 1), 0 <= i - 1) { let e = u.entities.getById(V.editPointID.add[i - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[i - 1], h.pottingPoint[i === h.pottingPoint.length ? 0 : i], new Cesium.Cartesian3)) } else if (i - 1 == -1 && "polygon" === p) { let e = u.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[0], h.pottingPoint[h.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else u.entities.removeById(V.editPointID.add[i - 1]), V.editPointID.add.pop(); let t = new c._cesium.Cartesian3; e = h.pottingPoint.length, i = (h.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V.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) } c.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() { c.defaultEvent(!0), V.editPointID.edit.forEach(e => { u.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { u.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { u.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { u.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && u.entities.remove(V.editPointID.move), V.editPointID.move = void 0, h && u.entities.remove(h), p = h = void 0, SmartEarthPopupData.editGraphic = {}, c.isEditting = !1, c.setStatus(!1), V.editVector = !1, c._primitiveCollection.show = !0, c.delButton(!1) } } else a() }, v.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 }, v.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;
@@ -68,7 +89,11 @@
                    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)}},v.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},v.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},v.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}},v.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<o.length;t++){let e=Number(o[t]).toString(16);"0"===(e=1===e.length?"0"+e:e)&&(e+=e),i+=e}return i=7!==i.length?t:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:n,type:e,graphic:n[e],getValue:function(e){return"position"===e||"name"===e||"id"===e?this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]):"radius"===e?"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0:"pHeight"!==e?"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]):this.getValue("position")?(e=this.getValue("position"),Cesium.Cartographic.fromCartesian(e).height):void 0},changeHeightPoint:function(i){0<V.editPointID.height.length&&V.editPointID.height.forEach(e=>{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<V.editPointID.edit.length&&V.editPointID.edit.forEach(e=>{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<V.editPointID.size.length&&V.editPointID.size.forEach(e=>{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<V.editPointID.add.length&&V.editPointID.add.forEach(e=>{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=V.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(){V.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{s.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{s.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{s.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&s.entities.remove(V.editPointID.move),V.editPointID.move=void 0},setTreeID:function(i){V.editPointID.edit.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.height.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.add.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.size.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.move&&(V.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){"name"===e?this.entity[e]=t:"color"===e||"outlineColor"===e?(t=Cesium.Color.fromCssColorString(t),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()}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(i.id)}}}):"polygon"===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,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));function t(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<V.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=s.entities.getById(V.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<V.editPointID.add.length&&V.editPointID.add.forEach(e=>{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()}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(i.id)}var e=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),e=s.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,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(e.id)}}):"ellipse"===e||"cylinder"===e||n.isSphere?((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,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=V.editPointID.move.position.getValue(),r=a.GetPositionFromA_D(o,i,90);let e=s.entities.getById(V.editPointID.size[0]),t=(e.position=r,n.pottingPoint[0]=r,n.pottingPoint[n.pottingPoint.length-1]=o,s.entities.getById(V.editPointID.height[0]));return void(t&&(o=a.toDegrees(r),r=a._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=a._cesium.Cartesian3.fromDegrees(o.lon,o.lat,r.height)))}if("cylinder"===this.type&&"length"===e)return this.graphic.length=i,o=a.toDegrees(this.entity.pottingPoint[1]),this.entity.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+i/2),void this.changeHeightPoint(o.height+i);function t(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.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}if("ellipse"===this.type&&"clampToGround"===e)return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{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,V.editPointID.size.push(e.id),V.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()}});V.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,V.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=V.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(V.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(V.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,V.editPointID.size.push(e.id),V.editPointID.size.push(t.id),V.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){"name"===e?this.entity[e]=t:"color"===e?(t=Cesium.Color.fromCssColorString(t),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()}});V.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,V.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<t.length-1;e++){var r=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),r=s.entities.add({name:"_add_point",position:r,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(r.id)}}})},Ii.prototype.createBillboardPointGeoJsonFeatureLayer=function(e,t,l,i,c){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),u=this,o=(o.then(function(e){for(var t={show:!0,position:u._cesium.Cartesian3.ZERO,pixelOffset:u._cesium.Cartesian2.ZERO,eyeOffset:u._cesium.Cartesian3.ZERO,heightReference:u._cesium.HeightReference.NONE,horizontalOrigin:u._cesium.HorizontalOrigin.CENTER,verticalOrigin:u._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:u._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:u._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},i=(u._core.isnull(l)||u._core.isnull(l.color)||/^\[/.test(l.color)&&"["==l.color.charAt(0)&&"]"==l.color.charAt(l.color.length-1)||(u._core.isHtmlColor(l.color)?l.color=u._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=u._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=u._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),u._core.extend(t,l,!0)),t=(u._core.isnull(l.near)&&(l.near=0),u._core.isnull(l.far)&&(l.far=999999999),parseFloat(l.near)),o=parseFloat(l.far),r=(new u._cesium.DistanceDisplayCondition(t,o),new u._cesium.BillboardCollection),n=e.entities.values,a=0;a<n.length;a++){var s=n[a];i.position=s.position._value,r.add(i)}t=u._viewer.scene.primitives.add(r);"function"==typeof c&&c(t)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"billboardLayer",item:this,url:t,style:options};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Ii.prototype.createBillboardGeoJsonFeatureLayerProvider=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,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},s=new v(this._viewer,this._cesium,a),l=(this._Provider=s,this),s=(s._loadTile=function(e){var t={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,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},i=(l._core.isnull(n)||l._core.isnull(n.color)||/^\[/.test(n.color)&&"["==n.color.charAt(0)&&"]"==n.color.charAt(n.color.length-1)||(l._core.isHtmlColor(n.color)?n.color=l._color.colorFromHtmlColor(n.color):(/^rgb/.test(n.color)&&(n.color=l._color.rgbaStringToRgbaObj(n.color)),1<n.color.r&&(n.color.r=n.color.r/255),1<n.color.g&&(n.color.g=n.color.g/255),1<n.color.b&&(n.color.b=n.color.b/255),1<n.color.a&&(n.color.a=n.color.a/255),n.color=l._color.createColor(n.color.r,n.color.g,n.color.b,n.color.a))),l._core.extend(t,n,!0)),t=(l._core.isnull(n.near)&&(n.near=0),l._core.isnull(n.far)&&(n.far=999999999),parseFloat(n.near)),o=parseFloat(n.far),r=(new l._cesium.DistanceDisplayCondition(t,o),new l._cesium.BillboardCollection);return e.features.forEach(function(e){var t;i.id=e,/^\[/.test(i.pointHeight)&&/\]$/.test(i.pointHeight)?(t=i.pointHeight.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[t]),e.geometry.coordinates.push(t),i.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]):i.pointHeight?(t=parseFloat(i.pointHeight),e.geometry.coordinates.push(t),i.position=l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]):i.position=l._cesium.Cartesian3.fromDegreesArray(e.geometry.coordinates)[0],i.id.treeID=n.id,i.id.VectorType="billboard",i.id.VectorStyle={position:i.position,pointHeight:t,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},r.add(i)}),r},n&&n.time&&(s.availability=new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:n.time.start?l._cesium.JulianDate.fromDate(new Date(n.time.start)):l._cesium.Iso8601.MINIMUM_VALUE,stop:n.time.end?l._cesium.JulianDate.fromDate(new Date(n.time.end)):l._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=s._primitiveCollection,s.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this,url:a.url,style:n});return this._Provider.treeID=n.id,this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Ii.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Ii.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ii.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e),e||this.item.removeAll()},Ii.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Ii.prototype.setTreeobj=function(e){this.treeobj=e},Ii.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Ii.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Ai.prototype.changeBurr=function(e){if(this.num=e,this.this_buff)switch(this.type){case"point":this.setPointBuff(this.num);break;case"polyline":this.setPolylineBuff(this.num);break;case"polygon":this.setPolygonBuff(this.num)}},Ai.prototype.DrawPoint=function(e,o){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var r=this._viewer,n=this._cesium;let t,a;return"number"==typeof e?(t=e,a={}):"object"==typeof e&&(a=e,t=a.radius),this.num=t||this.num,this.drawHandler=new n.ScreenSpaceEventHandler(r.scene.canvas),this.this_buff={entity:null,buff:null},this.type="point",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(function(e){var t,i,e=this._getPosition.getMouseDegrees(e);e&&(t=e.lon,i=e.lat,this.positions.push(t,i),this.this_buff.entity=r.entities.add({name:"新建缓冲点",position:n.Cartesian3.fromDegrees(t,i),point:{pixelSize:10,color:n.Color.YELLOW,outlineWidth:3,outlineColor:n.Color.YELLOW.withAlpha(.4),heightReference:1}}),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.setPointBuff(this.num,a),o&&"function"==typeof o&&o(e),this.end&&this.end())}.bind(this),n.ScreenSpaceEventType.LEFT_CLICK),this.end=()=>{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},Ai.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))},Ai.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=>{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),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)),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},Ai.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))},Ai.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),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)),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},Ai.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))},Ai.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<o.length){n.holes=[];for(let e=1,t;e<o.length;e++)r=this.pointsToDegreesArray(o[e]),t=Cesium.Cartesian3.fromDegreesArray(r),n.holes.push(t)}return n},Ai.prototype.pointsToDegreesArray=function(e){let t=[];return e.map(e=>{t.push(e[0]),t.push(e[1])}),t},Ai.prototype.degreesArrayToPoints=function(t){let i=[];for(let e=0;e<t.length-1;e+=2)i.push([t[e],t[e+1]]);return i},Ai.prototype.addBufferPolyogn=function(e,t={}){let i,o;return i=e.positions,e.holes&&(o=[],e.holes.forEach(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}})},Ai.prototype.clearBuff=function(){var t=this._viewer;0<this.buffs.length&&(this.buffs.forEach(function(e){t.entities.remove(e)}),this.buffs.length=0)},w.prototype.createGeojsonFeatureLayer=function(e,t,i,o,r,s){var n=t.url,a=t.maxLevel,l=t.minLevel,c=this._core.StyleContrastGeoJson(i,this._cesium),u=(null==n&&console.log("geojson is required"),null),u=n.then?n:this._cesium.GeoJsonDataSource.load(n),h=(this._viewer.dataSources.add(u),this),u=(!this.setNearAndFar&&a&&l&&(this.setNearAndFar=!0,this.Level=0,this._viewer.scene.preRender.addEventListener(function(){h.isShow&&h.item&&(h.Level=h.getLevel(),h.Level>=l&&h.Level<=a&&!h.item.show?h.item.show=!0:(h.Level<l||h.Level>a)&&(h.item.show=!1))})),u.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var o,r,n,a=t[i];null!=c.point&&((o=c.point).color=h._color.VectorColorTransformation(o.color,a),o.outlineColor=h._color.VectorColorTransformation(o.outlineColor,a),null!=o.pointHeight&&(a.position._value=h._core.setheight(a.position._value,o.pointHeight,h._cesium,h._viewer),delete o.pointHeight),a.point=new h._cesium.PointGraphics(o)),null!=c.label&&((o=c.label).fillColor=h._color.VectorColorTransformation(o.fillColor,a),o.outlineColor=h._color.VectorColorTransformation(o.outlineColor,a),null!=o.pointHeight&&(a.position._value=h._core.setheight(a.position._value,o.pointHeight,h._cesium,h._viewer),delete o.pointHeight),a.label=new h._cesium.LabelGraphics(o)),null!=c.billboard&&((r=c.billboard).color=h._color.VectorColorTransformation(r.color,a),null!=r.pointHeight&&(a.position._value=h._core.setheight(a.position._value,r.pointHeight,h._cesium,h._viewer),delete r.pointHeight),a.billboard=new h._cesium.BillboardGraphics(r)),null!=c.polyline&&((r=c.polyline).material=h._color.VectorColorTransformation(r.material,a),r.positions=a.polyline.positions,null!=r.pointHeight&&(a.position._value=h._core.setpolylineheight(a.position._value,r.pointHeight,h._cesium,h._viewer),delete r.pointHeight),a.polyline=new h._cesium.PolylineGraphics(r)),null!=c.polygon&&((n=c.polygon).hierarchy=a.polygon.hierarchy,n.material=h._color.VectorColorTransformation(n.material,a),n.outlineColor=h._color.VectorColorTransformation(n.outlineColor,a),n.outlineColor&&(n.outline=!0),a.polygon=new h._cesium.PolygonGraphics(n))}"function"==typeof s&&s(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),r?h.isShow=!0:h.setVisibility(!1),{id:c.id,name:e,checked:r,pId:this._core.isnull(o)?0:o,type:"datasource",item:this,url:n,style:c,treeData:{name:e,geoOptions:t,styleOption:i,GroupID:o,checked:r,disFnc:s}});return this.setTreeobj(u),this._tree.insertGroupId(u,this._core.isnull(o)?0:o),this},w.prototype.createGeojsonKmlFeatureLayer=function(e,t,i,o,r){var n=t,a={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=(this._viewer.dataSources.add(this._cesium.KmlDataSource.load(t,a)),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),o||this.setVisibility(!1),{id:a.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"datasource",item:this,url:n,style:a,treeData:{name:e,geoOptions:t,styleOption:"",GroupID:i,checked:o,disFnc:r}});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},w.prototype.createGeoJsonFeatureLayerAlawys=function(e,t,s,i,l){var c,o={id:this._core.getuid(),layertype:"",text:"",font:"16px",fillColor:this._cesium.WHITE,outlineColor:this._cesium.BLACK,outlineWidth:"1.0",scale:"1.0",maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,icon:""},u=(this._core.isnull(s)||this._core.isnull(s.fillColor)||"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(this._core.isHtmlColor(s.fillColor)?s.fillColor=this._color.colorFromHtmlColor(s.fillColor):s.fillColor=this._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a)),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a)),this._core.extend(o,s,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),h=(this._viewer.dataSources.add(o),this),o=(s&&s.time&&(c=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:s.time.start?h._cesium.JulianDate.fromDate(new Date(s.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?h._cesium.JulianDate.fromDate(new Date(s.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var o,r=t[i],n=(u.id=h._core.extendgl(r,s.id,u.id),u.text=h._core.extendgl(r,s.text,u.text),u.font=h._core.extendgl(r,s.font,u.font),u.fillColor=h._core.extendgl(r,s.fillColor,u.fillColor),u.outlineColor=h._core.extendgl(r,s.outlineColor,u.outlineColor),u.outlineWidth=parseInt(h._core.extendgl(r,s.outlineWidth,u.outlineWidth)),u.scale=parseFloat(h._core.extendgl(r,s.scale,u.scale)),u.image=h._core.extendgl(r,s.image,u.image),u.icon=h._core.extendgl(r,s.icon,u.icon),parseFloat(h._core.extendgl(r,u.minDistanceDisplay||u.near))),a=parseFloat(h._core.extendgl(r,u.maxDistanceDisplay||u.far)),n=new h._cesium.DistanceDisplayCondition(n,a);r.billboard&&(u?(h._core.isUrl(r.properties[u.icon])||h._core.isUrl(u.icon))&&!h._core.isnull(r.properties[u.text])||!h._core.isnull(u.text)?(o="fillColor:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue+";outlineColor:"+255*u.outlineColor.red+","+255*u.outlineColor.green+","+255*u.outlineColor.blue,h.Legend.push(o),r.label={id:"my label",text:h._core.isnull(r.properties[u.text])?u.text:r.properties[u.text]+"",font:u.font+" sans-serif",fillColor:u.fillColor,outlineColor:u.outlineColor,outlineWidth:u.outlineWidth,scale:parseFloat(u.scale),distanceDisplayCondition:n},r.billboard={image:h._core.isUrl(r.properties[u.icon])?r.properties[u.icon]:u.icon,distanceDisplayCondition:n}):h._core.isnull(u.icon)?h._core.isnull(r.properties[u.text])&&h._core.isnull(u.text)?(o="color:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue,h.Legend.push(o),r.billboard=void 0,r.point=new h._cesium.PointGraphics({color:h._cesium.Color.RED,pixelSize:10,distanceDisplayCondition:n})):(r.billboard=void 0,o="fillColor:"+255*u.fillColor.red+","+255*u.fillColor.green+","+255*u.fillColor.blue+";outlineColor:"+255*u.outlineColor.red+","+255*u.outlineColor.green+","+255*u.outlineColor.blue,h.Legend.push(o),r.label={id:"my label",text:h._core.isnull(r.properties[u.text])?u.text:r.properties[u.text]+"",font:u.font+" sans-serif",fillColor:u.fillColor,outlineColor:u.outlineColor,outlineWidth:u.outlineWidth,scale:parseFloat(u.scale),distanceDisplayCondition:n}):r.billboard={image:h._core.isUrl(r.properties[u.icon])?r.properties[u.icon]:u.icon,distanceDisplayCondition:n}:r.polygon?r.polygon.distanceDisplayCondition=n:r.polyline&&(r.polyline.distanceDisplayCondition=n),c&&(r.availability=c))}"function"==typeof l&&l(e)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),{id:u.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:u,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:l}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createGeoJsonFeatureLayer=function(t,e,i,o,r,n){var a=this._cesium.GeoJsonDataSource.load(e),s=this;return a.then(function(e){e=e.entities.values[0];/^point.fid/.test(e._id)||null!=e.point?s.createPointGeojsonFeatureLayer(t,a,i,o,r,n):/^polygon.fid/.test(e._id)||null!=e.polygon?s.createPolygonGeoJsonFeatureLayer(t,a,i,o,r,n):/^line.fid/.test(e._id)||null!=e.polyline?s.createPolylineGeoJsonFeatureLayer(t,a,i,o,r,n):s.createGeoJsonFeatureLayerAlawys(t,a,i,o,n)}),this},w.prototype.createPointGeojsonFeatureLayer=function(e,t,s,i,l=!0,c){var u,o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),height:0,pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},h=(this._core.isnull(s)||this._core.isnull(s.color)||"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=this._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),this._core.extend(o,s,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),m=(this._viewer.dataSources.add(o),this),o=(s&&s.time&&(u=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(h.color=m._core.extendgl(o,s.color,h.color),h.pixelSize=parseInt(m._core.extendgl(o,s.pixelSize,h.pixelSize)),h.outlineColor=m._core.extendgl(o,s.outlineColor,h.outlineColor),h.outlineWidth=parseFloat(m._core.extendgl(o,s.outlineWidth,h.outlineWidth)),h.show=m._core.extendgl(o,s.show,h.show),h.height=parseFloat(m._core.extendgl(o,s.height,h.height)),h.scaleByDistance=m._core.extendgl(o,s.scaleByDistance,h.scaleByDistance),parseFloat(m._core.extendgl(o,h.minDistanceDisplay||h.near))),n=parseFloat(m._core.extendgl(o,h.maxDistanceDisplay||h.far)),r=new m._cesium.DistanceDisplayCondition(r,n),n="color:"+255*h.color.red+","+255*h.color.green+","+255*h.color.blue+";outlineColor:"+255*h.outlineColor.red+","+255*h.outlineColor.green+","+255*h.outlineColor.blue,n=(m.Legend.push(n),h.distanceDisplayCondition=r,h.pointHeight=m._core.extendgl(o,s.pointHeight,h.pointHeight),h.pointHeight=parseFloat(h.pointHeight),m._viewer.scene.globe.ellipsoid,m._cesium.Cartographic.fromCartesian(o.position._value)),r=m._cesium.Math.toDegrees(n.longitude),a=m._cesium.Math.toDegrees(n.latitude),n=h.pointHeight||n.height,r=new m._cesium.Cartesian3.fromDegrees(r,a,n),a=(o.position._value=r,o.point=new m._cesium.PointGraphics(h),o.billboard=void 0,{positions:r});o.description=a,u&&(o.availability=u)}l||m.setVisibility(!1),"function"==typeof c&&c(e)}),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),{id:h.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:h,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:c}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createModelGeojsonFeatureLayer=function(e,t,m={},i,o,r){var d={color:m.color||"#ffffff",url:window.SmartEarthRootUrl+I.testModel,scale:1,minimumPixelSize:0,height:0,far:5e3,near:0,type:"default"},n=(null==t&&console.log("geojson is required"),null),n=t.then?t:this._cesium.GeoJsonDataSource.load(t),n=(m&&m.time&&new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),this.option=m,this.option.color="string"==typeof d.color?Cesium.Color.fromCssColorString(d.color):d.colorF,this.loadGeosjonData=()=>{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,c=[];for(let e=0,i;e<t.length;e++)if(i=t[e],"polylineVolume"===o.type){let e=this._core.extendgl(i,"[flieName]");e="/"+e.replace("xpl2","gltf"),n.get(o.url+e)||n.set(o.url+e,[]),l=n.get(o.url+e);var u=new Cesium.Cartesian3(this._core.extendgl(i,"[scaleY]",1),this._core.extendgl(i,"[scaleX]",1),this._core.extendgl(i,"[scaleZ]",1)),h=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.extendgl(i,"[Yaw]",0)),Cesium.Math.toRadians(this._core.extendgl(i,"[Pitch]",0)),Cesium.Math.toRadians(this._core.extendgl(i,"[Roll]",0))),h=Cesium.Matrix3.fromHeadingPitchRoll(h);let t=this._core.toDegrees(i.position.getValue());t.height=this._core.extendgl(i,"[Altitude]",0),s=new Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height),c.push(s),a=Cesium.Transforms.eastNorthUpToFixedFrame(s),Cesium.Matrix4.multiplyByMatrix3(a,h,a),Cesium.Matrix4.multiplyByScale(a,u,a),Cesium.ModelInstanceCollection?l.push({modelMatrix:a,modelId:this._core.getEntityProp(i)}):this.item.add(Cesium.Model.fromGltf({id:this._core.getEntityProp(i),url:o.url+e,modelMatrix:a,color:o.color,distanceDisplayCondition:r}))}else{if(n.get(o.url)||(n.set(o.url,[]),l=n.get(o.url)),void 0!==o.height||void 0!==o.pointHeight){let e=this._core.toDegrees(i.position.getValue());e.height=o.height||o.pointHeight,s=new Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),i.position=s}s=i.position.getValue(),c.push(s),a=Cesium.Transforms.eastNorthUpToFixedFrame(s);h=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.extendgl(i,o.heading,0)),Cesium.Math.toRadians(this._core.extendgl(i,o.pitch,0)),Cesium.Math.toRadians(this._core.extendgl(i,o.roll,0))),u=Cesium.Matrix3.fromHeadingPitchRoll(h);Cesium.Matrix4.multiplyByMatrix3(a,u,a),"object"==typeof o.scale?Cesium.Matrix4.multiplyByScale(a,o.scale,a):Cesium.Matrix4.multiplyByUniformScale(a,o.scale,a),Cesium.ModelInstanceCollection?l.push({modelMatrix:a,modelId:this._core.getEntityProp(i)}):this.item.add(Cesium.Model.fromGltf({id:this._core.getEntityProp(i),url:o.url,modelMatrix:a,color:o.color,distanceDisplayCondition:r}))}this.item.boundingSphere=Cesium.BoundingSphere.fromPoints(c),Cesium.ModelInstanceCollection&&n.forEach((e,t)=>{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<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._core.isnull(a)||this._core.isnull(a.radius)||(o.semiMajorAxis=a.radius,o.semiMinorAxis=a.radius),(void 0)._core.isnull(a.near)&&(a.near=0),(void 0)._core.isnull(a.far)&&(a.far=999999999),this._core.extend(o,a,!0)),o=(null==t&&console.log("geojson is required"),this._cesium.GeoJsonDataSource.load(t)),c=(this._viewer.dataSources.add(o),this),o=(o.then(function(e){for(var t=(c.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(l.semiMajorAxis=parseFloat(c._core.extendgl(o,a.semiMajorAxis,l.semiMajorAxis)),l.semiMinorAxis=parseFloat(c._core.extendgl(o,a.semiMinorAxis,l.semiMinorAxis)),l.height=parseFloat(c._core.extendgl(o,a.height,l.height)),l.heightReference=c._core.extendgl(o,a.heightReference,l.heightReference),l.extrudedHeight=parseFloat(c._core.extendgl(o,a.extrudedHeight,l.extrudedHeight)),l.extrudedHeightReference=c._core.extendgl(o,a.extrudedHeightReference,l.extrudedHeightReference),l.show=c._core.extendgl(o,a.show,l.show),l.fill=c._core.extendgl(o,a.fill,l.fill),l.material=c._core.extendgl(o,a.material,l.material),l.outline=c._core.extendgl(o,a.outline,l.outline),l.outlineColor=c._core.extendgl(o,a.outlineColor,l.outlineColor),l.outlineWidth=parseFloat(c._core.extendgl(o,a.outlineWidth,l.outlineWidth)),l.scaleByDistance=c._core.extendgl(o,a.scaleByDistance,l.scaleByDistance),"material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue+";outlineColor:"+255*l.outlineColor.red+","+255*l.outlineColor.green+","+255*l.outlineColor.blue),r=(c.Legend.push(r),parseFloat(c._core.extendgl(o,l.near))),n=parseFloat(c._core.extendgl(o,l.far)),r=new c._cesium.DistanceDisplayCondition(r,n);l.distanceDisplayCondition=r,o.billboard=void 0,o.ellipse=new c._cesium.EllipseGraphics(l)}"function"==typeof s&&s(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),{id:l.id,name:e,pId:this._core.isnull(i)?0:i,type:"layer",item:this,url:t,style:l,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:!0,disFnc:s}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createModelPointGeoJsonFeatureLayer=function(e,t,s,i,l,c){var u,o={uri:"",show:!0,scale:1,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,lightColor:void 0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),color:this._cesium.Color.WHITE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},h=this,m=(this._core.isnull(s)||this._core.isnull(s.color)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),h._core.isnull(s.near)&&(s.near=0),h._core.isnull(s.far)&&(s.far=999999999),this._core.extend(o,s,!0)),o=(null==t&&console.log("geojson is required"),this._cesium.GeoJsonDataSource.load(t)),o=(this._viewer.dataSources.add(o),s&&s.time&&(u=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:s.time.start?h._cesium.JulianDate.fromDate(new Date(s.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?h._cesium.JulianDate.fromDate(new Date(s.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(h.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(m.uri=h._core.extendgl(o,s.uri,m.uri),m.scale=parseFloat(h._core.extendgl(o,s.scale,m.scale)),m.incrementallyLoadTextures=h._core.extendgl(o,s.incrementallyLoadTextures,m.incrementallyLoadTextures),m.runAnimations=h._core.extendgl(o,s.runAnimations,m.runAnimations),m.clampAnimations=h._core.extendgl(o,s.clampAnimations,m.clampAnimations),m.shadows=h._core.extendgl(o,s.shadows,m.shadows),m.heightReference=h._core.extendgl(o,s.heightReference,m.heightReference),m.lightColor=h._core.extendgl(o,s.lightColor,m.lightColor),m.scaleByDistance=h._core.extendgl(o,s.scaleByDistance,m.scaleByDistance),m.color=h._core.extendgl(o,s.color,m.color),m.height?m.height=parseFloat(h._core.extendgl(o,s.height,m.height)):m.height=void 0,parseFloat(h._core.extendgl(o,s.near,m.near))),n=parseFloat(h._core.extendgl(o,s.far,m.far)),a="color:"+255*m.color.red+","+255*m.color.green+","+255*m.color.blue,a=(h.Legend.push(a),new h._cesium.DistanceDisplayCondition(r,n));m.distanceDisplayCondition=a,o.billboard=void 0,o.model=new h._cesium.ModelGraphics(m),m.height&&(r=h._cesium.Cartographic.fromCartesian(o.position._value),n=h._cesium.Math.toDegrees(r.longitude),a=h._cesium.Math.toDegrees(r.latitude),o.position=h._cesium.Cartesian3.fromDegrees(n,a,m.height)),u&&(o.availability=u)}"function"==typeof c&&c(e),l||h.setVisibility(!1)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),{id:m.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t,style:m,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:c}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createLabelPointGeoJsonFeatureLayer=function(s,e,l,t,i,o){var c,u={Name:"",text:"test",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,addHeight:0},h=this,r=(this._core.isnull(l)||this._core.isnull(l.fillColor)||(this._core.isHtmlColor(l.fillColor)?l.fillColor=this._color.colorFromHtmlColor(l.fillColor):(/^rgb/.test(l.fillColor)&&(l.fillColor=this._color.rgbaStringToRgbaObj(l.fillColor)),1<l.fillColor.r&&(l.fillColor.r=l.fillColor.r/255),1<l.fillColor.g&&(l.fillColor.g=l.fillColor.g/255),1<l.fillColor.b&&(l.fillColor.b=l.fillColor.b/255),1<l.fillColor.a&&(l.fillColor.a=l.fillColor.a/255),l.fillColor=this._color.createColor(l.fillColor.r,l.fillColor.g,l.fillColor.b,l.fillColor.a))),this._core.isnull(l)||this._core.isnull(l.color)||(this._core.isHtmlColor(l.color)?l.color=this._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=this._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=this._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),this._core.isnull(l)||this._core.isnull(l.outlineColor)||(this._core.isHtmlColor(l.outlineColor)?l.outlineColor=this._color.colorFromHtmlColor(l.outlineColor):(/^rgb/.test(l.outlineColor)&&(l.outlineColor=this._color.rgbaStringToRgbaObj(l.outlineColor)),1<l.outlineColor.r&&(l.outlineColor.r=l.outlineColor.r/255),1<l.outlineColor.g&&(l.outlineColor.g=l.outlineColor.g/255),1<l.outlineColor.b&&(l.outlineColor.b=l.outlineColor.b/255),1<l.outlineColor.a&&(l.outlineColor.a=l.outlineColor.a/255),l.outlineColor=this._color.createColor(l.outlineColor.r,l.outlineColor.g,l.outlineColor.b,l.outlineColor.a))),this._core.isnull(l)||this._core.isnull(l.backgroundColor)||(this._core.isHtmlColor(l.backgroundColor)?l.backgroundColor=this._color.colorFromHtmlColor(l.backgroundColor):(/^rgb/.test(l.backgroundColor)&&(l.backgroundColor=this._color.rgbaStringToRgbaObj(l.backgroundColor)),1<l.backgroundColor.r&&(l.backgroundColor.r=l.backgroundColor.r/255),1<l.backgroundColor.g&&(l.backgroundColor.g=l.backgroundColor.g/255),1<l.backgroundColor.b&&(l.backgroundColor.b=l.backgroundColor.b/255),1<l.backgroundColor.a&&(l.backgroundColor.a=l.backgroundColor.a/255),l.backgroundColor=this._color.createColor(l.backgroundColor.r,l.backgroundColor.g,l.backgroundColor.b,l.backgroundColor.a))),h._core.isnull(l.near)&&(l.near=0),h._core.isnull(l.far)&&(l.far=999999999),l&&l.time&&(c=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:l.time.start?this._cesium.JulianDate.fromDate(new Date(l.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?this._cesium.JulianDate.fromDate(new Date(l.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),null==e&&console.log("geojson is required"),this._cesium.GeoJsonDataSource.load(e)),h=(this._viewer.dataSources.add(r),this),r=(this.option=l,this.loadGeosjonData=()=>{l=this.option;var i=this.item.entities.values;let o=this._core.extend(u,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<i.length;t++){let e=i[t];o.font=h._core.extendgl(e,l.font,o.font),o.style=parseInt(h._core.extendgl(e,o.style,o.style)),o.fillColor=h._core.extendgl(e,l.fillColor,o.fillColor),o.outlineColor=h._core.extendgl(e,l.outlineColor,o.outlineColor),o.outlineWidth=parseFloat(h._core.extendgl(e,l.outlineWidth,o.outlineWidth)),o.show=h._core.extendgl(e,l.show,o.show),o.showBackground=h._core.extendgl(e,l.showBackground,o.showBackground),o.backgroundColor=h._core.extendgl(e,l.backgroundColor,o.backgroundColor),o.backgroundPadding=h._core.extendgl(e,l.backgroundPadding,o.backgroundPadding),o.scale=parseFloat(h._core.extendgl(e,l.scale,o.scale)),o.horizontalOrigin=h._core.extendgl(e,l.horizontalOrigin,o.horizontalOrigin),o.pointHeight=parseFloat(h._core.extendgl(e,l.pointHeight,o.pointHeight)),o.text=h._core.extendgl(e,l.text,o.text).toString();var r,n=parseFloat(h._core.extendgl(e,o.near)),a=parseFloat(h._core.extendgl(e,o.far)),n=new h._cesium.DistanceDisplayCondition(n,a),n=(o.distanceDisplayCondition=n,null!=o.image&&null!=o.image&&0<o.image.length?(e.billboard={image:o.image},e.billboard.scale=o.scale,e.billboard.color=o.color,e.billboard.verticalOrigin=o.verticalOrigin,e.billboard.horizontalOrigin=o.horizontalOrigin,e.billboard.disableDepthTestDistance=o.disableDepthTestDistance,e.billboard.heightReference=o.heightReference,e.billboard.distanceDisplayCondition=o.distanceDisplayCondition):e.billboard=void 0,"ellipsoidlayer"==o.layertype&&(e.name=s,a={show:!0,radii:new h._cesium.Cartesian3(o.long_axis,o.short_axis,o.long_axis),material:h._cesium.Color.fromRandom({alpha:1})},e.ellipsoid=new h._cesium.EllipsoidGraphics(a),e.ellipsoid.heightReference=o.heightReference,e.ellipsoid.material=url),{Name:o.Name,text:o.text,font:o.font,style:o.stylet,...o}),a="fillColor:"+255*o.fillColor.red+","+255*o.fillColor.green+","+255*o.fillColor.blue+";outlineColor:"+255*o.outlineColor.red+","+255*o.outlineColor.green+","+255*o.outlineColor.blue;h.Legend.push(a),e.label=new h._cesium.LabelGraphics(n),c&&(e.availability=c),(o.pointHeight||o.addHeight)&&(a=h._cesium.Cartographic.fromCartesian(e.position._value),n=h._cesium.Math.toDegrees(a.longitude),r=h._cesium.Math.toDegrees(a.latitude),a=(o.pointHeight||a.height)+o.addHeight,n=new Cesium.Cartesian3.fromDegrees(n,r,a),e.position._value=n),e.label&&(o.labelData&&Object.assign(e.label,o.labelData),(o.offsetX||o.offsetY)&&(e.label.pixelOffset=new Cesium.Cartesian2(o.offsetX||0,o.offsetY||0))),e.billboard&&o.imageData&&Object.assign(e.billboard,o.imageData)}},r.then(function(e){h.item=e,h.loadGeosjonData(),i||h.setVisibility(!1),"function"==typeof o&&o(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(s)&&(s="新建街景"+l.id),{id:l.id,name:s,checked:i,pId:this._core.isnull(t)?0:t,type:"labelPointLayer",item:this,url:e,style:l,treeData:{name:s,geoOptions:e,styleOption:l,GroupID:t,checked:i,disFnc:o}});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(t)?0:t),this},w.prototype.createStreetscapeGeoJsonFeatureLayer=function(e,t,c,i,u,h){var m,o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.RED,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},d=this,p=(this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||"("==c.material.toString().charAt(0)&&")"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a)),"1"==c.arcType||1==c.arcType?c.material=new Cesium.PolylineDashMaterialProperty({color:c.material}):c.material=c.material),d._core.isnull(c.near)&&(c.near=0),d._core.isnull(c.far)&&(c.far=999999999),this._core.extend(o,c,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),o=(this._viewer.dataSources.add(o,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),c&&c.time&&(m=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:c.time.start?this._cesium.JulianDate.fromDate(new Date(c.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?this._cesium.JulianDate.fromDate(new Date(c.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(d.item=e).entities.values,i=0;i<t.length;i++){var o,r,n=t[i],a=(p.arcType=d._core.extendgl(n,c.arcType,p.arcType),p.clampToGround=d._core.extendgl(n,c.clampToGround,p.clampToGround),p.width=parseFloat(d._core.extendgl(n,c.width,p.width)),p.show=d._core.extendgl(n,c.show,p.show),p.material=d._core.extendgl(n,c.material,p.material),p.height=parseFloat(d._core.extendgl(n,c.height,p.height)),parseFloat(d._core.extendgl(n,p.near))),s=parseFloat(d._core.extendgl(n,p.far)),a=new d._cesium.DistanceDisplayCondition(a,s),l=(p.distanceDisplayCondition=a,n.polyline.arcType=!0,0==p.heightReference?n.polyline.arcType=0:n.polyline.arcType=1,n.polyline.clampToGround=p.clampToGround,n.polyline.width=p.width,n.polyline.height=p.height,n.polyline.show=p.show,n.polyline.material=p.material,n.polyline.distanceDisplayCondition=a,[]),s=(n.polyline.positions._value.forEach(function(e){p.height?(r=d._cesium.Cartographic.fromCartesian(e),o=d._cesium.Math.toDegrees(r.longitude),r=d._cesium.Math.toDegrees(r.latitude),l.push(d._cesium.Cartesian3.fromDegrees(o,r,p.height))):l.push(e)}),n.polyline.positions=l,m&&(n.availability=m),"material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue);d.Legend.push(s)}u||d.setVisibility(!1),"function"==typeof h&&h(e)}),this._core.isnull(p.id)&&(p.id=this._core.getuid()),this._core.isnull(e)&&(e="新建街景"+p.id),{id:p.id,name:e,checked:u,pId:this._core.isnull(i)?0:i,type:"Streetscape",item:this,url:t,style:p,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:u,disFnc:h}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer=function(e,t,a,i,s){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},l=(this._core.isnull(a)||this._core.isnull(a.fillColor)||"["==a.fillColor.toString().charAt(0)&&"]"==a.fillColor.toString().charAt(a.fillColor.length-1)||"("==a.material.toString().charAt(0)&&")"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.fillColor)?a.fillColor=this._color.colorFromHtmlColor(a.fillColor):(/^rgb/.test(a.fillColor)&&(a.fillColor=this._color.rgbaStringToRgbaObj(a.fillColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=this._color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),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<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),this._core.isnull(a)||this._core.isnull(a.backgroundColor)||"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(this._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=this._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=this._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=this._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),(void 0)._core.isnull(a.near)&&(a.near=0),(void 0)._core.isnull(a.far)&&(a.far=999999999),this._core.extend(o,a,!0)),o=(null==t&&console.log("geojson is required"),this._cesium.GeoJsonDataSource.load(t)),c=(this._viewer.dataSources.add(o),this),o=(o.then(function(e){var t=(c.item=e).entities.values;c._core.isnull(a.font_size)&&(a.font_size="30px"),c._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),l.font=a.font_size+"px "+a.font_family;for(var i=0;i<t.length;i++){l.text=c._core.extendgl(entity,a.text,l.text),l.font=c._core.extendgl(entity,a.font,l.font),l.stylet=c._core.extendgl(entity,a.stylet,l.stylet),l.fillColor=c._core.extendgl(entity,a.fillColor,l.fillColor),l.outlineColor=c._core.extendgl(entity,a.outlineColor,l.outlineColor),l.outlineWidth=parseFloat(c._core.extendgl(entity,a.outlineWidth,l.outlineWidth)),l.show=c._core.extendgl(entity,a.show,l.show),l.showBackground=c._core.extendgl(entity,a.showBackground,l.showBackground),l.backgroundColor=c._core.extendgl(entity,a.backgroundColor,l.backgroundColor),l.backgroundPadding=c._core.extendgl(entity,a.backgroundPadding,l.backgroundPadding),l.scale=parseFloat(c._core.extendgl(entity,a.scale,l.scale)),l.horizontalOrigin=c._core.extendgl(entity,a.horizontalOrigin,l.horizontalOrigin),l.pointheight=parseFloat(c._core.extendgl(entity,a.pointheight,l.pointheight));var o=parseFloat(c._core.extendgl(entity,l.near)),r=parseFloat(c._core.extendgl(entity,l.far)),n="fillColor:"+255*l.fillColor.red+","+255*l.fillColor.green+","+255*l.fillColor.blue+";outlineColor:"+255*l.outlineColor.red+","+255*l.outlineColor.green+","+255*l.outlineColor.blue,n=(c.Legend.push(n),new c._cesium.DistanceDisplayCondition(o,r));l.distanceDisplayCondition=n,entity.ellipsoid.radii=new _this._cesium.Cartesian3(a.long_axis,a.short_axis,a.short_axis),entity.label=new c._cesium.LabelGraphics(l),entity.label.text=null==entity.properties[a.text]?a.text:entity.properties[a.text]._value,l.pointheight&&(o=c._cesium.Cartographic.fromCartesian(entity.position._value),r=c._cesium.Math.toDegrees(o.longitude),n=c._cesium.Math.toDegrees(o.latitude),entity.position=c._cesium.Cartesian3.fromDegrees(r,n,l.pointheight))}"function"==typeof s&&s(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),{id:l.id,name:e,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,style:l,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:!0,disFnc:s}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createBillboardGeoJsonFeature=function(e,t,s,i,l,c){var u,o={image:"",show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:2,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},h=(this._core.isnull(s)||this._core.isnull(s.color)||"["==s.color.toString().charAt(0)&&"]"==s.color.toString().charAt(s.color.length-1)||(this._core.isHtmlColor(s.color)?s.color=this._color.colorFromHtmlColor(s.color):(/^rgb/.test(s.color)&&(s.color=this._color.rgbaStringToRgbaObj(s.color)),1<s.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=this._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),this._core.extend(o,s,!0)),o=(null==t&&console.log("geojson is required"),this._cesium.GeoJsonDataSource.load(t)),m=(this._viewer.dataSources.add(o),this),o=(m._core.isnull(s.near)&&(s.near=0),m._core.isnull(s.far)&&(s.far=999999999),s&&s.time&&(u=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(m.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(h.image=m._core.extendgl(o,s.image,h.image),h.show=m._core.extendgl(o,s.show,h.show),h.scale=parseFloat(m._core.extendgl(o,s.scale,h.scale)),h.horizontalOrigin=m._core.extendgl(o,s.horizontalOrigin,h.horizontalOrigin),h.verticalOrigin=m._core.extendgl(o,s.verticalOrigin,h.verticalOrigin),h.eyeOffset=m._core.extendgl(o,s.eyeOffset,h.eyeOffset),h.pixelOffset=m._core.extendgl(o,s.pixelOffset,h.pixelOffset),h.alignedAxis=m._core.extendgl(o,s.alignedAxis,h.alignedAxis),h.rotation=m._core.extendgl(o,s.rotation,h.rotation),h.width?h.width=parseFloat(m._core.extendgl(o,s.width,h.width)):h.width=void 0,h.height?h.height=parseFloat(m._core.extendgl(o,s.height,h.height)):h.height=void 0,h.color=m._core.extendgl(o,s.color,h.color),"color:"+255*h.color.red+","+255*h.color.green+","+255*h.color.blue+";image:"+h.image),r=(m.Legend.push(r),parseFloat(m._core.extendgl(o,h.near))),n=parseFloat(m._core.extendgl(o,h.far)),r=new m._cesium.DistanceDisplayCondition(r,n),n=(h.distanceDisplayCondition=r,o.billboard=void 0,o.billboard=new m._cesium.BillboardGraphics(h),m._viewer.scene.globe.ellipsoid,m._cesium.Cartographic.fromCartesian(o.position._value)),r=m._cesium.Math.toDegrees(n.longitude),a=m._cesium.Math.toDegrees(n.latitude),r=(n=s.pointHeight||n.height,new m._cesium.Cartesian3.fromDegrees(r,a,n)),a={positions:o.position._value=r};o.description=a,u&&(o.availability=u)}l||m.setVisibility(!1),"function"==typeof c&&c(e)}),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),{id:h.id,name:e,checked:l,pId:this._core.isnull(i)?0:i,type:"imageLayer",item:this,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:l,disFnc:c}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,s,i,o,r){var l,c={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.WHITE,gapColor:Cesium.Color.TRANSPARENT,height:void 0,dashLength:16,outlineWidth:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},u=this,n=(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<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||"("==s.outlineColor.toString().charAt(0)&&")"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=this._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),s.gapColor&&"string"==typeof s.gapColor&&(s.gapColor=Cesium.Color.fromCssColorString(s.gapColor)),u._core.isnull(s.near)&&(s.near=0),u._core.isnull(s.far)&&(s.far=999999999),null==t&&console.log("geojson is required"),null),n=t.then?t:this._cesium.GeoJsonDataSource.load(t),n=(this._viewer.dataSources.add(n,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0}),s&&s.time&&(l=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:s.time.start?u._cesium.JulianDate.fromDate(new Date(s.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?u._cesium.JulianDate.fromDate(new Date(s.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})])),this.option=s,this.loadGeosjonData=()=>{s=this.option;var o=this.item.entities.values;let r=this._core.extend(c,s,!0);u.Legend=[];for(let i=0;i<o.length;i++){let e=o[i];r.arcType=u._core.extendgl(e,s.arcType,r.arcType),r.clampToGround=u._core.extendgl(e,s.clampToGround,r.clampToGround),r.width=parseFloat(u._core.extendgl(e,s.width,r.width)),r.show=u._core.extendgl(e,s.show,r.show),r.material=u._core.extendgl(e,s.material,r.material),r.height=parseFloat(u._core.extendgl(e,s.height,r.height));var n=parseFloat(u._core.extendgl(e,r.near)),a=parseFloat(u._core.extendgl(e,r.far)),n=new u._cesium.DistanceDisplayCondition(n,a);r.distanceDisplayCondition=n,void 0!==r.height&&(a=e.polyline.positions.getValue(),e.polyline.positions=u._core.setpolylineheight(a,r.height)),e.polyline.clampToGround=r.clampToGround,e.polyline.width=r.width,e.polyline.show=r.show,e.polyline.distanceDisplayCondition=n,e.polyline.classificationType=r.classificationType;let t;t=r.dash?new Cesium.PolylineDashMaterialProperty({color:r.material,gapColor:r.gapColor,dashLength:s.dashLength}):new Cesium.PolylineOutlineMaterialProperty({color:r.material,outlineColor:r.outlineColor,outlineWidth:s.outlineWidth}),e.polyline.material=t,l&&(e.availability=l);a="material:"+255*r.material.red+","+255*r.material.green+","+255*r.material.blue;u.Legend.push(a)}},n.then(function(e){u.item=e,u.loadGeosjonData(),o||u.setVisibility(!1),"function"==typeof r&&r(e)}),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),{id:s.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,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),this},w.prototype.createpolylineVolumeGeojsonFeatureLayer=function(e,t,d,i,p,g){var f,o={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,radiusScale:1},_=(this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||"("==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.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),this._core.extend(o,d,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),C=(this._viewer.dataSources.add(o),this),o=(_.shape=this.computeCircle(d.radius),d&&d.time&&(f=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:d.time.start?C._cesium.JulianDate.fromDate(new Date(d.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:d.time.end?C._cesium.JulianDate.fromDate(new Date(d.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t,i,o=(C.item=e).entities.values,r=(C._core.isnull(d.near)&&(d.near=0),C._core.isnull(d.far)&&(d.far=999999999),parseFloat(d.near)),n=parseFloat(d.far),a=new C._cesium.DistanceDisplayCondition(r,n);if(_.distanceDisplayCondition=a,"string"==typeof _.radius&&-1<_.radius.indexOf("[")&&-1<_.radius.indexOf("]")){let e;_.radius=_.radius.replace("[",""),_.radius=_.radius.replace("]",""),o[0]&&o[0].properties[_.radius]?(e=o[0].properties[_.radius].getValue()).indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),t=parseFloat(e[0])*_.radiusScale,i=parseFloat(e[1])*_.radiusScale,_.shape=[new C._cesium.Cartesian2(-t,-i),new C._cesium.Cartesian2(t,-i),new C._cesium.Cartesian2(t,i),new C._cesium.Cartesian2(-t,i)]):_.shape=C._core.computeCircle(e*_.radiusScale):_.shape=C._core.computeCircle(.5)}else"0"==_.slttype||0==_.slttype?_.shape=C._core.computeCircle(_.radius):"1"==_.slttype||1==_.slttype?_.shape=C._core.starPositions(_.number,_.exradius,_.inradius):"2"!=_.slttype&&2!=_.slttype||(t=_.orth_width/2,i=_.orth_height/2,_.shape=[new C._cesium.Cartesian2(-t,-i),new C._cesium.Cartesian2(t,-i),new C._cesium.Cartesian2(t,i),new C._cesium.Cartesian2(-t,i)]);for(var s=0;s<o.length;s++){var l,c,u=o[s],h=(_.show=C._core.extendgl(u,d.show,_.show),_.shape=C._core.extendgl(u,d.shape,_.shape),_.cornerType=C._core.extendgl(u,d.cornerType,_.cornerType),_.granularity=C._core.extendgl(u,d.granularity,_.granularity),_.fill=C._core.extendgl(u,d.fill,_.fill),_.material=C._core.extendgl(u,d.material,_.material),_.outline=C._core.extendgl(u,d.outline,_.outline),_.outlineColor=C._core.extendgl(u,d.outlineColor,_.outlineColor),_.outlineWidth=parseFloat(C._core.extendgl(u,d.outlineWidth,_.outlineWidth)),_.shadows=C._core.extendgl(u,d.shadows,_.shadows),[]),m=(u.polyline.positions._value.forEach(function(e){_.height?(c=C._cesium.Cartographic.fromCartesian(e),l=C._cesium.Math.toDegrees(c.longitude),c=C._cesium.Math.toDegrees(c.latitude),h.push(C._cesium.Cartesian3.fromDegrees(l,c,_.height))):h.push(e)}),u.polylineVolume=new C._cesium.PolylineVolumeGraphics({positions:h,show:_.show,shape:_.shape,cornerType:_.cornerType,fill:_.fill,outline:_.outline,outlineWidth:_.outlineWidth,material:_.material,distanceDisplayCondition:a}),"material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue);C.Legend.push(m),u.polyline=void 0,f&&(u.availability=f)}p||C.setVisibility(!1),"function"==typeof g&&g(e)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+_.id),{id:_.id,name:e,checked:p,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t,style:_,treeData:{name:e,geoOptions:t,styleOption:d,GroupID:i,checked:p,disFnc:g}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(e,t,s,i,o,r){let l={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,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,height:0,radiusScale:1},n=(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<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),null==t&&console.log("geojson is required"),null),d=(n=t.then?t:this._cesium.GeoJsonDataSource.load(t),this),p=(s&&s.time&&new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:s.time.start?d._cesium.JulianDate.fromDate(new Date(s.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?d._cesium.JulianDate.fromDate(new Date(s.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})]),new Cesium.PrimitiveCollection),g={allowPicking:!0,appearance:new d._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:s.shadows,geometryInstances:void 0},c=(this.option=s,{});function u(e){return c[e]||(c[e]=d._core.computeCircle(e)),c[e]}this.loadGeosjonData=()=>{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<o.length;e++){i=o[e],t=this._core.extend(l,s,!0),r=n=r=n=a=n=void 0;var r,n=i,a=t;if("string"==typeof a.radius&&-1<a.radius.indexOf("[")&&-1<a.radius.indexOf("]")){let e=d._core.getEntityPropValue(n,a.radius);e?e.indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),n=parseFloat(e[0])*a.radiusScale,r=parseFloat(e[1])*a.radiusScale,c[n+"*"+r]||(c[n+"*"+r]=[new d._cesium.Cartesian2(-n,-r),new d._cesium.Cartesian2(n,-r),new d._cesium.Cartesian2(n,r),new d._cesium.Cartesian2(-n,r)]),a.shape=c[n+"*"+r],a.radius=r):(a.radius=e*a.radiusScale,a.shape=u(a.radius),a.connect&&(a.connectRadius=e*a.radiusScale*1.1,a.connectRadius2=e*a.radiusScale*1.2,a.connectShape1=u(a.connectRadius),a.connectShape2=u(a.connectRadius2))):(a.shape=u(.5),a.radius=.5,a.connect&&(a.connectRadius=1.1*a.radius,a.connectRadius2=1.2*a.radius,a.connectShape1=u(a.connectRadius),a.connectShape2=u(a.connectRadius2)))}else"0"==a.slttype||0==a.slttype?(a.shape=u(a.radius),a.connect&&(a.connectRadius=1.1*a.radius,a.connectRadius2=1.2*a.radius,a.connectShape1=u(a.connectRadius),a.connectShape2=u(a.connectRadius2))):"1"==a.slttype||1==a.slttype?a.shape=d._core.starPositions(a.number,a.exradius,a.inradius):"2"!=a.slttype&&2!=a.slttype||(n=a.orth_width/2,r=a.orth_height/2,a.shape=[new d._cesium.Cartesian2(-n,-r),new d._cesium.Cartesian2(n,-r),new d._cesium.Cartesian2(n,r),new d._cesium.Cartesian2(-n,r)],a.radius=r);t.show=d._core.extendgl(i,s.show,t.show),t.shape=d._core.extendgl(i,s.shape,t.shape),t.cornerType=d._core.extendgl(i,s.cornerType,t.cornerType),t.granularity=d._core.extendgl(i,s.granularity,t.granularity),t.fill=d._core.extendgl(i,s.fill,t.fill),t.material=d._core.extendgl(i,s.material,t.material),t.outline=d._core.extendgl(i,s.outline,t.outline),t.outlineColor=d._core.extendgl(i,s.outlineColor,t.outlineColor),t.outlineWidth=parseFloat(d._core.extendgl(i,s.outlineWidth,t.outlineWidth)),t.shadows=d._core.extendgl(i,s.shadows,t.shadows),"string"==typeof t.material&&(t.material=Cesium.Color.fromCssColorString(t.material)),!async function(e,o){let t=e.polyline&&e.polyline.positions.getValue();if(t&&!(t.length<2)){let i;o.height=d._core.defaultValue(s.height,-2),o.height.start&&o.height.end?o.height={start:d._core.getEntityPropValue(e,s.height.start)||-2,end:d._core.getEntityPropValue(e,s.height.end)||-2}:("string"==typeof o.height&&o.height.includes("[")&&o.height.includes("]")&&(o.height=d._core.getEntityPropValue(e,s.height)||-2),o.height={start:o.height,end:o.height}),o.height._height=(o.height.end-o.height.start)/(t.length-1),t.forEach(function(e,t){(i=Cesium.Cartographic.fromCartesian(e)).height=o.height.start+o.height._height*t-o.radius,Cesium.Cartesian3.clone(Cesium.Cartographic.toCartesian(i),e)});var r={polylinePositions:t,shapePositions:o.shape,cornerType:o.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},r=new Cesium.PolylineVolumeGeometry(r),r=new Cesium.GeometryInstance({id:d._core.getEntityProp(e),geometry:r,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(o.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near,o.far)}}),r=(g.geometryInstances=r,p.add(new Cesium.Primitive(g)),console.log(o.material.toCssColorString()),o.connect&&10<o.shape.length&&!async function(t,i,o){let r=[],n=d._core.getPointFromTwoPointCenter([i[0],i[1]],2*o.connectRadius),a=d._core.getPointFromTwoPointCenter([i[0],i[1]],2*o.connectRadius2),s=d._core.getPointFromTwoPointCenter([i[i.length-1],i[i.length-2]],2*o.connectRadius),l=d._core.getPointFromTwoPointCenter([i[i.length-1],i[i.length-2]],2*o.connectRadius2);i[0].equals(i[1])&&i[2]&&(n=d._core.getPointFromTwoPointCenter([i[0],i[2]],2*o.connectRadius),a=d._core.getPointFromTwoPointCenter([i[0],i[2]],2*o.connectRadius2));i[i.length-1].equals(i[i.length-2])&&i[i.length-3]&&(s=d._core.getPointFromTwoPointCenter([i[i.length-1],i[i.length-3]],2*o.connectRadius),l=d._core.getPointFromTwoPointCenter([i[i.length-1],i[i.length-3]],2*o.connectRadius2));let c=[],u=new Cesium.EllipsoidGeometry({vertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0},stackPartitions:16,slicePartitions:16,radii:new Cesium.Cartesian3(o.connectRadius,o.connectRadius,o.connectRadius)}),h;if(n&&a){if(!i[0].equals(n)){let e=[];(h=d._core.toDegrees(i[0])).height-=.1*o.radius,e.push(d._core.fromDegrees(h)),(h=d._core.toDegrees(n)).height-=.1*o.radius,e.push(d._core.fromDegrees(h));var m=new d._cesium.PolylineVolumeGeometry({polylinePositions:e,shapePositions:o.connectShape1,cornerType:o.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});r.push(m)}if(!n.equals(a)){let e=[];(h=d._core.toDegrees(n)).height-=.2*o.radius,e.push(d._core.fromDegrees(h)),(h=d._core.toDegrees(a)).height-=.2*o.radius,e.push(d._core.fromDegrees(h));m=new d._cesium.PolylineVolumeGeometry({polylinePositions:e,shapePositions:o.connectShape2,cornerType:o.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});r.push(m)}m=new Cesium.GeometryInstance({geometry:u,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i[0]),new Cesium.Cartesian3(0,0,o.radius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(o.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near,o.far)}});c.push(m)}if(s&&l){if(!i[i.length-1].equals(s)){let e=[];(h=d._core.toDegrees(i[i.length-1])).height-=.1*o.radius,e.push(d._core.fromDegrees(h)),(h=d._core.toDegrees(s)).height-=.1*o.radius,e.push(d._core.fromDegrees(h));m=new d._cesium.PolylineVolumeGeometry({polylinePositions:e,shapePositions:o.connectShape1,cornerType:o.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}}),m=(r.push(m),new Cesium.GeometryInstance({geometry:u,modelMatrix:Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i[i.length-1]),new Cesium.Cartesian3(0,0,o.radius),new Cesium.Matrix4),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(o.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near,o.far)}}));c.push(m)}if(!l.equals(s)){let e=[];(h=d._core.toDegrees(s)).height-=.2*o.radius,e.push(d._core.fromDegrees(h)),(h=d._core.toDegrees(l)).height-=.2*o.radius,e.push(d._core.fromDegrees(h));i=new d._cesium.PolylineVolumeGeometry({polylinePositions:e,shapePositions:o.connectShape2,cornerType:o.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});r.push(i)}}r.forEach(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)}});c.push(e)}),g.geometryInstances=c,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,c,i,u,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(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))),this._core.isnull(c)||this._core.isnull(c.outlineColor)||"["==c.outlineColor.toString().charAt(0)&&"]"==c.outlineColor.toString().charAt(c.outlineColor.length-1)||(this._core.isHtmlColor(c.outlineColor)?c.outlineColor=this._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=this._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=this._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),this._core.extend(o,c,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),p=(this._viewer.dataSources.add(o),this),o=(c&&c.time&&(m=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:c.time.start?p._cesium.JulianDate.fromDate(new Date(c.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?p._cesium.JulianDate.fromDate(new Date(c.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){var t=(p.item=e).entities.values,i=(p._core.isnull(c.near)&&(c.near=0),p._core.isnull(c.far)&&(c.far=999999999),parseFloat(c.near)),o=parseFloat(c.far),r=new p._cesium.DistanceDisplayCondition(i,o);d.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n],s=(d.granularity=p._core.extendgl(a,c.granularity,d.granularity),d.fill=p._core.extendgl(a,c.fill,d.fill),d.material=p._core.extendgl(a,c.material,d.material),d.outline=p._core.extendgl(a,c.outline,d.outline),d.outlineColor=p._core.extendgl(a,c.outlineColor,d.outlineColor),d.outlineWidth=parseFloat(p._core.extendgl(a,c.outlineWidth,d.outlineWidth)),d.shadows=p._core.extendgl(a,c.shadows,d.shadows),a.polyline.positions._value.length),l=new Array(s),s=new Array(s),s=(l.fill(d.minimumHeights),s.fill(d.maximumHeights),a.wall=new p._cesium.WallGraphics({positions:a.polyline.positions._value,maximumHeights:s,minimumHeights:l,outline:d.outline,fill:d.fill,material:d.material,outlineColor:d.outlineColor,outlineWidth:d.outlineWidth,shadows:d.shadows,distanceDisplayCondition:r}),"material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue+";outlineColor:"+255*d.outlineColor.red+","+255*d.outlineColor.green+","+255*d.outlineColor.blue);p.Legend.push(s),a.polyline=void 0,m&&(a.availability=m)}u||p.setVisibility(!1),"function"==typeof h&&h(e)}),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+d.id),{id:d.id,name:e,checked:u,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:d,treeData:{name:e,geoOptions:t,styleOption:c,GroupID:i,checked:u,disFnc:h}});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},w.prototype.createterrainProvider=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.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},c=(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<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=this._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),this._core.isnull(s)||this._core.isnull(s.outlineColor)||"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(this._core.isHtmlColor(s.outlineColor)?s.outlineColor=this._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=this._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=this._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),s.checked=o,this._core.extend(r,s,!0)),r=(null==t&&console.log("geojson is required"),null),r=t.then?t:this._cesium.GeoJsonDataSource.load(t),u=(this._viewer.dataSources.add(r),this),r=(r.then(function(e){var t=(u.item=e).entities.values,i=(u._core.isnull(s.near)&&(s.near=0),u._core.isnull(s.far)&&(s.far=999999999),parseFloat(s.near)),o=parseFloat(s.far),r=new u._cesium.DistanceDisplayCondition(i,o);c.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){var a=t[n],a=(c.height=parseFloat(u._core.extendgl(a,s.height,c.height)),c.extrudedHeight=parseFloat(u._core.extendgl(a,s.extrudedHeight,c.extrudedHeight)),c.heightReference=u._core.extendgl(a,s.heightReference,c.heightReference),c.show=u._core.extendgl(a,s.show,c.show),c.fill=u._core.extendgl(a,s.fill,c.fill),c.material=u._core.extendgl(a,s.material,c.material),c.outline=u._core.extendgl(a,s.outline,c.outline),c.outlineColor=u._core.extendgl(a,s.outlineColor,c.outlineColor),c.outlineWidth=parseFloat(u._core.extendgl(a,s.outlineWidth,c.outlineWidth)),c.stRotation=parseInt(u._core.extendgl(a,s.stRotation,c.stRotation)),c.granularity=u._core.extendgl(a,s.granularity,c.granularity),c.shadows=u._core.extendgl(a,s.shadows,c.shadows),a.polygon.height=c.height,a.polygon.extrudedHeight=c.extrudedHeight,a.polygon.heightReference=c.heightReference,a.polygon.show=c.show,a.polygon.fill=c.fill,a.polygon.material=c.material,a.polygon.outline=c.outline,a.polygon.outlineColor=c.outlineColor,a.polygon.outlineWidth=c.outlineWidth,a.polygon.stRotation=c.stRotation,a.polygon.granularity=c.granularity,a.polygon.distanceDisplayCondition=r,a.polygon.perPositionHeight=c.perPositionHeight,a.polygon.closeTop=c.closeTop,a.polygon.closeBottom=c.closeBottom,a.polygon.shadows=c.shadows,"material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue);u.Legend.push(a)}"function"==typeof l&&l(e),s.checked||u.setVisibility(!1)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id),{id:c.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:c,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:o,disFnc:l}});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},w.prototype.createPrimitivePolygon=async function(t,i){let e;var o=i.clampToGround?Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT:Cesium.VertexFormat.POSITION_AND_NORMAL,o=(e="bulidingWall"===t?new Cesium.CorridorGeometry({positions:i.positions,width:i.bulidingWallWidth||.8,height:i.height,extrudedHeight:i.extrudedHeight,vertexFormat:o,cornerType:Cesium.CornerType.MITERED}):new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(i.positions,i.holes),height:i.height,extrudedHeight:i.extrudedHeight,vertexFormat:o,perPositionHeight:!1}),new Cesium.GeometryInstance({id:i.prop,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(i.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near,i.far)}}));if("mask"===t)this.primitivePolygon=new Cesium.GroundPrimitive({geometryInstances:o,appearance:new Cesium.PerInstanceColorAppearance({translucent:i.material.alpha<1}),classificationType:i.classificationType}),this._viewer.scene.primitives.add(this.primitivePolygon);else{this.primitivePolygon||(this.primitivePolygon=new Cesium.PrimitiveCollection,this._viewer.scene.primitives.add(this.primitivePolygon));let e=i.clampToGround?Cesium.GroundPrimitive:Cesium.Primitive;t=new e({geometryInstances:o,appearance:new Cesium.PerInstanceColorAppearance({translucent:i.material.alpha<1}),classificationType:i.classificationType});this.primitivePolygon.add(t)}},w.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,l={},i,o,r){var c,u={height:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,classificationType:this._cesium.ClassificationType.BOTH,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,disableDepthTestDistance:1/0,near:0,mask:!1},n=(l.material&&"string"==typeof l.material&&-1===l.material.indexOf("[")&&(l.material=Cesium.Color.fromCssColorString(l.material)),l.fillColor&&"string"==typeof l.fillColor&&-1===l.fillColor.indexOf("[")&&(l.fillColor=Cesium.Color.fromCssColorString(l.fillColor)),l.outlineColor&&"string"==typeof l.outlineColor&&-1===l.outlineColor.indexOf("[")&&(l.outlineColor=Cesium.Color.fromCssColorString(l.outlineColor)),l.labelOutlineColor&&"string"==typeof l.labelOutlineColor&&-1===l.labelOutlineColor.indexOf("[")&&(l.labelOutlineColor=Cesium.Color.fromCssColorString(l.labelOutlineColor)),l.checked=o,null==t&&console.log("geojson is required"),null),n=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0}),h=(this._viewer.dataSources.add(n),this),n=(l&&l.time&&(c=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:l.time.start?h._cesium.JulianDate.fromDate(new Date(l.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?h._cesium.JulianDate.fromDate(new Date(l.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})])),this.option=l,this.loadGeosjonData=()=>{l=this.option;var i=this.item.entities.values;let o=this._core.extend(u,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<i.length;t++){let e=i[t];o.height=parseFloat(h._core.extendgl(e,l.height,o.height)),o.extrudedHeight=h._core.extendgl(e,l.extrudedHeight,o.extrudedHeight),o.extrudedHeight=o.height+o.extrudedHeight,o.heightReference=h._core.extendgl(e,l.heightReference,o.heightReference),o.show=h._core.extendgl(e,l.show,o.show),o.fill=h._core.extendgl(e,l.fill,o.fill),o.material=h._core.extendgl(e,l.material,o.material),void 0!==o.extrudedHeight&&(o.extrudedHeight=parseFloat(o.extrudedHeight)),o.outline=h._core.extendgl(e,l.outline,o.outline),o.outlineColor=h._core.extendgl(e,l.outlineColor,o.outlineColor),o.outlineWidth=parseFloat(h._core.extendgl(e,l.outlineWidth,o.outlineWidth)),o.stRotation=h._core.extendgl(e,l.stRotation,o.stRotation),o.granularity=h._core.extendgl(e,l.granularity,o.granularity),o.distanceDisplayCondition=h._core.extendgl(e,l.distanceDisplayCondition,o.distanceDisplayCondition),o.perPositionHeight=h._core.extendgl(e,l.perPositionHeight,o.perPositionHeight),o.closeTop=h._core.extendgl(e,l.closeTop,o.closeTop),o.closeBottom=h._core.extendgl(e,l.closeBottom,o.closeBottom),o.shadows=h._core.extendgl(e,l.shadows,o.shadows),o.classificationType=h._core.extendgl(e,l.classificationType,o.classificationType),o.text=h._core.extendgl(e,l.text,o.text),o.clampToGround&&o.mask?(e.polygon.show=!1,n.push(e.polygon.hierarchy.getValue()),t===i.length-1&&h.createPrimitivePolygon("mask",{positions:Cesium.Cartesian3.fromDegreesArray([30,0,30,80,179,80,179,0]),holes:n,...o})):(e.polygon.defaultHierarchy&&(e.polygon.hierarchy=e.polygon.defaultHierarchy),e.polygon.show=!0,e.polygon.extrudedHeightReference=o.extrudedHeightReference,e.polygon.heightReference=o.heightReference,1!=o.heightReference&&(e.polygon.height=o.height,o.height&&(e.polygon.perPositionHeight=!1)),1!=o.extrudedHeightReference&&(e.polygon.extrudedHeight=o.extrudedHeight),o.clampToGround&&(e.polygon.height=void 0,e.polygon.heightReference=1,e.polygon.extrudedHeight=void 0,e.polygon.perPositionHeight=!1),e.polygon.show=o.show,e.polygon.fill=o.fill,e.polygon.material=o.material,e.polygon.outline=o.outline,e.polygon.outlineColor=o.outlineColor,e.polygon.outlineWidth=o.outlineWidth,e.polygon.stRotation=o.stRotation,e.polygon.granularity=o.granularity,e.polygon.distanceDisplayCondition=r,e.polygon.closeTop=o.closeTop,e.polygon.closeBottom=o.closeBottom,e.polygon.shadows=o.shadows,e.polygon.classificationType=o.classificationType,o.bulidingWall&&(e.polygon.show=!1,a=e.polygon.hierarchy.getValue().positions,h.createPrimitivePolygon("bulidingWall",{positions:a,...o}),t===i.length-1?(h.item.boundingSphere=Cesium.BoundingSphere.fromPoints(h.item.boundingPointsArr),h.item.boundingPointsArr=null):(h.item.boundingPointsArr||(h.item.boundingPointsArr=[]),h.item.boundingPointsArr.push(a[0])))),o.clampToGround&&o.outline?e.polyline={positions:e.polygon.hierarchy.getValue().positions,material:o.outlineColor,width:o.outlineWidth,classificationType:o.classificationType,clampToGround:!0,distanceDisplayCondition:r,zIndex:1}:e.polyline=void 0,o.text?(a=h._core.getCenterOfMass(e.polygon.hierarchy.getValue().positions),e.position=Cesium.Cartesian3.fromDegrees(a[0],a[1],a[2]),void 0!==o.pointHeight&&(e.position=Cesium.Cartesian3.fromDegrees(a[0],a[1],o.pointHeight)),e.label={text:o.text,font:o.font,style:Cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:o.fillColor||o.material,outlineColor:o.labelOutlineColor||o.outlineColor,outlineWidth:o.labelOutlineWidth||0,pixelOffset:o.pixelOffset,disableDepthTestDistance:h._core.defaultValue(o.disableDepthTestDistance,1/0),distanceDisplayCondition:o.labelNearFar}):e.label=void 0;var a,s="material:"+255*o.material.red+","+255*o.material.green+","+255*o.material.blue+";outlineColor:"+255*o.outlineColor.red+","+255*o.outlineColor.green+","+255*o.outlineColor.blue;h.Legend.push(s),c&&(e.availability=c)}},n.then(function(e){h.item=e,h.loadGeosjonData(),l.checked?h.isShow=!0:h.setVisibility(!1),"function"==typeof r&&r(e)}),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),{id:l.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:l,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:r}});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),this},w.prototype.createGeoJsonDataSource=function(e,t,i,o,r){var t=this._cesium.GeoJsonDataSource.load(t,i),n=(this._viewer.dataSources.add(t),this);return t.then(function(e){n.item=e,"function"==typeof r&&r(e)}),this._tree.insertGroupId({id:this._core.getuid(),name:e,pId:this._core.isnull(o)?0:o,type:"layer",item:this},this._core.isnull(o)?0:o),this},w.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item),this._viewer.scene.primitives.remove(this.item),this.item=null,this.primitivePolygon&&this._viewer.scene.primitives.remove(this.primitivePolygon),this.primitivePolygon=null},w.prototype.getLevel=function(){var e,t=this._viewer.camera;return t&&t.positionCartographic&&t.positionCartographic.height?(e=(e=this._viewer.scene.globe.getHeight(t.positionCartographic))||0,t=t.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(t/91610.74,7096758e-11))-40467.74)):0},w.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t},treeData:this.treeobj.treeData}},w.prototype.setVisibility=function(e){this.isShow=e,null!=this.item&&(this.item.show=e),this.primitivePolygon&&(this.primitivePolygon.show=e)},w.prototype.getVisibility=function(){return this.item.show},w.prototype.getProperties=function(){var e=[];if(this.item.entities.values){var t=this.item.entities.values[0];if(t.properties)for(var i=0;i<t.properties.propertyNames.length;i++)e.push({value:"["+t.properties.propertyNames[i]+"]",label:t.properties.propertyNames[i]})}return e},w.prototype.getTypes=function(){var e;if(this.item.entities.values)return e=this.item.entities.values[0],/^point.fid/.test(e._id)||null!=e.point?[{label:"文本标签",value:"labelLayer"},{label:"图片标签",value:"billboardLayer"},{label:"点标签",value:"pointLayer"},{label:"模型",value:"modelLayer"},{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"}]:void 0},w.prototype.saveDefaultGeosjonData=function(){this.defaultVectorData=this._core.extend({},this.option,!0)},w.prototype.restoreGeosjon=function(){this.defaultVectorData&&(this.option=this.defaultVectorData,this.loadGeosjonData()),this.defaultVectorData=void 0},w.prototype.updataGeosjon=function(e={}){(e.material||e.color||e.fillColor||e.labelOutlineColor||e.outlineColor||e.backgroundColor||e.gapColor)&&(e.color&&(e.color=Cesium.Color.fromCssColorString(e.color)),e.material&&(e.material=Cesium.Color.fromCssColorString(e.material)),e.fillColor&&(e.fillColor=Cesium.Color.fromCssColorString(e.fillColor)),e.outlineColor&&(e.outlineColor=Cesium.Color.fromCssColorString(e.outlineColor)),e.labelOutlineColor&&(e.labelOutlineColor=Cesium.Color.fromCssColorString(e.labelOutlineColor)),e.backgroundColor&&(e.backgroundColor=Cesium.Color.fromCssColorString(e.backgroundColor)),e.gapColor&&(e.gapColor=Cesium.Color.fromCssColorString(e.gapColor))),this.option=this._core.extend(this.option,e,!0),this.item&&(clearTimeout(this.updataGeojsonTime),this.updataVectorTime=setTimeout(()=>{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:C.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.fillColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.backgroundColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelBackground:{set:C.debounce(function(e){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},labelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0:void 0}},labelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},labelShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.show:void 0}},pointColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},pointDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0:void 0}},pointHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},modelShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.uri;if(e)return e._value}}},modelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0:void 0}},modelColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},billboardShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.image;if(e)return e._value}}},billboardScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},billboardDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0:void 0}},billboardPHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},polylineShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(/^line.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline&&(t[i].polyline.show=e)},500),get:function(){var e=this.item.entities.values;return(/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline?e[0].polyline.b:void 0}},polylineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.width=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.width;if(e)return e._value}}},polylinemMterial:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.material=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.material;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},polylinemArcType:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=0;i<t.length;i++)t[i].polyline.arcType=e}},500),get:function(){var e=this.item.entities.values;if((/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline){e=e[0].polyline.arcType;if(e)return e._value}}},polylineDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;return(/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline?e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},polylineDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^line.fid/.test(t[0]._id)||null!=t[0].polyline)&&t&&0<t.length&&t[0].polyline)for(var i=t[0].polyline.distanceDisplayCondition?t[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;return(/^line.fid/.test(e[0]._id)||null!=e[0].polyline)&&e&&0<e.length&&e[0].polyline?e[0].polyline.distanceDisplayCondition?e[0].polyline.distanceDisplayCondition._value.near:0:void 0}},polygonShow:{set:C.debounce(function(e){var t=this.item.entities.values;if(/^polygon.fid/.test(t[0]._id)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon&&(t[i].polygon.show=e)},500),get:function(){var e=this.item.entities.values;return(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon?e[0].polygon.b:void 0}},polygonHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.height=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.height;if(e)return e._value}}},polygonHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.heightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.heightReference;if(e)return e._value}}},polygonExtrudedHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.extrudedHeight=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.extrudedHeight;if(e)return e._value}}},polygonExtrudedHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.extrudedHeightReference=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.extrudedHeightReference;if(e)return e._value}}},polygonFill:{set:C.debounce(function(e){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.fill=e},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.fill;if(e)return e._value}}},polygonMaterial:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.material=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.material;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},polygonOutline:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outline=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.outline;if(e)return e._value}}},polygonOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)t[i].polygon.outlineColor=e}},500),get:function(){var e=this.item.entities.values;return(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon?(e=e[0].polygon.outlineColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},polygonOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].polygon.outlineWidth=e}},500),get:function(){var e=this.item.entities.values;if((/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon){e=e[0].polygon.outlineWidth;if(e)return e._value}}},polygonDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities.values;return(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon?e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},polygonDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities.values;if((/^polygon.fid/.test(t[0]._id)||null!=t[0].polygon)&&t&&0<t.length&&t[0].polygon)for(var i=t[0].polygon.distanceDisplayCondition?t[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities.values;return(/^polygon.fid/.test(e[0]._id)||null!=e[0].polygon)&&e&&0<e.length&&e[0].polygon?e[0].polygon.distanceDisplayCondition?e[0].polygon.distanceDisplayCondition._value.near:0:void 0}}}),T.prototype.update=function(o){if(this._quadtree.beginFrame(o),this._quadtree.render(o),this._quadtree.endFrame(o),this._availability&&(this._state=this.isAvailable(o.time)),this._state&&this._client&&this._quadtree._tilesToRender)for(let e=0,t=this._quadtree._tilesToRender.length,i;e<t;e++)!(i=this._quadtree._tilesToRender[e]).data||!i.data.geometryPrimitive||i.data.geometryPrimitive instanceof Cesium.Cesium3DTileset||i.data.geometryPrimitive.update&&i.data.geometryPrimitive.update(o)},T.prototype.static=function(e){this.cs=e},T.prototype.initialize=function(e){},T.prototype.beginUpdate=function(e){},T.prototype.endUpdate=function(e){},T.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},T.prototype.loadTile=function(e,t){},T.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;o=e.data;if(o.tileBoundingRegion,void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var r=t.cullingVolume,n=o.orientedBoundingBox;!n&&o.renderedMesh&&(n=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;a=e.rectangle,(s=this.cartographicLimitRectangle).west<s.east||(s=Rectangle.clone(s,splitCartographicLimitRectangleScratch),0<Rectangle.center(a,rectangleCenterScratch).longitude?s.east=CesiumMath.PI:s.west=-CesiumMath.PI);var a=s,s=new Cesium.Rectangle,a=Cesium.Rectangle.simpleIntersection(a,e.rectangle,s);if(!a)return Visibility.NONE;if(Cesium.Rectangle.equals(a,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!n)return Cesium.Intersect.INTERSECTING;s=this._clippingPlanes;if(s&&s.enabled){a=s.computeIntersectionWithBoundingVolume(n);if(e.isClipped=a!==Intersect.INSIDE,a===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}s=r.computeVisibility(n);return s!==Cesium.Intersect.OUTSIDE&&(e=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum,t.mode!==Cesium.SceneMode.SCENE3D||e||!i||!(a=o.occludeePointInScaledSpace)||i.ellipsoid.isScaledSpacePointVisible(a))?s:Cesium.Visibility.NONE},T.prototype.canRefine=function(e,t,i){return e.level<=this._normalTile+1},T.prototype.showTileThisFrame=function(e,t,i,o){this._availability&&(this._state=this.isAvailable(t.time))},T.prototype.computeDistanceToTile=function(e,t){u=this._maximumHeight,n=this._minimumHeight,s=e,this.terrainProvider,void 0===(r=s.data)&&(r=s.data=new Cesium.GlobeSurfaceTile),s._minimumHeight&&(n=s._minimumHeight),s._maximumHeight&&(u=s._maximumHeight),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:s.rectangle,ellipsoid:s.tilingScheme.ellipsoid,minimumHeight:n||0,maximumHeight:u||0}));var i,o,r=e.data,n=r.tileBoundingRegion;if(void 0===s)return 9999999999;r.boundingVolumeSourceTile!==s&&(r.boundingVolumeSourceTile=s,(u=e.rectangle)&&u.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(r.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=(s=this,u=r.orientedBoundingBox.center,l=e.rectangle,c=n.maximumHeight,i=r.occludeePointInScaledSpace,a=(s=s.quadtree._occluders.ellipsoid).ellipsoid,o=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,c,a,o[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,c,a,o[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,c,a,o[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,c,a,o[3]),s.computeHorizonCullingPoint(u,o,i))));var a,s,l=n.minimumHeight,c=n.maximumHeight,u=(r.boundingVolumeSourceTile!==e&&(a=t.camera.positionCartographic.height,s=Math.abs(a-l),Math.abs(a-c)<s?(n.minimumHeight=l,n.maximumHeight=l):(n.minimumHeight=c,n.maximumHeight=c)),n.distanceToCamera(t));return n.minimumHeight=l,n.maximumHeight=c,u},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return Cesium.destroyObject(this)},T.prototype.remove=function(){this.destroy()},T.prototype.setStatus=function(e){this._state=e,this._client=e},T.prototype.edit=function(e,r){let c=this,u=this._viewer;if(r=r||{},this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),e=void 0===e?!0:e){var h,m,d,p;this.editHandler=new this._cesium.ScreenSpaceEventHandler(u.scene.canvas),this.isEditting=!1;let n;return this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(a(),c.defaultEvent(!1));else{var i=t.position,o=u.scene.pick(i);if((!o||!o.id||o.id.treeID===c.treeID)&&o&&o.id&&(o.id instanceof Cesium.Entity||o.id.VectorType)){let e=o.id;c.isEditting||0!=V.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||(u.container.style.cursor="crosshair",c.defaultEvent(!1),"_height_point"==e.name?(d={windowPosition:i,originHeight:c._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?(c.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=c.createEditEntity(p,e.VectorStyle)).feature=e,h.treeID=c.treeID,c.getSimpleGraphicData(p,h),"point"===p||"billboard"===p||"label"===p||"model"===p?(c.isEditting=!0,c.tooltip.showAt(t.position,"拖拽修改位置")):(c.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(c.treeID)),c.setStatus(!1),V.editVector=!0)}}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))c.isEditting&&(a(),c.defaultEvent(!1));else{var r=u.scene.pick(t.endPosition);if((!r||!r.id||r.id.treeID===c.treeID)&&(c._cesium.defined(r)?c.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<h.pottingPoint.length||"polygon"===p&&3<h.pottingPoint.length?c.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):c.tooltip.showAt(t.endPosition,"拖拽修改位置"):!r.id||"_move_point"!==r.id.name&&"_size_point"!==r.id.name?r.id&&"_add_point"===r.id.name?c.tooltip.showAt(t.endPosition,"拖拽增加节点"):r.id&&"_height_point"===r.id.name?c.tooltip.showAt(t.endPosition,"拖拽修改高度"):r.id==h&&c.tooltip.show(!1):c.tooltip.showAt(t.endPosition,"拖拽修改位置"):c.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除"):c.isEditting||0!==V.states||(r.id&&r.id.VectorType?c.tooltip.showAt(t.endPosition,"点击激活编辑"):c.tooltip.show(!1)):0!=V.states||m||c.tooltip.show(!1),c.isEditting&&m)){c.tooltip.showAt(t.endPosition,"释放后完成修改");let i=c._getPosition.getMousePosition(t);if(i||"_height_point"===n)if("_edit_point"===n){m.position=i;r=V.editPointID.edit.indexOf(m.id);if(void 0!==h[p].height?(l=c.toDegrees(i),h.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(l.lon,l.lat,h[p].height.getValue()),m.position=h.pottingPoint[r]):h.pottingPoint[r]=i,0<V.editPointID.add.length){if(0<r){let i=u.entities.getById(V.editPointID.add[r-1]);if(i){let e=u.entities.getById(V.editPointID.edit[r-1]),t=u.entities.getById(V.editPointID.edit[r]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(r<h.pottingPoint.length-1){let i=u.entities.getById(V.editPointID.add[r]);if(i){let e=u.entities.getById(V.editPointID.edit[r]),t=u.entities.getById(V.editPointID.edit[r+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===p&&(0===r||r===h.pottingPoint.length-1)){let i=u.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);if(i){let e=u.entities.getById(V.editPointID.edit[0]),t=u.entities.getById(V.editPointID.edit[h.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=h.pottingPoint.concat([]),t=new c._cesium.Cartesian3;var l=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=l,t.y/=l,t.z/=l,V.editPointID.move&&(V.editPointID.move.position=t),"polyline"!==p&&"polygon"!==p&&"rectangle"!==p||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("_height_point"===n){r=V.editPointID.height.indexOf(m.id);let e=u.entities.getById(V.editPointID.edit[r]),i=("ellipse"!==p&&"cylinder"!==p&&"box"!==p||(e=V.editPointID.move),c.toDegrees(e.position.getValue()));l=d.originHeight-i.height,r=u.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);V.editPointID.height.forEach(e=>{let t=u.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))}),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=V.editPointID.add.indexOf(m.id),l=(u.entities.remove(m),u.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=(V.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=u.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=u.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=(V.editPointID.add.splice(r,1,t.id,e.id),SmartEarthPopupData.editGraphic.setTreeID(c.treeID),m=l,n="_edit_point",h.pottingPoint.concat([]));"polyline"!==p&&"polygon"!==p||SmartEarthPopupData.editGraphic.setValue("positions",r)}else if("_size_point"===n){t=V.editPointID.move.position.getValue(),e=c._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=c.toDegrees(i),t=(d=m.position.getValue(),c.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=c.toDegrees(i).height,h[p].height=l,h.thisHeight=l),h.pottingPoint.forEach((e,t)=>{let i,o,r=u.entities.getById(V.editPointID.edit[t]);if(r=r||u.entities.getById(V.editPointID.size[t]),i=r?c.toDegrees(r.position.getValue()):c.toDegrees(e),o=c._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<V.editPointID.add.length&&V.editPointID.add[t]){let e=u.entities.getById(V.editPointID.add[t]);e&&(i=c.toDegrees(e.position.getValue()),e.position=c._cesium.Cartesian3.fromDegrees(i.lon+n,i.lat+a,i.height+s))}});e=h.pottingPoint.concat([]);"polyline"===p||"polygon"===p||"rectangle"===p?SmartEarthPopupData.editGraphic.setValue("positions",e):"ellipse"===p?(h.pottingPoint[1]=i,h.position=i.clone()):"box"===p?(h.pottingPoint[2]=i,r=h.box.dimensions.getValue(),t=c.toDegrees(i),h.position=Cesium.Cartesian3.fromDegrees(t.lon,t.lat,t.height+r.z/2)):"cylinder"===p?(h.pottingPoint[1]=i,l=h.cylinder.length.getValue(),e=c.toDegrees(h.pottingPoint[1]),h.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height+l/2)):"ellipsoid"===p&&(h.pottingPoint[h.pottingPoint.length-1]=i,h.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?c.isEditting&&(a(),c.defaultEvent(!1)):(m&&"model"===m.VectorType&&(m.show=!0),m&&r.callBack&&r.callBack.updata&&r.callBack.updata(m.name,h),u.container.style.cursor="default",m=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&&(a(),c.defaultEvent(!1));else{e=u.scene.pick(e.position);if((!e||!e.id||e.id.treeID===c.treeID)&&c._cesium.defined(e)&&0==V.states){e=e.id;if(!e.VectorType&&-1<V.editPointID.edit.indexOf(e.id)&&("polyline"===p&&2<V.editPointID.edit.length||"polygon"===p&&3<V.editPointID.edit.length)){var i=V.editPointID.edit.indexOf(e.id);if(u.entities.removeById(e.id),V.editPointID.edit.splice(i,1),h.pottingPoint.splice(i,1),0<V.editPointID.add.length)if(V.editPointID.add[i]){if(u.entities.removeById(V.editPointID.add[i]),V.editPointID.add.splice(i,1),0<=i-1){let e=u.entities.getById(V.editPointID.add[i-1]);e&&(e.position=Cesium.Cartesian3.midpoint(h.pottingPoint[i-1],h.pottingPoint[i===h.pottingPoint.length?0:i],new Cesium.Cartesian3))}else if(i-1==-1&&"polygon"===p){let e=u.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(h.pottingPoint[0],h.pottingPoint[h.pottingPoint.length-1],new Cesium.Cartesian3))}}else u.entities.removeById(V.editPointID.add[i-1]),V.editPointID.add.pop();let t=new c._cesium.Cartesian3;e=h.pottingPoint.length,i=(h.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,V.editPointID.move&&(V.editPointID.move.position=t),h.pottingPoint.concat([]));"polyline"!==p&&"polygon"!==p||SmartEarthPopupData.editGraphic.setValue("positions",i),c.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(){c.defaultEvent(!0),V.editPointID.edit.forEach(e=>{u.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{u.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{u.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{u.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&u.entities.remove(V.editPointID.move),V.editPointID.move=void 0,h&&u.entities.remove(h),p=h=void 0,SmartEarthPopupData.editGraphic={},c.isEditting=!1,c.setStatus(!0),V.editVector=!1,c.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;
                    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) }
    }, v.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 }, v.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 }, v.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 } }, v.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 < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1)t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: e, graphic: n[e], getValue: function (e) { return "position" === e || "name" === e || "id" === e ? this.entity[e] && (this.entity[e].getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this.graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this.graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[e].getValue() : this.graphic.material[e]) : this.graphic[e] && (this.graphic[e].getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue("position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian(e).height) : void 0 }, changeHeightPoint: function (i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { 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 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { 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 < V.editPointID.size.length && V.editPointID.size.forEach(e => { 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 < V.editPointID.add.length && V.editPointID.add.forEach(e => { 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 = V.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 () { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID.move), V.editPointID.move = void 0 }, setTreeID: function (i) { V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.move && (V.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) { "name" === e ? this.entity[e] = t : "color" === e || "outlineColor" === e ? (t = Cesium.Color.fromCssColorString(t), 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() } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(i.id) } } }) : "polygon" === 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, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void (this.graphic.material.color = i) } else { if ("image" === e || "repeat" === e) return void (this.graphic.material[e] = i); if ("alpha" === e) return void (this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void (this.graphic.outlineColor._value.alpha = i); if ("positions" === e) return void (this.graphic.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(i) }, !1)); if ("hierarchy" === e) return void (this.graphic.hierarchy = new Cesium.CallbackProperty(function () { return i }, !1)); function t(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t.forEach((e, t) => { let i = s.entities.getById(V.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 < V.editPointID.add.length && V.editPointID.add.forEach(e => { 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() } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(i.id) } var e = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), e = s.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, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(e.id) } }) : "ellipse" === e || "cylinder" === e || n.isSphere ? ((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, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void (this.graphic.material.color = i) } else { if ("image" === e || "repeat" === e) return void (this.graphic.material[e] = i); if ("alpha" === e) return void (this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void (this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("semiMinorAxis" === e) return void (this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radii" === e) return void (this.graphic.radii = new Cesium.CallbackProperty(function () { return i }, !1)); if ("topRadius" === e) return void (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("bottomRadius" === e) return void (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material.image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function () { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint.length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void (t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t.position.getValue()), t.position = a._cesium.Cartesian3.fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium.Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this.changeHeightPoint(o.height + i); function t(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.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function () { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function () { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic.semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic.semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout(() => { 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, V.editPointID.size.push(e.id), V.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() } }); V.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, V.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 = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.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, V.editPointID.size.push(e.id), V.editPointID.size.push(t.id), V.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) { "name" === e ? this.entity[e] = t : "color" === e ? (t = Cesium.Color.fromCssColorString(t), 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() } }); V.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, V.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 < t.length - 1; e++) { var r = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), r = s.entities.add({ name: "_add_point", position: r, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(r.id) } } }) }, Ii.prototype.createBillboardPointGeoJsonFeatureLayer = function (e, t, l, i, c) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), u = this, o = (o.then(function (e) { for (var t = { show: !0, position: u._cesium.Cartesian3.ZERO, pixelOffset: u._cesium.Cartesian2.ZERO, eyeOffset: u._cesium.Cartesian3.ZERO, heightReference: u._cesium.HeightReference.NONE, horizontalOrigin: u._cesium.HorizontalOrigin.CENTER, verticalOrigin: u._cesium.VerticalOrigin.CENTER, scale: 1, image: "", imageSubRegion: void 0, color: u._cesium.Color.WHITE, id: void 0, rotation: 0, alignedAxis: u._cesium.Cartesian3.ZERO, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, i = (u._core.isnull(l) || u._core.isnull(l.color) || /^\[/.test(l.color) && "[" == l.color.charAt(0) && "]" == l.color.charAt(l.color.length - 1) || (u._core.isHtmlColor(l.color) ? l.color = u._color.colorFromHtmlColor(l.color) : (/^rgb/.test(l.color) && (l.color = u._color.rgbaStringToRgbaObj(l.color)), 1 < l.color.r && (l.color.r = l.color.r / 255), 1 < l.color.g && (l.color.g = l.color.g / 255), 1 < l.color.b && (l.color.b = l.color.b / 255), 1 < l.color.a && (l.color.a = l.color.a / 255), l.color = u._color.createColor(l.color.r, l.color.g, l.color.b, l.color.a))), u._core.extend(t, l, !0)), t = (u._core.isnull(l.near) && (l.near = 0), u._core.isnull(l.far) && (l.far = 999999999), parseFloat(l.near)), o = parseFloat(l.far), r = (new u._cesium.DistanceDisplayCondition(t, o), new u._cesium.BillboardCollection), n = e.entities.values, a = 0; a < n.length; a++) { var s = n[a]; i.position = s.position._value, r.add(i) } t = u._viewer.scene.primitives.add(r); "function" == typeof c && c(t) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "billboardLayer", item: this, url: t, style: options }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Ii.prototype.createBillboardGeoJsonFeatureLayerProvider = 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, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, s = new v(this._viewer, this._cesium, a), l = (this._Provider = s, this), s = (s._loadTile = function (e) { var t = { 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, width: void 0, height: void 0, scaleByDistance: void 0, translucencyByDistance: void 0, pixelOffsetScaleByDistance: void 0, sizeInMeters: !1, distanceDisplayCondition: void 0 }, i = (l._core.isnull(n) || l._core.isnull(n.color) || /^\[/.test(n.color) && "[" == n.color.charAt(0) && "]" == n.color.charAt(n.color.length - 1) || (l._core.isHtmlColor(n.color) ? n.color = l._color.colorFromHtmlColor(n.color) : (/^rgb/.test(n.color) && (n.color = l._color.rgbaStringToRgbaObj(n.color)), 1 < n.color.r && (n.color.r = n.color.r / 255), 1 < n.color.g && (n.color.g = n.color.g / 255), 1 < n.color.b && (n.color.b = n.color.b / 255), 1 < n.color.a && (n.color.a = n.color.a / 255), n.color = l._color.createColor(n.color.r, n.color.g, n.color.b, n.color.a))), l._core.extend(t, n, !0)), t = (l._core.isnull(n.near) && (n.near = 0), l._core.isnull(n.far) && (n.far = 999999999), parseFloat(n.near)), o = parseFloat(n.far), r = (new l._cesium.DistanceDisplayCondition(t, o), new l._cesium.BillboardCollection); return e.features.forEach(function (e) { var t; i.id = e, /^\[/.test(i.pointHeight) && /\]$/.test(i.pointHeight) ? (t = i.pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[t]), e.geometry.coordinates.push(t), i.position = l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]) : i.pointHeight ? (t = parseFloat(i.pointHeight), e.geometry.coordinates.push(t), i.position = l._cesium.Cartesian3.fromDegreesArrayHeights(e.geometry.coordinates)[0]) : i.position = l._cesium.Cartesian3.fromDegreesArray(e.geometry.coordinates)[0], i.id.treeID = n.id, i.id.VectorType = "billboard", i.id.VectorStyle = { position: i.position, pointHeight: t, 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 }, r.add(i) }), r }, n && n.time && (s.availability = new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({ start: n.time.start ? l._cesium.JulianDate.fromDate(new Date(n.time.start)) : l._cesium.Iso8601.MINIMUM_VALUE, stop: n.time.end ? l._cesium.JulianDate.fromDate(new Date(n.time.end)) : l._cesium.Iso8601.MAXIMUM_VALUE })])), this.item = s._primitiveCollection, s.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "imageLayer", item: this, url: a.url, style: n }); return this._Provider.treeID = n.id, this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Ii.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Ii.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) { } }, Ii.prototype.setVisibility = function (e) { this.item.show = e, this._Provider && this._Provider.setStatus(!e), e || this.item.removeAll() }, Ii.prototype.deleteObject = function () { if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++)this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, Ii.prototype.setTreeobj = function (e) { this.treeobj = e }, Ii.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, Ii.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }, Ai.prototype.changeBurr = function (e) { if (this.num = e, this.this_buff) switch (this.type) { case "point": this.setPointBuff(this.num); break; case "polyline": this.setPolylineBuff(this.num); break; case "polygon": this.setPolygonBuff(this.num) } }, Ai.prototype.DrawPoint = function (e, o) { this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.this_buff && this.this_buff.entity && this._viewer.entities.remove(this.this_buff.entity); var r = this._viewer, n = this._cesium; let t, a; return "number" == typeof e ? (t = e, a = {}) : "object" == typeof e && (a = e, t = a.radius), this.num = t || this.num, this.drawHandler = new n.ScreenSpaceEventHandler(r.scene.canvas), this.this_buff = { entity: null, buff: null }, this.type = "point", this.positions = [], this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this.drawHandler.setInputAction(function (e) { var t, i, e = this._getPosition.getMouseDegrees(e); e && (t = e.lon, i = e.lat, this.positions.push(t, i), this.this_buff.entity = r.entities.add({ name: "新建缓冲点", position: n.Cartesian3.fromDegrees(t, i), point: { pixelSize: 10, color: n.Color.YELLOW, outlineWidth: 3, outlineColor: n.Color.YELLOW.withAlpha(.4), heightReference: 1 } }), this.buffs.push(this.this_buff.entity), this.this_buff.entity = void 0, this.setPointBuff(this.num, a), o && "function" == typeof o && o(e), this.end && this.end()) }.bind(this), n.ScreenSpaceEventType.LEFT_CLICK), this.end = () => { 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 }, Ai.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)) }, Ai.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 => { 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), 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)), 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 }, Ai.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)) }, Ai.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), 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)), 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 }, Ai.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)) }, Ai.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 < o.length) { n.holes = []; for (let e = 1, t; e < o.length; e++)r = this.pointsToDegreesArray(o[e]), t = Cesium.Cartesian3.fromDegreesArray(r), n.holes.push(t) } return n }, Ai.prototype.pointsToDegreesArray = function (e) { let t = []; return e.map(e => { t.push(e[0]), t.push(e[1]) }), t }, Ai.prototype.degreesArrayToPoints = function (t) { let i = []; for (let e = 0; e < t.length - 1; e += 2)i.push([t[e], t[e + 1]]); return i }, Ai.prototype.addBufferPolyogn = function (e, t = {}) { let i, o; return i = e.positions, e.holes && (o = [], e.holes.forEach(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 } }) }, Ai.prototype.clearBuff = function () { var t = this._viewer; 0 < this.buffs.length && (this.buffs.forEach(function (e) { t.entities.remove(e) }), this.buffs.length = 0) }, w.prototype.createGeojsonFeatureLayer = function (e, t, i, o, r, s) { var n = t.url, a = t.maxLevel, l = t.minLevel, c = this._core.StyleContrastGeoJson(i, this._cesium), u = (null == n && console.log("geojson is required"), null), u = n.then ? n : this._cesium.GeoJsonDataSource.load(n), h = (this._viewer.dataSources.add(u), this), u = (!this.setNearAndFar && a && l && (this.setNearAndFar = !0, this.Level = 0, this._viewer.scene.preRender.addEventListener(function () { h.isShow && h.item && (h.Level = h.getLevel(), h.Level >= l && h.Level <= a && !h.item.show ? h.item.show = !0 : (h.Level < l || h.Level > a) && (h.item.show = !1)) })), u.then(function (e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n, a = t[i]; null != c.point && ((o = c.point).color = h._color.VectorColorTransformation(o.color, a), o.outlineColor = h._color.VectorColorTransformation(o.outlineColor, a), null != o.pointHeight && (a.position._value = h._core.setheight(a.position._value, o.pointHeight, h._cesium, h._viewer), delete o.pointHeight), a.point = new h._cesium.PointGraphics(o)), null != c.label && ((o = c.label).fillColor = h._color.VectorColorTransformation(o.fillColor, a), o.outlineColor = h._color.VectorColorTransformation(o.outlineColor, a), null != o.pointHeight && (a.position._value = h._core.setheight(a.position._value, o.pointHeight, h._cesium, h._viewer), delete o.pointHeight), a.label = new h._cesium.LabelGraphics(o)), null != c.billboard && ((r = c.billboard).color = h._color.VectorColorTransformation(r.color, a), null != r.pointHeight && (a.position._value = h._core.setheight(a.position._value, r.pointHeight, h._cesium, h._viewer), delete r.pointHeight), a.billboard = new h._cesium.BillboardGraphics(r)), null != c.polyline && ((r = c.polyline).material = h._color.VectorColorTransformation(r.material, a), r.positions = a.polyline.positions, null != r.pointHeight && (a.position._value = h._core.setpolylineheight(a.position._value, r.pointHeight, h._cesium, h._viewer), delete r.pointHeight), a.polyline = new h._cesium.PolylineGraphics(r)), null != c.polygon && ((n = c.polygon).hierarchy = a.polygon.hierarchy, n.material = h._color.VectorColorTransformation(n.material, a), n.outlineColor = h._color.VectorColorTransformation(n.outlineColor, a), n.outlineColor && (n.outline = !0), a.polygon = new h._cesium.PolygonGraphics(n)) } "function" == typeof s && s(e) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), r ? h.isShow = !0 : h.setVisibility(!1), { id: c.id, name: e, checked: r, pId: this._core.isnull(o) ? 0 : o, type: "datasource", item: this, url: n, style: c, treeData: { name: e, geoOptions: t, styleOption: i, GroupID: o, checked: r, disFnc: s } }); return this.setTreeobj(u), this._tree.insertGroupId(u, this._core.isnull(o) ? 0 : o), this }, w.prototype.createGeojsonKmlFeatureLayer = function (e, t, i, o, r) { var n = t, a = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = (this._viewer.dataSources.add(this._cesium.KmlDataSource.load(t, a)), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), o || this.setVisibility(!1), { id: a.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "datasource", item: this, url: n, style: a, treeData: { name: e, geoOptions: t, styleOption: "", GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), this }, w.prototype.createGeoJsonFeatureLayerAlawys = function (e, t, s, i, l) { var c, o = { id: this._core.getuid(), layertype: "", text: "", font: "16px", fillColor: this._cesium.WHITE, outlineColor: this._cesium.BLACK, outlineWidth: "1.0", scale: "1.0", maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, icon: "" }, u = (this._core.isnull(s) || this._core.isnull(s.fillColor) || "[" == s.fillColor.toString().charAt(0) && "]" == s.fillColor.toString().charAt(s.fillColor.length - 1) || (this._core.isHtmlColor(s.fillColor) ? s.fillColor = this._color.colorFromHtmlColor(s.fillColor) : s.fillColor = this._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a)), this._core.isnull(s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s.outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : s.outlineColor = this._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a)), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), h = (this._viewer.dataSources.add(o), this), o = (s && s.time && (c = new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: s.time.start ? h._cesium.JulianDate.fromDate(new Date(s.time.start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? h._cesium.JulianDate.fromDate(new Date(s.time.end)) : h._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o, r = t[i], n = (u.id = h._core.extendgl(r, s.id, u.id), u.text = h._core.extendgl(r, s.text, u.text), u.font = h._core.extendgl(r, s.font, u.font), u.fillColor = h._core.extendgl(r, s.fillColor, u.fillColor), u.outlineColor = h._core.extendgl(r, s.outlineColor, u.outlineColor), u.outlineWidth = parseInt(h._core.extendgl(r, s.outlineWidth, u.outlineWidth)), u.scale = parseFloat(h._core.extendgl(r, s.scale, u.scale)), u.image = h._core.extendgl(r, s.image, u.image), u.icon = h._core.extendgl(r, s.icon, u.icon), parseFloat(h._core.extendgl(r, u.minDistanceDisplay || u.near))), a = parseFloat(h._core.extendgl(r, u.maxDistanceDisplay || u.far)), n = new h._cesium.DistanceDisplayCondition(n, a); r.billboard && (u ? (h._core.isUrl(r.properties[u.icon]) || h._core.isUrl(u.icon)) && !h._core.isnull(r.properties[u.text]) || !h._core.isnull(u.text) ? (o = "fillColor:" + 255 * u.fillColor.red + "," + 255 * u.fillColor.green + "," + 255 * u.fillColor.blue + ";outlineColor:" + 255 * u.outlineColor.red + "," + 255 * u.outlineColor.green + "," + 255 * u.outlineColor.blue, h.Legend.push(o), r.label = { id: "my label", text: h._core.isnull(r.properties[u.text]) ? u.text : r.properties[u.text] + "", font: u.font + " sans-serif", fillColor: u.fillColor, outlineColor: u.outlineColor, outlineWidth: u.outlineWidth, scale: parseFloat(u.scale), distanceDisplayCondition: n }, r.billboard = { image: h._core.isUrl(r.properties[u.icon]) ? r.properties[u.icon] : u.icon, distanceDisplayCondition: n }) : h._core.isnull(u.icon) ? h._core.isnull(r.properties[u.text]) && h._core.isnull(u.text) ? (o = "color:" + 255 * u.fillColor.red + "," + 255 * u.fillColor.green + "," + 255 * u.fillColor.blue, h.Legend.push(o), r.billboard = void 0, r.point = new h._cesium.PointGraphics({ color: h._cesium.Color.RED, pixelSize: 10, distanceDisplayCondition: n })) : (r.billboard = void 0, o = "fillColor:" + 255 * u.fillColor.red + "," + 255 * u.fillColor.green + "," + 255 * u.fillColor.blue + ";outlineColor:" + 255 * u.outlineColor.red + "," + 255 * u.outlineColor.green + "," + 255 * u.outlineColor.blue, h.Legend.push(o), r.label = { id: "my label", text: h._core.isnull(r.properties[u.text]) ? u.text : r.properties[u.text] + "", font: u.font + " sans-serif", fillColor: u.fillColor, outlineColor: u.outlineColor, outlineWidth: u.outlineWidth, scale: parseFloat(u.scale), distanceDisplayCondition: n }) : r.billboard = { image: h._core.isUrl(r.properties[u.icon]) ? r.properties[u.icon] : u.icon, distanceDisplayCondition: n } : r.polygon ? r.polygon.distanceDisplayCondition = n : r.polyline && (r.polyline.distanceDisplayCondition = n), c && (r.availability = c)) } "function" == typeof l && l(e) }), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), { id: u.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: u, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: l } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createGeoJsonFeatureLayer = function (t, e, i, o, r, n) { var a = this._cesium.GeoJsonDataSource.load(e), s = this; return a.then(function (e) { e = e.entities.values[0]; /^point.fid/.test(e._id) || null != e.point ? s.createPointGeojsonFeatureLayer(t, a, i, o, r, n) : /^polygon.fid/.test(e._id) || null != e.polygon ? s.createPolygonGeoJsonFeatureLayer(t, a, i, o, r, n) : /^line.fid/.test(e._id) || null != e.polyline ? s.createPolylineGeoJsonFeatureLayer(t, a, i, o, r, n) : s.createGeoJsonFeatureLayerAlawys(t, a, i, o, n) }), this }, w.prototype.createPointGeojsonFeatureLayer = function (e, t, s, i, l = !0, c) { var u, o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), height: 0, pointHeight: 0, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, h = (this._core.isnull(s) || this._core.isnull(s.color) || "[" == s.color.toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (this._core.isHtmlColor(s.color) ? s.color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), this._core.isnull(s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s.outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = this._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = this._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), m = (this._viewer.dataSources.add(o), this), o = (s && s.time && (u = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (m.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (h.color = m._core.extendgl(o, s.color, h.color), h.pixelSize = parseInt(m._core.extendgl(o, s.pixelSize, h.pixelSize)), h.outlineColor = m._core.extendgl(o, s.outlineColor, h.outlineColor), h.outlineWidth = parseFloat(m._core.extendgl(o, s.outlineWidth, h.outlineWidth)), h.show = m._core.extendgl(o, s.show, h.show), h.height = parseFloat(m._core.extendgl(o, s.height, h.height)), h.scaleByDistance = m._core.extendgl(o, s.scaleByDistance, h.scaleByDistance), parseFloat(m._core.extendgl(o, h.minDistanceDisplay || h.near))), n = parseFloat(m._core.extendgl(o, h.maxDistanceDisplay || h.far)), r = new m._cesium.DistanceDisplayCondition(r, n), n = "color:" + 255 * h.color.red + "," + 255 * h.color.green + "," + 255 * h.color.blue + ";outlineColor:" + 255 * h.outlineColor.red + "," + 255 * h.outlineColor.green + "," + 255 * h.outlineColor.blue, n = (m.Legend.push(n), h.distanceDisplayCondition = r, h.pointHeight = m._core.extendgl(o, s.pointHeight, h.pointHeight), h.pointHeight = parseFloat(h.pointHeight), m._viewer.scene.globe.ellipsoid, m._cesium.Cartographic.fromCartesian(o.position._value)), r = m._cesium.Math.toDegrees(n.longitude), a = m._cesium.Math.toDegrees(n.latitude), n = h.pointHeight || n.height, r = new m._cesium.Cartesian3.fromDegrees(r, a, n), a = (o.position._value = r, o.point = new m._cesium.PointGraphics(h), o.billboard = void 0, { positions: r }); o.description = a, u && (o.availability = u) } l || m.setVisibility(!1), "function" == typeof c && c(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: h, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: l, disFnc: c } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createModelGeojsonFeatureLayer = function (e, t, m = {}, i, o, r) { var d = { color: m.color || "#ffffff", url: window.SmartEarthRootUrl + I.testModel, scale: 1, minimumPixelSize: 0, height: 0, far: 5e3, near: 0, type: "default" }, n = (null == t && console.log("geojson is required"), null), n = t.then ? t : this._cesium.GeoJsonDataSource.load(t), n = (m && m.time && new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: m.time.start ? this._cesium.JulianDate.fromDate(new Date(m.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: m.time.end ? this._cesium.JulianDate.fromDate(new Date(m.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })]), this.option = m, this.option.color = "string" == typeof d.color ? Cesium.Color.fromCssColorString(d.color) : d.colorF, this.loadGeosjonData = () => { 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, c = []; for (let e = 0, i; e < t.length; e++)if (i = t[e], "polylineVolume" === o.type) { let e = this._core.extendgl(i, "[flieName]"); e = "/" + e.replace("xpl2", "gltf"), n.get(o.url + e) || n.set(o.url + e, []), l = n.get(o.url + e); var u = new Cesium.Cartesian3(this._core.extendgl(i, "[scaleY]", 1), this._core.extendgl(i, "[scaleX]", 1), this._core.extendgl(i, "[scaleZ]", 1)), h = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.extendgl(i, "[Yaw]", 0)), Cesium.Math.toRadians(this._core.extendgl(i, "[Pitch]", 0)), Cesium.Math.toRadians(this._core.extendgl(i, "[Roll]", 0))), h = Cesium.Matrix3.fromHeadingPitchRoll(h); let t = this._core.toDegrees(i.position.getValue()); t.height = this._core.extendgl(i, "[Altitude]", 0), s = new Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height), c.push(s), a = Cesium.Transforms.eastNorthUpToFixedFrame(s), Cesium.Matrix4.multiplyByMatrix3(a, h, a), Cesium.Matrix4.multiplyByScale(a, u, a), Cesium.ModelInstanceCollection ? l.push({ modelMatrix: a, modelId: this._core.getEntityProp(i) }) : this.item.add(Cesium.Model.fromGltf({ id: this._core.getEntityProp(i), url: o.url + e, modelMatrix: a, color: o.color, distanceDisplayCondition: r })) } else { if (n.get(o.url) || (n.set(o.url, []), l = n.get(o.url)), void 0 !== o.height || void 0 !== o.pointHeight) { let e = this._core.toDegrees(i.position.getValue()); e.height = o.height || o.pointHeight, s = new Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), i.position = s } s = i.position.getValue(), c.push(s), a = Cesium.Transforms.eastNorthUpToFixedFrame(s); h = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.extendgl(i, o.heading, 0)), Cesium.Math.toRadians(this._core.extendgl(i, o.pitch, 0)), Cesium.Math.toRadians(this._core.extendgl(i, o.roll, 0))), u = Cesium.Matrix3.fromHeadingPitchRoll(h); Cesium.Matrix4.multiplyByMatrix3(a, u, a), "object" == typeof o.scale ? Cesium.Matrix4.multiplyByScale(a, o.scale, a) : Cesium.Matrix4.multiplyByUniformScale(a, o.scale, a), Cesium.ModelInstanceCollection ? l.push({ modelMatrix: a, modelId: this._core.getEntityProp(i) }) : this.item.add(Cesium.Model.fromGltf({ id: this._core.getEntityProp(i), url: o.url, modelMatrix: a, color: o.color, distanceDisplayCondition: r })) } this.item.boundingSphere = Cesium.BoundingSphere.fromPoints(c), Cesium.ModelInstanceCollection && n.forEach((e, t) => { 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 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = this._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || "(" == a.material.toString().charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core.isnull(a) || this._core.isnull(a.radius) || (o.semiMajorAxis = a.radius, o.semiMinorAxis = a.radius), (void 0)._core.isnull(a.near) && (a.near = 0), (void 0)._core.isnull(a.far) && (a.far = 999999999), this._core.extend(o, a, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), c = (this._viewer.dataSources.add(o), this), o = (o.then(function (e) { for (var t = (c.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (l.semiMajorAxis = parseFloat(c._core.extendgl(o, a.semiMajorAxis, l.semiMajorAxis)), l.semiMinorAxis = parseFloat(c._core.extendgl(o, a.semiMinorAxis, l.semiMinorAxis)), l.height = parseFloat(c._core.extendgl(o, a.height, l.height)), l.heightReference = c._core.extendgl(o, a.heightReference, l.heightReference), l.extrudedHeight = parseFloat(c._core.extendgl(o, a.extrudedHeight, l.extrudedHeight)), l.extrudedHeightReference = c._core.extendgl(o, a.extrudedHeightReference, l.extrudedHeightReference), l.show = c._core.extendgl(o, a.show, l.show), l.fill = c._core.extendgl(o, a.fill, l.fill), l.material = c._core.extendgl(o, a.material, l.material), l.outline = c._core.extendgl(o, a.outline, l.outline), l.outlineColor = c._core.extendgl(o, a.outlineColor, l.outlineColor), l.outlineWidth = parseFloat(c._core.extendgl(o, a.outlineWidth, l.outlineWidth)), l.scaleByDistance = c._core.extendgl(o, a.scaleByDistance, l.scaleByDistance), "material:" + 255 * l.material.red + "," + 255 * l.material.green + "," + 255 * l.material.blue + ";outlineColor:" + 255 * l.outlineColor.red + "," + 255 * l.outlineColor.green + "," + 255 * l.outlineColor.blue), r = (c.Legend.push(r), parseFloat(c._core.extendgl(o, l.near))), n = parseFloat(c._core.extendgl(o, l.far)), r = new c._cesium.DistanceDisplayCondition(r, n); l.distanceDisplayCondition = r, o.billboard = void 0, o.ellipse = new c._cesium.EllipseGraphics(l) } "function" == typeof s && s(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "layer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: !0, disFnc: s } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createModelPointGeoJsonFeatureLayer = function (e, t, s, i, l, c) { var u, o = { uri: "", show: !0, scale: 1, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, lightColor: void 0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), color: this._cesium.Color.WHITE, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, h = this, m = (this._core.isnull(s) || this._core.isnull(s.color) || (this._core.isHtmlColor(s.color) ? s.color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), h._core.isnull(s.near) && (s.near = 0), h._core.isnull(s.far) && (s.far = 999999999), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), o = (this._viewer.dataSources.add(o), s && s.time && (u = new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: s.time.start ? h._cesium.JulianDate.fromDate(new Date(s.time.start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? h._cesium.JulianDate.fromDate(new Date(s.time.end)) : h._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (h.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (m.uri = h._core.extendgl(o, s.uri, m.uri), m.scale = parseFloat(h._core.extendgl(o, s.scale, m.scale)), m.incrementallyLoadTextures = h._core.extendgl(o, s.incrementallyLoadTextures, m.incrementallyLoadTextures), m.runAnimations = h._core.extendgl(o, s.runAnimations, m.runAnimations), m.clampAnimations = h._core.extendgl(o, s.clampAnimations, m.clampAnimations), m.shadows = h._core.extendgl(o, s.shadows, m.shadows), m.heightReference = h._core.extendgl(o, s.heightReference, m.heightReference), m.lightColor = h._core.extendgl(o, s.lightColor, m.lightColor), m.scaleByDistance = h._core.extendgl(o, s.scaleByDistance, m.scaleByDistance), m.color = h._core.extendgl(o, s.color, m.color), m.height ? m.height = parseFloat(h._core.extendgl(o, s.height, m.height)) : m.height = void 0, parseFloat(h._core.extendgl(o, s.near, m.near))), n = parseFloat(h._core.extendgl(o, s.far, m.far)), a = "color:" + 255 * m.color.red + "," + 255 * m.color.green + "," + 255 * m.color.blue, a = (h.Legend.push(a), new h._cesium.DistanceDisplayCondition(r, n)); m.distanceDisplayCondition = a, o.billboard = void 0, o.model = new h._cesium.ModelGraphics(m), m.height && (r = h._cesium.Cartographic.fromCartesian(o.position._value), n = h._cesium.Math.toDegrees(r.longitude), a = h._cesium.Math.toDegrees(r.latitude), o.position = h._cesium.Cartesian3.fromDegrees(n, a, m.height)), u && (o.availability = u) } "function" == typeof c && c(e), l || h.setVisibility(!1) }), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), { id: m.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t, style: m, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: c } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createLabelPointGeoJsonFeatureLayer = function (s, e, l, t, i, o) { var c, u = { Name: "", text: "test", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), pointHeight: 0, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, addHeight: 0 }, h = this, r = (this._core.isnull(l) || this._core.isnull(l.fillColor) || (this._core.isHtmlColor(l.fillColor) ? l.fillColor = this._color.colorFromHtmlColor(l.fillColor) : (/^rgb/.test(l.fillColor) && (l.fillColor = this._color.rgbaStringToRgbaObj(l.fillColor)), 1 < l.fillColor.r && (l.fillColor.r = l.fillColor.r / 255), 1 < l.fillColor.g && (l.fillColor.g = l.fillColor.g / 255), 1 < l.fillColor.b && (l.fillColor.b = l.fillColor.b / 255), 1 < l.fillColor.a && (l.fillColor.a = l.fillColor.a / 255), l.fillColor = this._color.createColor(l.fillColor.r, l.fillColor.g, l.fillColor.b, l.fillColor.a))), this._core.isnull(l) || this._core.isnull(l.color) || (this._core.isHtmlColor(l.color) ? l.color = this._color.colorFromHtmlColor(l.color) : (/^rgb/.test(l.color) && (l.color = this._color.rgbaStringToRgbaObj(l.color)), 1 < l.color.r && (l.color.r = l.color.r / 255), 1 < l.color.g && (l.color.g = l.color.g / 255), 1 < l.color.b && (l.color.b = l.color.b / 255), 1 < l.color.a && (l.color.a = l.color.a / 255), l.color = this._color.createColor(l.color.r, l.color.g, l.color.b, l.color.a))), this._core.isnull(l) || this._core.isnull(l.outlineColor) || (this._core.isHtmlColor(l.outlineColor) ? l.outlineColor = this._color.colorFromHtmlColor(l.outlineColor) : (/^rgb/.test(l.outlineColor) && (l.outlineColor = this._color.rgbaStringToRgbaObj(l.outlineColor)), 1 < l.outlineColor.r && (l.outlineColor.r = l.outlineColor.r / 255), 1 < l.outlineColor.g && (l.outlineColor.g = l.outlineColor.g / 255), 1 < l.outlineColor.b && (l.outlineColor.b = l.outlineColor.b / 255), 1 < l.outlineColor.a && (l.outlineColor.a = l.outlineColor.a / 255), l.outlineColor = this._color.createColor(l.outlineColor.r, l.outlineColor.g, l.outlineColor.b, l.outlineColor.a))), this._core.isnull(l) || this._core.isnull(l.backgroundColor) || (this._core.isHtmlColor(l.backgroundColor) ? l.backgroundColor = this._color.colorFromHtmlColor(l.backgroundColor) : (/^rgb/.test(l.backgroundColor) && (l.backgroundColor = this._color.rgbaStringToRgbaObj(l.backgroundColor)), 1 < l.backgroundColor.r && (l.backgroundColor.r = l.backgroundColor.r / 255), 1 < l.backgroundColor.g && (l.backgroundColor.g = l.backgroundColor.g / 255), 1 < l.backgroundColor.b && (l.backgroundColor.b = l.backgroundColor.b / 255), 1 < l.backgroundColor.a && (l.backgroundColor.a = l.backgroundColor.a / 255), l.backgroundColor = this._color.createColor(l.backgroundColor.r, l.backgroundColor.g, l.backgroundColor.b, l.backgroundColor.a))), h._core.isnull(l.near) && (l.near = 0), h._core.isnull(l.far) && (l.far = 999999999), l && l.time && (c = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: l.time.start ? this._cesium.JulianDate.fromDate(new Date(l.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? this._cesium.JulianDate.fromDate(new Date(l.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), null == e && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(e)), h = (this._viewer.dataSources.add(r), this), r = (this.option = l, this.loadGeosjonData = () => { l = this.option; var i = this.item.entities.values; let o = this._core.extend(u, 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 < i.length; t++) { let e = i[t]; o.font = h._core.extendgl(e, l.font, o.font), o.style = parseInt(h._core.extendgl(e, o.style, o.style)), o.fillColor = h._core.extendgl(e, l.fillColor, o.fillColor), o.outlineColor = h._core.extendgl(e, l.outlineColor, o.outlineColor), o.outlineWidth = parseFloat(h._core.extendgl(e, l.outlineWidth, o.outlineWidth)), o.show = h._core.extendgl(e, l.show, o.show), o.showBackground = h._core.extendgl(e, l.showBackground, o.showBackground), o.backgroundColor = h._core.extendgl(e, l.backgroundColor, o.backgroundColor), o.backgroundPadding = h._core.extendgl(e, l.backgroundPadding, o.backgroundPadding), o.scale = parseFloat(h._core.extendgl(e, l.scale, o.scale)), o.horizontalOrigin = h._core.extendgl(e, l.horizontalOrigin, o.horizontalOrigin), o.pointHeight = parseFloat(h._core.extendgl(e, l.pointHeight, o.pointHeight)), o.text = h._core.extendgl(e, l.text, o.text).toString(); var r, n = parseFloat(h._core.extendgl(e, o.near)), a = parseFloat(h._core.extendgl(e, o.far)), n = new h._cesium.DistanceDisplayCondition(n, a), n = (o.distanceDisplayCondition = n, null != o.image && null != o.image && 0 < o.image.length ? (e.billboard = { image: o.image }, e.billboard.scale = o.scale, e.billboard.color = o.color, e.billboard.verticalOrigin = o.verticalOrigin, e.billboard.horizontalOrigin = o.horizontalOrigin, e.billboard.disableDepthTestDistance = o.disableDepthTestDistance, e.billboard.heightReference = o.heightReference, e.billboard.distanceDisplayCondition = o.distanceDisplayCondition) : e.billboard = void 0, "ellipsoidlayer" == o.layertype && (e.name = s, a = { show: !0, radii: new h._cesium.Cartesian3(o.long_axis, o.short_axis, o.long_axis), material: h._cesium.Color.fromRandom({ alpha: 1 }) }, e.ellipsoid = new h._cesium.EllipsoidGraphics(a), e.ellipsoid.heightReference = o.heightReference, e.ellipsoid.material = url), { Name: o.Name, text: o.text, font: o.font, style: o.stylet, ...o }), a = "fillColor:" + 255 * o.fillColor.red + "," + 255 * o.fillColor.green + "," + 255 * o.fillColor.blue + ";outlineColor:" + 255 * o.outlineColor.red + "," + 255 * o.outlineColor.green + "," + 255 * o.outlineColor.blue; h.Legend.push(a), e.label = new h._cesium.LabelGraphics(n), c && (e.availability = c), (o.pointHeight || o.addHeight) && (a = h._cesium.Cartographic.fromCartesian(e.position._value), n = h._cesium.Math.toDegrees(a.longitude), r = h._cesium.Math.toDegrees(a.latitude), a = (o.pointHeight || a.height) + o.addHeight, n = new Cesium.Cartesian3.fromDegrees(n, r, a), e.position._value = n), e.label && (o.labelData && Object.assign(e.label, o.labelData), (o.offsetX || o.offsetY) && (e.label.pixelOffset = new Cesium.Cartesian2(o.offsetX || 0, o.offsetY || 0))), e.billboard && o.imageData && Object.assign(e.billboard, o.imageData) } }, r.then(function (e) { h.item = e, h.loadGeosjonData(), i || h.setVisibility(!1), "function" == typeof o && o(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(s) && (s = "新建街景" + l.id), { id: l.id, name: s, checked: i, pId: this._core.isnull(t) ? 0 : t, type: "labelPointLayer", item: this, url: e, style: l, treeData: { name: s, geoOptions: e, styleOption: l, GroupID: t, checked: i, disFnc: o } }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(t) ? 0 : t), this }, w.prototype.createStreetscapeGeoJsonFeatureLayer = function (e, t, c, i, u, h) { var m, o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: this._cesium.Color.RED, height: 30, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, d = this, p = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) || "(" == c.material.toString().charAt(0) && ")" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c.material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c.material.a && (c.material.a = c.material.a / 255), c.material = this._color.createColor(c.material.r, c.material.g, c.material.b, c.material.a)), "1" == c.arcType || 1 == c.arcType ? c.material = new Cesium.PolylineDashMaterialProperty({ color: c.material }) : c.material = c.material), d._core.isnull(c.near) && (c.near = 0), d._core.isnull(c.far) && (c.far = 999999999), this._core.extend(o, c, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), o = (this._viewer.dataSources.add(o, { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas, clampToGround: !0 }), c && c.time && (m = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: c.time.start ? this._cesium.JulianDate.fromDate(new Date(c.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? this._cesium.JulianDate.fromDate(new Date(c.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (d.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n = t[i], a = (p.arcType = d._core.extendgl(n, c.arcType, p.arcType), p.clampToGround = d._core.extendgl(n, c.clampToGround, p.clampToGround), p.width = parseFloat(d._core.extendgl(n, c.width, p.width)), p.show = d._core.extendgl(n, c.show, p.show), p.material = d._core.extendgl(n, c.material, p.material), p.height = parseFloat(d._core.extendgl(n, c.height, p.height)), parseFloat(d._core.extendgl(n, p.near))), s = parseFloat(d._core.extendgl(n, p.far)), a = new d._cesium.DistanceDisplayCondition(a, s), l = (p.distanceDisplayCondition = a, n.polyline.arcType = !0, 0 == p.heightReference ? n.polyline.arcType = 0 : n.polyline.arcType = 1, n.polyline.clampToGround = p.clampToGround, n.polyline.width = p.width, n.polyline.height = p.height, n.polyline.show = p.show, n.polyline.material = p.material, n.polyline.distanceDisplayCondition = a, []), s = (n.polyline.positions._value.forEach(function (e) { p.height ? (r = d._cesium.Cartographic.fromCartesian(e), o = d._cesium.Math.toDegrees(r.longitude), r = d._cesium.Math.toDegrees(r.latitude), l.push(d._cesium.Cartesian3.fromDegrees(o, r, p.height))) : l.push(e) }), n.polyline.positions = l, m && (n.availability = m), "material:" + 255 * p.material.red + "," + 255 * p.material.green + "," + 255 * p.material.blue); d.Legend.push(s) } u || d.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(p.id) && (p.id = this._core.getuid()), this._core.isnull(e) && (e = "新建街景" + p.id), { id: p.id, name: e, checked: u, pId: this._core.isnull(i) ? 0 : i, type: "Streetscape", item: this, url: t, style: p, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: u, disFnc: h } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer = function (e, t, a, i, s) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, l = (this._core.isnull(a) || this._core.isnull(a.fillColor) || "[" == a.fillColor.toString().charAt(0) && "]" == a.fillColor.toString().charAt(a.fillColor.length - 1) || "(" == a.material.toString().charAt(0) && ")" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.fillColor) ? a.fillColor = this._color.colorFromHtmlColor(a.fillColor) : (/^rgb/.test(a.fillColor) && (a.fillColor = this._color.rgbaStringToRgbaObj(a.fillColor)), 1 < a.fillColor.r && (a.fillColor.r = a.fillColor.r / 255), 1 < a.fillColor.g && (a.fillColor.g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor.b = a.fillColor.b / 255), 1 < a.fillColor.a && (a.fillColor.a = a.fillColor.a / 255), a.fillColor = this._color.createColor(a.fillColor.r, a.fillColor.g, a.fillColor.b, a.fillColor.a))), 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 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = this._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), this._core.isnull(a) || this._core.isnull(a.backgroundColor) || "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (this._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = this._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = this._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = this._color.createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), (void 0)._core.isnull(a.near) && (a.near = 0), (void 0)._core.isnull(a.far) && (a.far = 999999999), this._core.extend(o, a, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), c = (this._viewer.dataSources.add(o), this), o = (o.then(function (e) { var t = (c.item = e).entities.values; c._core.isnull(a.font_size) && (a.font_size = "30px"), c._core.isnull(a.font_family) && (a.font_family = " sans-serif"), l.font = a.font_size + "px " + a.font_family; for (var i = 0; i < t.length; i++) { l.text = c._core.extendgl(entity, a.text, l.text), l.font = c._core.extendgl(entity, a.font, l.font), l.stylet = c._core.extendgl(entity, a.stylet, l.stylet), l.fillColor = c._core.extendgl(entity, a.fillColor, l.fillColor), l.outlineColor = c._core.extendgl(entity, a.outlineColor, l.outlineColor), l.outlineWidth = parseFloat(c._core.extendgl(entity, a.outlineWidth, l.outlineWidth)), l.show = c._core.extendgl(entity, a.show, l.show), l.showBackground = c._core.extendgl(entity, a.showBackground, l.showBackground), l.backgroundColor = c._core.extendgl(entity, a.backgroundColor, l.backgroundColor), l.backgroundPadding = c._core.extendgl(entity, a.backgroundPadding, l.backgroundPadding), l.scale = parseFloat(c._core.extendgl(entity, a.scale, l.scale)), l.horizontalOrigin = c._core.extendgl(entity, a.horizontalOrigin, l.horizontalOrigin), l.pointheight = parseFloat(c._core.extendgl(entity, a.pointheight, l.pointheight)); var o = parseFloat(c._core.extendgl(entity, l.near)), r = parseFloat(c._core.extendgl(entity, l.far)), n = "fillColor:" + 255 * l.fillColor.red + "," + 255 * l.fillColor.green + "," + 255 * l.fillColor.blue + ";outlineColor:" + 255 * l.outlineColor.red + "," + 255 * l.outlineColor.green + "," + 255 * l.outlineColor.blue, n = (c.Legend.push(n), new c._cesium.DistanceDisplayCondition(o, r)); l.distanceDisplayCondition = n, entity.ellipsoid.radii = new _this._cesium.Cartesian3(a.long_axis, a.short_axis, a.short_axis), entity.label = new c._cesium.LabelGraphics(l), entity.label.text = null == entity.properties[a.text] ? a.text : entity.properties[a.text]._value, l.pointheight && (o = c._cesium.Cartographic.fromCartesian(entity.position._value), r = c._cesium.Math.toDegrees(o.longitude), n = c._cesium.Math.toDegrees(o.latitude), entity.position = c._cesium.Cartesian3.fromDegrees(r, n, l.pointheight)) } "function" == typeof s && s(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: !0, disFnc: s } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createBillboardGeoJsonFeature = function (e, t, s, i, l, c) { var u, o = { image: "", show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: 2, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, h = (this._core.isnull(s) || this._core.isnull(s.color) || "[" == s.color.toString().charAt(0) && "]" == s.color.toString().charAt(s.color.length - 1) || (this._core.isHtmlColor(s.color) ? s.color = this._color.colorFromHtmlColor(s.color) : (/^rgb/.test(s.color) && (s.color = this._color.rgbaStringToRgbaObj(s.color)), 1 < s.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = this._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), this._core.extend(o, s, !0)), o = (null == t && console.log("geojson is required"), this._cesium.GeoJsonDataSource.load(t)), m = (this._viewer.dataSources.add(o), this), o = (m._core.isnull(s.near) && (s.near = 0), m._core.isnull(s.far) && (s.far = 999999999), s && s.time && (u = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (m.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (h.image = m._core.extendgl(o, s.image, h.image), h.show = m._core.extendgl(o, s.show, h.show), h.scale = parseFloat(m._core.extendgl(o, s.scale, h.scale)), h.horizontalOrigin = m._core.extendgl(o, s.horizontalOrigin, h.horizontalOrigin), h.verticalOrigin = m._core.extendgl(o, s.verticalOrigin, h.verticalOrigin), h.eyeOffset = m._core.extendgl(o, s.eyeOffset, h.eyeOffset), h.pixelOffset = m._core.extendgl(o, s.pixelOffset, h.pixelOffset), h.alignedAxis = m._core.extendgl(o, s.alignedAxis, h.alignedAxis), h.rotation = m._core.extendgl(o, s.rotation, h.rotation), h.width ? h.width = parseFloat(m._core.extendgl(o, s.width, h.width)) : h.width = void 0, h.height ? h.height = parseFloat(m._core.extendgl(o, s.height, h.height)) : h.height = void 0, h.color = m._core.extendgl(o, s.color, h.color), "color:" + 255 * h.color.red + "," + 255 * h.color.green + "," + 255 * h.color.blue + ";image:" + h.image), r = (m.Legend.push(r), parseFloat(m._core.extendgl(o, h.near))), n = parseFloat(m._core.extendgl(o, h.far)), r = new m._cesium.DistanceDisplayCondition(r, n), n = (h.distanceDisplayCondition = r, o.billboard = void 0, o.billboard = new m._cesium.BillboardGraphics(h), m._viewer.scene.globe.ellipsoid, m._cesium.Cartographic.fromCartesian(o.position._value)), r = m._cesium.Math.toDegrees(n.longitude), a = m._cesium.Math.toDegrees(n.latitude), r = (n = s.pointHeight || n.height, new m._cesium.Cartesian3.fromDegrees(r, a, n)), a = { positions: o.position._value = r }; o.description = a, u && (o.availability = u) } l || m.setVisibility(!1), "function" == typeof c && c(e) }), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), { id: h.id, name: e, checked: l, pId: this._core.isnull(i) ? 0 : i, type: "imageLayer", item: this, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: l, disFnc: c } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createPolylineGeoJsonFeatureLayer = function (e, t, s, i, o, r) { var l, c = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !0, width: 1, show: !0, material: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.WHITE, gapColor: Cesium.Color.TRANSPARENT, height: void 0, dashLength: 16, outlineWidth: 0, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, u = this, n = (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 < s.material.r && (s.material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = this._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), this._core.isnull(s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || "(" == s.outlineColor.toString().charAt(0) && ")" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s.outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = this._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = this._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), s.gapColor && "string" == typeof s.gapColor && (s.gapColor = Cesium.Color.fromCssColorString(s.gapColor)), u._core.isnull(s.near) && (s.near = 0), u._core.isnull(s.far) && (s.far = 999999999), null == t && console.log("geojson is required"), null), n = t.then ? t : this._cesium.GeoJsonDataSource.load(t), n = (this._viewer.dataSources.add(n, { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas, clampToGround: !0 }), s && s.time && (l = new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({ start: s.time.start ? u._cesium.JulianDate.fromDate(new Date(s.time.start)) : u._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? u._cesium.JulianDate.fromDate(new Date(s.time.end)) : u._cesium.Iso8601.MAXIMUM_VALUE })])), this.option = s, this.loadGeosjonData = () => { s = this.option; var o = this.item.entities.values; let r = this._core.extend(c, s, !0); u.Legend = []; for (let i = 0; i < o.length; i++) { let e = o[i]; r.arcType = u._core.extendgl(e, s.arcType, r.arcType), r.clampToGround = u._core.extendgl(e, s.clampToGround, r.clampToGround), r.width = parseFloat(u._core.extendgl(e, s.width, r.width)), r.show = u._core.extendgl(e, s.show, r.show), r.material = u._core.extendgl(e, s.material, r.material), r.height = parseFloat(u._core.extendgl(e, s.height, r.height)); var n = parseFloat(u._core.extendgl(e, r.near)), a = parseFloat(u._core.extendgl(e, r.far)), n = new u._cesium.DistanceDisplayCondition(n, a); r.distanceDisplayCondition = n, void 0 !== r.height && (a = e.polyline.positions.getValue(), e.polyline.positions = u._core.setpolylineheight(a, r.height)), e.polyline.clampToGround = r.clampToGround, e.polyline.width = r.width, e.polyline.show = r.show, e.polyline.distanceDisplayCondition = n, e.polyline.classificationType = r.classificationType; let t; t = r.dash ? new Cesium.PolylineDashMaterialProperty({ color: r.material, gapColor: r.gapColor, dashLength: s.dashLength }) : new Cesium.PolylineOutlineMaterialProperty({ color: r.material, outlineColor: r.outlineColor, outlineWidth: s.outlineWidth }), e.polyline.material = t, l && (e.availability = l); a = "material:" + 255 * r.material.red + "," + 255 * r.material.green + "," + 255 * r.material.blue; u.Legend.push(a) } }, n.then(function (e) { u.item = e, u.loadGeosjonData(), o || u.setVisibility(!1), "function" == typeof r && r(e) }), this._core.isnull(s.id) && (s.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), { id: s.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, 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), this }, w.prototype.createpolylineVolumeGeojsonFeatureLayer = function (e, t, d, i, p, g) { var f, o = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.DISABLED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, radius: .5, radiusScale: 1 }, _ = (this._core.isnull(d) || this._core.isnull(d.material) || "[" == d.material.toString().charAt(0) && "]" == d.material.toString().charAt(d.material.length - 1) || "(" == 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.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = this._color.createColor(d.material.r, d.material.g, d.material.b, d.material.a))), this._core.extend(o, d, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), C = (this._viewer.dataSources.add(o), this), o = (_.shape = this.computeCircle(d.radius), d && d.time && (f = new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({ start: d.time.start ? C._cesium.JulianDate.fromDate(new Date(d.time.start)) : C._cesium.Iso8601.MINIMUM_VALUE, stop: d.time.end ? C._cesium.JulianDate.fromDate(new Date(d.time.end)) : C._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { var t, i, o = (C.item = e).entities.values, r = (C._core.isnull(d.near) && (d.near = 0), C._core.isnull(d.far) && (d.far = 999999999), parseFloat(d.near)), n = parseFloat(d.far), a = new C._cesium.DistanceDisplayCondition(r, n); if (_.distanceDisplayCondition = a, "string" == typeof _.radius && -1 < _.radius.indexOf("[") && -1 < _.radius.indexOf("]")) { let e; _.radius = _.radius.replace("[", ""), _.radius = _.radius.replace("]", ""), o[0] && o[0].properties[_.radius] ? (e = o[0].properties[_.radius].getValue()).indexOf && (-1 < e.indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf("X")) ? (-1 < e.indexOf("*") ? e = e.split("*") : -1 < e.indexOf("X") ? e = e.split("X") : -1 < e.indexOf("x") && (e = e.split("x")), t = parseFloat(e[0]) * _.radiusScale, i = parseFloat(e[1]) * _.radiusScale, _.shape = [new C._cesium.Cartesian2(-t, -i), new C._cesium.Cartesian2(t, -i), new C._cesium.Cartesian2(t, i), new C._cesium.Cartesian2(-t, i)]) : _.shape = C._core.computeCircle(e * _.radiusScale) : _.shape = C._core.computeCircle(.5) } else "0" == _.slttype || 0 == _.slttype ? _.shape = C._core.computeCircle(_.radius) : "1" == _.slttype || 1 == _.slttype ? _.shape = C._core.starPositions(_.number, _.exradius, _.inradius) : "2" != _.slttype && 2 != _.slttype || (t = _.orth_width / 2, i = _.orth_height / 2, _.shape = [new C._cesium.Cartesian2(-t, -i), new C._cesium.Cartesian2(t, -i), new C._cesium.Cartesian2(t, i), new C._cesium.Cartesian2(-t, i)]); for (var s = 0; s < o.length; s++) { var l, c, u = o[s], h = (_.show = C._core.extendgl(u, d.show, _.show), _.shape = C._core.extendgl(u, d.shape, _.shape), _.cornerType = C._core.extendgl(u, d.cornerType, _.cornerType), _.granularity = C._core.extendgl(u, d.granularity, _.granularity), _.fill = C._core.extendgl(u, d.fill, _.fill), _.material = C._core.extendgl(u, d.material, _.material), _.outline = C._core.extendgl(u, d.outline, _.outline), _.outlineColor = C._core.extendgl(u, d.outlineColor, _.outlineColor), _.outlineWidth = parseFloat(C._core.extendgl(u, d.outlineWidth, _.outlineWidth)), _.shadows = C._core.extendgl(u, d.shadows, _.shadows), []), m = (u.polyline.positions._value.forEach(function (e) { _.height ? (c = C._cesium.Cartographic.fromCartesian(e), l = C._cesium.Math.toDegrees(c.longitude), c = C._cesium.Math.toDegrees(c.latitude), h.push(C._cesium.Cartesian3.fromDegrees(l, c, _.height))) : h.push(e) }), u.polylineVolume = new C._cesium.PolylineVolumeGraphics({ positions: h, show: _.show, shape: _.shape, cornerType: _.cornerType, fill: _.fill, outline: _.outline, outlineWidth: _.outlineWidth, material: _.material, distanceDisplayCondition: a }), "material:" + 255 * _.material.red + "," + 255 * _.material.green + "," + 255 * _.material.blue); C.Legend.push(m), u.polyline = void 0, f && (u.availability = f) } p || C.setVisibility(!1), "function" == typeof g && g(e) }), this._core.isnull(_.id) && (_.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + _.id), { id: _.id, name: e, checked: p, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t, style: _, treeData: { name: e, geoOptions: t, styleOption: d, GroupID: i, checked: p, disFnc: g } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createpolylineVolumeGeojsonPrimitiveLayer = function (e, t, s, i, o, r) { let l = { 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, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, radius: .5, height: 0, radiusScale: 1 }, n = (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 < s.material.r && (s.material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = this._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), null == t && console.log("geojson is required"), null), d = (n = t.then ? t : this._cesium.GeoJsonDataSource.load(t), this), p = (s && s.time && new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({ start: s.time.start ? d._cesium.JulianDate.fromDate(new Date(s.time.start)) : d._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? d._cesium.JulianDate.fromDate(new Date(s.time.end)) : d._cesium.Iso8601.MAXIMUM_VALUE })]), new Cesium.PrimitiveCollection), g = { allowPicking: !0, appearance: new d._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core.Shaders("vertexShaderSource"), fragmentShaderSource: d._core.Shaders("fragmentShaderSource") }), shadows: s.shadows, geometryInstances: void 0 }, c = (this.option = s, {}); function u(e) { return c[e] || (c[e] = d._core.computeCircle(e)), c[e] } this.loadGeosjonData = () => { 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 < o.length; e++) { i = o[e], t = this._core.extend(l, s, !0), r = n = r = n = a = n = void 0; var r, n = i, a = t; if ("string" == typeof a.radius && -1 < a.radius.indexOf("[") && -1 < a.radius.indexOf("]")) { let e = d._core.getEntityPropValue(n, a.radius); e ? e.indexOf && (-1 < e.indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf("X")) ? (-1 < e.indexOf("*") ? e = e.split("*") : -1 < e.indexOf("X") ? e = e.split("X") : -1 < e.indexOf("x") && (e = e.split("x")), n = parseFloat(e[0]) * a.radiusScale, r = parseFloat(e[1]) * a.radiusScale, c[n + "*" + r] || (c[n + "*" + r] = [new d._cesium.Cartesian2(-n, -r), new d._cesium.Cartesian2(n, -r), new d._cesium.Cartesian2(n, r), new d._cesium.Cartesian2(-n, r)]), a.shape = c[n + "*" + r], a.radius = r) : (a.radius = e * a.radiusScale, a.shape = u(a.radius), a.connect && (a.connectRadius = e * a.radiusScale * 1.1, a.connectRadius2 = e * a.radiusScale * 1.2, a.connectShape1 = u(a.connectRadius), a.connectShape2 = u(a.connectRadius2))) : (a.shape = u(.5), a.radius = .5, a.connect && (a.connectRadius = 1.1 * a.radius, a.connectRadius2 = 1.2 * a.radius, a.connectShape1 = u(a.connectRadius), a.connectShape2 = u(a.connectRadius2))) } else "0" == a.slttype || 0 == a.slttype ? (a.shape = u(a.radius), a.connect && (a.connectRadius = 1.1 * a.radius, a.connectRadius2 = 1.2 * a.radius, a.connectShape1 = u(a.connectRadius), a.connectShape2 = u(a.connectRadius2))) : "1" == a.slttype || 1 == a.slttype ? a.shape = d._core.starPositions(a.number, a.exradius, a.inradius) : "2" != a.slttype && 2 != a.slttype || (n = a.orth_width / 2, r = a.orth_height / 2, a.shape = [new d._cesium.Cartesian2(-n, -r), new d._cesium.Cartesian2(n, -r), new d._cesium.Cartesian2(n, r), new d._cesium.Cartesian2(-n, r)], a.radius = r); t.show = d._core.extendgl(i, s.show, t.show), t.shape = d._core.extendgl(i, s.shape, t.shape), t.cornerType = d._core.extendgl(i, s.cornerType, t.cornerType), t.granularity = d._core.extendgl(i, s.granularity, t.granularity), t.fill = d._core.extendgl(i, s.fill, t.fill), t.material = d._core.extendgl(i, s.material, t.material), t.outline = d._core.extendgl(i, s.outline, t.outline), t.outlineColor = d._core.extendgl(i, s.outlineColor, t.outlineColor), t.outlineWidth = parseFloat(d._core.extendgl(i, s.outlineWidth, t.outlineWidth)), t.shadows = d._core.extendgl(i, s.shadows, t.shadows), "string" == typeof t.material && (t.material = Cesium.Color.fromCssColorString(t.material)), !async function (e, o) { let t = e.polyline && e.polyline.positions.getValue(); if (t && !(t.length < 2)) { let i; o.height = d._core.defaultValue(s.height, -2), o.height.start && o.height.end ? o.height = { start: d._core.getEntityPropValue(e, s.height.start) || -2, end: d._core.getEntityPropValue(e, s.height.end) || -2 } : ("string" == typeof o.height && o.height.includes("[") && o.height.includes("]") && (o.height = d._core.getEntityPropValue(e, s.height) || -2), o.height = { start: o.height, end: o.height }), o.height._height = (o.height.end - o.height.start) / (t.length - 1), t.forEach(function (e, t) { (i = Cesium.Cartographic.fromCartesian(e)).height = o.height.start + o.height._height * t - o.radius, Cesium.Cartesian3.clone(Cesium.Cartographic.toCartesian(i), e) }); var r = { polylinePositions: t, shapePositions: o.shape, cornerType: o.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, r = new Cesium.PolylineVolumeGeometry(r), r = new Cesium.GeometryInstance({ id: d._core.getEntityProp(e), geometry: r, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(o.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near, o.far) } }), r = (g.geometryInstances = r, p.add(new Cesium.Primitive(g)), console.log(o.material.toCssColorString()), o.connect && 10 < o.shape.length && !async function (t, i, o) { let r = [], n = d._core.getPointFromTwoPointCenter([i[0], i[1]], 2 * o.connectRadius), a = d._core.getPointFromTwoPointCenter([i[0], i[1]], 2 * o.connectRadius2), s = d._core.getPointFromTwoPointCenter([i[i.length - 1], i[i.length - 2]], 2 * o.connectRadius), l = d._core.getPointFromTwoPointCenter([i[i.length - 1], i[i.length - 2]], 2 * o.connectRadius2); i[0].equals(i[1]) && i[2] && (n = d._core.getPointFromTwoPointCenter([i[0], i[2]], 2 * o.connectRadius), a = d._core.getPointFromTwoPointCenter([i[0], i[2]], 2 * o.connectRadius2)); i[i.length - 1].equals(i[i.length - 2]) && i[i.length - 3] && (s = d._core.getPointFromTwoPointCenter([i[i.length - 1], i[i.length - 3]], 2 * o.connectRadius), l = d._core.getPointFromTwoPointCenter([i[i.length - 1], i[i.length - 3]], 2 * o.connectRadius2)); let c = [], u = new Cesium.EllipsoidGeometry({ vertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 }, stackPartitions: 16, slicePartitions: 16, radii: new Cesium.Cartesian3(o.connectRadius, o.connectRadius, o.connectRadius) }), h; if (n && a) { if (!i[0].equals(n)) { let e = []; (h = d._core.toDegrees(i[0])).height -= .1 * o.radius, e.push(d._core.fromDegrees(h)), (h = d._core.toDegrees(n)).height -= .1 * o.radius, e.push(d._core.fromDegrees(h)); var m = new d._cesium.PolylineVolumeGeometry({ polylinePositions: e, shapePositions: o.connectShape1, cornerType: o.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }); r.push(m) } if (!n.equals(a)) { let e = []; (h = d._core.toDegrees(n)).height -= .2 * o.radius, e.push(d._core.fromDegrees(h)), (h = d._core.toDegrees(a)).height -= .2 * o.radius, e.push(d._core.fromDegrees(h)); m = new d._cesium.PolylineVolumeGeometry({ polylinePositions: e, shapePositions: o.connectShape2, cornerType: o.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }); r.push(m) } m = new Cesium.GeometryInstance({ geometry: u, modelMatrix: Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i[0]), new Cesium.Cartesian3(0, 0, o.radius), new Cesium.Matrix4), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(o.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near, o.far) } }); c.push(m) } if (s && l) { if (!i[i.length - 1].equals(s)) { let e = []; (h = d._core.toDegrees(i[i.length - 1])).height -= .1 * o.radius, e.push(d._core.fromDegrees(h)), (h = d._core.toDegrees(s)).height -= .1 * o.radius, e.push(d._core.fromDegrees(h)); m = new d._cesium.PolylineVolumeGeometry({ polylinePositions: e, shapePositions: o.connectShape1, cornerType: o.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }), m = (r.push(m), new Cesium.GeometryInstance({ geometry: u, modelMatrix: Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i[i.length - 1]), new Cesium.Cartesian3(0, 0, o.radius), new Cesium.Matrix4), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(o.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(o.near, o.far) } })); c.push(m) } if (!l.equals(s)) { let e = []; (h = d._core.toDegrees(s)).height -= .2 * o.radius, e.push(d._core.fromDegrees(h)), (h = d._core.toDegrees(l)).height -= .2 * o.radius, e.push(d._core.fromDegrees(h)); i = new d._cesium.PolylineVolumeGeometry({ polylinePositions: e, shapePositions: o.connectShape2, cornerType: o.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }); r.push(i) } } r.forEach(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) } }); c.push(e) }), g.geometryInstances = c, 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, c, i, u, 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(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c.material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c.material.a && (c.material.a = c.material.a / 255), c.material = this._color.createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.isnull(c) || this._core.isnull(c.outlineColor) || "[" == c.outlineColor.toString().charAt(0) && "]" == c.outlineColor.toString().charAt(c.outlineColor.length - 1) || (this._core.isHtmlColor(c.outlineColor) ? c.outlineColor = this._color.colorFromHtmlColor(c.outlineColor) : (/^rgb/.test(c.outlineColor) && (c.outlineColor = this._color.rgbaStringToRgbaObj(c.outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c.outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = this._color.createColor(c.outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), this._core.extend(o, c, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), p = (this._viewer.dataSources.add(o), this), o = (c && c.time && (m = new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({ start: c.time.start ? p._cesium.JulianDate.fromDate(new Date(c.time.start)) : p._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? p._cesium.JulianDate.fromDate(new Date(c.time.end)) : p._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { var t = (p.item = e).entities.values, i = (p._core.isnull(c.near) && (c.near = 0), p._core.isnull(c.far) && (c.far = 999999999), parseFloat(c.near)), o = parseFloat(c.far), r = new p._cesium.DistanceDisplayCondition(i, o); d.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { var a = t[n], s = (d.granularity = p._core.extendgl(a, c.granularity, d.granularity), d.fill = p._core.extendgl(a, c.fill, d.fill), d.material = p._core.extendgl(a, c.material, d.material), d.outline = p._core.extendgl(a, c.outline, d.outline), d.outlineColor = p._core.extendgl(a, c.outlineColor, d.outlineColor), d.outlineWidth = parseFloat(p._core.extendgl(a, c.outlineWidth, d.outlineWidth)), d.shadows = p._core.extendgl(a, c.shadows, d.shadows), a.polyline.positions._value.length), l = new Array(s), s = new Array(s), s = (l.fill(d.minimumHeights), s.fill(d.maximumHeights), a.wall = new p._cesium.WallGraphics({ positions: a.polyline.positions._value, maximumHeights: s, minimumHeights: l, outline: d.outline, fill: d.fill, material: d.material, outlineColor: d.outlineColor, outlineWidth: d.outlineWidth, shadows: d.shadows, distanceDisplayCondition: r }), "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue + ";outlineColor:" + 255 * d.outlineColor.red + "," + 255 * d.outlineColor.green + "," + 255 * d.outlineColor.blue); p.Legend.push(s), a.polyline = void 0, m && (a.availability = m) } u || p.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(d.id) && (d.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + d.id), { id: d.id, name: e, checked: u, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t, style: d, treeData: { name: e, geoOptions: t, styleOption: c, GroupID: i, checked: u, disFnc: h } }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, w.prototype.createterrainProvider = 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.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 }, c = (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 < s.material.r && (s.material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = this._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), this._core.isnull(s) || this._core.isnull(s.outlineColor) || "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (this._core.isHtmlColor(s.outlineColor) ? s.outlineColor = this._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = this._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = this._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), s.checked = o, this._core.extend(r, s, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), u = (this._viewer.dataSources.add(r), this), r = (r.then(function (e) { var t = (u.item = e).entities.values, i = (u._core.isnull(s.near) && (s.near = 0), u._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), o = parseFloat(s.far), r = new u._cesium.DistanceDisplayCondition(i, o); c.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { var a = t[n], a = (c.height = parseFloat(u._core.extendgl(a, s.height, c.height)), c.extrudedHeight = parseFloat(u._core.extendgl(a, s.extrudedHeight, c.extrudedHeight)), c.heightReference = u._core.extendgl(a, s.heightReference, c.heightReference), c.show = u._core.extendgl(a, s.show, c.show), c.fill = u._core.extendgl(a, s.fill, c.fill), c.material = u._core.extendgl(a, s.material, c.material), c.outline = u._core.extendgl(a, s.outline, c.outline), c.outlineColor = u._core.extendgl(a, s.outlineColor, c.outlineColor), c.outlineWidth = parseFloat(u._core.extendgl(a, s.outlineWidth, c.outlineWidth)), c.stRotation = parseInt(u._core.extendgl(a, s.stRotation, c.stRotation)), c.granularity = u._core.extendgl(a, s.granularity, c.granularity), c.shadows = u._core.extendgl(a, s.shadows, c.shadows), a.polygon.height = c.height, a.polygon.extrudedHeight = c.extrudedHeight, a.polygon.heightReference = c.heightReference, a.polygon.show = c.show, a.polygon.fill = c.fill, a.polygon.material = c.material, a.polygon.outline = c.outline, a.polygon.outlineColor = c.outlineColor, a.polygon.outlineWidth = c.outlineWidth, a.polygon.stRotation = c.stRotation, a.polygon.granularity = c.granularity, a.polygon.distanceDisplayCondition = r, a.polygon.perPositionHeight = c.perPositionHeight, a.polygon.closeTop = c.closeTop, a.polygon.closeBottom = c.closeBottom, a.polygon.shadows = c.shadows, "material:" + 255 * c.material.red + "," + 255 * c.material.green + "," + 255 * c.material.blue + ";outlineColor:" + 255 * c.outlineColor.red + "," + 255 * c.outlineColor.green + "," + 255 * c.outlineColor.blue); u.Legend.push(a) } "function" == typeof l && l(e), s.checked || u.setVisibility(!1) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id), { id: c.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: c, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: o, disFnc: l } }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, w.prototype.createPrimitivePolygon = async function (t, i) { let e; var o = i.clampToGround ? Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT : Cesium.VertexFormat.POSITION_AND_NORMAL, o = (e = "bulidingWall" === t ? new Cesium.CorridorGeometry({ positions: i.positions, width: i.bulidingWallWidth || .8, height: i.height, extrudedHeight: i.extrudedHeight, vertexFormat: o, cornerType: Cesium.CornerType.MITERED }) : new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(i.positions, i.holes), height: i.height, extrudedHeight: i.extrudedHeight, vertexFormat: o, perPositionHeight: !1 }), new Cesium.GeometryInstance({ id: i.prop, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(i.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near, i.far) } })); if ("mask" === t) this.primitivePolygon = new Cesium.GroundPrimitive({ geometryInstances: o, appearance: new Cesium.PerInstanceColorAppearance({ translucent: i.material.alpha < 1 }), classificationType: i.classificationType }), this._viewer.scene.primitives.add(this.primitivePolygon); else { this.primitivePolygon || (this.primitivePolygon = new Cesium.PrimitiveCollection, this._viewer.scene.primitives.add(this.primitivePolygon)); let e = i.clampToGround ? Cesium.GroundPrimitive : Cesium.Primitive; t = new e({ geometryInstances: o, appearance: new Cesium.PerInstanceColorAppearance({ translucent: i.material.alpha < 1 }), classificationType: i.classificationType }); this.primitivePolygon.add(t) } }, w.prototype.createPolygonGeoJsonFeatureLayer = function (e, t, l = {}, i, o, r) { var c, u = { height: 0, show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, stRotation: 0, shadows: this._cesium.ShadowMode.ENABLED, clampToGround: !0, classificationType: this._cesium.ClassificationType.BOTH, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, disableDepthTestDistance: 1 / 0, near: 0, mask: !1 }, n = (l.material && "string" == typeof l.material && -1 === l.material.indexOf("[") && (l.material = Cesium.Color.fromCssColorString(l.material)), l.fillColor && "string" == typeof l.fillColor && -1 === l.fillColor.indexOf("[") && (l.fillColor = Cesium.Color.fromCssColorString(l.fillColor)), l.outlineColor && "string" == typeof l.outlineColor && -1 === l.outlineColor.indexOf("[") && (l.outlineColor = Cesium.Color.fromCssColorString(l.outlineColor)), l.labelOutlineColor && "string" == typeof l.labelOutlineColor && -1 === l.labelOutlineColor.indexOf("[") && (l.labelOutlineColor = Cesium.Color.fromCssColorString(l.labelOutlineColor)), l.checked = o, null == t && console.log("geojson is required"), null), n = t.then ? t : this._cesium.GeoJsonDataSource.load(t, { clampToGround: !0 }), h = (this._viewer.dataSources.add(n), this), n = (l && l.time && (c = new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: l.time.start ? h._cesium.JulianDate.fromDate(new Date(l.time.start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? h._cesium.JulianDate.fromDate(new Date(l.time.end)) : h._cesium.Iso8601.MAXIMUM_VALUE })])), this.option = l, this.loadGeosjonData = () => { l = this.option; var i = this.item.entities.values; let o = this._core.extend(u, 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 < i.length; t++) { let e = i[t]; o.height = parseFloat(h._core.extendgl(e, l.height, o.height)), o.extrudedHeight = h._core.extendgl(e, l.extrudedHeight, o.extrudedHeight), o.extrudedHeight = o.height + o.extrudedHeight, o.heightReference = h._core.extendgl(e, l.heightReference, o.heightReference), o.show = h._core.extendgl(e, l.show, o.show), o.fill = h._core.extendgl(e, l.fill, o.fill), o.material = h._core.extendgl(e, l.material, o.material), void 0 !== o.extrudedHeight && (o.extrudedHeight = parseFloat(o.extrudedHeight)), o.outline = h._core.extendgl(e, l.outline, o.outline), o.outlineColor = h._core.extendgl(e, l.outlineColor, o.outlineColor), o.outlineWidth = parseFloat(h._core.extendgl(e, l.outlineWidth, o.outlineWidth)), o.stRotation = h._core.extendgl(e, l.stRotation, o.stRotation), o.granularity = h._core.extendgl(e, l.granularity, o.granularity), o.distanceDisplayCondition = h._core.extendgl(e, l.distanceDisplayCondition, o.distanceDisplayCondition), o.perPositionHeight = h._core.extendgl(e, l.perPositionHeight, o.perPositionHeight), o.closeTop = h._core.extendgl(e, l.closeTop, o.closeTop), o.closeBottom = h._core.extendgl(e, l.closeBottom, o.closeBottom), o.shadows = h._core.extendgl(e, l.shadows, o.shadows), o.classificationType = h._core.extendgl(e, l.classificationType, o.classificationType), o.text = h._core.extendgl(e, l.text, o.text), o.clampToGround && o.mask ? (e.polygon.show = !1, n.push(e.polygon.hierarchy.getValue()), t === i.length - 1 && h.createPrimitivePolygon("mask", { positions: Cesium.Cartesian3.fromDegreesArray([30, 0, 30, 80, 179, 80, 179, 0]), holes: n, ...o })) : (e.polygon.defaultHierarchy && (e.polygon.hierarchy = e.polygon.defaultHierarchy), e.polygon.show = !0, e.polygon.extrudedHeightReference = o.extrudedHeightReference, e.polygon.heightReference = o.heightReference, 1 != o.heightReference && (e.polygon.height = o.height, o.height && (e.polygon.perPositionHeight = !1)), 1 != o.extrudedHeightReference && (e.polygon.extrudedHeight = o.extrudedHeight), o.clampToGround && (e.polygon.height = void 0, e.polygon.heightReference = 1, e.polygon.extrudedHeight = void 0, e.polygon.perPositionHeight = !1), e.polygon.show = o.show, e.polygon.fill = o.fill, e.polygon.material = o.material, e.polygon.outline = o.outline, e.polygon.outlineColor = o.outlineColor, e.polygon.outlineWidth = o.outlineWidth, e.polygon.stRotation = o.stRotation, e.polygon.granularity = o.granularity, e.polygon.distanceDisplayCondition = r, e.polygon.closeTop = o.closeTop, e.polygon.closeBottom = o.closeBottom, e.polygon.shadows = o.shadows, e.polygon.classificationType = o.classificationType, o.bulidingWall && (e.polygon.show = !1, a = e.polygon.hierarchy.getValue().positions, h.createPrimitivePolygon("bulidingWall", { positions: a, ...o }), t === i.length - 1 ? (h.item.boundingSphere = Cesium.BoundingSphere.fromPoints(h.item.boundingPointsArr), h.item.boundingPointsArr = null) : (h.item.boundingPointsArr || (h.item.boundingPointsArr = []), h.item.boundingPointsArr.push(a[0])))), o.clampToGround && o.outline ? e.polyline = { positions: e.polygon.hierarchy.getValue().positions, material: o.outlineColor, width: o.outlineWidth, classificationType: o.classificationType, clampToGround: !0, distanceDisplayCondition: r, zIndex: 1 } : e.polyline = void 0, o.text ? (a = h._core.getCenterOfMass(e.polygon.hierarchy.getValue().positions), e.position = Cesium.Cartesian3.fromDegrees(a[0], a[1], a[2]), void 0 !== o.pointHeight && (e.position = Cesium.Cartesian3.fromDegrees(a[0], a[1], o.pointHeight)), e.label = { text: o.text, font: o.font, style: Cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: o.fillColor || o.material, outlineColor: o.labelOutlineColor || o.outlineColor, outlineWidth: o.labelOutlineWidth || 0, pixelOffset: o.pixelOffset, disableDepthTestDistance: h._core.defaultValue(o.disableDepthTestDistance, 1 / 0), distanceDisplayCondition: o.labelNearFar }) : e.label = void 0; var a, s = "material:" + 255 * o.material.red + "," + 255 * o.material.green + "," + 255 * o.material.blue + ";outlineColor:" + 255 * o.outlineColor.red + "," + 255 * o.outlineColor.green + "," + 255 * o.outlineColor.blue; h.Legend.push(s), c && (e.availability = c) } }, n.then(function (e) { h.item = e, h.loadGeosjonData(), l.checked ? h.isShow = !0 : h.setVisibility(!1), "function" == typeof r && r(e) }), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), { id: l.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), this }, w.prototype.createGeoJsonDataSource = function (e, t, i, o, r) { var t = this._cesium.GeoJsonDataSource.load(t, i), n = (this._viewer.dataSources.add(t), this); return t.then(function (e) { n.item = e, "function" == typeof r && r(e) }), this._tree.insertGroupId({ id: this._core.getuid(), name: e, pId: this._core.isnull(o) ? 0 : o, type: "layer", item: this }, this._core.isnull(o) ? 0 : o), this }, w.prototype.deleteObject = function () { this._viewer.dataSources.remove(this.item), this._viewer.scene.primitives.remove(this.item), this.item = null, this.primitivePolygon && this._viewer.scene.primitives.remove(this.primitivePolygon), this.primitivePolygon = null }, w.prototype.getLevel = function () { var e, t = this._viewer.camera; return t && t.positionCartographic && t.positionCartographic.height ? (e = (e = this._viewer.scene.globe.getHeight(t.positionCartographic)) || 0, t = t.positionCartographic.height - e, Math.round(80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 }, w.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t }, treeData: this.treeobj.treeData } }, w.prototype.setVisibility = function (e) { this.isShow = e, null != this.item && (this.item.show = e), this.primitivePolygon && (this.primitivePolygon.show = e) }, w.prototype.getVisibility = function () { return this.item.show }, w.prototype.getProperties = function () { var e = []; if (this.item.entities.values) { var t = this.item.entities.values[0]; if (t.properties) for (var i = 0; i < t.properties.propertyNames.length; i++)e.push({ value: "[" + t.properties.propertyNames[i] + "]", label: t.properties.propertyNames[i] }) } return e }, w.prototype.getTypes = function () { var e; if (this.item.entities.values) return e = this.item.entities.values[0], /^point.fid/.test(e._id) || null != e.point ? [{ label: "文本标签", value: "labelLayer" }, { label: "图片标签", value: "billboardLayer" }, { label: "点标签", value: "pointLayer" }, { label: "模型", value: "modelLayer" }, { 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" }] : void 0 }, w.prototype.saveDefaultGeosjonData = function () { this.defaultVectorData = this._core.extend({}, this.option, !0) }, w.prototype.restoreGeosjon = function () { this.defaultVectorData && (this.option = this.defaultVectorData, this.loadGeosjonData()), this.defaultVectorData = void 0 }, w.prototype.updataGeosjon = function (e = {}) { (e.material || e.color || e.fillColor || e.labelOutlineColor || e.outlineColor || e.backgroundColor || e.gapColor) && (e.color && (e.color = Cesium.Color.fromCssColorString(e.color)), e.material && (e.material = Cesium.Color.fromCssColorString(e.material)), e.fillColor && (e.fillColor = Cesium.Color.fromCssColorString(e.fillColor)), e.outlineColor && (e.outlineColor = Cesium.Color.fromCssColorString(e.outlineColor)), e.labelOutlineColor && (e.labelOutlineColor = Cesium.Color.fromCssColorString(e.labelOutlineColor)), e.backgroundColor && (e.backgroundColor = Cesium.Color.fromCssColorString(e.backgroundColor)), e.gapColor && (e.gapColor = Cesium.Color.fromCssColorString(e.gapColor))), this.option = this._core.extend(this.option, e, !0), this.item && (clearTimeout(this.updataGeojsonTime), this.updataVectorTime = setTimeout(() => { 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: C.debounce(function (e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++)if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) { } } else { try { i[o].point.show = !1 } catch (e) { } i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.style = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = e + "px  " + o } } }, 500) }, labelFontSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.font = e + "px  sans-serif" } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.fillColor = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.outlineColor = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, labelOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.outlineWidth = e } }, 200), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.backgroundColor = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: C.debounce(function (e) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.showBackground = e }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.heightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, labelShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].label && e ? (t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium.LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, pointColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.color = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].point && e ? (t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium.PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.outlineColor = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.outlineWidth = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.heightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, modelShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)t[o].model ? t[o].model.uri = e : (/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.uri; if (e) return e._value } } }, modelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.shadows = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.heightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e) } }, 500), get: function () { var e = this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0].model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.color = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelLightColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.lightColor = e } }, 100), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, billboardShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].billboard && e ? (t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard = new this._cesium.BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o].billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.image; if (e) return e._value } } }, billboardScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.scale = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.horizontalOrigin = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.verticalOrigin = e } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.width = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.height = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.color = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, billboardHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].billboard.heightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, polylineShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (/^line.fid/.test(t[0]._id) && t && 0 < t.length && t[0].polyline) for (var i = 0; i < t.length; i++)t[i].polyline && (t[i].polyline.show = e) }, 500), get: function () { var e = this.item.entities.values; return (/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline ? e[0].polyline.b : void 0 } }, polylineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t.length && t[0].polyline) for (var i = 0; i < t.length; i++)t[i].polyline.width = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline) { e = e[0].polyline.width; if (e) return e._value } } }, polylinemMterial: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t.length && t[0].polyline) for (var i = 0; i < t.length; i++)t[i].polyline.material = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline) { e = e[0].polyline.material; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, polylinemArcType: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t.length && t[0].polyline) for (var i = 0; i < t.length; i++)t[i].polyline.arcType = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline) { e = e[0].polyline.arcType; if (e) return e._value } } }, polylineDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t.length && t[0].polyline) for (var i = t[0].polyline.distanceDisplayCondition ? t[0].polyline.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].polyline.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e) } }, 500), get: function () { var e = this.item.entities.values; return (/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline ? e[0].polyline.distanceDisplayCondition ? e[0].polyline.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, polylineDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^line.fid/.test(t[0]._id) || null != t[0].polyline) && t && 0 < t.length && t[0].polyline) for (var i = t[0].polyline.distanceDisplayCondition ? t[0].polyline.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].polyline.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i) } }, 500), get: function () { var e = this.item.entities.values; return (/^line.fid/.test(e[0]._id) || null != e[0].polyline) && e && 0 < e.length && e[0].polyline ? e[0].polyline.distanceDisplayCondition ? e[0].polyline.distanceDisplayCondition._value.near : 0 : void 0 } }, polygonShow: { set: C.debounce(function (e) { var t = this.item.entities.values; if (/^polygon.fid/.test(t[0]._id) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon && (t[i].polygon.show = e) }, 500), get: function () { var e = this.item.entities.values; return (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon ? e[0].polygon.b : void 0 } }, polygonHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon.height = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.height; if (e) return e._value } } }, polygonHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.heightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.heightReference; if (e) return e._value } } }, polygonExtrudedHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon.extrudedHeight = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.extrudedHeight; if (e) return e._value } } }, polygonExtrudedHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.extrudedHeightReference = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.extrudedHeightReference; if (e) return e._value } } }, polygonFill: { set: C.debounce(function (e) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.fill = e }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.fill; if (e) return e._value } } }, polygonMaterial: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.material = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.material; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, polygonOutline: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.outline = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.outline; if (e) return e._value } } }, polygonOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)t[i].polygon.outlineColor = e } }, 500), get: function () { var e = this.item.entities.values; return (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon ? (e = e[0].polygon.outlineColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, polygonOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].polygon.outlineWidth = e } }, 500), get: function () { var e = this.item.entities.values; if ((/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon) { e = e[0].polygon.outlineWidth; if (e) return e._value } } }, polygonDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = t[0].polygon.distanceDisplayCondition ? t[0].polygon.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].polygon.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e) } }, 500), get: function () { var e = this.item.entities.values; return (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon ? e[0].polygon.distanceDisplayCondition ? e[0].polygon.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, polygonDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities.values; if ((/^polygon.fid/.test(t[0]._id) || null != t[0].polygon) && t && 0 < t.length && t[0].polygon) for (var i = t[0].polygon.distanceDisplayCondition ? t[0].polygon.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].polygon.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i) } }, 500), get: function () { var e = this.item.entities.values; return (/^polygon.fid/.test(e[0]._id) || null != e[0].polygon) && e && 0 < e.length && e[0].polygon ? e[0].polygon.distanceDisplayCondition ? e[0].polygon.distanceDisplayCondition._value.near : 0 : void 0 } } }), T.prototype.update = function (o) { if (this._quadtree.beginFrame(o), this._quadtree.render(o), this._quadtree.endFrame(o), this._availability && (this._state = this.isAvailable(o.time)), this._state && this._client && this._quadtree._tilesToRender) for (let e = 0, t = this._quadtree._tilesToRender.length, i; e < t; e++)!(i = this._quadtree._tilesToRender[e]).data || !i.data.geometryPrimitive || i.data.geometryPrimitive instanceof Cesium.Cesium3DTileset || i.data.geometryPrimitive.update && i.data.geometryPrimitive.update(o) }, T.prototype.static = function (e) { this.cs = e }, T.prototype.initialize = function (e) { }, T.prototype.beginUpdate = function (e) { }, T.prototype.endUpdate = function (e) { }, T.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumError / (1 << e) }, T.prototype.loadTile = function (e, t) { }, T.prototype.computeTileVisibility = function (e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility.NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch).longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode.SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE } s = r.computeVisibility(n); return s !== Cesium.Intersect.OUTSIDE && (e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum, t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i.ellipsoid.isScaledSpacePointVisible(a)) ? s : Cesium.Visibility.NONE }, T.prototype.canRefine = function (e, t, i) { return e.level <= this._normalTile + 1 }, T.prototype.showTileThisFrame = function (e, t, i, o) { this._availability && (this._state = this.isAvailable(t.time)) }, T.prototype.computeDistanceToTile = function (e, t) { u = this._maximumHeight, n = this._minimumHeight, s = e, this.terrainProvider, void 0 === (r = s.data) && (r = s.data = new Cesium.GlobeSurfaceTile), s._minimumHeight && (n = s._minimumHeight), s._maximumHeight && (u = s._maximumHeight), void 0 === r.tileBoundingRegion && (r.tileBoundingRegion = new Cesium.TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: n || 0, maximumHeight: u || 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (u = e.rectangle) && u.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium.OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e.tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, u = r.orientedBoundingBox.center, l = e.rectangle, c = n.maximumHeight, i = r.occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3], Cesium.Cartesian3.fromRadians(l.west, l.south, c, a, o[0]), Cesium.Cartesian3.fromRadians(l.east, l.south, c, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l.north, c, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, c, a, o[3]), s.computeHorizonCullingPoint(u, o, i)))); var a, s, l = n.minimumHeight, c = n.maximumHeight, u = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - c) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n.minimumHeight = c, n.maximumHeight = c)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = c, u }, T.prototype.isDestroyed = function () { return !1 }, T.prototype.destroy = function () { return Cesium.destroyObject(this) }, T.prototype.remove = function () { this.destroy() }, T.prototype.setStatus = function (e) { this._state = e, this._client = e }, T.prototype.edit = function (e, r) { let c = this, u = this._viewer; if (r = r || {}, this.editHandler && (this.editHandler.destroy(), this.editHandler = void 0), e = void 0 === e ? !0 : e) { var h, m, d, p; this.editHandler = new this._cesium.ScreenSpaceEventHandler(u.scene.canvas), this.isEditting = !1; let n; return this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) c.isEditting && (a(), c.defaultEvent(!1)); else { var i = t.position, o = u.scene.pick(i); if ((!o || !o.id || o.id.treeID === c.treeID) && o && o.id && (o.id instanceof Cesium.Entity || o.id.VectorType)) { let e = o.id; c.isEditting || 0 != V.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 || (u.container.style.cursor = "crosshair", c.defaultEvent(!1), "_height_point" == e.name ? (d = { windowPosition: i, originHeight: c._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 ? (c.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 = c.createEditEntity(p, e.VectorStyle)).feature = e, h.treeID = c.treeID, c.getSimpleGraphicData(p, h), "point" === p || "billboard" === p || "label" === p || "model" === p ? (c.isEditting = !0, c.tooltip.showAt(t.position, "拖拽修改位置")) : (c.isEditting = !0, SmartEarthPopupData.editGraphic.updataEditPoint(), SmartEarthPopupData.editGraphic.setTreeID(c.treeID)), c.setStatus(!1), V.editVector = !0) } } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) c.isEditting && (a(), c.defaultEvent(!1)); else { var r = u.scene.pick(t.endPosition); if ((!r || !r.id || r.id.treeID === c.treeID) && (c._cesium.defined(r) ? c.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 < h.pottingPoint.length || "polygon" === p && 3 < h.pottingPoint.length ? c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : !r.id || "_move_point" !== r.id.name && "_size_point" !== r.id.name ? r.id && "_add_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽增加节点") : r.id && "_height_point" === r.id.name ? c.tooltip.showAt(t.endPosition, "拖拽修改高度") : r.id == h && c.tooltip.show(!1) : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.tooltip.showAt(t.endPosition, "拖拽修改位置") : c.isEditting || 0 !== V.states || (r.id && r.id.VectorType ? c.tooltip.showAt(t.endPosition, "点击激活编辑") : c.tooltip.show(!1)) : 0 != V.states || m || c.tooltip.show(!1), c.isEditting && m)) { c.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = c._getPosition.getMousePosition(t); if (i || "_height_point" === n) if ("_edit_point" === n) { m.position = i; r = V.editPointID.edit.indexOf(m.id); if (void 0 !== h[p].height ? (l = c.toDegrees(i), h.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(l.lon, l.lat, h[p].height.getValue()), m.position = h.pottingPoint[r]) : h.pottingPoint[r] = i, 0 < V.editPointID.add.length) { if (0 < r) { let i = u.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = u.entities.getById(V.editPointID.edit[r - 1]), t = u.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if (r < h.pottingPoint.length - 1) { let i = u.entities.getById(V.editPointID.add[r]); if (i) { let e = u.entities.getById(V.editPointID.edit[r]), t = u.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if ("polygon" === p && (0 === r || r === h.pottingPoint.length - 1)) { let i = u.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); if (i) { let e = u.entities.getById(V.editPointID.edit[0]), t = u.entities.getById(V.editPointID.edit[h.pottingPoint.length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } } let e = h.pottingPoint.concat([]), t = new c._cesium.Cartesian3; var l = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= l, t.y /= l, t.z /= l, V.editPointID.move && (V.editPointID.move.position = t), "polyline" !== p && "polygon" !== p && "rectangle" !== p || SmartEarthPopupData.editGraphic.setValue("positions", e) } else if ("_height_point" === n) { r = V.editPointID.height.indexOf(m.id); let e = u.entities.getById(V.editPointID.edit[r]), i = ("ellipse" !== p && "cylinder" !== p && "box" !== p || (e = V.editPointID.move), c.toDegrees(e.position.getValue())); l = d.originHeight - i.height, r = u.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); V.editPointID.height.forEach(e => { let t = u.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)) }), 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 = V.editPointID.add.indexOf(m.id), l = (u.entities.remove(m), u.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 = (V.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 = u.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 = u.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 = (V.editPointID.add.splice(r, 1, t.id, e.id), SmartEarthPopupData.editGraphic.setTreeID(c.treeID), m = l, n = "_edit_point", h.pottingPoint.concat([])); "polyline" !== p && "polygon" !== p || SmartEarthPopupData.editGraphic.setValue("positions", r) } else if ("_size_point" === n) { t = V.editPointID.move.position.getValue(), e = c._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 = c.toDegrees(i), t = (d = m.position.getValue(), c.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 = c.toDegrees(i).height, h[p].height = l, h.thisHeight = l), h.pottingPoint.forEach((e, t) => { let i, o, r = u.entities.getById(V.editPointID.edit[t]); if (r = r || u.entities.getById(V.editPointID.size[t]), i = r ? c.toDegrees(r.position.getValue()) : c.toDegrees(e), o = c._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 < V.editPointID.add.length && V.editPointID.add[t]) { let e = u.entities.getById(V.editPointID.add[t]); e && (i = c.toDegrees(e.position.getValue()), e.position = c._cesium.Cartesian3.fromDegrees(i.lon + n, i.lat + a, i.height + s)) } }); e = h.pottingPoint.concat([]); "polyline" === p || "polygon" === p || "rectangle" === p ? SmartEarthPopupData.editGraphic.setValue("positions", e) : "ellipse" === p ? (h.pottingPoint[1] = i, h.position = i.clone()) : "box" === p ? (h.pottingPoint[2] = i, r = h.box.dimensions.getValue(), t = c.toDegrees(i), h.position = Cesium.Cartesian3.fromDegrees(t.lon, t.lat, t.height + r.z / 2)) : "cylinder" === p ? (h.pottingPoint[1] = i, l = h.cylinder.length.getValue(), e = c.toDegrees(h.pottingPoint[1]), h.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height + l / 2)) : "ellipsoid" === p && (h.pottingPoint[h.pottingPoint.length - 1] = i, h.position = i.clone()) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? c.isEditting && (a(), c.defaultEvent(!1)) : (m && "model" === m.VectorType && (m.show = !0), m && r.callBack && r.callBack.updata && r.callBack.updata(m.name, h), u.container.style.cursor = "default", m = 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 && (a(), c.defaultEvent(!1)); else { e = u.scene.pick(e.position); if ((!e || !e.id || e.id.treeID === c.treeID) && c._cesium.defined(e) && 0 == V.states) { e = e.id; if (!e.VectorType && -1 < V.editPointID.edit.indexOf(e.id) && ("polyline" === p && 2 < V.editPointID.edit.length || "polygon" === p && 3 < V.editPointID.edit.length)) { var i = V.editPointID.edit.indexOf(e.id); if (u.entities.removeById(e.id), V.editPointID.edit.splice(i, 1), h.pottingPoint.splice(i, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[i]) { if (u.entities.removeById(V.editPointID.add[i]), V.editPointID.add.splice(i, 1), 0 <= i - 1) { let e = u.entities.getById(V.editPointID.add[i - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[i - 1], h.pottingPoint[i === h.pottingPoint.length ? 0 : i], new Cesium.Cartesian3)) } else if (i - 1 == -1 && "polygon" === p) { let e = u.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(h.pottingPoint[0], h.pottingPoint[h.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else u.entities.removeById(V.editPointID.add[i - 1]), V.editPointID.add.pop(); let t = new c._cesium.Cartesian3; e = h.pottingPoint.length, i = (h.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V.editPointID.move.position = t), h.pottingPoint.concat([])); "polyline" !== p && "polygon" !== p || SmartEarthPopupData.editGraphic.setValue("positions", i), c.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() { c.defaultEvent(!0), V.editPointID.edit.forEach(e => { u.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { u.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { u.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { u.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && u.entities.remove(V.editPointID.move), V.editPointID.move = void 0, h && u.entities.remove(h), p = h = void 0, SmartEarthPopupData.editGraphic = {}, c.isEditting = !1, c.setStatus(!0), V.editVector = !1, c.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;
@@ -79,7 +104,11 @@
                        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<o.length;t++){let e=Number(o[t]).toString(16);"0"===(e=1===e.length?"0"+e:e)&&(e+=e),i+=e}return i=7!==i.length?t:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:n,type:e,graphic:n[e],getValue:function(e){return"position"===e||"name"===e||"id"===e?this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]):"radius"===e?"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0:"pHeight"!==e?"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]):this.getValue("position")?(e=this.getValue("position"),Cesium.Cartographic.fromCartesian(e).height):void 0},changeHeightPoint:function(i){0<V.editPointID.height.length&&V.editPointID.height.forEach(e=>{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<V.editPointID.edit.length&&V.editPointID.edit.forEach(e=>{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<V.editPointID.size.length&&V.editPointID.size.forEach(e=>{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<V.editPointID.add.length&&V.editPointID.add.forEach(e=>{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=V.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(){V.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{s.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{s.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{s.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&s.entities.remove(V.editPointID.move),V.editPointID.move=void 0},setTreeID:function(i){V.editPointID.edit.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.height.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.add.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.size.forEach(e=>{let t=s.entities.getById(e);t.treeID=i}),V.editPointID.move&&(V.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){"name"===e?this.entity[e]=t:"color"===e||"outlineColor"===e?(t=Cesium.Color.fromCssColorString(t),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()}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(i.id)}}}):"polygon"===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,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("positions"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(i)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return i},!1));function t(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<V.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=s.entities.getById(V.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<V.editPointID.add.length&&V.editPointID.add.forEach(e=>{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()}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"_add_point",position:i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(i.id)}var e=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),e=s.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,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});V.editPointID.add.push(e.id)}}):"ellipse"===e||"cylinder"===e||n.isSphere?((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,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=V.editPointID.move.position.getValue(),r=a.GetPositionFromA_D(o,i,90);let e=s.entities.getById(V.editPointID.size[0]),t=(e.position=r,n.pottingPoint[0]=r,n.pottingPoint[n.pottingPoint.length-1]=o,s.entities.getById(V.editPointID.height[0]));return void(t&&(o=a.toDegrees(r),r=a._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=a._cesium.Cartesian3.fromDegrees(o.lon,o.lat,r.height)))}if("cylinder"===this.type&&"length"===e)return this.graphic.length=i,o=a.toDegrees(this.entity.pottingPoint[1]),this.entity.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+i/2),void this.changeHeightPoint(o.height+i);function t(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.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}if("ellipse"===this.type&&"clampToGround"===e)return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{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,V.editPointID.size.push(e.id),V.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()}});V.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,V.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=V.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(V.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(V.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,V.editPointID.size.push(e.id),V.editPointID.size.push(t.id),V.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},S.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,s,i,l){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),c=this,o=(o.then(function(e){for(var t={Name:"",text:"",font:" 30px sans-serif",stylet:c._cesium.LabelStyle.OUTLINE,fillColor:c._cesium.Color.WHITE,outlineColor:c._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new c._cesium.Color(.165,.165,.165,.8),backgroundPadding:new c._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:c._cesium.HorizontalOrigin.CENTER,verticalOrigin:c._cesium.VerticalOrigin.CENTER,eyeOffset:c._cesium.Cartesian3.ZERO,pixelOffset:c._cesium.Cartesian2.ZERO,heightReference:c._cesium.HeightReference.NONE,scaleByDistance:new c._cesium.NearFarScalar(0,0,1,1)},i=(s.material,c._core.isnull(s)||c._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(c._core.isHtmlColor(s.fillColor)?s.fillColor=c._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=c._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=c._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),c._core.isnull(s)||c._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(c._core.isHtmlColor(s.material)?s.material=c._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=c._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.fillColor.r/255),1<s.material.g&&(s.material.g=s.fillColor.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=c._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),c._core.isnull(s)||c._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(c._core.isHtmlColor(s.outlineColor)?s.outlineColor=c._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=c._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=c._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),c._core.isnull(s)||c._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(c._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=c._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=c._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=c._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))),c._core.extend(t,s,!0)),o=(c.item=e).entities.values,t=(c._core.isnull(s.near)&&(s.near=0),c._core.isnull(s.far)&&(s.far=999999999),parseFloat(s.near)),e=parseFloat(s.far),t=new c._cesium.DistanceDisplayCondition(t,e),r=(i.distanceDisplayCondition=t,c._core.isnull(s.font_size)&&(s.font_size="30px"),c._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),i.font=parseFloat(s.font_size)+"px "+s.font_family,new c._cesium.LabelCollection),n=0;n<o.length;n++){var a=o[n],a=(i.position=a.position._value,i.text="a label","fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue);c.Legend.push(a),r.add(i)}e=c._viewer.scene.primitives.add(r);"function"==typeof l&&l(e)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options,treeData:{name:e,geoOptions:t,styleOption:s,GroupID:i,checked:!0,disFnc:l}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},S.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,u,i,h,m){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,pointHeight:0},d=this,p=(this._core.isnull(u)||this._core.isnull(u.fillColor)||(this._core.isHtmlColor(u.fillColor)?u.fillColor=this._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=this._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=this._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a))),this._core.isnull(u)||this._core.isnull(u.outlineColor)||(this._core.isHtmlColor(u.outlineColor)?u.outlineColor=this._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=this._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=this._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),this._core.isnull(u)||this._core.isnull(u.backgroundColor)||(this._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=this._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=this._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=this._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a))),d._core.isnull(u.near)&&(u.near=0),d._core.isnull(u.far)&&(u.far=999999999),this._core.extend(o,u,!0)),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),d=this,o=(o.then(function(e){var t=(d.item=e).entities.values;d._core.isnull(p.font_size)&&(p.font_size="30"),d._core.isnull(p.font_family)&&(p.font_family=" sans-serif"),p.font=p.font_size+"px "+p.font_family;for(var i=0;i<t.length;i++){var o=t[i],r=(p.font=d._core.extendgl(o,u.font,p.font),p.style=parseInt(d._core.extendgl(o,p.stylet,p.style)),p.fillColor=d._core.extendgl(o,u.fillColor,p.fillColor),p.outlineColor=d._core.extendgl(o,u.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(d._core.extendgl(o,u.outlineWidth,p.outlineWidth)),p.show=d._core.extendgl(o,u.show,p.show),p.showBackground=d._core.extendgl(o,u.showBackground,p.showBackground),p.backgroundColor=d._core.extendgl(o,u.backgroundColor,p.backgroundColor),p.backgroundPadding=d._core.extendgl(o,u.backgroundPadding,p.backgroundPadding),p.scale=parseFloat(d._core.extendgl(o,u.scale,p.scale)),p.horizontalOrigin=d._core.extendgl(o,u.horizontalOrigin,p.horizontalOrigin),p.pointHeight=parseFloat(d._core.extendgl(o,u.pointHeight,p.pointHeight)),p.text=d._core.extendgl(o,u.text,p.text),parseFloat(d._core.extendgl(o,p.near))),n=parseFloat(d._core.extendgl(o,p.far)),r=new d._cesium.DistanceDisplayCondition(r,n),n=(p.distanceDisplayCondition=r,p.text=null==o.properties[p.text]?p.text:o.properties[p.text]._value,o.billboard.color=d._cesium.Color.WHITE.withAlpha(0),o.label=new d._cesium.LabelGraphics(p),d._viewer.scene.globe.ellipsoid,d._cesium.Cartographic.fromCartesian(o.position._value)),r=d._cesium.Math.toDegrees(n.longitude),a=d._cesium.Math.toDegrees(n.latitude),n=p.pointHeight||n.height,r=new d._cesium.Cartesian3.fromDegrees(r,a,n);o.position._value=r}e.clustering.enabled=!0,e.clustering.pixelRange=45,e.clustering.minimumClusterSize=3;for(var s,l=new d._cesium.PinBuilder,c=(l.fromText("50+",d._cesium.Color.RED,48).toDataURL(),l.fromText("40+",d._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",d._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",d._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",d._cesium.Color.BLUE,48).toDataURL(),new Array(8)),i=0;i<c.length;++i)c[i]=l.fromText(""+(i+2),d._cesium.Color.VIOLET,48).toDataURL();s=d._cesium.defined(s)?void s():e.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=d._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.BLUE,48).toDataURL():t.billboard.image=c[e.length-2]}),s=e.clustering.pixelRange,e.clustering.pixelRange=0,e.clustering.pixelRange=s,h||d.setVisibility(h),d._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:h,disFnc:m}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},S.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,u,i,h,m){var d,o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},p=(this._core.isnull(u)||this._core.isnull(u.color)||"["==u.color.toString().charAt(0)&&"]"==u.color.toString().charAt(u.color.length-1)||(this._core.isHtmlColor(u.color)?u.color=this._color.colorFromHtmlColor(u.color):(/^rgb/.test(u.color)&&(u.color=this._color.rgbaStringToRgbaObj(u.color)),1<u.color.r&&(u.color.r=u.color.r/255),1<u.color.g&&(u.color.g=u.color.g/255),1<u.color.b&&(u.color.b=u.color.b/255),1<u.color.a&&(u.color.a=u.color.a/255),u.color=this._color.createColor(u.color.r,u.color.g,u.color.b,u.color.a))),this._core.isnull(u)||this._core.isnull(u.outlineColor)||"["==u.outlineColor.toString().charAt(0)&&"]"==u.outlineColor.toString().charAt(u.outlineColor.length-1)||(this._core.isHtmlColor(u.outlineColor)?u.outlineColor=this._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=this._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=this._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),this._core.extend(o,u,!0)),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),g=this,o=(u&&u.time&&(d=new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({start:u.time.start?g._cesium.JulianDate.fromDate(new Date(u.time.start)):g._cesium.Iso8601.MINIMUM_VALUE,stop:u.time.end?g._cesium.JulianDate.fromDate(new Date(u.time.end)):g._cesium.Iso8601.MAXIMUM_VALUE})])),o.then(function(e){for(var t=(g.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(p.color=g._core.extendgl(o,u.color,p.color),p.pixelSize=parseInt(g._core.extendgl(o,u.pixelSize,p.pixelSize)),p.outlineColor=g._core.extendgl(o,u.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(g._core.extendgl(o,u.outlineWidth,p.outlineWidth)),p.show=g._core.extendgl(o,u.show,p.show),p.height=parseFloat(g._core.extendgl(o,u.height,p.height)),p.scaleByDistance=g._core.extendgl(o,u.scaleByDistance,p.scaleByDistance),parseFloat(g._core.extendgl(o,p.minDistanceDisplay))),n=parseFloat(g._core.extendgl(o,p.maxDistanceDisplay)),r=new g._cesium.DistanceDisplayCondition(r,n),n=(o.billboard.image="",p.distanceDisplayCondition=r,o.point=new g._cesium.PointGraphics(p),p.pointHeight=g._core.extendgl(o,u.pointHeight,p.pointHeight),p.pointHeight=parseFloat(p.pointHeight),g._viewer.scene.globe.ellipsoid,g._cesium.Cartographic.fromCartesian(o.position._value)),r=g._cesium.Math.toDegrees(n.longitude),a=g._cesium.Math.toDegrees(n.latitude),n=p.pointHeight||n.height,r=new g._cesium.Cartesian3.fromDegrees(r,a,n);o.position._value=r,d&&(o.availability=d)}e.clustering.enabled=!0,e.clustering.pixelRange=45,e.clustering.minimumClusterSize=3;for(var s,l=new g._cesium.PinBuilder,c=(l.fromText("50+",g._cesium.Color.RED,48).toDataURL(),l.fromText("40+",g._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",g._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",g._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",g._cesium.Color.BLUE,48).toDataURL(),new Array(8)),i=0;i<c.length;++i)c[i]=l.fromText(""+(i+2),g._cesium.Color.VIOLET,48).toDataURL();s=g._cesium.defined(s)?void s():e.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=g._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,g._cesium.Color.BLUE,48).toDataURL():t.billboard.image=c[e.length-2]}),s=e.clustering.pixelRange,e.clustering.pixelRange=0,e.clustering.pixelRange=s,h||g.setVisibility(h),g._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:h,disFnc:m}};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},S.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections),new this._cesium.BillboardCollection;for(e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},S.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){for(var a=t,s=(this._viewer.scene.primitives,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height,new this._cesium.BillboardCollection,{}),l=[],c=0;c<a.length;c++){var u={position:new this._cesium.Cartesian3.fromDegrees(a[c].lng,a[c].lat,100),text:a[c].name},h=(this.labelCollections1.push(u),a[c]);if(s[h[i.adminname]])for(var m=0;m<l.length;m++){var d=l[m];if(d.adminname==h[i.adminname]){d.data.push(h);break}}else l.push({adminname:h[i.adminname],name:h.name,showBackground:!0,lat:h.lat,lng:h.lng,data:[h]}),s[h[i.adminname]]=h}for(var p,c=0;c<l.length;c++){u={position:new this._cesium.Cartesian3.fromDegrees(l[c].lng,l[c].lat,100),image:pinBuilder.fromText(l[c].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(u),this.BillboardCollections.add(u)}i&&i.time&&(p=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this._viewer.scene.primitives.add(this.BillboardCollections,p)},S.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,o,i,r,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},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._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):/^http/.test(o.material)||(/^rgb/.test(o.material)&&(o.material=this._color.rgbaStringToRgbaObj(o.material)),1<o.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._core.isnull(o)||this._core.isnull(o.fill)||"["==o.fill.toString().charAt(0)&&"]"==o.fill.toString().charAt(o.fill.length-1)||(this._core.isHtmlColor(o.fill)?o.fill=this._color.colorFromHtmlColor(o.fill):/^http/.test(o.fill)||(/^rgb/.test(o.fill)&&(o.fill=this._color.rgbaStringToRgbaObj(o.fill)),1<o.fill.r&&(o.fill.r=o.fill.r/255),1<o.fill.g&&(o.fill.g=o.fill.g/255),1<o.fill.b&&(o.fill.b=o.fill.b/255),1<o.fill.a&&(o.fill.a=o.fill.a/255),o.fill=this._color.createColor(o.fill.r,o.fill.g,o.fill.b,o.fill.a))),this._core.extend(a,o,!0)),c=this,u=(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=o.level_max-1,this._Provider._minimumHeight=parseFloat(l.height)||0,this._Provider.loadTile=function(t,i){var e;i.state===Cesium.QuadtreeTileLoadState.START&&(i.data={lines:[],geometryPrimitive:void 0},i.level>=o.level_min&&i.level<o.level_max&&c.item.show?(e=u.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level),c._cache&&(e+="&"+c._core.getuid()),c._core.xhr({url:e,type:"get",dataType:"json",success:function(e){""==cluster?c.labelCollections=new c._cesium.PointPrimitiveCollection:c.labelCollections=new c._cesium.BillboardCollection;var o=new c._cesium.PinBuilder;null==e?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):(e.features.forEach(function(e){var t=(l.id=e).geometry.coordinates[2]||0,i=(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(l.height)&&/\]$/.test(l.height)?(i=l.height.replace(/\[/,"").replace(/\]/,""),t+=parseFloat(e.properties[i])):t+=parseFloat(l.height)||0,{}),t=new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),i=""==cluster?{id:e,color:l.material,position:t}:{position:t,image:o.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:c._cesium.VerticalOrigin.BOTTOM};c.labelCollections.add(i)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=c.labelCollections,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0))},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING):(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});a=this._viewer.scene.primitives,o&&o.time&&(this._Provider._availability=new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({start:o.time.start?c._cesium.JulianDate.fromDate(new Date(o.time.start)):c._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?c._cesium.JulianDate.fromDate(new Date(o.time.end)):c._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),a.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,s={id:l.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(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},S.prototype.createLabelGeoJsonFeatureLayerProvider=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,c=(s.material,l._core.isnull(s)||l._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(l._core.isHtmlColor(s.fillColor)?s.fillColor=l._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=l._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=l._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),l._core.isnull(s)||l._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(l._core.isHtmlColor(s.material)?s.material=l._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=l._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.material.r/255),1<s.material.g&&(s.material.g=s.material.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=l._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),l._core.isnull(s)||l._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(l._core.isHtmlColor(s.outlineColor)?s.outlineColor=l._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=l._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=l._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),l._core.isnull(s)||l._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(l._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=l._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=l._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=l._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))),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(o,a){var e;a.state===Cesium.QuadtreeTileLoadState.START&&(a.data={lines:[],geometryPrimitive:void 0},a.level>=s.level_min&&a.level<s.level_max&&l.item.show?(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){var r,t,i,n;null==e?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):(i={Name:"",text:"",font:" 30px sans-serif",style:l._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:l._cesium.Color.WHITE,outlineColor:l._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new l._cesium.Color(.165,.165,.165,.8),backgroundPadding:new l._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,eyeOffset:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,heightReference:l._cesium.HeightReference.NONE,scaleByDistance:new l._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},r=l._core.extend(i,s,!0),l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999),i=parseFloat(s.near),t=parseFloat(s.far),i=new l._cesium.DistanceDisplayCondition(i,t),r.distanceDisplayCondition=i,l._core.isnull(s.font_size)&&(s.font_size="30px"),l._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),r.font=parseFloat(s.font_size)+"px "+s.font_family,n=new(null!=r.image&&null!=r.image?l._cesium.BillboardCollection:l._cesium.LabelCollection),e.features.forEach(function(e){r.id=e;var t,i=r.pointHeight,o=(/^\[/.test(i)&&/\]$/.test(i)?(o=i.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[o])):null!=i&&""!=i?i=parseFloat(i):null!=e.properties.height&&(i=parseFloat(e.properties.height)),r.position=new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(s.fillColor)&&/\]$/.test(s.fillColor)&&(t=s.fillColor.replace(/\[/,"").replace(/\]/,""),r.fillColor=e.properties[t],l._core.isHtmlColor(r.fillColor)?r.fillColor=l._color.colorFromHtmlColor(r.fillColor):(/^rgb/.test(r.fillColor)&&(r.fillColor=l._color.rgbaStringToRgbaObj(r.fillColor)),1<r.fillColor.r&&(r.fillColor.r=r.fillColor.r/255),1<r.fillColor.g&&(r.fillColor.g=r.fillColor.g/255),1<r.fillColor.b&&(r.fillColor.b=r.fillColor.b/255),1<r.fillColor.a&&(r.fillColor.a=r.fillColor.a/255),r.fillColor=l._color.createColor(r.fillColor.r,r.fillColor.g,r.fillColor.b,r.fillColor.a))),/^\[/.test(s.outlineColor)&&/\]$/.test(s.outlineColor)&&(t=s.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[t],l._core.isHtmlColor(r.outlineColor)?r.outlineColor=l._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=l._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=l._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),"fillColor:"+255*r.fillColor.red+","+255*r.fillColor.green+","+255*r.fillColor.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue);l.Legend.push(o),/^\[/.test(s.text)&&/\]$/.test(s.text)&&(t=s.text.replace(/\[/,"").replace(/\]/,""),r.text=e.properties[t]),r.id.treeID=s.id,r.id.VectorType="label",r.id.VectorStyle={position:r.position,pointHeight:i,text:r.text,font:r.font,scale:r.scale,style:r.style,fillColor:r.fillColor,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,showBackground:r.showBackground,backgroundColor:r.backgroundColor,heightReference:r.heightReference,horizontalOrigin:r.horizontalOrigin,verticalOrigin:r.verticalOrigin,scaleByDistance:r.scaleByDistance,distanceDisplayCondition:r.distanceDisplayCondition},n.add(r)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=n,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(o,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},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):(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),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._Provider.treeID=s.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},S.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(e,t,u,i,o,r){var n,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},h=this,s=(u.material,h._core.isnull(u)||h._core.isnull(u.fillColor)||"string"!=typeof u.fillColor||/^\[/.test(u.fillColor)&&/\]$/.test(u.fillColor)||(h._core.isHtmlColor(u.fillColor)||/^rgb/.test(u.fillColor))&&(u.fillColor=Cesium.Color.fromCssColorString(u.fillColor)),h._core.isnull(u)||h._core.isnull(u.outlineColor)||"string"!=typeof u.outlineColor||/^\[/.test(u.outlineColor)&&/\]$/.test(u.outlineColor)||(h._core.isHtmlColor(u.outlineColor)||/^rgb/.test(u.outlineColor))&&(u.outlineColor=Cesium.Color.fromCssColorString(u.outlineColor)),h._core.isnull(u)||h._core.isnull(u.color)||"string"!=typeof u.color||/^\[/.test(u.color)&&/\]$/.test(u.color)||(h._core.isHtmlColor(u.color)||/^rgb/.test(u.color))&&(u.color=Cesium.Color.fromCssColorString(u.color)),h._core.isnull(u)||h._core.isnull(u.backgroundColor)||"string"!=typeof u.backgroundColor||/^\[/.test(u.backgroundColor)&&/\]$/.test(u.backgroundColor)||(h._core.isHtmlColor(u.backgroundColor)||/^rgb/.test(u.backgroundColor))&&(u.backgroundColor=Cesium.Color.fromCssColorString(u.backgroundColor)),h._core.isnull(u.font)&&(h._core.isnull(u.font_size)&&(u.font_size="30px"),h._core.isnull(u.font_family)&&(u.font_family=" sans-serif"),u.font=u.font_size+" "+u.font_family,u.bold&&(u.font="bold "+u.font),u.italic&&(u.font="italic "+u.font)),h._core.isnull(u.near)&&(u.near=0),h._core.isnull(u.far)&&(u.far=999999999),parseFloat(u.near)),l=parseFloat(u.far),c=new h._cesium.DistanceDisplayCondition(s,l);u.distanceDisplayCondition=c;let m=-1<t.url.indexOf("/gisserver/");function d(e,t){let i;var o,r;return i=(i="string"==typeof t.value?/^\[/.test(t.value)&&/\]$/.test(t.value)?(i=t.value.replace(/\[/,"").replace(/\]/,""),e.properties[i]):t.value:(r=(o=t.value).Condition,e=e.properties[r],o.Value[e]))||t.defaultValue,i=h._core.isHtmlColor(i)?Cesium.Color.fromCssColorString(i):i}function p(){return{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}}n=m?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._core._serialize(a.urlParams),this._urlTemplate=n,this._Provider=new T(this._viewer,this._cesium,m?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=u.level_max,this._Provider._minimumHeight=parseFloat(u.height)||0,this.initThisProvider=()=>{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>=u.level_min&&i.level<=u.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.x<t.minCol||i.y>t.maxRow||i.y<t.minRow)return i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void y()}if(h._Provider.EntityCollection.isShow&&(h._Provider.EntityCollection.show=!0),h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y]){let e=h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y];return e.setVisibility(!0),i.data.geometryPrimitive=e,i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,void y()}t=n.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.reverseY||i.y).replace(window.encodeURIComponent("{z}"),i.level);h._cache&&(t+="&"+h._core.getuid()),h._core.xhr({url:t,type:"get",dataType:"json",success:function(e){if(e&&e.features&&e.features.length){var s,l,t=p(),c=h._core.extend(t,u,!0);c.image&&!c.text?l=!0:s=!(c.image||!c.text)||(!c.image||!c.text||(l=!0));let a=new _(h._viewer,h._Provider.EntityCollection,i);!async function(e){e.features.forEach(function(e,t){a.isDestroy||!async function(e){c.id=e.id;var t=c.pointHeight;"string"==typeof t&&/^\[/.test(t)&&/\]$/.test(t)?(i=t.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])):null!=t&&""!=t?t=parseFloat(t):null!=e.properties.height&&(t=parseFloat(e.properties.height));c.position=new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),"object"==typeof u.font&&(c.font=d(e,u.font));"string"==typeof u.fillColor&&/^\[/.test(u.fillColor)&&/\]$/.test(u.fillColor)?(o=u.fillColor.replace(/\[/,"").replace(/\]/,""),c.fillColor=e.properties[o],(h._core.isHtmlColor(c.fillColor)||/^rgb/.test(c.fillColor))&&(c.fillColor=Cesium.Color.fromCssColorString(c.fillColor))):"object"==typeof u.fillColor&&u.fillColor.value&&(c.fillColor=d(e,u.fillColor));"string"==typeof u.outlineColor&&/^\[/.test(u.outlineColor)&&/\]$/.test(u.outlineColor)?(o=u.outlineColor.replace(/\[/,"").replace(/\]/,""),c.outlineColor=e.properties[o],(h._core.isHtmlColor(c.outlineColor)||/^rgb/.test(c.outlineColor))&&(c.outlineColor=Cesium.Color.fromCssColorString(c.outlineColor))):"object"==typeof u.outlineColor&&u.outlineColor.value&&(c.outlineColor=d(e,u.outlineColor));u.showBackground&&("string"==typeof u.backgroundColor&&/^\[/.test(u.backgroundColor)&&/\]$/.test(u.backgroundColor)?(o=u.backgroundColor.replace(/\[/,"").replace(/\]/,""),c.backgroundColor=e.properties[o],(h._core.isHtmlColor(c.backgroundColor)||/^rgb/.test(c.backgroundColor))&&(c.backgroundColor=Cesium.Color.fromCssColorString(c.backgroundColor))):"object"==typeof u.backgroundColor&&u.backgroundColor.value&&(c.backgroundColor=d(e,u.backgroundColor)));var i="fillColor:"+255*c.fillColor.red+","+255*c.fillColor.green+","+255*c.fillColor.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue;h.Legend.push(i),"string"==typeof u.text&&/^\[/.test(u.text)&&/\]$/.test(u.text)?(o=u.text.replace(/\[/,"").replace(/\]/,""),c.text=e.properties[o]):"object"==typeof u.text&&(c.text=d(e,u.text));{var o;"string"==typeof u.image&&/^\[/.test(u.image)&&/\]$/.test(u.image)?(o=u.image.replace(/\[/,"").replace(/\]/,""),c.image=e.properties[o]):"object"==typeof u.image&&(c.image=d(e,u.image))}let r={position:c.position};if(s){let e=c;c.labelData&&(e=Object.assign({},c,c.labelData,!0)),(c.offsetX||c.offsetY)&&(e.pixelOffset=new Cesium.Cartesian2(c.offsetX||0,c.offsetY||0)),r.label=e}if(l){let e=c;c.imageData&&(e=Object.assign({},c,c.imageData,!0)),r.billboard=e}let n=new Cesium.Entity(r);n.feature=e,a.add(n)}(e)})}(e),i.data.geometryPrimitive=a,h._Provider.EntityCollection.childrenCollection[i.level+"-"+i.x+"-"+i.y]=a,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),y()}else i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0},error:function(){i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0,y()}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}y()},"function"==typeof r&&r(this.item)};let g,f;function _(e,t,i){this.viewer=e,this.collection=t,this.key=i.level+"-"+i.x+"-"+i.y,this.isDestroy=!1,this.values=[],this._time=void 0,this.show=!0}this.saveDefaultVectorData=()=>{f=h._core.extend({},u,!0)},this.restoreVector=()=>{if(f&&(u=f,h._Provider._normalTile=u.level_max,h._Provider&&h._Provider.EntityCollection)){var e=p();let r=h._core.extend(e,u,!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)),u=h._core.extend(u,a,!0),h._Provider._normalTile=u.level_max,u.font=u.font_size+" "+u.font_family,u.bold&&(u.font="bold "+u.font),u.italic&&(u.font="italic "+u.font),a.font=u.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(u.offsetX||0,u.offsetY||0)),Object.assign(o,a),t&&(o.text=t),void 0!==a.text&&(o.show=!!a.text)):a.text&&(e.label={...u},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:u.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});c=this._viewer.scene.primitives,u&&u.time&&(this._Provider._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._Provider.isAvailable=function(e){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),c.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(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,a={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=u.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},S.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(e,t,u,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=(u.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(u.height)||0,this._Provider.loadTile=function(i,o){var e;o.state===Cesium.QuadtreeTileLoadState.START&&(o.data={lines:[],geometryPrimitive:void 0},o.level>=u.level_min&&o.level<u.level_max&&h.item.show?(e=s.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var s,l,c,t;null==e?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):((s=h._core.extend(a,u,!0)).font=u.font,s.image&&!s.text?c=new h._cesium.BillboardCollection({scene:h._viewer.scene}):(s.image||!s.text)&&s.image&&s.text?(l=new h._cesium.LabelCollection({scene:h._viewer.scene}),c=new h._cesium.BillboardCollection({scene:h._viewer.scene}),(t=new h._cesium.PrimitiveCollection).add(l),t.add(c)):l=new h._cesium.LabelCollection({scene:h._viewer.scene}),e.features.forEach(function(e){s.id=e;var t,i,o=s.pointHeight;if(/^\[/.test(o)&&/\]$/.test(o)?(t=o.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[t])):null!=o&&""!=o?o=parseFloat(o):null!=e.properties.height&&(o=parseFloat(e.properties.height)),s.position=new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),u.fillColor)/^\[/.test(u.fillColor)&&/\]$/.test(u.fillColor)&&(i=u.fillColor.replace(/\[/,"").replace(/\]/,""),s.fillColor=e.properties[i]),h._core.isHtmlColor(s.fillColor)?s.fillColor=h._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=h._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=h._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a));else if(u.fillColor&&u.fillColor.Class instanceof Array){for(var r=0;r<u.fillColor.Class.length;r++)if((a=(n=u.fillColor.Class[r]).Condition.replace("<","").replace(">","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){s.fillColor=n.Value,h._core.isHtmlColor(s.fillColor)?s.fillColor=h._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=h._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=h._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a));break}}else(u.fillColor&&"{}"!=u.fillColor.Class.toString()||style.fillColor&&"{}"!=style.fillColor.toString())&&(s.fillColor=u.fillColor.Value,h._core.isHtmlColor(s.fillColor)?s.fillColor=h._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=h._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=h._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a)));if(u.outlineColor)/^\[/.test(u.outlineColor)&&/\]$/.test(u.outlineColor)&&(i=u.outlineColor.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s.outlineColor=e.properties[i],h._core.isHtmlColor(s.outlineColor)?s.outlineColor=h._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=h._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=h._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a)));else if(u.outlineColor&&u.outlineColor.Class instanceof Array){for(r=0;r<u.fillColor.Class.length;r++)if((a=(n=u.fillColor.Class[r]).Condition.replace("<","").replace(">","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){s.outlineColor=a.Value,h._core.isHtmlColor(s.outlineColor)?s.outlineColor=h._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=h._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=h._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a));break}}else(u.outlineColor&&"{}"!=u.outlineColor.Class.toString()||u.outlineColorTe&&"{}"!=u.outlineColor.toString())&&(s.outlineColor=u.outlineColor.Value,h._core.isHtmlColor(s.outlineColor)?s.outlineColor=h._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=h._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=h._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a)));if(u.backgroundColor)/^\[/.test(u.backgroundColor)&&/\]$/.test(u.backgroundColor)&&(i=u.backgroundColor.replace(/\[/,"").replace(/\]/,""),s.backgroundColor=e.properties[i],h._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=h._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=h._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=h._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));else if(u.backgroundColor&&u.backgroundColor.Class instanceof Array){for(r=0;r<u.backgroundColor.Class.length;r++)if((a=(n=u.backgroundColor.Class[r]).Condition.replace("<","").replace(">","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){s.backgroundColor=getSGColor(a.Value),h._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=h._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=h._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=h._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a));break}}else u.backgroundColor&&"{}"!=u.backgroundColor.Class.toString()?(s.backgroundColor=getSGColor(u.backgroundColor.Value),h._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=h._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=h._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=h._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))):u.backgroundColor&&"{}"!=u.backgroundColor.toString()&&(s.backgroundColor=u.backgroundColor.Value,h._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=h._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=h._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=h._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a)));if(u.scale)/^\[/.test(u.scale)&&/\]$/.test(u.scale)&&(i=u.scale.replace(/\[/,"").replace(/\]/,""),s.scale=e.properties[i]);else if(u.scale&&u.scale.Class instanceof Array)for(r=0;r<u.scale.Class.length;r++)(a=(n=u.scale.Class[r]).Condition.replace("<","").replace(">","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]&&(s.scale=n.Value);else u.scale&&"{}"!=u.scale.Class.toString()?s.scale=u.scale.Value:u.scale&&"[object Object]"!=u.scale.toString()&&"{}"!=u.scale.toString()&&(s.scale=u.scale);if(/^\[/.test(u.text)&&/\]$/.test(u.text)||u.textTe?u.textTe?u.text.Class instanceof Object?(t=u.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s.text=e.properties[t]):(i=(u.text&&u.text.Class&&"{}"!=u.text.Class.toString()?u.text.Class.Value:u.text).replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s.text=e.properties[i]):u.text&&"[object Object]"!=u.text.toString()&&"{}"!=u.text.toString()?s.text=u.text:(i=u.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s.text=e.properties[i]):u.text&&"[object Object]"!=u.text.toString()&&"{}"!=u.text.toString()&&(s.text=u.text),(s=s.labelData?h._core.extend(s,s.labelData,!0):s).verticalOrigin=Cesium.VerticalOrigin.CENTER,s.horizontalOrigin=Cesium.HorizontalOrigin.LEFT,l&&l.add(s),u.image&&u.image.Class instanceof Array){for(var n,a,r=0;r<u.image.Class.length;r++)if((a=(n=u.image.Class[r]).Condition.replace("<","").replace(">","").split("="))[0]=a[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),a[1]=a[1].replace(/\"/,"").replace(/\"/,""),e.properties[a[0]]==a[1]){s.image=n.Value;break}}else u.image&&u.image.Class&&"{}"!=u.image.Class.toString()?(i=u.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),s.image=e.properties[i]):u.image&&"[object Object]"!=u.image.toString()&&"{}"!=u.image.toString()&&(s.image=u.image);o=C.cloneDeep(s);o.verticalOrigin=Cesium.VerticalOrigin.CENTER,o.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT,c&&c.add(o)}),0==e.features.length&&(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0),o.data.geometryPrimitive=t||c||l,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):(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});n=this._viewer.scene.primitives,u&&u.time&&(this._Provider._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._Provider.isAvailable=function(e){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),n.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,n={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u,treeData:{name:e,geoOptions:t,styleOption:u,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=u.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},S.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,c=(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}),u=(s.width&&(c.width=s.width),s.height&&(c.height=s.height),s.image&&(c.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){var e;a.state===Cesium.QuadtreeTileLoadState.START&&(a.data={lines:[],geometryPrimitive:void 0},a.level>=s.level_min&&a.level<=s.level_max&&l.item.show?(e=u.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)a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0;else{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;c.position=Cesium.Cartesian3.fromDegrees(o,i,r),t.add(c)}}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):(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),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},S.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,c=(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){var e;o.state===Cesium.QuadtreeTileLoadState.START&&(o.data={lines:[],geometryPrimitive:void 0},o.level>=r.level_min&&o.level<=r.level_max&&l.item.show?(e=c.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){var t;null==e?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):("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):(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0))},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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),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},S.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<i.length;o++){var r,n,a=i[o],a=(r=/^\[/.test(h.text)&&/\]$/.test(h.text)?(r=h.text.replace(/\[/,"").replace(/\]/,""),a.properties[r]._value):h.text,p.optiontext.push(r),a.billboard=void 0,p._viewer.scene.globe.ellipsoid,p._cesium.Cartographic.fromCartesian(a.position._value)),a=[p._cesium.Math.toDegrees(a.longitude),p._cesium.Math.toDegrees(a.latitude),h.pointHeight||a.height],s=p._core.getuid();a instanceof Array?2===a.length?n=p._cesium.Cartesian3.fromDegrees(a[0],a[1]):3===a.length&&(n=p._cesium.Cartesian3.fromDegrees(a[0],a[1],a[2])):n=a.z?p._cesium.Cartesian3.fromDegrees(a.x,a.y,a.z):p._cesium.Cartesian3.fromDegrees(a.x,a.y),g.add({id:"DivPoint"+s,position:n,color:p._cesium.Color.YELLOW,description:h.text})}h&&h.time&&(t=new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({start:h.time.start?p._cesium.JulianDate.fromDate(new Date(h.time.start)):p._cesium.Iso8601.MINIMUM_VALUE,stop:h.time.end?p._cesium.JulianDate.fromDate(new Date(h.time.end)):p._cesium.Iso8601.MAXIMUM_VALUE})])),p.item=g,p.pointPrimitive=p._viewer.scene.primitives.add(g,t);var l,c,u=!0;p.pointPrimitive.update=function(){for(var e,t,i=0;i<p.pointPrimitive.length;i++){if(e=p.pointPrimitive.get(i),c=e.position,!(c=p._viewer.scene.cartesianToCanvasCoordinates(c)))return;(l=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+p.optiontext[i]+"</div>\n           </div>",$(".cesium-viewer").append(t),l=document.getElementById(e.id)),e.description?l.style.transform="matrix(1, 0, 0, 1, "+c.x+", "+(c.y-157)+")":l.style.transform="matrix(1, 0, 0, 1, "+c.x+", "+(c.y-134)+")",l&&(l.style.display=p.pointPrimitive.show?"block":"none")}u&&(m||p.setVisibility(!1),u=!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},S.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},c=this,r=new v(this._viewer,this._cesium,r),r=((this._Provider=r)._loadTile=function(e){var o,r,n=new c._cesium.PointPrimitiveCollection,a=(c.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 c._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]),c._core.getuid());n.add({id:"DivPoint"+i,position:Cartesian3,color:c._cesium.Color.YELLOW,description:s.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(n),!0);return c.pointPrimitive.update=function(){for(var e,t,i=0;i<c.pointPrimitive.length;i++){if(e=c.pointPrimitive.get(i),r=e.position,!(r=c._viewer.scene.cartesianToCanvasCoordinates(r)))return;(o=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+c.optiontext[i]+"</div>\n           </div>",$(".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||c.setVisibility(!1),a=!1)},c.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},S.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,c=(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.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=l._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),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){var e;a.state===Cesium.QuadtreeTileLoadState.START&&(a.data={lines:[],geometryPrimitive:void 0},a.level>=s.level_min&&a.level<s.level_max&&l.item.show?(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){var o,t,i,r;null==e?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):(i={url:"",modelMatrix:l._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:l._cesium.Color.DARKSALMON,scale:2},o=l._core.extend(i,s,!0),l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999),i=parseFloat(s.near),t=parseFloat(s.far),i=new l._cesium.DistanceDisplayCondition(i,t),o.distanceDisplayCondition=i,r=new l._cesium.PrimitiveCollection,e.features.forEach(function(e){o.id=e;var t=o.height,i=(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)&&(i=o.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])),o.modelMatrix=l._cesium.Transforms.eastNorthUpToFixedFrame(l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t)),l._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition}));r.add(i)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=r,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(n,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},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):(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.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},S.prototype.createPointGeoJsonFeatureLayerProvider=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,c=(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.color.r&&(s.color.r=s.color.r/255),1<s.color.g&&(s.color.g=s.color.g/255),1<s.color.b&&(s.color.b=s.color.b/255),1<s.color.a&&(s.color.a=s.color.a/255),s.color=l._color.createColor(s.color.r,s.color.g,s.color.b,s.color.a))),l._core.isnull(s)||l._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(l._core.isHtmlColor(s.outlineColor)?s.outlineColor=l._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=l._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=l._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),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(o,a){var e;a.state===Cesium.QuadtreeTileLoadState.START&&(a.data={lines:[],geometryPrimitive:void 0},a.level>=s.level_min&&a.level<s.level_max&&l.item.show?(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){var r,t,i,n;null==e?(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0):(i={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:l._cesium.LabelStyle.OUTLINE,fillColor:l._cesium.Color.WHITE,outlineColor:l._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new l._cesium.Color(.165,.165,.165,.8),backgroundPadding:new l._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:l._cesium.HorizontalOrigin.CENTER,verticalOrigin:l._cesium.VerticalOrigin.CENTER,eyeOffset:l._cesium.Cartesian3.ZERO,pixelOffset:l._cesium.Cartesian2.ZERO,heightReference:l._cesium.HeightReference.NONE,scaleByDistance:new l._cesium.NearFarScalar(0,0,1,1)},s.material,l._core.isnull(s)||l._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(l._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=l._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=l._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=l._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))),r=l._core.extend(i,s,!0),l._core.isnull(s.near)&&(s.near=0),l._core.isnull(s.far)&&(s.far=999999999),i=parseFloat(s.near),t=parseFloat(s.far),i=new l._cesium.DistanceDisplayCondition(i,t),r.distanceDisplayCondition=i,l._core.isnull(s.font_size)&&(s.font_size="30px"),l._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),r.font=parseFloat(s.font_size)+"px "+s.font_family,n=new l._cesium.PointPrimitiveCollection,e.features.forEach(function(e){r.id=e;var t=0,i=(/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(i=r.pointHeight.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])):void 0!==r.pointHeight&&""!==r.pointHeight?t=parseFloat(r.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(s.color)&&/\]$/.test(s.color)&&(o=s.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[o],l._core.isHtmlColor(r.color)?r.color=l._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=l._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=l._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(s.outlineColor)&&/\]$/.test(s.outlineColor)&&(o=s.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[o],l._core.isHtmlColor(r.outlineColor)?r.outlineColor=l._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=l._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=l._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),r.text=e.properties.name,{show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e}),o="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;l.Legend.push(o),n.add(i)}),0==e.features.length&&(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0),a.data.geometryPrimitive=n,a.state=Cesium.QuadtreeTileLoadState.LOADING,a.state===Cesium.QuadtreeTileLoadState.LOADING&&(a.data.geometryPrimitive.update(o,[]),a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},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):(a.state=Cesium.QuadtreeTileLoadState.DONE,a.renderable=!0))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.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},S.prototype.setTreeobj=function(e){this.treeobj=e},S.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},S.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},S.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t},treeData:this.treeobj.treeData}},S.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},S.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&void 0!==this._Provider._state&&this._Provider.setStatus(e),this._Provider&&this._Provider.EntityCollection&&(e||(this._Provider.EntityCollection.show=e),this._Provider.EntityCollection.isShow=e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&void 0!==this._Provider._stop&&this._Provider.setStatus(!e)},S.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},S.prototype.forceRefresh=function(){try{this._cache=!0,this._forceRefreshPrvimitive||(this._forceRefreshPrvimitive=C.cloneDeep(this._primitive));var e=C.cloneDeep(this._forceRefreshPrvimitive);this._viewer.scene.primitives.remove(this._primitive),this._viewer.scene.primitives.add(e),this.edit(this.isEditting,this.editoption)}catch(e){}},Object.defineProperties(S.prototype,{labelText:{set:C.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.fillColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.backgroundColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelBackground:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},labelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0:void 0}},labelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},labelShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500)},modelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0:void 0}},modelColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},pointColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},pointDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0:void 0}},pointHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},billboardShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500)},billboardScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},billboardDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0:void 0}},billboardPHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}}});var Bi="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 Vi(i,o,r,n,a,e,s,l){var c=0,u=[];if(e.map(function(e){var t;!s||c<=0?(t=0,i.beginPath(),e.map(function(e){e=o.project(e,r);0==t?i.moveTo(n+e.x,a+e.y):i.lineTo(n+e.x,a+e.y),t++}),s&&(i.closePath(),i.fill()),l&&i.stroke()):u.push(e),c++}),s)return u;u=null}function Fi(e,t,i){this._viewer=e,this._cesium=t,this._tree=i,this._core=new f}function Hi(e,t){this._viewer=e,this._cesium=t,this.item={show:!0},this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._flyTo=new Fi(this._viewer,this._cesium,this._tree),this._Provider=void 0,this.Legend=[],this.model=[],this._cache=!1,this._forceRefreshPrvimitive=null,this._forceRefreshProvider=null}function P(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._createGroup=new Ei,this.model=[],this.heading=this._cesium.Math.toRadians(0),this.pitch=this._cesium.Math.toRadians(0),this.roll=this._cesium.Math.toRadians(0),this.rotate=10,this.state=0,this.modelPointArr=[],this.modifyModel=null,this.modifyPoint=null,this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.position=null,this.tempPoints=[],this.scale=0,this.Radius=20}function Gi(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._Provider=void 0,this._primitive=void 0,this._taskProcessor=new this._cesium.TaskProcessor("vectorTileProvider"),this.model=[],this.Legend=[],this._ajax=null,this.datas=null}E.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Bi(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},E.prototype.createHistogramVectorGeoJsonFeatureLayer=function(e,t,r,i,o,n){var a={radius:50,height:100,scale:1,defaultColor:"#ffffff",showLabel:!0,label:{showBackground:!1,fillColor:"#ffffff",outlineColor:"#000000",backgroundColor:"rgba(0,0,0,0.5)",style:2,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,outlineWidth:1,font:"20px 微软雅黑"},alpha:.5,level_max:20,level_min:10},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};r.label&&(a.label=this._core.extend(a.label,r.label,!0),delete r.label);let g=this._core.extend(a,r,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");let f,_=(Array.isArray(g.color)&&(f={name:g.color[0].name,value:{">":{},"<":{}}},g.color.forEach(e=>{var t;e.value.indexOf&&-1<e.value.indexOf(">")?(t=e.value.split(">"),f.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)):e.value.indexOf&&-1<e.value.indexOf("<")?(t=e.value.split("<"),f.value["<"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)):f.value[e.value]=Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)})),Cesium.Color.fromCssColorString(g.defaultColor).withAlpha(g.alpha));var l=this,C={text:"",...g.label,fillColor:Cesium.Color.fromCssColorString(g.label.fillColor),outlineColor:Cesium.Color.fromCssColorString(g.label.outlineColor),backgroundColor:Cesium.Color.fromCssColorString(g.label.backgroundColor)},c=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=r.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(t,e){var i=t,o=e,p=l;if(o.state===Cesium.QuadtreeTileLoadState.START)if(o.data={lines:[],geometryPrimitive:void 0},o.level>=r.level_min&&o.level<r.level_max&&p.item.show){{t=c.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level);p._cache&&(t+="&"+p._core.getuid());let m=[],d=new Cesium.LabelCollection,e=Cesium.GeoJsonDataSource.load(t);e.then(e=>{let t=e.entities.values;if(t&&t.length){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<l){r=f.value["<"][l];break}}}r=r||_.clone();let c;e.polygon?(n=e.polygon.hierarchy.getValue().positions,c=Cesium.BoundingSphere.fromPoints(n).center,n=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n),height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,perPositionHeight:!1}),n=new Cesium.GeometryInstance({id:t,geometry:n,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),m.push(n)):(e.point||e.billboard)&&(c=e.position.getValue());n=new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({extrudedHeight:o,center:c,semiMinorAxis:g.radius,semiMajorAxis:g.radius,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST}),id:t});let u=Cesium.Material.fromType("Color");u.uniforms.color=r.withAlpha(1);e=new Cesium.Primitive({geometryInstances:n,appearance:new Cesium.EllipsoidSurfaceAppearance({material:u}),shadows:g.shadows});h.add(e),g.showLabel&&(n=p._core.toDegrees(c),C.text=g.value?g.value(i,t):i+"",C.position=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,1.1*o),C.useColorConfig&&(C.fillColor=r),d.add(C))}),m.length&&(e=new Cesium.GroundPrimitive({geometryInstances:m,appearance:new Cesium.PerInstanceColorAppearance({translucent:g.alpha<1}),classificationType:Cesium.ClassificationType.BOTH,shadows:g.shadows}),h.add(e)),g.showLabel&&h.add(d),p.probj.push(h),o.data.geometryPrimitive=h,o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0)}else o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0},e=>{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}else o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0},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},E.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 u=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(u.color)&&(h={name:u.color[0].name,value:{">":{},"<":{}}},u.color.forEach(e=>{var t;e.value.indexOf&&-1<e.value.indexOf(">")?(t=e.value.split(">"),h.value[">"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha)):e.value.indexOf&&-1<e.value.indexOf("<")?(t=e.value.split("<"),h.value["<"][t[1]]=Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha)):h.value[e.value]=Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha)})),Cesium.Color.fromCssColorString(u.defaultColor).withAlpha(u.alpha));var s=this,l=(this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),t.url+"?"+this._serialize(a.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(t,e){var o=t,r=e,n=s;if(r.state===Cesium.QuadtreeTileLoadState.START)if(r.data={lines:[],geometryPrimitive:void 0},r.level>=i.level_min&&r.level<i.level_max&&n.item.show){{t=l.replace(window.encodeURIComponent("{x}"),r.x).replace(window.encodeURIComponent("{y}"),r.y).replace(window.encodeURIComponent("{z}"),r.level);n._cache&&(t+="&"+n._core.getuid());let c=[],e=Cesium.GeoJsonDataSource.load(t);e.then(e=>{let i=e.entities.values;if(i&&i.length){i.forEach(e=>{var t=e.properties.getValue();let i,o;"3D"===u.type&&(i=u.height,t&&"string"==typeof u.height&&/^\[/.test(u.height)&&/\]$/.test(u.height)&&(n=u.height.replace(/\[/,"").replace(/\]/,""),i=t[n]||100),o=i*u.scale);let r;if(t&&"string"==typeof u.color&&/^\[/.test(u.color)&&/\]$/.test(u.color)){var n=t[u.color.replace(/\[/,"").replace(/\]/,"")]||u.defaultColor;r=Cesium.Color.fromCssColorString(n).withAlpha(u.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<l){r=h.value["<"][l];break}}}r=r||m.clone(),e.polygon&&(n=e.polygon.hierarchy.getValue().positions,e=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(n),height:0,extrudedHeight:"3D"===u.type?o:0,vertexFormat:Cesium.VertexFormat.DEFAULT,perPositionHeight:!1}),n=new Cesium.GeometryInstance({id:t,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(r)}}),c.push(n))});let t;if(c.length){let e="3D"===u.type?Cesium.Primitive:Cesium.GroundPrimitive;t=new e({geometryInstances:c,appearance:new Cesium.PerInstanceColorAppearance({translucent:u.alpha<1}),classificationType:Cesium.ClassificationType.BOTH,shadows:u.shadows})}n.probj.push(t),r.data.geometryPrimitive=t,r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(o,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)}else r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0},e=>{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}else r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0},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(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:u.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},E.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 c=this._core.extend(n,a,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=this,h=(this._urlTemplate=t.url,t.url);this._Provider=new T(this._viewer,this._cesium,c.tilingScheme),this._Provider._normalTile=a.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(i,e){var o=i,r=e,n=u;if(r.state===Cesium.QuadtreeTileLoadState.START)if(r.data={lines:[],geometryPrimitive:void 0},r.level>=a.level_min&&r.level<a.level_max&&n.item.show){{i=h.replace("{x}",r.x-s).replace("{y}",r.y-l).replace("{z}",r.level);n._cache&&(i+="&"+n._core.getuid());let e=new Cesium.Cesium3DTileset({url:i,...c}),t=e.readyPromise.then(function(e){n.probj.push(e),r.data.geometryPrimitive=e,n._viewer.scene.primitives.add(e),r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(o,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)});t.catch&&t.catch(function(e){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}),t.otherwise&&t.otherwise(function(e){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}else r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0},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(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);n={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:a};return this._Provider.treeID=n.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.createVector3DTilesFeatureLayerRelease=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 c=this._core.extend(n,a,!0);null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required");var u=this,h=(u.models=0,this._urlTemplate=t.url,t.url);this._Provider=new T(this._viewer,this._cesium,c.tilingScheme),this._Provider._normalTile=a.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(i,e){var o=i,r=e,n=u;if(r.state===Cesium.QuadtreeTileLoadState.START)if(r.data={lines:[],geometryPrimitive:void 0},r.level>=a.level_min&&r.level<a.level_max&&n.item.show){{i=h.replace("{x}",r.x-s).replace("{y}",r.y-l).replace("{z}",18);n._cache&&(i+="&"+n._core.getuid());let e=new Cesium.Cesium3DTileset({url:i,...c}),t=e.readyPromise.then(function(e){function t(e){Cesium.defined(e)&&e.freeResources()}r.freeResources=function(){r.state=0,r.renderable=!1,r.upsampledFromParent=!1,Cesium.defined(r.data)&&Cesium.defined(r.data.freeResources)&&r.data.freeResources(),Cesium.defined(this.data)&&Cesium.defined(this.data.geometryPrimitive)&&18<=r._level&&(this.data.geometryPrimitive.destroy(),this.data.geometryPrimitive=void 0),t(r._southwestChild),r._southwestChild=void 0,t(r._southeastChild),r._southeastChild=void 0,t(r._northwestChild),r._northwestChild=void 0,t(r._northeastChild),r._northeastChild=void 0},n.probj.push(e),n._viewer.scene.primitives.add(e),r.state=Cesium.QuadtreeTileLoadState.LOADING,r.state===Cesium.QuadtreeTileLoadState.LOADING&&(r.data.geometryPrimitive.update(o,[]),r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0)});t.catch&&t.catch(function(e){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}),t.otherwise&&t.otherwise(function(e){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}else r.state=Cesium.QuadtreeTileLoadState.DONE,r.renderable=!0},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(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+c.id);n={id:c.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:a};return this._Provider.treeID=n.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.VectorGeoJsonFeatureLayer=function(e,t,g,i,o,r){var n=this._core.VectorSlice(t,this._cesium),n=new v(this._viewer,this._cesium,n),f=this,n=((this._Provider=n)._loadTile=function(e){var t=new Cesium.PrimitiveCollection,c=new Cesium.PointPrimitiveCollection,u=new Cesium.LabelCollection,h=new Cesium.BillboardCollection,m=[],d=[],p=-1;return e.features.forEach(function(e){var t,i=[];if(null!=g.lable&&null==e.geometry.coordinates[0][0]&&(o=0,null!=g.lable.height&&/^\[/.test(g.lable.height)&&/\]$/.test(g.lable.height)&&(l=g.lable.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(t=f._core.StyleContrast("lable",g.lable,Cesium)).fillColor=f._color.VectorColorTransformation(t.fillColor,e),t.outlineColor=f._color.VectorColorTransformation(t.outlineColor,e),t.backgroundColor=f._color.VectorColorTransformation(t.backgroundColor,e),t.text=f._core.Analysis(t.text,e),t.position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),u.add(t)),null!=g.billboard&&null==e.geometry.coordinates[0][0]&&(o=0,null!=(s=g.billboard).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=f._core.StyleContrast("billboard",s,Cesium)).position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),h.add(r)),null!=g.point&&null==e.geometry.coordinates[0][0]&&(o=0,null!=(s=g.point).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=f._core.StyleContrast("point",s,Cesium)).position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],o),r.color=f._color.VectorColorTransformation(r.color,e),r.outlineColor=f._color.VectorColorTransformation(r.outlineColor,e),c.add(r)),null!=g.polyline){var o=0,r=(null!=(s=g.polyline).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),f._core.StyleContrast("polyline",s,Cesium));if(p=r.classificationType,delete r.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(var n=0;n<e.geometry.coordinates.length;n++){i=f._core.coordinate(i=[],e.geometry.coordinates[n]),r.positions=Cesium.Cartesian3.fromDegreesArray(i);var a=f._core.createPolyline(r,p,e,Cesium);m.push(a)}else{i=f._core.coordinate(i,e.geometry.coordinates),r.positions=Cesium.Cartesian3.fromDegreesArray(i);a=f._core.createPolyline(r,p,e,Cesium);m.push(a)}}if(null!=g.polygon){var s,l,o=0;if(null!=(s=g.polygon).height&&/^\[/.test(s.height)&&/\]$/.test(s.height)&&(l=s.height.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[l])),(r=f._core.StyleContrast("polygon",s,Cesium)).material=f._color.VectorColorTransformation(r.material,e),p=r.classificationType,delete r.classificationType,Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length)if(Array.isArray(e.geometry.coordinates[0][0]))for(n=0;n<e.geometry.coordinates.length;n++){i=[],e.geometry.coordinates[n].pop(),i=f._core.coordinate(i,e.geometry.coordinates[n]),r.polygonHierarchy=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i));a=f._core.createPolygon(r,p,e,Cesium);d.push(a)}else{i=f._core.coordinate(i,e.geometry.coordinates),r.polygonHierarchy=new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i));a=f._core.createPolygon(r,p,e,Cesium);d.push(a)}}}),t.add(u),t.add(h),t.add(c),0<m.length&&(-1!=p?t.add(new Cesium.GroundPolylinePrimitive({geometryInstances:m,classificationType:p,appearance:new Cesium.PolylineMaterialAppearance})):t.add(new Cesium.Primitive({geometryInstances:m,appearance:new Cesium.PolylineMaterialAppearance}))),0<d.length&&(-1!=p?t.add(new Cesium.GroundPrimitive({geometryInstances:d,classificationType:p,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:f._core.Shaders("vertexShaderSource"),fragmentShaderSource:f._core.Shaders("fragmentShaderSource")})})):t.add(new Cesium.Primitive({geometryInstances:d,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:f._core.Shaders("vertexShaderSource"),fragmentShaderSource:f._core.Shaders("fragmentShaderSource")})}))),t},this.item=n._primitiveCollection,n.addTo(this._viewer),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,{id:g.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"Vector",item:this,url:t.url,style:g,treeData:{name:e,geoOptions:t,styleOption:g,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.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=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},m=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this,d=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){var c,u,h;c=e,h=l,(u=t).state===Cesium.QuadtreeTileLoadState.START&&(u.data={lines:[],geometryPrimitive:void 0},u.level>=i.level_min&&u.level<i.level_max&&h.item.show?(e=d.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0;else{var i=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}0==i.length&&(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0);var a=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows});u.data.geometryPrimitive=a,u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive.update(c,[]),u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0)}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e,t;/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(r.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=r.properties[e],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=o.length&&(e=Cesium.Cartesian3.fromDegreesArray(o),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:r,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,h.Legend.push(t),i.push(e))}},error:function(){null==u.count&&(u.count=0),u.count+=1,2<=u.count?(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0):u.state=Cesium.QuadtreeTileLoadState.START}}),u.state=Cesium.QuadtreeTileLoadState.LOADING):(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:m.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss=function(e,t,l,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(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._option=this._core.extend(n,l,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=l.level_min&&t.level<l.level_max&&d.item.show){var o=C.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:o[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));if(!d.Primitivekey.includes(i)){d.Primitivekey.push(i),c.push({level:t.level,x:t.x,y:t.y,data:void 0});for(var o=d._option.level_min+(d._option.level_max-d._option.level_min)/2,n=Oi(t,o),r=0;r<n.length;r++){var a=n[r],s="z"+a.level+"x"+a.x+"y"+a.y;d.loadAllKey.includes(s)||(d.loadAllKey.push(s),function(u){var e=d._urlTemplate.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),h=(d.tilesLength++,d._cache&&(e+="&"+d._core.getuid()),"z"+u.level+"x"+u.x+"y"+u.y);d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):s.push(e[t])}function t(){var e,t;/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(l.properties[e])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(e=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=l.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=s.length&&(e=Cesium.Cartesian3.fromDegreesArray(s),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:l,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r,n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var c=0;c<l.geometry.coordinates.length;c++)s=[],l.geometry.coordinates[c].pop(),o(l.geometry.coordinates[c]),t();else o(l.geometry.coordinates),t()}0<i.length&&(r=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:d._option.shadows}),n={level:u.level,key:h,data:r},d.probj.push(r),d.loadFinishKey.push(h),d.PrimitiveData.push(n),d._viewer.scene.primitives.add(r),d.returnCount++)},error:function(){},complete:function(e,t){}})}(a))}}}}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;n={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:r}};this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},E.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(e,t,a,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},s=(t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium,this._core.isnull(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),l=[],m={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"/"+window.encodeURIComponent("{z}")+"/"+window.encodeURIComponent("{x}")+"/"+window.encodeURIComponent("{reverseY}")+".json",this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=a.level_min&&t.level<a.level_max&&d.item.show){var o=C.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:o[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));d.Primitivekey.includes(i)||(d.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),o=(u=t).tilingScheme.getNumberOfYTilesAtLevel(u.level)-u.y-1,n=d._urlTemplate.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{reverseY}"),o).replace(window.encodeURIComponent("{z}"),u.level),d.tilesLength++,h="z"+u.level+"x"+u.x+"y"+u.y,d._cache&&(n+="&"+d._core.getuid()),0<C.filter(l,function(e){return e.url==n}).length||(l.push({url:n}),d._core.xhr({url:n,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){m.extrudedHeight=parseFloat(d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(t=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=3*parseFloat(a.properties[t])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(t=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[t],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))));var e,t=Cesium.Color.WHITE;2<=n.length&&(e=Cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),shadows:d._option.shadows}),c=(d.probj.push(l),{level:u.level,key:h,data:l});d.loadFinishKey.push(h),d.PrimitiveData.push(c),d._viewer.scene.primitives.add(l),d.returnCount++;try{2==d.probj.length&&(d._viewer.scene.primitives.remove(d.probj[0]),d.probj.pop())}catch(e){}},error:function(){var e=d.Primitivekey.indexOf(h);-1<e&&d.Primitivekey.splice(e,1),s=C.remove(s,function(e){return e.x==u.x&&e.y==u.y&&e.level==u.level})},complete:function(e,t){u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive&&(u.state=Cesium.QuadtreeTileLoadState.DONE),u.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 u,n,h},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;n={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a,treeData:{name:e,geoOptions:t,styleOption:a,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.PointVectorGeoJsonFeatureLayerGis=function(e,t,h,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=(this._option=this._core.extend(n,h,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),n={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},m=this,n=(this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new Li(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(m.Level=m.getLevel(),m.Level<m._option.level_min){if(0<m.primitve.length){for(var t=0;t<m.primitve.length;t++)m._viewer.scene.primitives.remove(m.primitve[t]);m.primitve=[]}if(0<m.probj.length){for(t=0;t<m.probj.length;t++)m._viewer.scene.primitives.remove(m.probj[t]);m.probj=[]}a=[]}else{var s=new Cesium.PrimitiveCollection,l=new Cesium.PointPrimitiveCollection,c=new Cesium.LabelCollection,u=new Cesium.BillboardCollection,i=(e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0},e.url.replace("png","json"));0<C.filter(a,function(e){return e.url==i}).length||1!=m.start&&(a.push({url:i}),m._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){m.Legend=[];for(var t=0;t<e.features.length;t++){var n=[],a=e.features[t];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var i=0;i<a.geometry.coordinates.length;i++)n=[],a.geometry.coordinates[i].pop(),o(a.geometry.coordinates[i]),r();else o(a.geometry.coordinates),r()}0<c.length&&s.add(c),0<u.length&&s.add(u),0<l.length&&s.add(l),m.primitve.push(s),m.probj.push(s),m._viewer.scene.primitives.add(s),m.returnCount++;try{2==m.probj.length&&(m._viewer.scene.primitives.remove(m.probj[0]),m.probj.pop())}catch(e){}}function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function r(){var e,t,i,o,r;null!=h.lable&&(t=0,null!=h.lable.height&&/^\[/.test(h.lable.height)&&/\]$/.test(h.lable.height)&&(o=h.lable.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(e=m._core.StyleContrast("lable",h.lable,Cesium)).fillColor=m._color.VectorColorTransformation(e.fillColor,a),e.outlineColor=m._color.VectorColorTransformation(e.outlineColor,a),e.backgroundColor=m._color.VectorColorTransformation(e.backgroundColor,a),e.text=m._core.Analysis(e.text,a),e.position=new Cesium.Cartesian3.fromDegrees(n[0],n[1],t),c.add(e)),null!=h.billboard&&(t=0,null!=(i=h.billboard).height&&/^\[/.test(i.height)&&/\]$/.test(i.height)&&(o=i.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(r=m._core.StyleContrast("billboard",i,Cesium)).position=new Cesium.Cartesian3.fromDegrees(n[0],n[1],t),u.add(r)),null!=h.point&&(t=0,null!=(i=h.point).height&&/^\[/.test(i.height)&&/\]$/.test(i.height)&&(o=i.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(a.properties[o])),(r=m._core.StyleContrast("point",i,Cesium)).position=new Cesium.Cartesian3.fromDegrees(n[0],n[1],t),r.color=m._color.VectorColorTransformation(r.color,a),r.outlineColor=m._color.VectorColorTransformation(r.outlineColor,a),l.add(r))}}}))}}),this.img=this._Provider1.ent,o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:h,treeData:{name:e,geoOptions:t,styleOption:h,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.PolylineVectorGeoJsonFeatureLayerGis=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=(this._option=this._core.extend(n,u,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),n={id:t.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},h=this,n=(this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new Li(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(h.Level=h.getLevel(),h.Level<h._option.level_min){if(0<h.primitve.length){for(var t=0;t<h.primitve.length;t++)h._viewer.scene.primitives.remove(h.primitve[t]);h.primitve=[]}if(0<h.probj.length){for(t=0;t<h.probj.length;t++)h._viewer.scene.primitives.remove(h.probj[t]);h.probj=[]}a=[]}else{var c=-1,i=(e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0},e.url.replace("png","json"));0<C.filter(a,function(e){return e.url==i}).length||1!=h.start&&(a.push({url:i}),h._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var i=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}var a=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._option.shadows,classificationType:c});h.probj.push(a),h.primitve.push(a),h._viewer.scene.primitives.add(a),h.returnCount++;try{2==h.probj.length&&(h._viewer.scene.primitives.remove(h.probj[0]),h.probj.pop())}catch(e){}}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e=u,t=(null!=e.height&&/^\[/.test(e.height)&&/\]$/.test(e.height)&&(t=e.height.replace(/\[/,"").replace(/\]/,""),parseFloat(r.properties[t])),h._core.StyleContrast("polyline",e,Cesium));c=t.classificationType,delete t.classificationType,t.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),t.material=r.properties[e],h._core.isHtmlColor(t.material)?t.material=h._color.colorFromHtmlColor(t.material):(/^rgb/.test(t.material)&&(t.material=h._color.rgbaStringToRgbaObj(t.material)),1<t.material.red&&(t.material.red=t.material.red/255),1<t.material.green&&(t.material.green=t.material.green/255),1<t.material.blue&&(t.material.blue=t.material.blue/255),1<t.material.alpha&&(t.material.a=t.material.alpha/255),t.material=h._color.createColor(t.material.red,t.material.green,t.material.blue,t.material.alpha))):(h._option.material&&(t.material=h._option.material),t.material&&(h._core.isHtmlColor(t.material)?t.material=h._color.colorFromHtmlColor(t.material):(/^rgb/.test(t.material)&&(t.material=h._color.rgbaStringToRgbaObj(t.material)),1<t.material.red&&(t.material.red=t.material.red/255),1<t.material.green&&(t.material.green=t.material.green/255),1<t.material.blue&&(t.material.blue=t.material.blue/255),1<t.material.alpha&&(t.material.a=t.material.alpha/255),t.material=h._color.createColor(t.material.red,t.material.green,t.material.blue,t.material.alpha)))),2<=o.length&&(t.positions=Cesium.Cartesian3.fromDegreesArray(o),e=new Cesium.GeometryInstance({id:r,geometry:new Cesium.PolylineGeometry(t),attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(t.material)}}),t="material:"+255*t.material.red+","+255*t.material.green+","+255*t.material.blue,h.Legend.push(t),i.push(e))}}}))}}),this.img=this._Provider1.ent,o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:u,treeData:{name:e,geoOptions:t,styleOption:u,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.VolumeVectorGeoJsonFeatureLayerGisOptimization=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=(t.url,t.layer,t.upperLevelLimit,t.lowerLevelLimit,this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),this._cesium,this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.toString().charAt(0)&&"]"==i.material.toString().charAt(i.material.length-1)||(this._core.isHtmlColor(i.material)?i.material=this._color.colorFromHtmlColor(i.material):(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),c={id:t.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},u=this,a=(this._urlTemplate=t.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new Li(this._viewer,this._cesium,{url:this._urlTemplate},function(e){if(u.Level=u.getLevel(),u.Level<u._option.level_min){if(0<u.primitve.length){for(var t=0;t<u.primitve.length;t++)u._viewer.scene.primitives.remove(u.primitve[t]);u.primitve=[]}if(0<u.probj.length){for(t=0;t<u.probj.length;t++)u._viewer.scene.primitives.remove(u.probj[t]);u.probj=[]}s=[]}else{e.templateValues.z,e.templateValues.x,e.templateValues.reverseY,e.data={lines:[],geometryPrimitive:void 0};var i=e.url.replace("png","json");0<C.filter(s,function(e){return e.url==i}).length||1!=u.start&&(s.push({url:i}),u._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(0!=e.features.length){var t=[];u.Legend=[];for(var i=0;i<e.features.length;i++){var o=[],r=e.features[i];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}var a=new Cesium.Primitive({geometryInstances:t,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:u._core.Shaders("vertexShaderSource"),fragmentShaderSource:u._core.Shaders("fragmentShaderSource")}),shadows:u._option.shadows});u.primitve.push(a),u.probj.push(a),u._viewer.scene.primitives.add(a),u.returnCount++;try{2==u.probj.length&&(u._viewer.scene.primitives.remove(u.probj[0]),u.probj.pop())}catch(e){}}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e;c.extrudedHeight=u._option.extrudedHeight,/^\[/.test(u._option.extrudedHeight)&&/\]$/.test(u._option.extrudedHeight)&&(e=u._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),c.extrudedHeight=3*parseFloat(r.properties[e])),c.material=u._option.material,/^\[/.test(u._option.material)&&/\]$/.test(u._option.material)?(e=u._option.material.replace(/\[/,"").replace(/\]/,""),c.material=r.properties[e],u._core.isHtmlColor(c.material)?c.material=u._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=u._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=u._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))):(u._option.material&&(c.material=u._option.material),c.material&&(u._core.isHtmlColor(c.material)?c.material=u._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=u._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=u._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha)))),2<=o.length&&(e=Cesium.Cartesian3.fromDegreesArray(o),c.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(c),e=new Cesium.GeometryInstance({id:r,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material)}}),c.material.red,c.material.green,c.material.blue,t.push(e))}}}))}}),this.img=this._Provider1.ent,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,{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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization=function(e,t,m,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},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},d=(this._core.isnull(m)||this._core.isnull(m.material)||"["==m.material.toString().charAt(0)&&"]"==m.material.toString().charAt(m.material.length-1)||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))),this._core.extend(n,m,!0)),s=(null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),p=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&p.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=m.level_min&&t.level<m.level_max&&p.item.show){var o=C.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:o[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<p.PrimitiveData.length)for(var r=0;r<p.PrimitiveData.length;r++)if(p.PrimitiveData[r].key==i)return void p.Primitivekey.push(i);p.Primitivekey.includes(i)||(p.Primitivekey.push(i),s.push({level:t.level,x:t.x,y:t.y,data:void 0}),h=t,o=p._urlTemplate.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),p.tilesLength++,p._cache&&(o+="&"+p._core.getuid()),p._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(n.push(e[t]),2!==t||a||(a=!0))}function t(){var e=a?Cesium.Cartesian3.fromDegreesArrayHeights(n):Cesium.Cartesian3.fromDegreesArray(n),t=(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)&&(t=m.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(s.properties[t])),d.extrudedHeight=parseFloat(d.extrudedHeight),1==d.heightReference&&delete d.height,1==d.extrudedHeightReference&&delete d.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)&&(t=m.material.replace(/\[/,"").replace(/\]/,""),d.material=s.properties[t],p._core.isHtmlColor(d.material)?d.material=p._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=p._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=p._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),d.polygonHierarchy=new Cesium.PolygonHierarchy(e),new Cesium.PolygonGeometry(d)),e=(s.treeID=d.id,s.VectorType="polygon",s.VectorStyle={haveZ:a,extrudedHeight:d.extrudedHeight,positions:n,material:d.material},new Cesium.GeometryInstance({id:s,geometry:t,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}})),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue;p.Legend.push(t),i.push(e)}p.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=!1,s=e.features[r];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length)if(Array.isArray(s.geometry.coordinates[0][0]))for(var l=0;l<s.geometry.coordinates.length;l++)n=[],s.geometry.coordinates[l].pop(),o(s.geometry.coordinates[l]),t();else o(s.geometry.coordinates),t()}var c=new Cesium.ClassificationPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:p._core.Shaders("vertexShaderSource"),fragmentShaderSource:p._core.Shaders("fragmentShaderSource")}),classificationType:d.classificationType,shadows:Cesium.ShadowMode.ENABLED}),u=(p.PrimitiveObj.data=c,p.PrimitiveObj.key=p.Primitivekey[p.returnCount],{level:h.level,key:p.Primitivekey[p.returnCount],data:c});p.loadFinishKey.push(p.Primitivekey[p.returnCount]),p.PrimitiveData.push(u),p._viewer.scene.primitives.add(c),p.returnCount++,p.returnCount>=p.tilesLength&&(p.returnCount=0,p.tilesLength=0,p.Primitivekey=[])},error:function(){s=C.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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),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},E.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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),m=this,d=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){var l,c,u;l=e,u=m,(c=t).state===Cesium.QuadtreeTileLoadState.START&&(c.data={lines:[],geometryPrimitive:void 0},c.level>=i.level_min&&c.level<i.level_max&&u.item.show?(e=d.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level),u._cache&&(e+="&"+u._core.getuid()),u._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0;else{var i=new Cesium.PrimitiveCollection;u.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),a(r.geometry.coordinates[n]),s();else a(r.geometry.coordinates),s()}c.data.geometryPrimitive=i,c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive.update(l,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)}function a(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?a(e[t]):o.push(e[t])}function s(){var e,t;u._option.extrudedHeight&&(h.extrudedHeight=u._option.extrudedHeight),/^\[/.test(u._option.extrudedHeight)&&/\]$/.test(u._option.extrudedHeight)&&(e=u._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h.extrudedHeight=parseFloat(r.properties[e])),h.material=u._option.material,/^\[/.test(u._option.material)&&/\]$/.test(u._option.material)?(e=u._option.material.replace(/\[/,"").replace(/\]/,""),h.material=r.properties[e],u._core.isHtmlColor(h.material)?h.material=u._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=u._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=u._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha))):(u._option.material&&(h.material=u._option.material),h.material&&(u._core.isHtmlColor(h.material)?h.material=u._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=u._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=u._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha)))),2<=o.length&&(e=Cesium.Cartesian3.fromDegreesArray(o),h.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(h),e=new Cesium.GeometryInstance({id:r,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),e=new Cesium.ClassificationPrimitive({geometryInstances:e,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:u._core.Shaders("vertexShaderSource"),fragmentShaderSource:u._core.Shaders("fragmentShaderSource")}),classificationType:u._option.classificationType}),t="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue,u.Legend.push(t),i.add(e))}},error:function(){null==c.count&&(c.count=0),c.count+=1,2<=c.count?(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0):c.state=Cesium.QuadtreeTileLoadState.START}}),c.state=Cesium.QuadtreeTileLoadState.LOADING):(c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:h.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3=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},m=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this,d=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){var c,u,h;c=e,h=l,(u=t).state===Cesium.QuadtreeTileLoadState.START&&(u.data={lines:[],geometryPrimitive:void 0},u.level>=i.level_min&&u.level<i.level_max&&h.item.show?(e=d.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0;else{new Cesium.PrimitiveCollection,h.Legend=[];for(var t=[],i=0;i<e.features.length;i++){var o=[],r=e.features[i];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}var a=new Cesium.ClassificationPrimitive1({geometryInstances:t,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});u.data.geometryPrimitive=a,u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive.update(c,[]),u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0)}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e;h._option.extrudedHeight&&(m.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(r.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=r.properties[e],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=o.length&&(e=Cesium.Cartesian3.fromDegreesArray(o),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:r,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t.push(e))}},error:function(){null==u.count&&(u.count=0),u.count+=1,2<=u.count?(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0):u.state=Cesium.QuadtreeTileLoadState.START}}),u.state=Cesium.QuadtreeTileLoadState.LOADING):(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:m.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(e,t,n,i,o,r){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(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._option=this._core.extend(a,n,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=n.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=n.level_min&&t.level<n.level_max&&d.item.show){var o=C.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:o[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));d.Primitivekey.includes(i)||(d.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),u=t,o=d._urlTemplate.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),d.tilesLength++,h="z"+u.level+"x"+u.x+"y"+u.y,d._cache&&(o+="&"+d._core.getuid()),d._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=new Cesium.PrimitiveCollection;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){var e,t;d._option.extrudedHeight&&(m.extrudedHeight=d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(a.properties[e])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(e=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=a.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=n.length&&(e=Cesium.Cartesian3.fromDegreesArray(n),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),e=new Cesium.ClassificationPrimitive({geometryInstances:e,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),classificationType:d._option.classificationType}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.add(e))}d.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=i,c=(d.probj.push(l),{level:u.level,key:h,data:l});d.loadFinishKey.push(h),d.PrimitiveData.push(c),d._viewer.scene.primitives.add(l),d.returnCount++,d.removeObsoletePrimitives(u)},error:function(){var e=d.Primitivekey.indexOf(h);-1<e&&d.Primitivekey.splice(e,1),l=C.remove(l,function(e){return e.x==u.x&&e.y==u.y&&e.level==u.level})},complete:function(e,t){u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive&&(u.state=Cesium.QuadtreeTileLoadState.DONE),u.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 u,h},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n,treeData:{name:e,geoOptions:t,styleOption:n,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1=function(e,t,l,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(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._option=this._core.extend(n,l,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),m={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},d=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&d.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=l.level_min&&t.level<l.level_max&&d.item.show){var o=C.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:o[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<d.PrimitiveData.length)for(var r=0;r<d.PrimitiveData.length;r++)if(d.PrimitiveData[r].key==i)return void(d.Primitivekey.includes(i)||d.Primitivekey.push(i));if(!d.Primitivekey.includes(i)){d.Primitivekey.push(i),c.push({level:t.level,x:t.x,y:t.y,data:void 0});for(var o=d._option.level_min+Math.floor((d._option.level_max-d._option.level_min)/2),n=Oi(t,o),r=0;r<n.length;r++){var a=n[r],s="z"+a.level+"x"+a.x+"y"+a.y;d.loadAllKey.includes(s)||(d.loadAllKey.push(s),function(u){var e=d._urlTemplate.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),h=(d.tilesLength++,"z"+u.level+"x"+u.x+"y"+u.y);d._cache&&(e+="&"+d._core.getuid()),d._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):s.push(e[t])}function t(){var e,t;d._option.extrudedHeight&&(m.extrudedHeight=d._option.extrudedHeight),/^\[/.test(d._option.extrudedHeight)&&/\]$/.test(d._option.extrudedHeight)&&(e=d._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(l.properties[e])),m.material=d._option.material,/^\[/.test(d._option.material)&&/\]$/.test(d._option.material)?(e=d._option.material.replace(/\[/,"").replace(/\]/,""),m.material=l.properties[e],d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(d._option.material&&(m.material=d._option.material),m.material&&(d._core.isHtmlColor(m.material)?m.material=d._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=d._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=d._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=s.length&&(e=Cesium.Cartesian3.fromDegreesArray(s),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:l,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,d.Legend.push(t),i.push(e))}d.Legend=[];for(var r,n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var c=0;c<l.geometry.coordinates.length;c++)s=[],l.geometry.coordinates[c].pop(),o(l.geometry.coordinates[c]),t();else o(l.geometry.coordinates),t()}0<i.length&&(r=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:d._core.Shaders("vertexShaderSource"),fragmentShaderSource:d._core.Shaders("fragmentShaderSource")}),classificationType:d._option.classificationType,show:d.item.show}),d.probj.push(r),n={level:u.level,key:h,data:r},d.loadFinishKey.push(h),d.PrimitiveData.push(n),d._viewer.scene.primitives.add(r),d.returnCount++)},error:function(){},complete:function(e,t){}})}(a))}}}}else t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)}},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;n={id:m.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l,treeData:{name:e,geoOptions:t,styleOption:l,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.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2=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},m=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this,d=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){var c,u,h;c=e,h=l,(u=t).state===Cesium.QuadtreeTileLoadState.START&&(u.data={lines:[],geometryPrimitive:void 0},u.level>=i.level_min&&u.level<i.level_max&&h.item.show?(e=d.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0;else{var i=[];h.Legend=[];for(var t=0;t<e.features.length;t++){var o=[],r=e.features[t];if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var n=0;n<r.geometry.coordinates.length;n++)o=[],r.geometry.coordinates[n].pop(),s(r.geometry.coordinates[n]),l();else s(r.geometry.coordinates),l()}0==i.length&&(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0);var a=new Cesium.GroundPrimitive1({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),classificationType:h._option.classificationType});u.data.geometryPrimitive=a,u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive.update1(c,[]),u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0)}function s(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?s(e[t]):o.push(e[t])}function l(){var e,t;h._option.extrudedHeight&&(m.extrudedHeight=h._option.extrudedHeight),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),m.extrudedHeight=parseFloat(r.properties[e])),m.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),m.material=r.properties[e],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha))):(h._option.material&&(m.material=h._option.material),m.material&&(h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.red&&(m.material.red=m.material.red/255),1<m.material.green&&(m.material.green=m.material.green/255),1<m.material.blue&&(m.material.blue=m.material.blue/255),1<m.material.alpha&&(m.material.a=m.material.alpha/255),m.material=h._color.createColor(m.material.red,m.material.green,m.material.blue,m.material.alpha)))),2<=o.length&&(e=Cesium.Cartesian3.fromDegreesArray(o),m.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(m),e=new Cesium.GeometryInstance({id:r,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),t="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,h.Legend.push(t),i.push(e))}},error:function(){u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0}}),u.state=Cesium.QuadtreeTileLoadState.LOADING):(u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:m.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3=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},d=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._option=this._core.extend(a,i,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this,c=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url+"?"+this._serialize(s.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=i.level_max-1,this._Provider.loadTile=function(e,t){var u,h,m;u=e,m=l,(h=t).state===Cesium.QuadtreeTileLoadState.START&&(h.data={lines:[],geometryPrimitive:void 0},h.level>=i.level_min&&h.level<i.level_max&&m.item.show?(e=c.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=["#ffff00","#ffcc00","#ff3300","#ccff00","#cccc00","#99ff66","#999933","#66cc99","#6633ff","#33ffff","#3399cc","#009933","#ccccff","#ff99ff","#9966ff","#336699"];if(null==e)h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;else{var o=[];m.Legend=[];for(var t=0;t<e.features.length;t++){var r=[],n=e.features[t];if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length)if(Array.isArray(n.geometry.coordinates[0][0]))for(var a=0;a<n.geometry.coordinates.length;a++)r=[],n.geometry.coordinates[a].pop(),l(n.geometry.coordinates[a]),c();else l(n.geometry.coordinates),c()}0==o.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);var s=new Cesium.ClassificationPrimitive1({geometryInstances:o,classificationType:Cesium.ClassificationType.BOTH});h.data.geometryPrimitive=s,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(u,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}function l(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?l(e[t]):r.push(e[t])}function c(){var e,t;m._option.extrudedHeight&&(d.extrudedHeight=m._option.extrudedHeight),/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)&&(e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(n.properties[e])),d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(e=m._option.material.replace(/\[/,"").replace(/\]/,""),d.material=n.properties[e],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))):(m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)))),2<=r.length&&(e=Cesium.Cartesian3.fromDegreesArray(r),d.polygonHierarchy=new Cesium.PolygonHierarchy(e),0!=d.extrudedHeight&&"0"!=d.extrudedHeight&&null!=d.extrudedHeight&&null!=d.extrudedHeight||(d.extrudedHeight=1e4),e=new Cesium.PolygonGeometry(d),t=i[Math.floor(Math.random()*i.length)],e=new Cesium.GeometryInstance({id:n,geometry:e,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t).withAlpha(.5))}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,m.Legend.push(t),o.push(e))}},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING):(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(d.id)&&(d.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+d.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:d.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},E.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,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},s=((s=this)._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),this),l=(this._urlTemplate=t.url+"?"+this._serialize(n.urlParams),t.url+"?"+this._serialize(n.urlParams)),n=(this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,{Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:Cesium.LabelStyle.OUTLINE,fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new Cesium.Color(.165,.165,.165,.8),backgroundPadding:new Cesium.Cartesian2(7,5),scale:1,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,eyeOffset:Cesium.Cartesian3.ZERO,pixelOffset:Cesium.Cartesian2.ZERO,heightReference:Cesium.HeightReference.NONE,scaleByDistance:new Cesium.NearFarScalar(0,0,1,1)}),c=(s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),s._core.extend(n,a,!0)),n=(s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999),parseFloat(a.near)),u=parseFloat(a.far),n=new Cesium.DistanceDisplayCondition(n,u);c.distanceDisplayCondition=n,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),c.font=parseFloat(a.font_size)+"px "+a.font_family,a.material,this._Provider.loadTile=function(e,t){var i,o,n;i=e,n=s,(o=t).state===Cesium.QuadtreeTileLoadState.START&&(o.data={lines:[],geometryPrimitive:void 0},o.level>=a.level_min&&o.level<a.level_max&&n.item.show?(e=l.replace(window.encodeURIComponent("{x}"),o.x).replace(window.encodeURIComponent("{y}"),o.y).replace(window.encodeURIComponent("{z}"),o.level),n._cache&&(e+="&"+n._core.getuid()),n._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var r;null==e?(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0):(r=new Cesium.PointPrimitiveCollection,e.features.forEach(function(e){c.id=e;var t,i=0,o=(/^\[/.test(c.pointHeight)&&/\]$/.test(c.pointHeight)?(o=c.pointHeight.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[o])):void 0!==c.pointHeight&&""!==c.pointHeight?i=parseFloat(c.pointHeight):null!=e.properties.height&&(i=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(t=a.color.replace(/\[/,"").replace(/\]/,""),c.color=e.properties[t],n._core.isHtmlColor(c.color)?c.color=n._color.colorFromHtmlColor(c.color):(/^rgb/.test(c.color)&&(c.color=n._color.rgbaStringToRgbaObj(c.color)),1<c.color.r&&(c.color.r=c.color.r/255),1<c.color.g&&(c.color.g=c.color.g/255),1<c.color.b&&(c.color.b=c.color.b/255),1<c.color.a&&(c.color.a=c.color.a/255),c.color=n._color.createColor(c.color.r,c.color.g,c.color.b,c.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(t=a.outlineColor.replace(/\[/,"").replace(/\]/,""),c.outlineColor=e.properties[t],n._core.isHtmlColor(c.outlineColor)?c.outlineColor=n._color.colorFromHtmlColor(c.outlineColor):(/^rgb/.test(c.outlineColor)&&(c.outlineColor=n._color.rgbaStringToRgbaObj(c.outlineColor)),1<c.outlineColor.r&&(c.outlineColor.r=c.outlineColor.r/255),1<c.outlineColor.g&&(c.outlineColor.g=c.outlineColor.g/255),1<c.outlineColor.b&&(c.outlineColor.b=c.outlineColor.b/255),1<c.outlineColor.a&&(c.outlineColor.a=c.outlineColor.a/255),c.outlineColor=n._color.createColor(c.outlineColor.r,c.outlineColor.g,c.outlineColor.b,c.outlineColor.a))),c.position=new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),c.text=e.properties.name,{show:c.show,position:c.position,pixelSize:c.pixelSize,color:c.color,outlineColor:c.outlineColor,outlineWidth:c.outlineWidth,id:e});c.color&&c.color.red&&(t="color:"+255*c.color.red+","+255*c.color.green+","+255*c.color.blue+";outlineColor:"+255*c.outlineColor.red+","+255*c.outlineColor.green+","+255*c.outlineColor.blue,n.Legend.push(t)),o.id.treeID=a.id,o.id.VectorType="point",o.id.VectorStyle={show:o.show,pointHeight:i,position:o.position,pixelSize:o.pixelSize,color:o.color,outlineColor:o.outlineColor,outlineWidth:o.outlineWidth},r.add(o)}),o.data.geometryPrimitive=r,o.state=Cesium.QuadtreeTileLoadState.LOADING,o.state===Cesium.QuadtreeTileLoadState.LOADING&&(o.data.geometryPrimitive.update(i,[]),o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0))},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):(o.state=Cesium.QuadtreeTileLoadState.DONE,o.renderable=!0))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});u=this._viewer.scene.primitives,a&&a.time&&(this._Provider._availability=new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:a.time.start?Cesium.JulianDate.fromDate(new Date(a.time.start)):Cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?Cesium.JulianDate.fromDate(new Date(a.time.end)):Cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),u.add(this._primitive),o?(this.item.show=!0,this.setVisibility(!0)):this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,n={id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a,treeData:{name:e,geoOptions:t,styleOption:a,GroupID:i,checked:o,disFnc:r}};return this._Provider.treeID=a.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,d,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.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: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},p=(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.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),this._option=this._core.extend({...a},d,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{id:this._option.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this;let c=-1<t.url.indexOf("/gisserver/");n=c?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._serialize(s.urlParams),this._urlTemplate=n,this._Provider=new T(this._viewer,this._cesium,c?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=d.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var u=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START)if(h.data={lines:[],geometryPrimitive:void 0},h.level>=d.level_min&&h.level<d.level_max&&m.item.show){if(c&&(h.reverseY=m._Provider.tilingScheme.getNumberOfYTilesAtLevel(h.level)-h.y-1),m.TileMatrixLimits){var i=m.TileMatrixLimits[h.level];if(!i||h.x>i.maxCol||h.x<i.minCol||h.y>i.maxRow||h.y<i.minRow)return void(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}i=n.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.reverseY||h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(i+="&"+m._core.getuid()),m._core.xhr({url:i,type:"get",dataType:"json",success:function(e){if(null==e)h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;else{var i=[];m.Legend=[];for(var t,o=0;o<e.features.length;o++){var r=[],n=!1,a=e.features[o];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)r=[],a.geometry.coordinates[s].pop(),l(a.geometry.coordinates[s]),c();else l(a.geometry.coordinates),c()}0==i.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0),t=p.material.alpha<1?new Cesium.PerInstanceColorAppearance({translucent:!0}):new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),t=m._option.clampToGround?new Cesium.GroundPrimitive({geometryInstances:i,appearance:t,classificationType:m._option.classificationType}):new Cesium.Primitive({geometryInstances:i,appearance:t,shadows:m._option.shadows}),h.data.geometryPrimitive=t,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(u,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}function l(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?l(e[t]):(r.push(e[t]),2!==t||n||(n=!0))}function c(){var e,t;/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)?(e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),p.extrudedHeight=parseFloat(a.properties[e])):m._option.extrudedHeight&&(p.extrudedHeight=parseFloat(m._option.extrudedHeight)),/^\[/.test(m._option.height)&&/\]$/.test(m._option.height)?(e=m._option.height.replace(/\[/,"").replace(/\]/,""),p.height=parseFloat(a.properties[e])):m._option.height&&(p.height=parseFloat(m._option.height)),p.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(e=m._option.material.replace(/\[/,"").replace(/\]/,""),p.material=a.properties[e],m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha))):(m._option.material&&(p.material=m._option.material),p.material&&(m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.red&&(p.material.red=p.material.red/255),1<p.material.green&&(p.material.green=p.material.green/255),1<p.material.blue&&(p.material.blue=p.material.blue/255),1<p.material.alpha&&(p.material.a=p.material.alpha/255),p.material=m._color.createColor(p.material.red,p.material.green,p.material.blue,p.material.alpha)))),d.preLoad&&d.preLoad(p,a),2<=r.length&&(e=n?Cesium.Cartesian3.fromDegreesArrayHeights(r):Cesium.Cartesian3.fromDegreesArray(r),p.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(p),a.treeID=p.id,a.VectorType="polygon",a.VectorStyle={haveZ:n,extrudedHeight:p.extrudedHeight,positions:r,material:p.material},e=new Cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(p.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(m._option.near,m._option.far)}}),t="material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue,m.Legend.push(t),i.push(e))}},error:function(){h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}}),h.state=Cesium.QuadtreeTileLoadState.LOADING}else h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0},"function"==typeof r&&r(this.item)};let u,h;this.saveDefaultVectorData=()=>{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(u),u=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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),s.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:c},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},E.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},c=(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.color.r&&(o.color.r=o.color.r/255),1<o.color.g&&(o.color.g=o.color.g/255),1<o.color.b&&(o.color.b=o.color.b/255),1<o.color.a&&(o.color.a=o.color.a/255),o.color=a._color.createColor(o.color.r,o.color.g,o.color.b,o.color.a))),a._core.extend(s,o,!0)),s=(a._core.isnull(o.near)&&(o.near=0),a._core.isnull(o.far)&&(o.far=999999999),parseFloat(o.near)),u=parseFloat(o.far),s=new Cesium.DistanceDisplayCondition(s,u),h=(c.distanceDisplayCondition=s,o.material,this._urlTemplate=t.url+"?"+this._serialize(l.urlParams),t.url+"?"+this._serialize(l.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(c.height)||0,this._Provider.loadTile=function(t,i){var e;i.state===Cesium.QuadtreeTileLoadState.START&&(i.data={lines:[],geometryPrimitive:void 0},i.level>=o.level_min&&i.level<o.level_max&&a.item.show?(e=h.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level),a._cache&&(e+="&"+a._core.getuid()),a._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var o;null==e?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):(o=new Cesium.PrimitiveCollection({isModel:!0}),e.features.forEach(function(e){var t=(c.id=e).geometry.coordinates[2]||0,i=(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(c.height)&&/\]$/.test(c.height)?(i=c.height.replace(/\[/,"").replace(/\]/,""),t+=parseFloat(e.properties[i])):t+=parseFloat(c.height)||0,c.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t)),Cesium.Model.fromGltf({id:e,url:c.uri,color:c.color,modelMatrix:c.modelMatrix,scale:c.scale,heightReference:parseInt(c.heightReference),distanceDisplayCondition:c.distanceDisplayCondition}));o.add(i)}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=o,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0))},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING):(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0))},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});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;u={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(u),this._tree.insertGroupId(u,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},E.prototype.createModelGeoJsonFeatureLayerProvider=function(e,t,o,i,r,n){var a,s=this,l={url:"",color:Cesium.Color.DARKSALMON,scale:2},c={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},u=(s._core.isnull(o)||s._core.isnull(o.color)||/^\[/.test(o.color)&&"["==o.color.toString().charAt(0)&&"]"==o.color.toString().charAt(o.color.length-1)||(s._core.isHtmlColor(o.color)?o.color=s._color.colorFromHtmlColor(o.color):(/^rgb/.test(o.color)&&(o.color=s._color.rgbaStringToRgbaObj(o.color)),1<o.color.r&&(o.color.r=o.color.r/255),1<o.color.g&&(o.color.g=o.color.g/255),1<o.color.b&&(o.color.b=o.color.b/255),1<o.color.a&&(o.color.a=o.color.a/255),o.color=s._color.createColor(o.color.r,o.color.g,o.color.b,o.color.a))),s._core.extend(l,o,!0)),h=(s._core.isnull(o.near)&&(o.near=0),s._core.isnull(o.far)&&(o.far=999999999),parseFloat(o.near)),m=parseFloat(o.far),h=new Cesium.DistanceDisplayCondition(h,m);u.distanceDisplayCondition=h,o.material;let d=-1<t.url.indexOf("/gisserver/");a=d?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._serialize(c.urlParams),this._urlTemplate=a,this._Provider=new T(this._viewer,this._cesium,d?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(u.height)||0,this.initThisProvider=()=>{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.level<o.level_max&&s.item.show){if(d&&(i.reverseY=s._Provider.tilingScheme.getNumberOfYTilesAtLevel(i.level)-i.y-1),s.TileMatrixLimits){var e=s.TileMatrixLimits[i.level];if(!e||i.x>e.maxCol||i.x<e.minCol||i.y>e.maxRow||i.y<e.minRow)return i.state=Cesium.QuadtreeTileLoadState.DONE,void(i.renderable=!0)}e=a.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.reverseY||i.y).replace(window.encodeURIComponent("{z}"),i.level);s._cache&&(e+="&"+s._core.getuid()),s._core.xhr({url:e,type:"get",dataType:"json",success:function(e){if(null==e)i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0;else{let a=[],s;Cesium.ModelInstanceCollection||(s=new Cesium.PrimitiveCollection),e.features.forEach(function(e){var t=(u.id=e).geometry.coordinates[2]||0,i=(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(u.height)&&/\]$/.test(u.height)?(i=u.height.replace(/\[/,"").replace(/\]/,""),t+=parseFloat(e.properties[i])):t+=parseFloat(u.height)||0,Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t)));let o=u.heading||0,r=u.pitch||0,n=u.roll||0;/^\[/.test(o)&&/\]$/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=parseFloat(e.properties[o])),/^\[/.test(r)&&/\]$/.test(r)&&(r=r.replace(/\[/,"").replace(/\]/,""),r=parseFloat(e.properties[r])),/^\[/.test(n)&&/\]$/.test(n)&&(n=n.replace(/\[/,"").replace(/\]/,""),n=parseFloat(e.properties[n]));t=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o),Cesium.Math.toRadians(r),Cesium.Math.toRadians(n)),t=Cesium.Matrix3.fromHeadingPitchRoll(t);Cesium.Matrix4.multiplyByMatrix3(i,t,i),Cesium.Matrix4.multiplyByUniformScale(i,u.scale,i),s?s.add(Cesium.Model.fromGltf({id:e,url:u.uri,modelMatrix:i,color:u.color})):a.push({modelMatrix:i,modelId:e})}),s=s||new Cesium.ModelInstanceCollection({url:u.uri,instances:a,color:u.color}),0==e.features.length&&(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0),i.data.geometryPrimitive=s,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(t,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)}},error:function(){null==i.count&&(i.count=0),i.count+=1,2<=i.count?(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0):i.state=Cesium.QuadtreeTileLoadState.START}}),i.state=Cesium.QuadtreeTileLoadState.LOADING}else i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0},"function"==typeof n&&n(this.item)};let p,g;this.saveDefaultVectorData=()=>{g=s._core.extend({},o,!0)},this.restoreVector=()=>{g&&(o=g,u=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),u=s._core.extend(u,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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),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(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,h={id:u.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},E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1=function(e,t,c,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},u=(this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))),this._option=this._core.extend(n,c,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=c.level_max-1,h._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=h._option.fill.indexOf("[")?h._defaultStyle.fillShow=h._option.fill:h._defaultStyle.fillColor=Cesium.Color.fromCssColorString(h._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>c.level_max+2&&0<h.probj.length)for(;0<h.probj.length;n++){h._viewer.entities.remove(h.probj[0]);var o=h.probj.indexOf(h.probj[0]);h.probj.splice(o,1)}if(t.level>=c.level_min&&t.level<c.level_max&&h.item.show){var r=C.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:r[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<h.PrimitiveData.length)for(var n=0;n<h.PrimitiveData.length;n++)if(h.PrimitiveData[n].key==i)return void(h.Primitivekey.includes(i)||h.Primitivekey.push(i));h.Primitivekey.includes(i)||(h.Primitivekey.push(i),u.push({level:t.level,x:t.x,y:t.y,data:void 0}),a=t,r=h._urlTemplate.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level),h.tilesLength++,s="z"+a.level+"x"+a.x+"y"+a.y,h._cache&&(r+="&"+h._core.getuid()),l={xMin:Cesium.Math.toDegrees(a._rectangle.west),yMin:Cesium.Math.toDegrees(a._rectangle.south),xMax:Cesium.Math.toDegrees(a._rectangle.east),yMax:Cesium.Math.toDegrees(a._rectangle.north)},h._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var t=e,e=(h._tileWidth=256,h._tileHeight=256,h.x=a._x,h.y=a._y,h.level=a._level,h._createCanvas(),h._drawGeojson(h._context,0,0,e,l,h._tileWidth,h._tileHeight,h._fill,h._outline,h.x,h.y,h.level),h._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:a.rectangle,material:new Cesium.ImageMaterialProperty({image:h._canvas,transparent:!0}),zIndex:a.level,classificationType:Cesium.ClassificationType.BOTH}})),t=(h.probj.push(e),{level:a.level,key:s,data:e});h.loadFinishKey.push(s),h.PrimitiveData.push(t),h.returnCount++,h.removeObsoleteEntitiesxp(a.rectangle)},error:function(){a.state=Cesium.QuadtreeTileLoadState.DONE,a.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 a,s,l},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:n.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.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(e,t,l,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(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._option=this._core.extend(n,l,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},u=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=l.level_max-1,u._defaultStyle={outlineColor:Cesium.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:Cesium.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:Cesium.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",pointColor:Cesium.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},-1!=u._option.fill.indexOf("[")?u._defaultStyle.fillShow=u._option.fill:u._defaultStyle.fillColor=Cesium.Color.fromCssColorString(u._option.fill),this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&u.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>l.level_max+2&&0<u.probj.length)for(;0<u.probj.length;n++){u._viewer.entities.remove(u.probj[0]);var o=u.probj.indexOf(u.probj[0]);u.probj.splice(o,1)}if(t.level>=l.level_min&&t.level<l.level_max&&u.item.show){var r=C.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=r.length&&r[0].data&&0<r[0].data.length)t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:r[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=Cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<u.PrimitiveData.length)for(var n=0;n<u.PrimitiveData.length;n++)if(u.PrimitiveData[n].key==i)return void(u.Primitivekey.includes(i)||u.Primitivekey.push(i));u.Primitivekey.includes(i)||(u.Primitivekey.push(i),c.push({level:t.level,x:t.x,y:t.y,data:void 0}),a=t,r=u._urlTemplate.replace(window.encodeURIComponent("{x}"),a.x).replace(window.encodeURIComponent("{y}"),a.y).replace(window.encodeURIComponent("{z}"),a.level),u.tilesLength++,s="z"+a.level+"x"+a.x+"y"+a.y,u._cache&&(r+="&"+u._core.getuid()),Cesium.Math.toDegrees(a._rectangle.west),Cesium.Math.toDegrees(a._rectangle.south),Cesium.Math.toDegrees(a._rectangle.east),Cesium.Math.toDegrees(a._rectangle.north),u._core.xhr({url:r,type:"get",dataType:"json",success:function(e){var t=e,t=(u._tileWidth=256,u._tileHeight=256,u.x=a._x,u.y=a._y,u.level=a._level,u._viewer.entities.add({ids:t,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:a.rectangle,material:new Cesium.ImageMaterialProperty({image:e,transparent:!0}),zIndex:a.level,classificationType:Cesium.ClassificationType.BOTH}})),e=(u.probj.push(t),{level:a.level,key:s,data:t});u.loadFinishKey.push(s),u.PrimitiveData.push(e),u.returnCount++,u.removeObsoleteEntitiesxp(a.rectangle)},error:function(){a.state=Cesium.QuadtreeTileLoadState.DONE,a.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 a,s},this._primitive=new Cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.add(this._primitive),o||this.setVisibility(!1),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l,treeData:{name:e,geoOptions:t,styleOption:l,GroupID:i,checked:o,disFnc:r}};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},E.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=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: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},d=(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.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),{id:this._option.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED}),l=this,a=-1<t.url.indexOf("/gisserver/"),c=a?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._serialize(s.urlParams);this._urlTemplate=c,this._Provider=new T(this._viewer,this._cesium,a?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=o.level_max-1,this._Provider._minimumHeight=parseFloat(o.height||0),this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var u=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START)if(h.data={lines:[],geometryPrimitive:void 0},h.level>=o.level_min&&h.level<o.level_max&&m.item.show){if(m.TileMatrixLimits){var i=m.TileMatrixLimits[h.level];if(!i||h.x>i.maxCol||h.x<i.minCol||h.y>i.maxRow||h.y<i.minRow)return void(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}i=c.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(i+="&"+m._core.getuid()),m._core.xhr({url:i,type:"get",dataType:"json",success:function(e){var t=C.cloneDeep(e);if(t.features.length<=0)h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;else if(null==t)h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0;else{var i=[];m.Legend=[];for(var o=0;o<t.features.length;o++){var r=[],n=!1,a=t.features[o];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)r=[],a.geometry.coordinates[s].pop(),l(a.geometry.coordinates[s]),c();else l(a.geometry.coordinates),c()}0==i.length&&(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0);e=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:m._core.Shaders("vertexShaderSource"),fragmentShaderSource:m._core.Shaders("fragmentShaderSource")}),classificationType:m._option.classificationType,shadows:m._option.shadows});m.probj.push(e),h.data.geometryPrimitive=e,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(u,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}function l(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?l(e[t]):(r.push(e[t]),2!==t||n||(n=!0))}function c(){var e,t;/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)&&(e=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),d.extrudedHeight=parseFloat(a.properties[e])),d.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(e=m._option.material.replace(/\[/,"").replace(/\]/,""),d.material=a.properties[e],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha))):(m._option.material&&(d.material=m._option.material),d.material&&(m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.red&&(d.material.red=d.material.red/255),1<d.material.green&&(d.material.green=d.material.green/255),1<d.material.blue&&(d.material.blue=d.material.blue/255),1<d.material.alpha&&(d.material.a=d.material.alpha/255),d.material=m._color.createColor(d.material.red,d.material.green,d.material.blue,d.material.alpha)))),2<=r.length&&(e=n?Cesium.Cartesian3.fromDegreesArrayHeights(r):Cesium.Cartesian3.fromDegreesArray(r),d.polygonHierarchy=new Cesium.PolygonHierarchy(e),e=new Cesium.PolygonGeometry(d),a.treeID=d.id,a.VectorType="polygon",a.VectorStyle={haveZ:n,extrudedHeight:d.extrudedHeight,positions:r,material:d.material},e=new Cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,m.Legend.push(t),i.push(e))}},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}else h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0}},this._primitive=new 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:4490",gisserverTMS:a},e=>{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},E.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;t<e.features.length;t++)e.features[t].properties.nod=0==t?"rgba(255,255,0,1)":1==t?"rgba(220,20,60,1)":2==t?"rgba(75,0,130,1)":3==t?"rgba(0,0,255,1)":4==t?"rgba(30,144,255,1)":"rgba(50,205,50,1)";try{var i=new VectorTileImageryProvider({source:e,zIndex:99,removeDuplicate:!1,defaultStyle:{outlineColor:"rgba(209,204,226,1)",lineWidth:0,outline:!0,fill:!0,fillColor:"rgba(209,204,226,1)",fillShow:"[nod]",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:"rgba(255,0,0,1)",labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"黑体",centerLabelPropertyName:"NAME"},maximumLevel:20,minimumLevel:15,simplify:!1});i.readyPromise.then(function(){viewer.imageryLayers.addImageryProvider(i),Cesium.Camera.DEFAULT_VIEW_RECTANGLE=i.rectangle})}catch(e){console.log(e)}})},E.prototype._drawGeojson=function(o,r,n,e,a,t,i,s,l,c,u,h){var m,d,p,g,f,_,C,y,v,w,b,T,S,E=this;function P(e){if(E._styleFilter){if(0==(d=e.style).show)return;p={labelStroke:d.labelStroke,labelStrokeWidth:d.labelStrokeWidth,labelStrokeColor:d.labelStrokeColor,pointSize:d.pointSize,fontSize:d.fontSize,fontFamily:d.fontFamily,color:d.fontColor.toCssColorString(),backgroundColor:d.pointColor.toCssColorString(),pointStyle:d.pointStyle,ringRadius:d.ringRadius,circleLineWidth:d.circleLineWidth,showMaker:d.showMaker,showLabel:d.showLabel,labelOffsetX:d.labelOffsetX,labelOffsetY:d.labelOffsetY,markerSymbol:d.makerImage instanceof Image?d.makerImage:d.makerImageEl}}else d=E._defaultStyle;if(o.lineWidth=d.lineWidth,o.strokeStyle=d.outlineColor.toCssColorString(),o.fillStyle=d.fillColor.toCssColorString(),-1!=d.fillShow.indexOf("[")&&(i=d.fillShow.replace("[","").replace("]",""),o.fillStyle=e.properties[i]),d.lineDash&&o.setLineDash(d.lineDash),o.lineCap=d.lineCap,d.shadowColor&&d.shadowColor instanceof Cesium.Color?o.shadowColor=d.shadowColor.toCssColorString():o.shadowColor=d.shadowColor,o.shadowBlur=d.shadowBlur,o.shadowOffsetX=d.shadowOffsetX,o.shadowOffsetY=d.shadowOffsetY,o.miterLimit=d.miterLimit,o.lineJoin=d.lineJoin,"Point"==e.geometry.type)drawMarker(o,m,a,r,n,e,s,l,d.labelPropertyName,p);else if("Polygon"==e.geometry.type&&d.fill){var t=turf.getCoords(e),i=Vi(o,m,a,r,n,t,!0,!1);i&&i.map(function(e){e.style=d,g.push(e)})}else if("MultiPolygon"==e.geometry.type&&d.fill)try{turf.getCoords(e).map(function(e){e=Vi(o,m,a,r,n,e,!0,!1);e&&e.map(function(e){e.style=d,g.push(e)})})}catch(e){}else"MultiLineString"==e.geometry.type?e.properties.isOutline&&!d.outline||(t=turf.getCoords(e),Vi(o,m,a,r,n,t,!1,!0)):"LineString"!=e.geometry.type||e.properties.isOutline&&!d.outline||(i=turf.getCoords(e),Vi(o,m,a,r,n,t=[i],!1,!0),i=null)}void 0===l&&(l=!0),((s=void 0===s?!0:s)||l)&&(m=new Mi(t=void 0===t?o.canvas.width-r:t,i=void 0===i?o.canvas.height-n:i),d=this._defaultStyle,p={labelStroke:d.labelStroke,labelStrokeWidth:d.labelStrokeWidth,labelStrokeColor:d.labelStrokeColor,pointSize:d.pointSize,fontSize:d.fontSize,fontFamily:d.fontFamily,color:d.fontColor.toCssColorString(),backgroundColor:d.pointColor.toCssColorString(),pointStyle:d.pointStyle,ringRadius:d.ringRadius,circleLineWidth:d.circleLineWidth,showMaker:d.showMaker,showLabel:d.showLabel,labelOffsetX:d.labelOffsetX,labelOffsetY:d.labelOffsetY,markerSymbol:d.makerImage instanceof Image?d.makerImage:d.makerImageEl},g=[],E._styleFilter&&(turf.featureEach(e,function(e,t){E._styleFilter&&(d=E._defaultStyle.clone(),E._styleFilter(e,d,c,u,h),e.style=d)}),e.features.sort(function(e,t){return e.style&&e.style.lineDash?1:t.style&&t.style.lineDash?-1:0})),turf.featureEach(e,function(e,t){"Polygon"!=e.geometry.type&&"MultiPolygon"!=e.geometry.type||P(e)}),g&&g.length&&(f=m,_=a,C=r,y=n,t=g,w=(i=o).canvas,b=i.getImageData(0,0,w.width,w.height),(T=document.createElement("canvas")).width=w.width,T.height=w.height,S=T.getContext("2d"),t.map(function(e){S.clearRect(0,0,T.width,T.height),S.beginPath();var t=0;e.map(function(e){e=f.project(e,_);0==t?S.moveTo(C+e.x,y+e.y):S.lineTo(C+e.x,y+e.y),t++}),S.closePath(),S.fillStyle="rgba(255,255,255,1)",S.fill(),v=S.getImageData(0,0,T.width,T.height).data;for(var i=3;i<v.length;i+=4)0<v[i]&&(b.data[i]=0)}),i.putImageData(b,0,0)),turf.featureEach(e,function(e,t){"LineString"!=e.geometry.type&&"MultiLineString"!=e.geometry.type||P(e)}),turf.featureEach(e,function(e,t){"Point"!=e.geometry.type&&"MultiPoint"!=e.geometry.type||P(e)}))},E.prototype._createCanvas=function(){this._canvas=document.createElement("canvas"),this._canvas.width=this._tileWidth,this._canvas.height=this._tileHeight,this._context=this._canvas.getContext("2d"),this._context.lineWidth=this._defaultStyle.lineWidth,this._context.strokeStyle=this._defaultStyle.outlineColor.toCssColorString(),this._context.fillStyle=this._defaultStyle.fillColor.toCssColorString()},E.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},E.prototype.removeObsoletePrimitives1=function(e){},E.prototype.removeObsoletePrimitives=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,Ri(t)),o=Math.max.apply(Math,Ri(t)),r=this.PrimitiveData.length-1;0<=r;r--){var n=this.PrimitiveData[r];(n.level<i||n.level>o)&&this._viewer.scene.primitives.remove(n.data)&&(-1<(u=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(u,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<s.length;r++)var l=s[r].children,a=a.concat(l);for(var c,u,r=0;r<a.length;r++)a[r]&&(c="z"+a[r].level+"x"+a[r].x+"y"+a[r].y,-1<(u=this.loadFinishKey.indexOf(c))&&this._viewer.scene.primitives.remove(this.PrimitiveData[u].data)&&(-1<(u=this.Primitivekey.indexOf(c))&&this.Primitivekey.splice(u,1),this.PrimitiveData.splice(u,1),this.loadFinishKey.splice(u,1)))},E.prototype.removeObsoleteEntities=function(e){for(var t=this._viewer.scene.globe._surface._tilesToRender.map(function(e){return e.level}),i=Math.min.apply(Math,Ri(t))-1,o=Math.max.apply(Math,Ri(t))+1,r=this.PrimitiveData.length-1;0<=r;r--){var n=this.PrimitiveData[r];(n.level<i||n.level>o)&&this._viewer.entities.remove(n.data)&&(-1<(u=this.Primitivekey.indexOf(this.loadFinishKey[r]))&&this.Primitivekey.splice(u,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<s.length;r++)var l=s[r].children,a=a.concat(l);for(var c,u,r=0;r<a.length;r++)a[r]&&(c="z"+a[r].level+"x"+a[r].x+"y"+a[r].y,-1<(u=this.loadFinishKey.indexOf(c))&&this._viewer.entities.remove(this.PrimitiveData[u].data)&&(-1<(u=this.Primitivekey.indexOf(c))&&this.Primitivekey.splice(u,1),this.PrimitiveData.splice(u,1),this.loadFinishKey.splice(u,1)))},E.prototype.removeObsoleteEntitiesxp=function(e){for(var t=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.west),this._cesium.Math.toDegrees(e.south)),i=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.east),this._cesium.Math.toDegrees(e.north)),o=0;o<this.probj.length;o++)this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(t)),this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(i));for(var r=this._viewer.camera.computeViewRectangle(),n=0;n<this.probj.length;n++){var a=this.probj[n].rectangle.coordinates.getValue(),s=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.west),this._cesium.Math.toDegrees(a.south)),a=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.east),this._cesium.Math.toDegrees(a.north)),s=this._cesium.Rectangle.contains(r,this._cesium.Cartographic.fromCartesian(s)),a=this._cesium.Rectangle.contains(r,this._cesium.Cartographic.fromCartesian(a));this.probj[n].show=!(!s&&!a)}},E.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},E.prototype.setTreeobj=function(e){this.treeobj=e},E.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t,pId:this.treeobj.pId},treeData:this.treeobj.treeData}},E.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&0<this.probj.length&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),null!=this.img&&this._viewer.imageryLayers.remove(this.img),this.primitve&&0<this.primitve.length){for(var e=0;e<this.primitve.length;e++)this._viewer.scene.primitives.remove(this.primitve[e]);this.primitve=[]}this.loadAllKey&&0<this.loadAllKey.length&&(this.loadAllKey=[]);try{this._Provider.remove()}catch(e){}},E.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},E.prototype.getLevel=function(){var e,t=this._viewer.camera;return t&&t.positionCartographic&&t.positionCartographic.height?(e=(e=this._viewer.scene.globe.getHeight(t.positionCartographic))||0,t=t.positionCartographic.height-e,Math.round(80955.31/(1+Math.pow(t/91610.74,7096758e-11))-40467.74)):0},E.prototype.setVisibility=function(e){try{if(this.loadAllKey=[],null!=this.item&&null!=this.item.show&&(this.item.show=e),null!=this.img&&(this.img.show=e),this.primitve&&0<this.primitve.length)for(var t=0;t<this.primitve.length;t++)this.primitve[t].show=e;if(this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e),this.probj&&0<this.probj.length)for(t=0;t<this.probj.length;t++)this.probj[t].show=e}catch(e){}},E.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},E.prototype.isCache=function(e){this._cache=e},E.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Fi.prototype.flyTo=function(e,t={}){return this._viewer.flyTo(e,{duration:t.time||3,maximumHeight:t.maxHeight,offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(t.heading||0),Cesium.Math.toRadians(t.pitch||-45),t.range)})},Fi.prototype.flyToPointsInterest=function(e,t){return this._viewer.camera.flyTo({destination:e.destination,orientation:e.orientation,duration:e.duration,complete:t})},Fi.prototype.flyToPosition=function(e,t,i,o={}){o={heading:this._core.defaultValue(o.heading,0),pitch:this._core.defaultValue(o.pitch,-90),roll:this._core.defaultValue(o.roll,0),time:this._core.defaultValue(o.time,3)};Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.flyTo({destination:this._cesium.Cartesian3.fromDegrees(e,t,i),orientation:new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading),Cesium.Math.toRadians(o.pitch),Cesium.Math.toRadians(o.roll)),duration:o.time}):this._viewer.camera.flyTo({destination:{x:e,y:t,z:i},orientation:new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading),Cesium.Math.toRadians(o.pitch),Cesium.Math.toRadians(o.roll)),duration:o.time})},Hi.prototype.createPolylineGeoJsonFeatureLayer=function(e,t,p,i,g,f){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},_=(this._core.isnull(p)||this._core.isnull(p.material)||"["==p.material.toString().charAt(0)&&"]"==p.material.toString().charAt(p.material.length-1)||(this._core.isHtmlColor(p.material)?p.material=this._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=this._color.rgbaStringToRgbaObj(p.material)),1<p.material.r&&(p.material.r=p.material.r/255),1<p.material.g&&(p.material.g=p.material.g/255),1<p.material.b&&(p.material.b=p.material.b/255),1<p.material.a&&(p.material.a=p.material.a/255),p.material=this._color.createColor(p.material.r,p.material.g,p.material.b,p.material.a))),this._core.extend(o,p,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),C=this,o=(o.then(function(e){for(var t,i=e.entities.values,o=new C._cesium.PrimitiveCollection,r=0;r<i.length;r++){var n=i[r],a=null;if(_.clampToGround){_.positions=n.polyline.positions._value;var s={positions:n.polyline.positions._value,width:_.width},s=new C._cesium.GroundPolylineGeometry(s),a=new C._cesium.GeometryInstance({id:n,geometry:s,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}else{for(var l=[],r=0;r<n.polyline.positions._value.length;r++){C._viewer.scene.globe.ellipsoid;var c=C._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]),u=C._cesium.Math.toDegrees(c.longitude),h=C._cesium.Math.toDegrees(c.latitude),c=c.height+_.height,u=new C._cesium.Cartesian3.fromDegrees(u,h,c);l.push(u)}_.positions=l;var s=new C._cesium.PolylineGeometry(_),m=C._cesium.PolylineGeometry.createGeometry(s);a=new C._cesium.GeometryInstance({id:n,geometry:m,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}n.positions=_.positions;var m="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue,d=(C.Legend.push(m),null),d=_.clampToGround?new C._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new C._cesium.MaterialAppearance({material:new C._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1})}):new C._cesium.Primitive({geometryInstances:a,appearance:new C._cesium.PolylineMaterialAppearance({material:new C._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}})}),shadows:C._cesium.ShadowMode.ENABLED});o.add(d)}p&&p.time&&(t=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:p.time.start?C._cesium.JulianDate.fromDate(new Date(p.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:p.time.end?C._cesium.JulianDate.fromDate(new Date(p.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})])),C._viewer.scene.primitives.add(o,t).show=_.show,C.item=o,g||C.setVisibility(!1),"function"==typeof f&&f(C.item)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id),{id:_.id,name:e,checked:g,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:_});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Hi.prototype.createGroundPolylineGeoJsonFeatureLayer=function(e,t,p,i,g,f){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},_=(this._core.isnull(p)||this._core.isnull(p.material)||"["==p.material.toString().charAt(0)&&"]"==p.material.toString().charAt(p.material.length-1)||(this._core.isHtmlColor(p.material)?p.material=this._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=this._color.rgbaStringToRgbaObj(p.material)),1<p.material.r&&(p.material.r=p.material.r/255),1<p.material.g&&(p.material.g=p.material.g/255),1<p.material.b&&(p.material.b=p.material.b/255),1<p.material.a&&(p.material.a=p.material.a/255),p.material=this._color.createColor(p.material.r,p.material.g,p.material.b,p.material.a))),this._core.extend(o,p,!0)),o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),C=this,o=(o.then(function(e){for(var t,i=e.entities.values,o=new C._cesium.PrimitiveCollection,r=0;r<i.length;r++){var n=i[r],a=null;if(_.clampToGround){_.positions=n.polyline.positions._value;var s={positions:n.polyline.positions._value,width:_.width},s=new C._cesium.GroundPolylineGeometry(s),a=new C._cesium.GeometryInstance({id:n,geometry:s,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}else{for(var l=[],r=0;r<n.polyline.positions._value.length;r++){C._viewer.scene.globe.ellipsoid;var c=C._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]),u=C._cesium.Math.toDegrees(c.longitude),h=C._cesium.Math.toDegrees(c.latitude),c=c.height+_.height,u=new C._cesium.Cartesian3.fromDegrees(u,h,c);l.push(u)}_.positions=l;var s=new C._cesium.PolylineGeometry(_),m=C._cesium.PolylineGeometry.createGeometry(s);a=new C._cesium.GeometryInstance({id:n,geometry:m,attributes:{color:new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material)}})}n.positions=_.positions;var m="material:"+255*_.material.red+","+255*_.material.green+","+255*_.material.blue,d=(C.Legend.push(m),null),d=_.clampToGround?new C._cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new C._cesium.MaterialAppearance({material:new C._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}}),faceForward:!0,flat:!1})}):new C._cesium.Primitive({geometryInstances:a,appearance:new C._cesium.PolylineMaterialAppearance({material:new C._cesium.Material({fabric:{type:"Color",uniforms:{color:_.material}}})}),shadows:C._cesium.ShadowMode.ENABLED});o.add(d)}p&&p.time&&(t=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:p.time.start?C._cesium.JulianDate.fromDate(new Date(p.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:p.time.end?C._cesium.JulianDate.fromDate(new Date(p.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})])),C._viewer.scene.primitives.add(o,t).show=_.show,C.item=o,g||C.setVisibility(!1),"function"==typeof f&&f(C.item)}),this._core.isnull(_.id)&&(_.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+_.id),{id:_.id,name:e,checked:g,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t,style:_});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1=function(e,t,c,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},u=(this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))),this._core.extend(n,c,!0)),h=this,n=new v(this._viewer,this._cesium,a),a=((this._Provider=n)._loadTile=function(e){h.Legend=[];var l=new h._cesium.PrimitiveCollection;return e.features.forEach(function(a){var e,i=[],s=!1;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(i.push(e[t]),2!==t||s||(s=!0))}if(/^\[/.test(c.material)&&/\]$/.test(c.material)&&(e=c.material.replace(/\[/,"").replace(/\]/,""),u.material=a.properties[e],h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=h._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var t=0;t<a.geometry.coordinates.length;t++)i=[],o(a.geometry.coordinates[t]),r(i);else o(a.geometry.coordinates),r(i);function r(e){var t=s?h._cesium.Cartesian3.fromDegreesArrayHeights(e):h._cesium.Cartesian3.fromDegreesArray(e),i=(u.positions=t,{positions:u.positions,width:u.width}),t=(a.positions=t,a.treeID=u.id,a.VectorType="polyline",a.VectorStyle={haveZ:s,width:u.width,positions:e,material:u.material,clampToGround:u.clampToGround},null);if(u.clampToGround)i=new h._cesium.GroundPolylineGeometry(i),t=new h._cesium.GeometryInstance({id:a,geometry:i,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}});else{var o=e,r=e.length/2+1+e.length;/^\[/.test(c.height)&&/\]$/.test(c.height)&&(i=c.height.replace(/\[/,"").replace(/\]/,""),u.height=a.properties[i]);for(var n=2;n<r;n+=3)o.splice(n,0,parseFloat(u.height));e=h._cesium.Cartesian3.fromDegreesArrayHeights(o),i=(u.positions=e,a.positions=e,new h._cesium.PolylineGeometry(u));t=new h._cesium.GeometryInstance({id:a,geometry:i,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}})}e="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue,h.Legend.push(e),i=null,i=u.clampToGround?new h._cesium.GroundPolylinePrimitive({geometryInstances:t,appearance:new h._cesium.MaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:u.material}}}),faceForward:!0,flat:!1})}):new h._cesium.Primitive({geometryInstances:t,appearance:new h._cesium.PolylineMaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:u.material}}})}),shadows:h._cesium.ShadowMode.ENABLED});l.add(i)}}),l},c&&c.time&&(n.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.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:c});return this._Provider.treeID=u.id,this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProvider=function(e,t,d,i,o,r){var n,a={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,outlineWidth:1,show:!0,material:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.WHITE,gapColor:this._cesium.Color.TRANSPARENT,height:30},s={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(t.srs,"EPSG:4326")+":{z}",TILEMATRIXSET:this._core.defaultValue(t.srs,"EPSG:4326"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:d.level_min,lowerLevelLimit:d.level_max,Cesium:this._cesium},p=(this._core.isnull(d)||this._core.isnull(d.material)||"["==d.material.toString().charAt(0)&&"]"==d.material.toString().charAt(d.material.length-1)||(d.material=Cesium.Color.fromCssColorString(d.material)),this._core.isnull(d)||this._core.isnull(d.outlineColor)||(d.outlineColor=Cesium.Color.fromCssColorString(d.outlineColor)),this._core.isnull(d)||this._core.isnull(d.gapColor)||(d.gapColor=Cesium.Color.fromCssColorString(d.gapColor)),this._core.extend({...a},d,!0)),l=this;let c=-1<t.url.indexOf("/gisserver/");n=c?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._core._serialize(s.urlParams),this._urlTemplate=n,this._Provider=new T(this._viewer,this._cesium,c?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=d.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(e,t){var u=e,h=t,m=l;if(h.state===Cesium.QuadtreeTileLoadState.START)if(h.data={lines:[],geometryPrimitive:void 0},h.level>=d.level_min&&h.level<d.level_max&&m.item.show){if(c&&(h.reverseY=m._Provider.tilingScheme.getNumberOfYTilesAtLevel(h.level)-h.y-1),m.TileMatrixLimits){var i=m.TileMatrixLimits[h.level];if(!i||h.x>i.maxCol||h.x<i.minCol||h.y>i.maxRow||h.y<i.minRow)return void(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)}i=n.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.reverseY||h.y).replace(window.encodeURIComponent("{z}"),h.level);m._cache&&(i+="&"+m._core.getuid()),m._core.xhr({url:i,type:"get",dataType:"json",success:function(e){var o,r=[],i=[],n=!1;for(o of e.features){var t,i=[];function a(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?a(e[t]):(2===t&&(e[t]=p.height||e[t],n=!0),i.push(e[t]),1===t&&2===e.length&&i.push(p.height||0))}if(/^\[/.test(d.material)&&/\]$/.test(d.material)&&(t=d.material.replace(/\[/,"").replace(/\]/,""),p.material=o.properties[t],p.material=Cesium.Color.fromCssColorString(p.material)),/^\[/.test(d.height)&&/\]$/.test(d.height)&&(t=d.height.replace(/\[/,"").replace(/\]/,""),p.height=o.properties[t]),Array.isArray(o.geometry.coordinates)&&0<o.geometry.coordinates.length)if(Array.isArray(o.geometry.coordinates[0][0]))for(var s=0;s<o.geometry.coordinates.length;s++)i=[],a(o.geometry.coordinates[s]),l(i);else a(o.geometry.coordinates),l(i);function l(e){var t=m._cesium.Cartesian3.fromDegreesArrayHeights(e),i=(p.positions=t,{positions:p.positions,width:p.width}),t=(o.positions=t,d.preLoad&&d.preLoad(p,o),o.treeID=p.id,o.VectorType="polyline",o.VectorStyle={haveZ:n,width:p.width,positions:e,material:p.material,clampToGround:p.clampToGround},null),i=(t=p.clampToGround?(i=new m._cesium.GroundPolylineGeometry(i),new m._cesium.GeometryInstance({id:o,geometry:i,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(p.near,p.far)}})):(e=new m._cesium.PolylineGeometry(p),new m._cesium.GeometryInstance({id:o,geometry:e,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(p.near,p.far)}})),"material:"+255*p.material.red+","+255*p.material.green+","+255*p.material.blue);m.Legend.push(i),r.push(t)}}e=null;let c;c=p.dash?new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineDashType,{color:p.material,gapColor:p.gapColor||Cesium.Color.TRANSPARENT,dashLength:p.dashLength||20})}):new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineOutline",uniforms:{color:p.material,outlineColor:p.outlineColor,outlineWidth:p.outlineWidth}}}),faceForward:!0,flat:!1}),e=p.clampToGround?new m._cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:c,classificationType:p.classificationType}):new m._cesium.Primitive({geometryInstances:r,appearance:c,shadows:m._cesium.ShadowMode.ENABLED}),h.data.geometryPrimitive=e,h.state=Cesium.QuadtreeTileLoadState.LOADING,h.state===Cesium.QuadtreeTileLoadState.LOADING&&(h.data.geometryPrimitive.update(u,[]),h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0)},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}else h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0},"function"==typeof r&&r(this.item)};let u,h;this.saveDefaultVectorData=()=>{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(u),u=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:c},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},Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete=function(e,t,c,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},u=(this._core.isnull(c)||this._core.isnull(c.material)||"["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)||(this._core.isHtmlColor(c.material)?c.material=this._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=this._color.rgbaStringToRgbaObj(c.material)),1<c.material.r&&(c.material.r=c.material.r/255),1<c.material.g&&(c.material.g=c.material.g/255),1<c.material.b&&(c.material.b=c.material.b/255),1<c.material.a&&(c.material.a=c.material.a/255),c.material=this._color.createColor(c.material.r,c.material.g,c.material.b,c.material.a))),this._core.extend(n,c,!0)),h=this,n=new v(this._viewer,this._cesium,a),a=((this._Provider=n)._loadTile=function(e,t){var s=new h._cesium.PrimitiveCollection,l=[];if(e.features.forEach(function(a){var e,i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}if(/^\[/.test(c.material)&&/\]$/.test(c.material)&&(e=c.material.replace(/\[/,"").replace(/\]/,""),u.material=a.properties[e],h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=h._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var t=0;t<a.geometry.coordinates.length;t++)i=[],o(a.geometry.coordinates[t]),r(i),n(i);else o(a.geometry.coordinates),r(i),n(i);function r(e){var t=h._cesium.Cartesian3.fromDegreesArray(e),t=(u.positions=t,a.positions=t,{positions:u.positions,width:u.width}),i=null;if(u.clampToGround)t=new h._cesium.GroundPolylineGeometry(t),i=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}});else{for(var o=e,r=e.length/2+1+e.length,n=2;n<r;n+=3)o.splice(n,0,parseFloat(u.height));t=h._cesium.Cartesian3.fromDegreesArrayHeights(o),e=(u.positions=t,new h._cesium.PolylineGeometry(u)),t=h._cesium.PolylineGeometry.createGeometry(e);i=new h._cesium.GeometryInstance({id:a,geometry:t,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}})}e=null,e=u.clampToGround?new h._cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new h._cesium.MaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:u.material}}}),faceForward:!0,flat:!1})}):new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PolylineMaterialAppearance({material:new h._cesium.Material({fabric:{type:"Color",uniforms:{color:u.material}}})}),shadows:h._cesium.ShadowMode.ENABLED});s.add(e)}function n(e){for(var t=u.clampToGround?h._cesium.Cartesian3.fromDegreesArray(e):h._cesium.Cartesian3.fromDegreesArrayHeights(e),i=1;i<t.length;i++){var o=[],r=(o.push(t[i-1]),o.push(t[i]),h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i-1]).x),n=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i-1]).y,a=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i]).x,s=h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene,t[i]).y;h.setPolylinemodels(o,r,n,a,s,u,function(e){l.push(e)})}}}),l.length){let t;Cesium.ModelInstanceCollection?t=new h._cesium.ModelInstanceCollection({url:u.url,instances:l,color:u.color,lightColor:u.lightColor,scale:parseInt(u.scale),heightReference:parseInt(u.heightReference),distanceDisplayCondition:u.distanceDisplayCondition}):(t=new Cesium.PrimitiveCollection,l.forEach(e=>{t.add({id:e.modelId,url:u.url,modelMatrix:e.modelMatrix,color:u.color,lightColor:u.lightColor,scale:parseInt(u.scale),heightReference:parseInt(u.heightReference),distanceDisplayCondition:u.distanceDisplayCondition})})),s.add(t)}return s},c&&c.time&&(n.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.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineLayer",item:this,url:t.url,style:c});return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Hi.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.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=this._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a))),this._core.extend(n,d,!0)),s=this,l=(this._urlTemplate=t.url+"?"+this._core._serialize(a.urlParams),t.url+"?"+this._core._serialize(a.urlParams));this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=d.level_max-1,this._Provider.loadTile=function(e,t){var h,m;m=s,(h=t).state===Cesium.QuadtreeTileLoadState.START&&(h.data={lines:[],geometryPrimitive:void 0},h.level>=d.level_min&&h.level<d.level_max&&m.item.show?(t=l.replace(window.encodeURIComponent("{x}"),h.x).replace(window.encodeURIComponent("{y}"),h.y).replace(window.encodeURIComponent("{z}"),h.level),m._cache&&(t+="&"+m._core.getuid()),m._core.xhr({url:t,type:"get",dataType:"json",success:function(e){var l=[],a=new m._cesium.PrimitiveCollection,t=e.features,i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}function r(e){var t=m._cesium.Cartesian3.fromDegreesArray(e),t=(p.positions=t,c.positions=t,{positions:p.positions,width:p.width}),i=null;if(p.clampToGround)t=new m._cesium.GroundPolylineGeometry(t),i=new m._cesium.GeometryInstance({id:c,geometry:t,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material)}});else{for(var o=e,r=e.length/2+1+e.length,n=2;n<r;n+=3)o.splice(n,0,parseFloat(p.height));t=m._cesium.Cartesian3.fromDegreesArrayHeights(o),e=(p.positions=t,new m._cesium.PolylineGeometry(p)),t=m._cesium.PolylineGeometry.createGeometry(e);i=new m._cesium.GeometryInstance({id:c,geometry:t,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material)}})}e=null,e=p.clampToGround?new m._cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:p.material}}}),faceForward:!0,flat:!1})}):new m._cesium.Primitive({geometryInstances:i,appearance:new m._cesium.PolylineMaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:p.material}}})}),shadows:m._cesium.ShadowMode.ENABLED});a.add(e)}function n(e){for(var t=p.clampToGround?m._cesium.Cartesian3.fromDegreesArray(e):m._cesium.Cartesian3.fromDegreesArrayHeights(e),i=1;i<t.length;i++)try{var o=[],r=(o.push(t[i-1]),o.push(t[i]),m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene,t[i-1]).x),n=m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene,t[i-1]).y,a=m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene,t[i]).x,s=m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene,t[i]).y;m.setPolylinemodels(o,r,n,a,s,p,function(e){l.push(e)})}catch(e){}}/^\[/.test(d.material)&&/\]$/.test(d.material)&&(e=d.material.replace(/\[/,"").replace(/\]/,""),p.material=c.properties[e],m._core.isHtmlColor(p.material)?p.material=m._color.colorFromHtmlColor(p.material):(/^rgb/.test(p.material)&&(p.material=m._color.rgbaStringToRgbaObj(p.material)),1<p.material.r&&(p.material.r=p.material.r/255),1<p.material.g&&(p.material.g=p.material.g/255),1<p.material.b&&(p.material.b=p.material.b/255),1<p.material.a&&(p.material.a=p.material.a/255),p.material=m._color.createColor(p.material.r,p.material.g,p.material.b,p.material.a)));for(var s=0;s<t.length;s++){var c=t[s];if(Array.isArray(c.geometry.coordinates)&&0<c.geometry.coordinates.length)if(Array.isArray(c.geometry.coordinates[0][0]))for(var u=0;u<c.geometry.coordinates.length;u++)i=[],o(c.geometry.coordinates[u]),r(i),n(i);else o(c.geometry.coordinates),r(i),n(i)}if(l.length){let t;Cesium.ModelInstanceCollection?t=new m._cesium.ModelInstanceCollection({url:p.url,instances:l,color:p.color,lightColor:p.lightColor,scale:parseInt(p.scale),heightReference:parseInt(p.heightReference),distanceDisplayCondition:p.distanceDisplayCondition}):(t=new Cesium.PrimitiveCollection,l.forEach(e=>{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):(h.state=Cesium.QuadtreeTileLoadState.DONE,h.renderable=!0))},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},Hi.prototype.setPolylinemodels=function(e,t,i,o,r,n,a){for(var s=this._cesium,l=this._core.getSpaceDistancem(e,s),c=10,u=parseFloat(n.distance),l=(0!=u&&(c=parseInt(l/u)),e[0]),u=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(u),e=s.Math.toDegrees(l.longitude),u=s.Math.toDegrees(l.latitude),d=c,p=s.Math.lerp(h,e,1/d)-h,g=s.Math.lerp(m,u,1/d)-m,f=0;f<d;f++){var _=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(h+(f+1)*p,m+(f+1)*g,parseInt(n.height)));Cesium.Matrix4.multiplyByUniformScale(_,parseInt(n.scale),_),a&&a({modelMatrix:_,modelId:n})}},Hi.prototype.getType=function(){return{label:"线",value:"polylineLayer"}},Hi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Hi.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),null!=this.model&&null!=this.model&&0<this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},Hi.prototype.setTreeobj=function(e){this.treeobj=e},Hi.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Hi.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Hi.prototype.setVisibility=function(e){if(null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e),null!=this.model&&null!=this.model&&0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e},Hi.prototype.edit=function(e,t){return this.editoption=t,this.isEditting=e,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Hi.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},P.prototype.exectPointModel=function(e,t,f,i,_,C){var o={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},y=(this._core.isnull(f)||this._core.isnull(f.material)||"["==f.material.toString().charAt(0)&&"]"==f.material.toString().charAt(f.material.length-1)||(this._core.isHtmlColor(f.material)?f.material=this._color.colorFromHtmlColor(f.material):(/^rgb/.test(f.material)&&(f.material=this._color.rgbaStringToRgbaObj(f.material)),1<f.material.r&&(f.material.r=f.material.r/255),1<f.material.g&&(f.material.g=f.material.g/255),1<f.material.b&&(f.material.b=f.material.b/255),1<f.material.a&&(f.material.a=f.material.a/255),f.material=this._color.createColor(f.material.r,f.material.g,f.material.b,f.material.a))),this._core.isnull(f)||this._core.isnull(f.color)||"["==f.color.toString().charAt(0)&&"]"==f.color.toString().charAt(f.color.length-1)||(this._core.isHtmlColor(f.color)?f.color=this._color.colorFromHtmlColor(f.color):(/^rgb/.test(f.color)&&(f.color=this._color.rgbaStringToRgbaObj(f.color)),1<f.color.r&&(f.color.r=f.color.r/255),1<f.color.g&&(f.color.g=f.color.g/255),1<f.color.b&&(f.color.b=f.color.b/255),1<f.color.a&&(f.color.a=f.color.a/255),f.color=this._color.createColor(f.color.r,f.color.g,f.color.b,f.color.a))),this._core.isnull(f)||this._core.isnull(f.lightColor)||"["==f.lightColor.toString().charAt(0)&&"]"==f.lightColor.toString().charAt(f.lightColor.length-1)||(this._core.isHtmlColor(f.lightColor)?f.lightColor=this._color.colorFromHtmlColor(f.lightColor):(/^rgb/.test(f.lightColor)&&(f.lightColor=this._color.rgbaStringToRgbaObj(f.lightColor)),1<f.lightColor.r&&(f.lightColor.r=f.lightColor.r/255),1<f.lightColor.g&&(f.lightColor.g=f.lightColor.g/255),1<f.lightColor.b&&(f.lightColor.b=f.lightColor.b/255),1<f.lightColor.a&&(f.lightColor.a=f.lightColor.a/255),f.lightColor=this._color.createColor(f.lightColor.r,f.lightColor.g,f.lightColor.b,f.lightColor.a))),this._core.isnull(f)||this._core.isnull(f.linecolor)||"["==f.linecolor.toString().charAt(0)&&"]"==f.linecolor.toString().charAt(f.linecolor.length-1)||(this._core.isHtmlColor(f.linecolor)?f.linecolor=this._color.colorFromHtmlColor(f.linecolor):(/^rgb/.test(f.linecolor)&&(f.linecolor=this._color.rgbaStringToRgbaObj(f.linecolor)),1<f.linecolor.r&&(f.linecolor.r=f.linecolor.r/255),1<f.linecolor.g&&(f.linecolor.g=f.linecolor.g/255),1<f.linecolor.b&&(f.linecolor.b=f.linecolor.b/255),1<f.linecolor.a&&(f.linecolor.a=f.linecolor.a/255),f.linecolor=this._color.createColor(f.linecolor.r,f.linecolor.g,f.linecolor.b,f.linecolor.a))),this._core.extend(o,f,!0)),o=(this._core.isnull(f.near)&&(f.near=0),this._core.isnull(f.far)&&(f.far=999999999),parseFloat(f.near)),r=parseFloat(f.far),o=new this._cesium.DistanceDisplayCondition(o,r),r=(y.distanceDisplayCondition=o,null==t&&console.log("geojson is required"),null),r=t.then?t:this._cesium.GeoJsonDataSource.load(t),v=this,o=(r.then(function(e){e.entities.values;for(var t,i=[],o=e.entities.values,i=[],r=0;r<o.length;r++){var n=o[r],a=new v._cesium.GeometryInstance({id:n,geometry:new v._cesium.CorridorGeometry({positions:n.polyline.positions._value,width:y.width,height:y.height,arcType:y.arcType,vertexFormat:v._cesium.VertexFormat.POSITION_ONLY}),attributes:{color:new v._cesium.ColorGeometryInstanceAttribute.fromColor(y.linecolor)}});i.push(a)}f&&f.time&&(t=new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({start:f.time.start?v._cesium.JulianDate.fromDate(new Date(f.time.start)):v._cesium.Iso8601.MINIMUM_VALUE,stop:f.time.end?v._cesium.JulianDate.fromDate(new Date(f.time.end)):v._cesium.Iso8601.MAXIMUM_VALUE})]));for(var e=v._viewer.scene.primitives.add(new v._cesium.GroundPrimitive({geometryInstances:i,classificationType:v._cesium.ClassificationType.BOTH}),t),s=(e.show=y.show,v.item=e,[]),r=0;r<o.length;r++)for(var l=(n=o[r]).polyline.positions.getValue(),c=1;c<l.length;c++)try{var u=[],h=(u.push(l[c-1]),u.push(l[c]),v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene,l[c-1]).x),m=v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene,l[c-1]).y,d=v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene,l[c]).x,p=v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene,l[c]).y,s=v.setPolylinemodels(u,h,m,d,p,s,y,v._cesium,v._viewer,t)}catch(e){}let g;Cesium.ModelInstanceCollection?g=new v._cesium.ModelInstanceCollection({url:y.url,instances:s,color:y.color,lightColor:y.lightColor,scale:parseInt(y.scale),heightReference:parseInt(y.heightReference),distanceDisplayCondition:y.distanceDisplayCondition}):(g=new Cesium.PrimitiveCollection,s.forEach(e=>{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,u){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=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(n.point=e.point),""!=e.polyline&&null!=e.polyline&&(n.polyline=e.polyline)),this._core.CreateTooltip()),y={spot:[],distance:[],label:[],polyline:[],model:[]},a=(m.setInputAction(function(e){0===d.length?C.showAt(e.endPosition,"左键开始,右键结束!"):C.showAt(e.endPosition,"右键结束!");e=h._viewer.camera.getPickRay(e.endPosition);o=h._viewer.scene.globe.pick(e,h._viewer.scene),2<=d.length&&(h._cesium.defined(t)?(d.pop(),d.push(o)):t=new a(d),i=h._core.getHorizontalDistance(d,h._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),m.setInputAction(function(e){var t=h._viewer.camera.getPickRay(e.position),t=(o=h._viewer.scene.globe.pick(t,h._viewer.scene),0==d.length&&d.push(o.clone()),{px:e.position.x,py:e.position.y}),e=(d.push(o),{positionsxp:o,lxy:t});_.push(e),y.spot.push(o),y.distance.push(i)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(e){m.destroy(),d.pop();for(var t=0;t<p.length;t++)h._viewer.entities.remove(p[t]);for(var i=[],o=1;o<_.length;o++){var r=[],n=_[o-1].lxy.px,a=_[o-1].lxy.py,s=_[o].lxy.px,l=_[o].lxy.py,c=g;r.push(_[o-1].positionsxp),r.push(_[o].positionsxp),i=h.setPolylinemodel(r,n,a,s,l,c,f,h.modelurl,i,h._cesium,h._viewer)}y.model=i,""!=u&&null!=u&&"function"==typeof u&&u(y),C.show(!1)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),s.prototype._init=function(){var e=this,t=(this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return e.positions},!1),h._viewer.entities.add(this.options));h.item=t,p.push(t),y.polyline.push(t)},s);function s(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:n.polyline,width:3,clampToGround:!0}},this.positions=e,this._init()}return this},P.prototype.setPolylinemodel=function(e,t,i,o,r,n,a,s,l,c,u){for(var h=this._core.getSpaceDistancem(e,c),h=(0!=a&&(n=parseInt(h/a)),e[0]),a=e[e.length-1],e=c.Cartographic.fromCartesian(h),m=c.Math.toDegrees(e.longitude),d=c.Math.toDegrees(e.latitude),h=(e.height,c.Cartographic.fromCartesian(a)),e=c.Math.toDegrees(h.longitude),a=c.Math.toDegrees(h.latitude),p=(h.height,n),g=c.Math.lerp(m,e,1/p)-m,f=c.Math.lerp(d,a,1/p)-d,_=c.Math.lerp(t,o,1/p)-t,C=c.Math.lerp(i,r,1/p)-i,y=0;y<p;y++){var v=m+(y+1)*g,w=d+(y+1)*f;(0==y||1==y)&&new c.Cartesian3(v,w,0);v=t+(y+1)*_,w=i+(y+1)*C;var b=u.camera.pickEllipsoid({x:v,y:w},u.scene.globe.ellipsoid),b=c.Cartographic.fromCartesian(b),v=c.Math.toDegrees(b.longitude),w=c.Math.toDegrees(b.latitude),b=c.Transforms.eastNorthUpToFixedFrame(c.Cartesian3.fromDegrees(v,w,6)),v=c.Model.fromGltf({url:s,modelMatrix:b,scale:100});u.scene.primitives.add(v),l.push(v)}return l},P.prototype.setPolylinemodels_obsolete=function(e,t,i,o,r,n,a,s,l,c){var u=this._core.getSpaceDistancem(e,s),h=10,m=parseFloat(a.distance),u=(0!=m&&(h=parseInt(u/m)),e[0]),m=e[e.length-1],e=s.Cartographic.fromCartesian(u),d=s.Math.toDegrees(e.longitude),p=s.Math.toDegrees(e.latitude),u=(e.height,s.Cartographic.fromCartesian(m)),m=s.Math.toDegrees(u.longitude),g=s.Math.toDegrees(u.latitude),f=(u.height,s.Math.toDegrees(e.height),h),_=s.Math.lerp(d,m,1/f)-d,C=s.Math.lerp(p,g,1/f)-p;s.Math.lerp(t,o,1/f),s.Math.lerp(i,r,1/f);for(var y=0;y<f;y++){var v=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d+(y+1)*_,p+(y+1)*C,a.height)),v=(parseInt(a.heightReference),s.Model.fromGltf({url:a.url,modelMatrix:v,color:a.color,lightColor:a.lightColor,scale:parseInt(a.scale),heightReference:parseInt(a.heightReference),distanceDisplayCondition:a.distanceDisplayCondition}));l.scene.primitives.add(v,c),n.push(v)}return n},P.prototype.setPolylinemodels=function(e,t,i,o,r,n,a,s,l,c){var u=this._core.getSpaceDistancem(e,s),h=10,m=parseFloat(a.distance),u=(0!=m&&(h=parseInt(u/m)),e[0]),m=e[e.length-1],e=s.Cartographic.fromCartesian(u),d=s.Math.toDegrees(e.longitude),p=s.Math.toDegrees(e.latitude),u=(e.height,s.Cartographic.fromCartesian(m)),m=s.Math.toDegrees(u.longitude),g=s.Math.toDegrees(u.latitude),f=(u.height,s.Math.toDegrees(e.height),h),_=s.Math.lerp(d,m,1/f)-d,C=s.Math.lerp(p,g,1/f)-p;s.Math.lerp(t,o,1/f),s.Math.lerp(i,r,1/f);for(var y=0;y<f;y++){var v=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d+(y+1)*_,p+(y+1)*C,parseInt(a.height||0)));parseInt(a.heightReference),Cesium.Matrix4.multiplyByUniformScale(v,parseInt(a.scale),v),n.push({modelMatrix:v,modelId:a})}return n},P.prototype.createPolygonModel=function(e,t,m,i,o,d){var p,r={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,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,scale:1,classificationType:this._cesium.ClassificationType.BOTH},g=m.modelurl,f=(this._core.isnull(m)||this._core.isnull(m.fill)||(this._core.isHtmlColor(m.fill)?m.material=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.material=this._color.rgbaStringToRgbaObj(m.fill)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))),this._core.isnull(m)||this._core.isnull(m.outlineColor)||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),1<m.outlineColor.r&&(m.outlineColor.r=m.outlineColor.r/255),1<m.outlineColor.g&&(m.outlineColor.g=m.outlineColor.g/255),1<m.outlineColor.b&&(m.outlineColor.b=m.outlineColor.b/255),1<m.outlineColor.a&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),this._core.isnull(m)||this._core.isnull(m.color)||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),1<m.color.r&&(m.color.r=m.color.r/255),1<m.color.g&&(m.color.g=m.color.g/255),1<m.color.b&&(m.color.b=m.color.b/255),1<m.color.a&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),this._core.isnull(m)||this._core.isnull(m.lightColor)||(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),1<m.lightColor.r&&(m.lightColor.r=m.lightColor.r/255),1<m.lightColor.g&&(m.lightColor.g=m.lightColor.g/255),1<m.lightColor.b&&(m.lightColor.b=m.lightColor.b/255),1<m.lightColor.a&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a))),this._core.extend(r,m,!0)),r=(m.checked=o,f.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND,null==t&&console.log("geojson is required"),null),r=t.then?t:this._cesium.GeoJsonDataSource.load(t,{clampToGround:!0}),_=(this._viewer.dataSources.add(r),this),r=(m&&m.time&&(p=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})])),r.then(function(e){_.item=e,_.model=[];var t=e.entities.values,i=(_._core.isnull(m.near)&&(m.near=0),_._core.isnull(m.far)&&(m.far=999999999),parseFloat(m.near)),o=parseFloat(m.far),r=new _._cesium.DistanceDisplayCondition(i,o);f.distanceDisplayCondition=r;for(var n=0;n<t.length;n++){for(var a=t[n],s=(f.height=parseFloat(_._core.extendgl(a,m.height,f.height)),f.extrudedHeight=parseFloat(_._core.extendgl(a,m.extrudedHeight,f.extrudedHeight)),f.heightReference=_._core.extendgl(a,m.heightReference,f.heightReference),f.show=_._core.extendgl(a,m.show,f.show),f.material=_._core.extendgl(a,m.material,f.material),f.outline=_._core.extendgl(a,m.outline,f.outline),f.outlineColor=_._core.extendgl(a,m.outlineColor,f.outlineColor),f.outlineWidth=parseFloat(_._core.extendgl(a,m.outlineWidth,f.outlineWidth)),f.stRotation=_._core.extendgl(a,m.stRotation,f.stRotation),f.granularity=_._core.extendgl(a,m.granularity,f.granularity),f.distanceDisplayCondition=_._core.extendgl(a,m.distanceDisplayCondition,f.distanceDisplayCondition),f.perPositionHeight=_._core.extendgl(a,m.perPositionHeight,f.perPositionHeight),f.closeTop=_._core.extendgl(a,m.closeTop,f.closeTop),f.closeBottom=_._core.extendgl(a,m.closeBottom,f.closeBottom),f.shadows=_._core.extendgl(a,m.shadows,f.shadows),f.classificationType=_._core.extendgl(a,m.classificationType,f.classificationType),a.polygon._hierarchy._value.positions,a.polygon.heightReference=1,a.polygon.show=f.show,a.polygon.material=f.material,a.polygon.outline=f.outline,a.polygon.outlineColor=f.outlineColor,a.polygon.outlineWidth=f.outlineWidth,a.polygon.stRotation=f.stRotation,a.polygon.granularity=f.granularity,a.polygon.distanceDisplayCondition=r,a.polygon.closeTop=f.closeTop,a.polygon.closeBottom=f.closeBottom,a.polygon.shadows=f.shadows,a.polygon.classificationType=f.classificationType,p&&(a.availability=p),[]),l=a.polygon.hierarchy.getValue().positions,c=0;c<l.length;c++){var u=_._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[c]).longitude),h=_._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[c]).latitude);s.push(u),s.push(h)}a=_.getTheBottomPoint(s);_.scanningPolygon(a,f.offset_x,f.offset_y,s).forEach(function(e){e=_._cesium.Transforms.eastNorthUpToFixedFrame(_._cesium.Cartesian3.fromDegrees(e.lon,e.lat,f.height)),e=_._cesium.Model.fromGltf({url:g,color:f.color,silhouetteColor:f.lightColor,silhouetteSize:f.lightWidth,modelMatrix:e,scale:f.scale,heightReference:parseInt(f.heightReference),distanceDisplayCondition:r});_._viewer.scene.primitives.add(e,p),e.time=p,_.model.push(e)})}m.checked||_.setVisibility(!1),"function"==typeof d&&d(e)}),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+f.id),{id:f.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t,style:f});return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i),this},P.prototype.setItem=function(e){this.item=e},P.prototype.modelMove=function(){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this.yd=!1;var r=this;this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){r._viewer.scene.pickPosition(e.position);var t,i,o,e=r._viewer.scene.pick(e.position);null!=r.yd&&r.yd&&r._tree.handler.destroy(),r.yd=!0,null!=e.tileset&&(t=e.tileset,i=r._cesium.Cartographic.fromCartesian(t.boundingSphere.center),o=r._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height),r._tree.handler.setInputAction(function(e){e=r._viewer.scene.pickPosition(e.endPosition),e=r._cesium.Cartographic.fromCartesian(e),e=r._cesium.Cartesian3.fromRadians(e.longitude,e.latitude,i.height),e=r._cesium.Cartesian3.subtract(e,o,new r._cesium.Cartesian3);t.modelMatrix=r._cesium.Matrix4.fromTranslation(e)},r._cesium.ScreenSpaceEventType.MOUSE_MOVE))},r._cesium.ScreenSpaceEventType.LEFT_CLICK)},P.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},P.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,c=-180,u=-90,h=0;h<o.length;h+=2)u=u>o[h+1]?u:o[h+1],l=l<o[h]?l:o[h],c=c>o[h]?c: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<=u;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<=c;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;l<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},P.prototype.createModel=function(e,t,i,o,r,n){var t={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},i=this._core.extend(t,i,!0),e=(this._position=e,{id:i.id,position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:i}),a=((i.heading||i.pitch||i.roll)&&(this.heading=i.heading,this.pitch=i.pitch,this.roll=i.roll,e.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(i.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.roll,0))))),this);i.rotate&&(e.orientation=new this._cesium.CallbackProperty(function(){return a.heading=a.heading+a.rotate,a._cesium.Transforms.headingPitchRollQuaternion(a._cesium.Cartesian3.fromDegrees(a._position[0],a._position[1],a._position[2]),new a._cesium.HeadingPitchRoll(a._cesium.Math.toRadians(a._cesium.defaultValue(a.heading,0)),a._cesium.Math.toRadians(a._cesium.defaultValue(a.pitch,0)),a._cesium.Math.toRadians(a._cesium.defaultValue(a.roll,0))))},!1),a.rotate=i.rotate,delete i.rotate),delete i.heading,delete i.pitch,delete i.roll,e.model=i,this.item=this._viewer.entities.add(e),"function"==typeof n&&n(this.item);i={id:this.item.id,name:r||"新建模型"+t.id,pId:this._core.isnull(o)?0:o,type:"Point",item:this.item};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},P.prototype.createModelEditable=function(e,t,i,o,r,n){var t={id:this._core.getuid(),uri:t,show:!0,heading:0,pitch:0,roll:0,scale:1},i=this._core.extend(t,i,!0),e=(this._position=e,{position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:i}),a=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),s=this.createCylinder(a,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(l.pitch),l._cesium.Math.toRadians(l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(c,!1),new this._cesium.CallbackProperty(u,!1),this._cesium.Color.LIMEGREEN,!1),s=(s.oid=1,this.modelPointArr.push(s),this.createCylinder(a,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(90+l.pitch),l._cesium.Math.toRadians(l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(c,!1),new this._cesium.CallbackProperty(u,!1),this._cesium.Color.MEDIUMBLUE,!1)),s=(s.oid=2,this.modelPointArr.push(s),this.createCylinder(a,new this._cesium.CallbackProperty(function(){var e=l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),t=l._cesium.Math.toRadians(l.heading),t=new l._cesium.HeadingPitchRoll(t,l._cesium.Math.toRadians(l.pitch),l._cesium.Math.toRadians(90+l.roll));return l._cesium.Transforms.headingPitchRollQuaternion(e,t)},!1),new this._cesium.CallbackProperty(c,!1),new this._cesium.CallbackProperty(u,!1),this._cesium.Color.RED,!1)),s=(s.oid=3,this.modelPointArr.push(s),this.creatBillboard(a,new this._cesium.CallbackProperty(function(){return new l._cesium.Cartesian2(0,-(l.Radius*l.scale))},!1),"../../img/j.png",!1)),s=(s.oid=4,this.modelPointArr.push(s),this.creatBillboard(a,new this._cesium.CallbackProperty(function(){return new l._cesium.Cartesian2(-(l.Radius*l.scale),0)},!1),"../../img/s.png",!1)),l=(s.oid=5,this.modelPointArr.push(s),(i.heading||i.pitch||i.roll)&&(this.heading=i.heading,this.pitch=i.pitch,this.roll=i.roll,e.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(i.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(i.roll,0))))),this);function c(){return l.Radius*l.scale}function u(){return 100*l.Radius}i.rotate&&(e.orientation=new this._cesium.CallbackProperty(function(){return l.heading=l.heading+l.rotate,l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll,0))))},!1),l.rotate=i.rotate,delete i.rotate),e.orientation=new this._cesium.CallbackProperty(function(){return l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0],l._position[1],l._position[2]),new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch,0)),l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll,0))))},!1),l.scale=i.scale,e.model.scale=new this._cesium.CallbackProperty(function(){return l.scale},!1),delete i.heading,delete i.pitch,delete i.roll,e.model=i,this.item=this._viewer.entities.add(e),this.item.objId=this.objId,this.state=1,"function"==typeof n&&n(this.item);a={id:this.item.id,name:r||"新建模型"+t.id,pId:this._core.isnull(o)?0:o,type:"Point",item:this.item};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),this},P.prototype.createOrientation=function(e,t,i){var o=this._cesium.Math.toRadians(0),o=new this._cesium.HeadingPitchRoll(o,this._cesium.Math.toRadians(t),this._cesium.Math.toRadians(i));return this._cesium.Transforms.headingPitchRollQuaternion(e,o)},P.prototype.createCylinder=function(e,t,i,o,r,n){if(e)return this._viewer.entities.add({position:e,orientation:t,cylinder:{length:10,topRadius:i,bottomRadius:i,fill:!1,material:r.withAlpha(.5),outline:!0,outlineWidth:10,outlineColor:r,numberOfVerticalLines:o,slices:o},show:n})},P.prototype.startModify=function(){if(2==this.state||1==this.state){var r=this;this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var n,a,s,l,c,u,e=0;e<r.modelPointArr.length;e++){var t=r.modelPointArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){var t=r._viewer.scene.pick(e.position),t=(r._cesium.defined(t)&&t.id&&(t.id.objId?r.modifyModel=t.id:!r.modifyPoint||4!=r.modifyPoint.oid&&5!=r.modifyPoint.oid?r.modifyPoint=t.id:(t.id.oid!=r.modifyPoint.oid&&(r.modifyPoint=t.id),4==r.modifyPoint.oid?r.scale=r.scale+1:r.scale=r.scale-1),r.forbidDrawWorld(!0)),r._cesium.Cartesian3.fromDegrees(r._position[0],r._position[1],r._position[2]));n=r._cesium.SceneTransforms.wgs84ToWindowCoordinates(r._viewer.scene,t),a=e.position,l=r.heading+0,u=r.roll+0,c=r.pitch+0,r.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){e=r._viewer.scene.pick(e.position);if(!r._cesium.defined(e)||!e.id){for(var t=0;t<r.modelPointArr.length;t++){var i=r.modelPointArr[t];i&&(i.show=!1)}r.modifyHandler&&(r.modifyHandler.destroy(),r.modifyHandler=null)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){if(r._viewer.scene.pick(e.endPosition),r.modifyModel||r.modifyPoint){var t=r._viewer.scene.pickPosition(e.endPosition);if(t)if(r.modifyModel){r.item.position.setValue(t);for(var i=0;i<r.modelPointArr.length;i++){var o=r.modelPointArr[i];o&&o.position.setValue(t)}}else r.modifyPoint&&(s=e.endPosition,e=r.arge(n,a,s),1==r.modifyPoint.oid?r.heading=l+e:2==r.modifyPoint.oid?r.roll=u+e:3==r.modifyPoint.oid&&(r.pitch=c+e))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){!r.modifyPoint&&!r.modifyModel||r.modifyPoint&&(4==r.modifyPoint.oid||5==r.modifyPoint.oid)||(r.modifyPoint=null,r.modifyModel=null,r.forbidDrawWorld(!1))},this._cesium.ScreenSpaceEventType.LEFT_UP)}},P.prototype.creatBillboard=function(e,t,i,o){e=this._viewer.entities.add({position:e,show:o,billboard:{image:i,pixelOffset:t,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM}});return e.attr="editPoint",e},P.prototype.arge=function(e,t,i){var o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),e=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),t=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),i=(Math.pow(o,2)+Math.pow(e,2)-Math.pow(t,2))/(2*o*e);return Math.round(180*Math.acos(i)/Math.PI)},P.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},P.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{r=t.camera.getPickRay(e);if(!r)return;o=t.scene.globe.pick(r,t.scene)}return o},P.prototype.setTreeobj=function(e){this.treeobj=e},P.prototype.setVisibility=function(e){if(this.item.item?this.item.item.show=e:this.item.show=e,0<this.model.length)for(var t=0;t<this.model.length;t++)this.model[t].show=e,this.model[t]._availability&&!e?this.model[t]._availability=void 0:this.model[t].time&&e&&(this.model[t]._availability=this.model[t].time)},P.prototype.setOrientation=function(e){(e.heading||e.pitch||e.roll)&&(this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(e.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(e.roll,0)))))},P.prototype.setScale=function(e){this.item&&this.item.model&&(this.item.model.scale=e)},P.prototype.setPosition=function(e){this.item&&this.item.model&&(this._position=e,this.item.position=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]))},P.prototype.getVisibility=function(){return this.item.show},P.prototype.deleteObject=function(){if(this.model&&this.model.length)for(var e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._viewer.scene.primitives.remove(this.item)}catch(e){}try{this._viewer.entities.remove(this.item)}catch(e){}try{this._viewer.dataSources.remove(this.item)}catch(e){}try{this._Provider.remove()}catch(e){}},Gi.prototype.createPolygonGeoJsonFeatureLayer=function(e,t,i,o,n){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},a=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.extend(r,i,!0)),r=(null==t&&console.log("geojson is required"),null),r=t.then?t:this._cesium.GeoJsonDataSource.load(t),s=this,l=[],i=(r.then(function(e){for(var t=e.entities.values,i=0;i<t.length;i++){var o=t[i],o=(a.polygonHierarchy=new s._cesium.PolygonHierarchy(o.polygon.hierarchy._value.positions),new s._cesium.PolygonGeometry(a)),o=s._cesium.PolygonGeometry.createGeometry(o),o=new s._cesium.GeometryInstance({geometry:o});l.push(o)}var e=s._viewer.scene.primitives.add(new s._cesium.Primitive({geometryInstances:l,appearance:new s._cesium.MaterialAppearance({material:new s._cesium.Material({fabric:{type:"Color",uniforms:{color:a.material}}}),faceForward:!0,flat:!1})})),r="material:"+255*a.material.red+","+255*a.material.green+","+255*a.material.blue;s.Legend.push(r),s.item=e,0==a.show&&(e.show=!1),"function"==typeof n&&n(e)}),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),{id:a.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t,style:a});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},Gi.prototype.deleteObject=function(){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if(null!=this.model&&null!=this.model&&0<this.model.length)for(e=0;e<this.model.length;e++)this._viewer.scene.primitives.remove(this.model[e]);try{this._Provider.remove()}catch(e){}},Gi.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Gi.prototype.setVisibility=function(e){if(null!=this.items&&null!=this.items&&0<this.items.length)for(var t=0;t<this.items.length;t++)this.items[t].show=e;else this.item.show=e;if(null!=this.model&&null!=this.model&&0<this.model.length)for(t=0;t<this.model.length;t++)this.model[t].show=e;this._Provider&&this._Provider.setStatus(!e)},Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(e,t,a,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},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(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._core.extend(n,a,!0)),c=(0==l.extrudedHeight&&(l.extrudedHeight=999999),this.items=[],this),u=new v(this._viewer,this._cesium,s),n=((this._Provider=u)._loadTile=function(e){var n=[];if(scene.primitives,c.Legend=[],new c._cesium.PrimitiveCollection,e.features.forEach(function(i){if(u._isCameraMoving)return null;var o=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):o.push(e[t])}if(Array.isArray(i.geometry.coordinates)&&0<i.geometry.coordinates.length)if(Array.isArray(i.geometry.coordinates[0][0]))for(var e=0;e<i.geometry.coordinates.length;e++)o=[],r(i.geometry.coordinates[e]),t(o);else r(i.geometry.coordinates),t(o);function t(e){var t;u._isCameraMoving||(e=c._cesium.Cartesian3.fromDegreesArray(e),/^\[/.test(a.extrudedHeight)&&/\]$/.test(a.extrudedHeight)&&(t=a.extrudedHeight.replace(/\[/,"").replace(/\]/,""),l.extrudedHeight=parseFloat(i.properties[t])),l.extrudedHeight=parseFloat(l.extrudedHeight),1==l.heightReference&&delete l.height,1==l.extrudedHeightReference&&delete l.extrudedHeight,/^\[/.test(a.material)&&/\]$/.test(a.material)&&(t=a.material.replace(/\[/,"").replace(/\]/,""),l.material=i.properties[t],c._core.isHtmlColor(l.material)?l.material=c._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=c._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=c._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),l.polygonHierarchy=new c._cesium.PolygonHierarchy(e),i.positions=e,t=new c._cesium.PolygonGeometry(l),e=null,e=new c._cesium.GeometryInstance({id:i,geometry:t,attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(l.material)}}),t="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue,c.Legend.push(t),n.push(e))}}),0<n.length)return new c._cesium.GroundPrimitive({geometryInstances:n,appearance:new c._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:l.classificationType})},this.item=u._primitiveCollection,u.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(e,t,l,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},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,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},c=l.material,u=l.height,h=(this._core.isnull(l)||this._core.isnull(l.color)||(this._core.isHtmlColor(l.color)?l.color=this._color.colorFromHtmlColor(l.color):(/^rgb/.test(l.color)&&(l.color=this._color.rgbaStringToRgbaObj(l.color)),1<l.color.r&&(l.color.r=l.color.r/255),1<l.color.g&&(l.color.g=l.color.g/255),1<l.color.b&&(l.color.b=l.color.b/255),1<l.color.a&&(l.color.a=l.color.a/255),l.color=this._color.createColor(l.color.r,l.color.g,l.color.b,l.color.a))),this._core.isnull(l)||this._core.isnull(l.lightColor)||(this._core.isHtmlColor(l.lightColor)?l.lightColor=this._color.colorFromHtmlColor(l.lightColor):(/^rgb/.test(l.lightColor)&&(l.lightColor=this._color.rgbaStringToRgbaObj(l.lightColor)),1<l.lightColor.r&&(l.lightColor.r=l.lightColor.r/255),1<l.lightColor.g&&(l.lightColor.g=l.lightColor.g/255),1<l.lightColor.b&&(l.lightColor.b=l.lightColor.b/255),1<l.lightColor.a&&(l.lightColor.a=l.lightColor.a/255),l.lightColor=this._color.createColor(l.lightColor.r,l.lightColor.g,l.lightColor.b,l.lightColor.a))),this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),this._core.extend(n,l,!0)),m=(0==h.extrudedHeight&&(h.extrudedHeight=999999),this.items=[],this),d=new v(this._viewer,this._cesium,a),n=((this._Provider=d)._loadTile=function(e){var a=null,s=(scene.primitives,new m._cesium.PrimitiveCollection);return m.Legend=[],e.features.forEach(function(o){if(d._isCameraMoving)return null;var i=[];function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):i.push(e[t])}if(Array.isArray(o.geometry.coordinates)&&0<o.geometry.coordinates.length)if(Array.isArray(o.geometry.coordinates[0][0]))for(var e=0;e<o.geometry.coordinates.length;e++)i=[],r(o.geometry.coordinates[e]),t(i),n(i);else r(o.geometry.coordinates),t(i),n(i);function t(e){var t,i;d._isCameraMoving||(e=m._cesium.Cartesian3.fromDegreesArray(e),/^\[/.test(l.extrudedHeight)&&/\]$/.test(l.extrudedHeight)&&(t=l.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h.extrudedHeight=parseFloat(o.properties[t])),h.extrudedHeight=parseFloat(h.extrudedHeight),1==h.heightReference&&delete h.height,1==h.extrudedHeightReference&&delete h.extrudedHeight,/^\[/.test(l.material)&&/\]$/.test(l.material)&&(t=l.material.replace(/\[/,"").replace(/\]/,""),h.material=o.properties[t],m._core.isHtmlColor(h.material)?h.material=m._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=m._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=m._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a))),h.polygonHierarchy=new m._cesium.PolygonHierarchy(e),t=new m._cesium.PolygonGeometry(h),i=null,o.positions=e,i=new m._cesium.GeometryInstance({id:o,geometry:t,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),e="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue,m.Legend.push(e),a=new m._cesium.ClassificationPrimitive({geometryInstances:i,appearance:new m._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:h.classificationType,shadows:m._cesium.ShadowMode.ENABLED}),s.add(a))}function n(e){for(var e=m._cesium.Cartesian3.fromDegreesArray(e),t=[],i=new m._cesium.PolygonHierarchy(e).positions,o=0;o<i.length;o++){var r=m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).longitude),n=m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).latitude);t.push(r),t.push(n)}e=m.getTheBottomPoint(t);m.scanningPolygon(e,h.offset_x,h.offset_y,t).forEach(function(e){e=m._cesium.Transforms.eastNorthUpToFixedFrame(m._cesium.Cartesian3.fromDegrees(e.lon,e.lat,u)),e=m._cesium.Model.fromGltf({url:c,color:h.color,lightColor:h.lightColor,modelMatrix:e,scale:h.scale});s.add(e)})}}),s},l&&l.time&&(d.availability=new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:l.time.start?m._cesium.JulianDate.fromDate(new Date(l.time.start)):m._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?m._cesium.JulianDate.fromDate(new Date(l.time.end)):m._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=d._primitiveCollection,d.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:h.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:l});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Gi.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]},Gi.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},Gi.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,c=-180,u=-90,h=0;h<o.length;h+=2)u=u>o[h+1]?u:o[h+1],l=l<o[h]?l:o[h],c=c>o[h]?c: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<=u;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<=c;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},Gi.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<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},Gi.prototype.setPolylinemodels=function(e,t,i,o,r,n,a,s,l){var c=this._core.getSpaceDistancem(e,s),u=10,h=parseFloat(a.distance),c=(0!=h&&(u=parseInt(c/h)),e[0]),h=e[e.length-1],e=s.Cartographic.fromCartesian(c),m=s.Math.toDegrees(e.longitude),d=s.Math.toDegrees(e.latitude),c=(e.height,s.Cartographic.fromCartesian(h)),h=s.Math.toDegrees(c.longitude),p=s.Math.toDegrees(c.latitude),g=(c.height,s.Math.toDegrees(e.height),u),f=s.Math.lerp(m,h,1/g)-m,_=s.Math.lerp(d,p,1/g)-d;s.Math.lerp(t,o,1/g),s.Math.lerp(i,r,1/g);for(var C=0;C<g;C++){var y=s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(m+(C+1)*f,d+(C+1)*_,a.height)),y=(parseInt(a.heightReference),s.Model.fromGltf({url:a.url,modelMatrix:y,color:a.color,lightColor:a.lightColor,scale:a.scale,heightReference:parseInt(a.heightReference)}));l.scene.primitives.add(y),n.push(y)}return n},Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl=function(e,t,i,o,r,n){var a={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},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(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.extend(a,i,!0)),c=this,u=new v(this._viewer,this._cesium,s),a=((this._Provider=u)._loadTile=function(e,t){var a,e=c._taskProcessor.scheduleTask({json:e,styleOption:i,options:l,tileKey:t});c._cesium.defined(e)&&(a=c)._cesium.when(e,function(e){if(!u._primitiveByTile[e.tileKey]){for(var t=new a._cesium.PrimitiveCollection,i=0;i<e.geomInstances.length;i++){var o=null,r=e.geomInstances[i],n=r.id.id;u._primitiveByTile[n]||(n=new a._cesium.Material({fabric:{type:"Color",uniforms:{color:e.materials[i]}}}),new a._cesium.MaterialAppearance({material:n,faceForward:!0,flat:!1}),o=new a._cesium.Primitive({allowPicking:!0,appearance:new a._cesium.PerInstanceColorAppearance,geometryInstances:r,shadows:c._cesium.ShadowMode.ENABLED}),t.add(o))}u._primitiveCollection.add(t),u._primitiveByTile[e.tileKey]=t}})},this.item=u._primitiveCollection,u.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:l.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i});return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(e,t,a,i,o,r){var n={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},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(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):/^http/.test(a.material)||(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._core.isnull(a)||this._core.isnull(a.fill)||"["==a.fill.toString().charAt(0)&&"]"==a.fill.toString().charAt(a.fill.length-1)||(this._core.isHtmlColor(a.fill)?a.fill=this._color.colorFromHtmlColor(a.fill):/^http/.test(a.fill)||(/^rgb/.test(a.fill)&&(a.fill=this._color.rgbaStringToRgbaObj(a.fill)),1<a.fill.r&&(a.fill.r=a.fill.r/255),1<a.fill.g&&(a.fill.g=a.fill.g/255),1<a.fill.b&&(a.fill.b=a.fill.b/255),1<a.fill.a&&(a.fill.a=a.fill.a/255),a.fill=this._color.createColor(a.fill.r,a.fill.g,a.fill.b,a.fill.a))),this._core.extend(n,a,!0)),c=this,n=new v(this._viewer,this._cesium,s),s=((this._Provider=n)._loadTile=function(e){c.Legend=[];var n=new c._cesium.PrimitiveCollection;return e.features.forEach(function(r){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):i.push(e[t])}if(Array.isArray(r.geometry.coordinates)&&0<r.geometry.coordinates.length)if(Array.isArray(r.geometry.coordinates[0][0]))for(var e=0;e<r.geometry.coordinates.length;e++)i=[],o(r.geometry.coordinates[e]),t(i);else o(r.geometry.coordinates),t(i);function t(e){var e=c._cesium.Cartesian3.fromDegreesArray(e),t=(/^\[/.test(a.extrudedHeight)&&/\]$/.test(a.extrudedHeight)&&(t=a.extrudedHeight.replace(/\[/,"").replace(/\]/,""),l.extrudedHeight=parseFloat(r.properties[t])),l.extrudedHeight=parseFloat(l.extrudedHeight),1==l.heightReference&&delete l.height,1==l.extrudedHeightReference&&delete l.extrudedHeight,/^\[/.test(a.material)&&/\]$/.test(a.material)&&(t=a.material.replace(/\[/,"").replace(/\]/,""),l.material=r.properties[t],c._core.isHtmlColor(l.material)?l.material=c._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=c._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=c._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),l.polygonHierarchy=new c._cesium.PolygonHierarchy(e),r.positions=e,new c._cesium.PolygonGeometry(l)),e=new c._cesium.ColorGeometryInstanceAttribute.fromColor(l.fill),i={},i=/^http/.test(l.material)?new c._cesium.Material({fabric:{type:"Image",uniforms:{image:l.material}}}):(o="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue,c.Legend.push(o),new c._cesium.Material({fabric:{type:"Color",uniforms:{color:l.material}}})),o=new c._cesium.GeometryInstance({id:r,geometry:t,attributes:{color:e}}),t=new c._cesium.Primitive({allowPicking:!0,appearance:new c._cesium.MaterialAppearance({material:i}),geometryInstances:o,shadows:c._cesium.ShadowMode.ENABLED});n.add(t)}}),n},a&&a.time&&(n.availability=new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({start:a.time.start?c._cesium.JulianDate.fromDate(new Date(a.time.start)):c._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?c._cesium.JulianDate.fromDate(new Date(a.time.end)):c._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:a});return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=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},l=(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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.outlineColor)||"["==i.outlineColor.toString().charAt(0)&&"]"==i.outlineColor.toString().charAt(i.outlineColor.length-1)||(this._core.isHtmlColor(i.outlineColor)?i.outlineColor=this._color.colorFromHtmlColor(i.outlineColor):(/^rgb/.test(i.outlineColor)&&(i.outlineColor=this._color.rgbaStringToRgbaObj(i.outlineColor)),1<i.outlineColor.r&&(i.outlineColor.r=i.outlineColor.r/255),1<i.outlineColor.g&&(i.outlineColor.g=i.outlineColor.g/255),1<i.outlineColor.b&&(i.outlineColor.b=i.outlineColor.b/255),1<i.outlineColor.a&&(i.outlineColor.a=i.outlineColor.a/255),i.outlineColor=this._color.createColor(i.outlineColor.r,i.outlineColor.g,i.outlineColor.b,i.outlineColor.a))),this._option=this._core.extend(a,i,!0),this),a=t.urlinit,c={polygonHierarchy:void 0,height:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},a=($.ajax({url:a,type:"get",async:!1,dataType:"json",success:function(e){l.datas=e.features}}),new v(this._viewer,this._cesium,s)),s=((this._Provider=a)._loadTile=function(e){l.Legend=[],new l._cesium.PrimitiveCollection;var a=[],s=[],t=new Cesium.PrimitiveCollection;return e.features.forEach(function(e){var o=[];var t=e.id,t=parseInt(t.split(".")[1])-1;if(e=l.datas[t],Array.isArray(e.geometry.coordinates)&&0<e.geometry.coordinates.length&&Array.isArray(e.geometry.coordinates[0][0][0]))for(var i=0;i<e.geometry.coordinates[0].length;i++){o=[],!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?(3==t[i].length&&t[i].splice(2,1),t[i].push(l._option.height),e(t[i])):o.push(t[i])}(e.geometry.coordinates[0][i]),n=r=n=r=r=r=n=n=n=r=void 0;var r=o,n=(/^\[/.test(l._option.extrudedHeight)&&/\]$/.test(l._option.extrudedHeight)&&(n=l._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),c.extrudedHeight=parseFloat(e.properties[n])),c.material=l._option.material,/^\[/.test(l._option.material)&&/\]$/.test(l._option.material)?(n=l._option.material.replace(/\[/,"").replace(/\]/,""),c.material=e.properties[n],l._core.isHtmlColor(c.material)?c.material=l._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=l._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=l._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha))):(l._option.material&&(c.material=l._option.material),c.material&&(l._core.isHtmlColor(c.material)?c.material=l._color.colorFromHtmlColor(c.material):(/^rgb/.test(c.material)&&(c.material=l._color.rgbaStringToRgbaObj(c.material)),1<c.material.red&&(c.material.red=c.material.red/255),1<c.material.green&&(c.material.green=c.material.green/255),1<c.material.blue&&(c.material.blue=c.material.blue/255),1<c.material.alpha&&(c.material.a=c.material.alpha/255),c.material=l._color.createColor(c.material.red,c.material.green,c.material.blue,c.material.alpha)))),l._cesium.Cartesian3.fromDegreesArrayHeights(r)),r=(c.polygonHierarchy=new l._cesium.PolygonHierarchy(n),new l._cesium.PolygonGeometry(c)),r=new Cesium.GeometryInstance({id:e,geometry:r,attributes:{color:new l._cesium.ColorGeometryInstanceAttribute.fromColor(l._option.randomColor?Cesium.Color.fromRandom().withAlpha(c.material.alpha):c.material)}}),r=(a.push(r),{positions:n,width:l._option.width}),n=new l._cesium.GroundPolylineGeometry(r),r=new l._cesium.GeometryInstance({geometry:n}),n=(s.push(r),"material:"+255*c.material.red+","+255*c.material.green+","+255*c.material.blue);l.Legend.push(n)}}),0<a.length&&(c.extrudedHeight?t.add(new l._cesium.Primitive({geometryInstances:a,appearance:new l._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:l._core.Shaders("vertexShaderSource"),fragmentShaderSource:l._core.Shaders("fragmentShaderSource")})})):t.add(new l._cesium.GroundPrimitive({geometryInstances:a,appearance:new l._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:l._core.Shaders("vertexShaderSource")})}))),0<s.length&&t.add(new l._cesium.GroundPolylinePrimitive({geometryInstances:s,appearance:new l._cesium.PolylineMaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:l._option.outlineColor}}})}),shadows:l._cesium.ShadowMode.ENABLED})),t},this.item=a._primitiveCollection,a.addTo(this._viewer),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,{id:c.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i});return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Gi.prototype.setTreeobj=function(e){this.treeobj=e},Gi.prototype.createPolygonVectorFeatureLayerProvider=function(e,t,n,i,o){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},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},s=(this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._core.extend(r,n,!0)),l=this,r=new v(this._viewer,this._cesium,a),a=((this._Provider=r)._loadTile=function(e){var r=[];return l.Legend=[],e.features.forEach(function(e){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.geometry.coordinates[0]);var t=l._cesium.Cartesian3.fromDegreesArray(o),e=(/^\[/.test(n.extrudedHeight)&&/\]$/.test(n.extrudedHeight)&&(i=n.extrudedHeight.replace(/\[/,"").replace(/\]/,""),s.extrudedHeight=parseFloat(e.properties[i])),s.polygonHierarchy=new l._cesium.PolygonHierarchy(t),new l._cesium.PolygonGeometry(s)),i=l._cesium.PolygonGeometry.createGeometry(e),t="material:"+255*s.material.red+","+255*s.material.green+","+255*s.material.blue,e=(l.Legend.push(t),new l._cesium.GeometryInstance({geometry:i,attributes:{color:new l._cesium.ColorGeometryInstanceAttribute.fromColor(s.material)},shadows:l._cesium.ShadowMode.ENABLED}));r.push(e)}),new this._cesium.Primitive({allowPicking:!1,appearance:new this._cesium.PerInstanceColorAppearance({translucent:!1,flat:!0,faceForward:!0,closed:!0}),geometryInstances:r})},this.item=r._primitiveCollection,r.addTo(this._viewer),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),{id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n});this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},Gi.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(e,t,n,i,o){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},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},s=(this._core.isnull(n)||this._core.isnull(n.material)||"["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)||(this._core.isHtmlColor(n.material)?n.material=this._color.colorFromHtmlColor(n.material):(/^rgb/.test(n.material)&&(n.material=this._color.rgbaStringToRgbaObj(n.material)),1<n.material.r&&(n.material.r=n.material.r/255),1<n.material.g&&(n.material.g=n.material.g/255),1<n.material.b&&(n.material.b=n.material.b/255),1<n.material.a&&(n.material.a=n.material.a/255),n.material=this._color.createColor(n.material.r,n.material.g,n.material.b,n.material.a))),this._core.extend(r,n,!0)),r=new v(this._viewer,this._cesium,a),l=(this._Provider=r,this),a=(r._loadTile=function(e){var r=[];return e.features.forEach(function(e){var o=[];!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.geometry.coordinates[0]);var t=l._cesium.Cartesian3.fromDegreesArray(o),e=(/^\[/.test(n.extrudedHeight)&&/\]$/.test(n.extrudedHeight)&&(i=n.extrudedHeight.replace(/\[/,"").replace(/\]/,""),s.extrudedHeight=parseFloat(e.properties[i])),s.polygonHierarchy=new l._cesium.PolygonHierarchy(t),new l._cesium.PolygonGeometry(s)),i=new l._cesium.GeometryInstance({geometry:e,attributes:{color:l._cesium.ColorGeometryInstanceAttribute.fromColor(l._cesium.Color.fromCssColorString("#004FFF").withAlpha(.5)),show:new l._cesium.ShowGeometryInstanceAttribute(!0)}});r.push(i)}),new l._cesium.GroundPrimitive({classificationType:l._cesium.ClassificationType.BOTH,geometryInstances:r})},this.item=r._primitiveCollection,r.addTo(this._viewer),this._core.isnull(s.id)&&(s.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+s.id),{id:s.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:n});this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof o&&o(this.item)},Gi.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Gi.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}};var ki={};function Ni(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}ki.read=function(e,t,i,o,r){var n,a,s=8*r-o-1,l=(1<<s)-1,c=l>>1,u=-7,h=i?r-1:0,m=i?-1:1,r=e[t+h];for(h+=m,n=r&(1<<-u)-1,r>>=-u,u+=s;0<u;n=256*n+e[t+h],h+=m,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=o;0<u;a=256*a+e[t+h],h+=m,u-=8);if(0===n)n=1-c;else{if(n===l)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,o),n-=c}return(r?-1:1)*a*Math.pow(2,n-o)},ki.write=function(e,t,i,o,r,n){var a,s,l=8*n-r-1,c=(1<<l)-1,u=c>>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=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-a))<1&&(a--,o*=2),2<=(t+=1<=a+u?h/o:h*Math.pow(2,1-u))*o&&(a++,o/=2),c<=a+u?(s=0,a=c):1<=a+u?(s=(t*o-1)*Math.pow(2,r),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),a=0));8<=r;e[i+m]=255&s,m+=d,s/=256,r-=8);for(a=a<<r|s,l+=r;0<l;e[i+m]=255&a,m+=d,a/=256,l-=8);e[i+m-d]|=128*n},Ni.Varint=0,Ni.Fixed64=1,Ni.Bytes=2,Ni.Fixed32=5;var ji=4294967296,Ui=1/ji;function zi(e){return e.type===Ni.Bytes?e.readVarint()+e.pos:e.pos+1}function Wi(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Yi(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<e.length;i++)t.writeVarint(e[i])}function Ki(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function Qi(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function qi(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function Xi(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function Zi(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function $i(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function eo(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function to(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function io(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function oo(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function ro(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function no(e,t){this.x=e,this.y=t}function ao(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(so,this,t)}function so(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<n;){var a=r._keys[o.readVarint()],s=r._values[o.readVarint()];r.properties[a]=s}else 3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function lo(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(co,this,t),this.length=this._features.length}function co(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){var t=null,i=e.readVarint()+e.pos;for(;e.pos<i;){var o=e.readVarint()>>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 uo(e,t){this.layers=e.readFields(ho,{},t)}function ho(e,t,i){3===e&&(e=new lo(i,i.readVarint()+i.pos)).length&&(t[e.name]=e)}function mo(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,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=[]}Ni.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),r=o>>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=io(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ro(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=io(this.buf,this.pos)+io(this.buf,this.pos+4)*ji;return this.pos+=8,e},readSFixed64:function(){var e=io(this.buf,this.pos)+ro(this.buf,this.pos+4)*ji;return this.pos+=8,e},readFloat:function(){var e=ki.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ki.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 Wi(i,r,t);if(n=e[o.pos++],r|=(127&n)<<3,n<128)return Wi(i,r,t);if(n=e[o.pos++],r|=(127&n)<<10,n<128)return Wi(i,r,t);if(n=e[o.pos++],r|=(127&n)<<17,n<128)return Wi(i,r,t);if(n=e[o.pos++],r|=(127&n)<<24,n<128)return Wi(i,r,t);if(n=e[o.pos++],r|=(1&n)<<31,n<128)return Wi(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<i;){var l=e[s],c=null,u=239<l?4:223<l?3:191<l?2:1;if(i<s+u)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[s+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=e[s+1],r=e[s+2],128==(192&o)&&128==(192&r)&&((c=(15&l)<<12|(63&o)<<6|63&r)<=2047||55296<=c&&c<=57343)&&(c=null)):4===u&&(o=e[s+1],r=e[s+2],n=e[s+3],128==(192&o)&&128==(192&r)&&128==(192&n)&&((c=(15&l)<<18|(63&o)<<12|(63&r)<<6|63&n)<=65535||1114112<=c)&&(c=null)),null===c?(c=65533,u=1):65535<c&&(c-=65536,a+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),a+=String.fromCharCode(c),s+=u}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=zi(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=zi(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){e&=7;if(e===Ni.Varint)for(;127<this.buf[this.pos++];);else if(e===Ni.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ni.Fixed32)this.pos+=4;else{if(e!==Ni.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t,i=this.length||16;i<this.pos+e;)i*=2;i!==this.length&&((t=new Uint8Array(i)).set(this.buf),this.buf=t,this.length=i)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),oo(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),oo(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),oo(this.buf,-1&e,this.pos),oo(this.buf,Math.floor(e*Ui),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),oo(this.buf,-1&e,this.pos),oo(this.buf,Math.floor(e*Ui),this.pos+4),this.pos+=8},writeVarint:function(e){if(268435455<(e=+e||0)||e<0){var t=e,i=this;if(0<=t?(o=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(o=~(-t%4294967296))?o=o+1|0:r=r+1|(o=0)),0x10000000000000000<=t||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10);var t=o,o=i,t=(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|128,t>>>=7,o.buf[o.pos]=127&t,r),r=i,i=(7&t)<<4;r.buf[r.pos++]|=i|((t>>>=3)?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|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=127&t)))))}else this.realloc(4),this.buf[this.pos++]=127&e|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(127<e?128:0),e<=127||(this.buf[this.pos++]=e>>>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<t.length;n++){if(55295<(o=t.charCodeAt(n))&&o<57344){if(!r){56319<o||n+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):r=o;continue}if(o<56320){e[i++]=239,e[i++]=191,e[i++]=189,r=o;continue}o=r-55296<<10|o-56320|65536,r=null}else r&&(e[i++]=239,e[i++]=191,e[i++]=189,r=null);o<128?e[i++]=o:(o<2048?e[i++]=o>>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&&Yi(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),ki.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ki.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<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos,e=(e(t,this),this.pos-i);128<=e&&Yi(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e},writeMessage:function(e,t,i){this.writeTag(e,Ni.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,Ji,t)},writePackedSVarint:function(e,t){this.writeMessage(e,Ki,t)},writePackedBoolean:function(e,t){this.writeMessage(e,Xi,t)},writePackedFloat:function(e,t){this.writeMessage(e,Qi,t)},writePackedDouble:function(e,t){this.writeMessage(e,qi,t)},writePackedFixed32:function(e,t){this.writeMessage(e,Zi,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,$i,t)},writePackedFixed64:function(e,t){this.writeMessage(e,eo,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,to,t)},writeBytesField:function(e,t){this.writeTag(e,Ni.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Ni.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Ni.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Ni.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Ni.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Ni.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Ni.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Ni.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Ni.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Ni.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}},no.prototype={clone:function(){return new no(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,e=e.y-this.y;return t*t+e*e},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,e=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=e,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),e=Math.sin(e),i=t*this.x-e*this.y,e=e*this.x+t*this.y;return this.x=i,this.y=e,this},_rotateAround:function(e,t){var i=Math.cos(e),e=Math.sin(e),o=t.x+i*(this.x-t.x)-e*(this.y-t.y),e=t.y+e*(this.x-t.x)+i*(this.y-t.y);return this.x=o,this.y=e,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},no.convert=function(e){return!(e instanceof no)&&Array.isArray(e)?new no(e[0],e[1]):e},ao.types=["Unknown","Point","LineString","Polygon"],ao.prototype.loadGeometry=function(){for(var e,t,i=this._pbf,o=(i.pos=this._geometry,i.readVarint()+i.pos),r=1,n=0,a=0,s=0,l=[];i.pos<o;)if(n<=0&&(r=7&(t=i.readVarint()),n=t>>3),n--,1===r||2===r)a+=i.readSVarint(),s+=i.readSVarint(),1===r&&(e&&l.push(e),e=[]),e.push(new no(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}return e&&l.push(e),l},ao.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,c=1/0,u=-1/0;t.pos<i;)if(r<=0&&(o=7&(e=t.readVarint()),r=e>>3),r--,1===o||2===o)(n+=t.readSVarint())<s&&(s=n),l<n&&(l=n),(a+=t.readSVarint())<c&&(c=a),u<a&&(u=a);else if(7!==o)throw new Error("unknown command "+o);return[s,c,l,u]},ao.prototype.toGeoJSON=function(e,t,i,o){var r,n=this.extent*Math.pow(2,i),a=this.extent*e,s=this.extent*t/2,l=this.loadGeometry(),i=ao.types[this.type];function c(e){for(var t=0;t<e.length;t++){var i=e[t],o=90-180*(i.y+s)/(n/2);e[t]=[360*(i.x+a)/n-180,o]}}switch(this.type){case 1:for(var u=[],h=0;h<l.length;h++)u[h]=l[h][0];c(l=u);break;case 2:for(h=0;h<l.length;h++)c(l[h]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var i,o,r=[],n=0;n<t;n++){var a=function(e){for(var t,i,o=0,r=0,n=e.length,a=n-1;r<n;a=r++)t=e[r],i=e[a],o+=(i.x-t.x)*(t.y+i.y);return o}(e[n]);0!==a&&((o=void 0===o?a<0:o)===a<0?(i&&r.push(i),i=[e[n]]):i.push(e[n]))}i&&r.push(i);return r}(l),h=0;h<l.length;h++)for(r=0;r<l[h].length;r++)c(l[h][r])}1===l.length?l=l[0]:i="Multi"+i;e={type:"Feature",geometry:{type:i,coordinates:l},properties:this.properties};return"id"in this&&(e.id=this.id),e},lo.prototype.feature=function(e){if(e<0||e>=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 ao(this._pbf,e,this.extent,this._keys,this._values)};var po="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 go(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,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 f,this._tree=V,this._getPosition=new y(this._viewer,this._cesium),this._ModelEdit=new Jt(this._viewer),this._popupmessage=new Si(this._viewer,this._cesium),this._createGroup=new Ei(this._viewer,this._cesium),this._billboardGeoJsonFeatureLayer=new Ii(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new w(this._viewer,this._cesium),this._LabelGeoJsonFeatureLayercopy=new S(this._viewer,this._cesium),this._VectorGeoJsonFeatureLayer=new E(this._viewer,this._cesium),this._PolylineGeoJsonFeatureLayer=new Hi(this._viewer,this._cesium),this._PointModel=new P(this._viewer,this._cesium),this._PolygonGeoJsonFeatureLayer=new Gi(this._viewer,this._cesium),this._PolygonVectorTileLayerArcgis=new mo(this._viewer,this._cesium),this._WallGeoFeatureLayer=new go(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.objectsToExclude=[],this.SimpleGraphicObj=[],V.editPointID||(V.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}mo.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":po(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},mo.prototype.createVolumeVectorGeoJsonFeatureLayer=function(e,t,E,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(E)||this._core.isnull(E.fill)||"["==E.fill.toString().charAt(0)&&"]"==E.fill.toString().charAt(E.fill.length-1)||(this._core.isHtmlColor(E.fill)?E.fill=this._color.colorFromHtmlColor(E.fill):(/^rgb/.test(E.fill)&&(E.fill=this._color.rgbaStringToRgbaObj(E.fill)),1<E.fill.r&&(E.fill.r=E.fill.r/255),1<E.fill.g&&(E.fill.g=E.fill.g/255),1<E.fill.b&&(E.fill.b=E.fill.b/255),1<E.fill.a&&(E.fill.a=E.fill.a/255),E.fill=this._color.createColor(E.fill.r,E.fill.g,E.fill.b,E.fill.a))),this._core.isnull(E)||this._core.isnull(E.polylinefill)||"["==E.polylinefill.toString().charAt(0)&&"]"==E.polylinefill.toString().charAt(E.polylinefill.length-1)||(this._core.isHtmlColor(E.polylinefill)?E.polylinefill=this._color.colorFromHtmlColor(E.polylinefill):(/^rgb/.test(E.polylinefill)&&(E.polylinefill=this._color.rgbaStringToRgbaObj(E.polylinefill)),1<E.polylinefill.r&&(E.polylinefill.r=E.polylinefill.r/255),1<E.polylinefill.g&&(E.polylinefill.g=E.polylinefill.g/255),1<E.polylinefill.b&&(E.polylinefill.b=E.polylinefill.b/255),1<E.polylinefill.a&&(E.polylinefill.a=E.polylinefill.a/255),E.polylinefill=this._color.createColor(E.polylinefill.r,E.polylinefill.g,E.polylinefill.b,E.polylinefill.a))),this._core.isnull(E)||this._core.isnull(E.outlineColor)||"["==E.outlineColor.toString().charAt(0)&&"]"==E.outlineColor.toString().charAt(E.outlineColor.length-1)||(this._core.isHtmlColor(E.outlineColor)?E.outlineColor=this._color.colorFromHtmlColor(E.outlineColor):(/^rgb/.test(E.outlineColor)&&(E.outlineColor=this._color.rgbaStringToRgbaObj(E.outlineColor)),1<E.outlineColor.r&&(E.outlineColor.r=E.outlineColor.r/255),1<E.outlineColor.g&&(E.outlineColor.g=E.outlineColor.g/255),1<E.outlineColor.b&&(E.outlineColor.b=E.outlineColor.b/255),1<E.outlineColor.a&&(E.outlineColor.a=E.outlineColor.a/255),E.outlineColor=this._color.createColor(E.outlineColor.r,E.outlineColor.g,E.outlineColor.b,E.outlineColor.a))),this._option=this._core.extend(r,E,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required"),this);Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE;P._core.xhr({url:"http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json",type:"get",dataType:"json",success:function(e){var T=[],S=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<e.length;t++)Array.isArray(e[t])?i(e[t]):T.push(e[t])}function t(e){e={positions:Cesium.Cartesian3.fromDegreesArray(e),width:10,color:Cesium.ColorGeometryInstanceAttribute.fromColor(P._option.polylinefill)},e=new Cesium.PolylineGeometry(e),e=new Cesium.GeometryInstance({geometry:e});a.push(e)}function o(e){e=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e))}),e=Cesium.PolygonGeometry.createGeometry(e),e=new Cesium.GeometryInstance({geometry:e,attributes:{color:b}});s.push(e)}var r,n=new uo(new Ni(e)),a=[],s=[];for(r in P.labelCollections=new P._cesium.LabelCollection,n.layers)for(var l=n.layers[r],c=0;c<l.length;c++)for(var u=l.feature(c),h=u.loadGeometry(),m=0;m<h.length;m++)for(var d=h[m],p=0;p<d.length;p++){d[p];var g=null;if(null!=u.properties._symbol)for(var f=u.properties._symbol,_=0;_<S.length;_++)null!=S[_].filter&&"=="==S[_].filter[0]&&"_symbol"==S[_].filter[1]&&S[_].filter[2]==f&&(g=S[_]);else if(null!=l.name)for(var C=l.name,_=0;_<S.length;_++)null!=S[_]["source-layer"]&&S[_]["source-layer"]==C&&(g=S[_]);if(1==u.type)try{var y,v=u.toGeoJSON(0,0,0,P.extent),w=(null!=E.text&&/^\[/.test(E.text)&&/\]$/.test(E.text)&&(y=E.text.replace(/\[/,"").replace(/\]/,""),P._option.text=u.properties[y]),null!=g.paint&&g.paint["icon-color"]&&(P._option.fill=P._color.createColorTransformation(g.paint["icon-color"])),P._option.position=new P._cesium.Cartesian3.fromDegrees(v.geometry.coordinates[0],v.geometry.coordinates[1],P._option.height),{}),w="point"==v.geometry.type?{id:v,color:P._option.fill,position:P._option.position}:P._option;P.labelCollections.add(w)}catch(e){}if(2==u.type){d[0];v=u.toGeoJSON(0,0,0,P.extent);if(!P._core.isnull(E.polylinefill)&&null!=g.paint&&g.paint["icon-color"]&&(P._option.polylinefill=P._color.createColorTransformation(g.paint["icon-color"])),Array.isArray(v.geometry.coordinates)&&0<v.geometry.coordinates.length)if(Array.isArray(v.geometry.coordinates[0][0]))for(m=0;m<v.geometry.coordinates.length;m++)T=[],i(v.geometry.coordinates[m]),t(T);else i(v.geometry.coordinates),t(T)}if(3==u.type)try{d[0];var v=u.toGeoJSON(0,0,0,P.extent),b=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA);if(null!=g.paint["fill-color"]&&(b=Cesium.ColorGeometryInstanceAttribute.fromColor(P._color.createColorTransformation(g.paint["fill-color"]))),Array.isArray(v.geometry.coordinates)&&0<v.geometry.coordinates.length)if(Array.isArray(v.geometry.coordinates[0][0]))for(m=0;m<v.geometry.coordinates.length;m++)T=[],i(v.geometry.coordinates[m]),o(T);else i(v.geometry.coordinates),o(T)}catch(e){}}0<P.labelCollections.length&&P._viewer.scene.primitives.add(P.labelCollections),0<a.length&&P._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:a,appearance:new Cesium.PolylineColorAppearance})),0<s.length&&P._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:s,appearance:new P._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}})},mo.prototype.createVolumeVectorGeoJsonFeatureLayers=function(e,t,o,i,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},s=(this.extent={XMin:t.minx||0,YMin:t.miny||0,XMax:t.maxx||0,YMax:t.maxy||0},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.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(n,o,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required"),[]),w={polygonHierarchy:void 0,height:0,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},b=this;this._urlTemplate=t.url+"?"+this._serialize(a.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){var i,v;(this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&b.item.show&&(t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max?0!=(i=C.filter(s,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&i[0].data&&0<i[0].data.length?(t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(v=t,Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function(e){var t,i=new uo(new Ni(e)),o=(b.labelCollections=new b._cesium.PointPrimitiveCollection,[]),r=[];for(t in i.layers)for(var n=i.layers[t],a=0;a<n.length;a++)for(var s=n.feature(a),l=s.loadGeometry(),c=0;c<l.length;c++)for(var u=l[c],h=0;h<u.length;h++){if(u[h],1==s.type)try{var m,d=s.toGeoJSON(0,0,0,b.extent),p=(null!=b._option.text&&/^\[/.test(b._option.text)&&/\]$/.test(b._option.text)&&(m=b._option.text.replace(/\[/,"").replace(/\]/,""),w.text=s.properties[m]),w.position=new b._cesium.Cartesian3.fromDegrees(d.geometry.coordinates[0],d.geometry.coordinates[1],w.height),{}),p="point"==d.geometry.type?{id:d,color:w.material,position:w.position}:w;b.labelCollections.add(p)}catch(e){}if(2==s.type){u[0];for(d=s.toGeoJSON(v.x,v.y,v.level,b.extent),h=0;h<d.geometry.coordinates.length;h++)try{var g=[],f=(d.geometry.coordinates[h].forEach(function(e){g.push(e[0],e[1])}),new Cesium.PolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(g),width:10})),_=Cesium.PolylineGeometry.createGeometry(f),C=new Cesium.GeometryInstance({geometry:_});o.push(C)}catch(e){}}if(3==s.type){u[0];for(d=s.toGeoJSON(v.x,v.y,v.level,b.extent),h=0;h<d.geometry.coordinates.length;h++)try{var g=[],y=(d.geometry.coordinates[h].forEach(function(e){g.push(e[0],e[1])}),new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(g))})),_=Cesium.PolygonGeometry.createGeometry(y),C=new Cesium.GeometryInstance({geometry:_});r.push(C)}catch(e){}}}0<b.labelCollections.length&&b._viewer.scene.primitives.add(b.labelCollections),0<o.length&&b._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:o,appearance:new b._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED})),0<r.length&&b._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:r,appearance:new b._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})):(t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.data.geometryPrimitive.update(e,[]),t._parent&&t._parent.data&&t._parent.data.geometryPrimitive&&(t._parent.data.geometryPrimitive.destroy(),t._parent.data.geometryPrimitive=null,t._parent.state=Cesium.QuadtreeTileLoadState.START),t._southwestChild&&t._southwestChild.data&&t._southwestChild.data.geometryPrimitive&&(t._southwestChild.data.geometryPrimitive.destroy(),t._southwestChild.data.geometryPrimitive=null,t._southwestChild.state=Cesium.QuadtreeTileLoadState.START),t._southeastChild&&t._southeastChild.data&&t._southeastChild.data.geometryPrimitive&&(t._southeastChild.data.geometryPrimitive.destroy(),t._southeastChild.data.geometryPrimitive=null,t._southeastChild.state=Cesium.QuadtreeTileLoadState.START),t._northwestChild&&t._northwestChild.data&&t._northwestChild.data.geometryPrimitive&&(t._northwestChild.data.geometryPrimitive.destroy(),t._northwestChild.data.geometryPrimitive=null,t._northwestChild.state=Cesium.QuadtreeTileLoadState.START),t._northeastChild&&t._northeastChild.data&&t._northeastChild.data.geometryPrimitive&&(t._northeastChild.data.geometryPrimitive.destroy(),t._northeastChild.data.geometryPrimitive=null,t._northeastChild.state=Cesium.QuadtreeTileLoadState.START)),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new b._cesium.QuadtreePrimitive({tileProvider:this._Provider}),this._viewer.scene.primitives.add(this._primitive)},mo.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED},o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,c=[],t=(s.shapePositions=this.computeCircle(n.radius),o.then(function(e){for(var t=l._cesium.Color.WHITE,i=(l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):C.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a))),e.entities.values),o=0;o<i.length;o++){var r=i[o],r=(s.polylinePositions=r.polyline.positions._value,new l._cesium.PolylineVolumeGeometry(s)),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});c.push(r)}e=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:c,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=e,0==n.show&&(e.show=!1),"function"==typeof a&&a(e)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id),{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},mo.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},mo.prototype.createVolumeGeoJsonFeatureLayerProvider=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.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium},h=(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<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._core.extend(n,u,!0)),n=new v(this._viewer,this._cesium,a),m=(this._Provider=n,this),a=(n._loadTile=function(e){var c=new m._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];/^\[/.test(u.material)&&/\]$/.test(u.material)&&(s=u.material.replace(/\[/,"").replace(/\]/,""),h.material=e.properties[s],that._core.isHtmlColor(h.material)?h.material=that._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=that._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=that._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));for(var i=0;i<e.geometry.coordinates.length;i++){var o=e.geometry.coordinates[i];if(0<o.length)if(Array.isArray(o[0]))for(var r=0;r<o.length;r++){var n=o[r],n=m._cesium.Cartesian3.fromDegrees(n[0],n[1],h.height);t.push(n)}else{var a=m._cesium.Cartesian3.fromDegrees(o[0],o[1],h.height);t.push(a)}}h.position=t,"0"==h.slttype||0==h.slttype?h.shape=m._core.computeCircle(h.radius):"1"==h.slttype||1==h.slttype?h.shape=m._core.starPositions(h.number,h.exradius,h.inradius):"2"!=h.slttype&&2!=h.slttype||(s=h.orth_width/2,l=h.orth_height/2,h.shape=[new m._cesium.Cartesian2(-s,-l),new m._cesium.Cartesian2(s,-l),new m._cesium.Cartesian2(s,l),new m._cesium.Cartesian2(-s,l)]),e.positions=t;var s={polylinePositions:h.position,shapePositions:h.shape,cornerType:h.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},l=new m._cesium.PolylineVolumeGeometry(s),s=m._cesium.PolylineVolumeGeometry.createGeometry(l),l=new m._cesium.GeometryInstance({id:e,geometry:s,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),s=new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),shadows:h.shadows,geometryInstances:l});c.add(s)}),c},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:h.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:u});this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},mo.prototype.setTreeobj=function(e){this.treeobj=e},mo.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},mo.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},mo.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},mo.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},go.prototype.createWallGeoFeatureLayer=function(o,r,e,a,s,t,i){var n={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},l=(this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a))),this._core.extend(n,e,!0)),c=(this._core.isnull(a)&&(a=16),this._core.isnull(s)&&(s=14),null==r&&console.log("url is required"),null==o&&console.log("layername is required"),this),u=[];this._VectorTileProvider.loadTile=function(e,t){var i,n;(this.tile=t).state===c._cesium.QuadtreeTileLoadState.START&&(t.data={lines:[],geometryPrimitive:void 0},t.level>=s&&t.level<a?0!=(i=C.filter(u,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&i[0].data&&0<i[0].data.length?(t.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:i[0].data,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED}),t.state=c._cesium.QuadtreeTileLoadState.LOADING,t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(u.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,c._core.xhr({url:r+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+n.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+n.x+"&TILEROW="+n.y,type:"get",dataType:"json",success:function(e){var t=[];for(var i=0;i<e.features.length;i++){var o=[],r=(!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.features[i].geometry.coordinates[0]),c._cesium.Cartesian3.fromDegreesArray(o)),r=(l.positions=r,new c._cesium.GeometryInstance({geometry:new c._cesium.WallGeometry({positions:l.positions}),attributes:{color:new c._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}}));t.push(r)}C.filter(u,function(e){return e.x==n.x&&e.y==n.y})[0].data=t,n.data.geometryPrimitive=new c._cesium.Primitive({geometryInstances:t,appearance:new c._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:c._cesium.ShadowMode.ENABLED})},error:function(){u=C.remove(u,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(){n.state=c._cesium.QuadtreeTileLoadState.LOADING,n.state===c._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&n.data.geometryPrimitive.update(e,[]),n.state=c._cesium.QuadtreeTileLoadState.DONE,n.renderable=!0)}})):(t.state=c._cesium.QuadtreeTileLoadState.LOADING,t.state===c._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=c._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new c._cesium.QuadtreePrimitive({tileProvider:this._VectorTileProvider}),this._viewer.scene.primitives.add(this._primitive)},go.prototype.createWallPrimitiveGeoFeatureLayer=function(e,t,c,i,u,h){var m={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT},o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),d=this,p=[],o=(o.then(function(e){for(var t,i=e.entities.values,o=0;o<i.length;o++){var r=i[o],n=(m.positions=r.polyline.positions._value,new Array(m.positions.length)),a=new Array(m.positions.length),s=void 0,l=void 0,s=/^\[/.test(c.minimumHeights)?(s=c.minimumHeights.replace(/\[/,"").replace("/]/",""),r.properties[s]._value):c.minimumHeights,l=/^\[/.test(c.maximumHeights)?(l=c.maximumHeights.replace(/\[/,"").replace("/]/",""),r.properties[l]._value):c.maximumHeights,s=(n.fill(s),a.fill(l),m.minimumHeights=n,m.maximumHeights=a,d._cesium.Color.WHITE),l=(d._core.isnull(c)||d._core.isnull(c.material)||(s="["==c.material.toString().charAt(0)&&"]"==c.material.toString().charAt(c.material.length-1)?c.material.replace(/\[/,"").replace("/]/",""):C.clone(c.material),s=d._core.isHtmlColor(s)?d._color.colorFromHtmlColor(c.material):(1<(s=/^rgb/.test(s)?d._color.rgbaStringToRgbaObj(s):s).r&&(s.r=s.r/255),1<s.g&&(s.g=s.g/255),1<s.b&&(s.b=s.b/255),1<s.a&&(s.a=s.a/255),d._color.createColor(s.r,s.g,s.b,s.a))),"material:"+255*s.red+","+255*s.green+","+255*s.blue),n=(d.Legend.push(l),new d._cesium.GeometryInstance({id:r,geometry:new d._cesium.WallGeometry(m),attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(s)}}));p.push(n)}c&&c.time&&(t=new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({start:c.time.start?d._cesium.JulianDate.fromDate(new Date(c.time.start)):d._cesium.Iso8601.MINIMUM_VALUE,stop:c.time.end?d._cesium.JulianDate.fromDate(new Date(c.time.end)):d._cesium.Iso8601.MAXIMUM_VALUE})]));e=d._viewer.scene.primitives.add(new d._cesium.Primitive({geometryInstances:p,appearance:new d._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),t);d.item=e,u||_this.setVisibility(!1),"function"==typeof h&&h(e)}),this._core.isnull(c.id)&&(c.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+options.id),{id:c.id,name:e,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t,style:options});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},go.prototype.createWallGeoJsonFeatureLayerProvider=function(e,t,l,i,o,r){var c={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT},n={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},n=(this._core.isnull(l)||this._core.isnull(l.material)||"["==l.material.toString().charAt(0)&&"]"==l.material.toString().charAt(l.material.length-1)||(this._core.isHtmlColor(l.material)?l.material=this._color.colorFromHtmlColor(l.material):(/^rgb/.test(l.material)&&(l.material=this._color.rgbaStringToRgbaObj(l.material)),1<l.material.r&&(l.material.r=l.material.r/255),1<l.material.g&&(l.material.g=l.material.g/255),1<l.material.b&&(l.material.b=l.material.b/255),1<l.material.a&&(l.material.a=l.material.a/255),l.material=this._color.createColor(l.material.r,l.material.g,l.material.b,l.material.a))),new v(this._viewer,this._cesium,n)),u=(this._Provider=n,this),n=(n._loadTile=function(e){u.Legend=[];var s=new u._cesium.PrimitiveCollection;return e.features.forEach(function(n){var i=[],a=!1;function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):(i.push(e[t]),2!==t||a||(a=!0))}if(Array.isArray(n.geometry.coordinates)&&0<n.geometry.coordinates.length)if(Array.isArray(n.geometry.coordinates[0][0]))for(var e=0;e<n.geometry.coordinates.length;e++)i=[],o(n.geometry.coordinates[e]),t(i);else o(n.geometry.coordinates),t(i);function t(e){/^\[/.test(l.material)&&/\]$/.test(l.material)&&(t=l.material.replace(/\[/,"").replace(/\]/,""),options.material=n.properties[t],u._core.isHtmlColor(options.material)?options.material=u._color.colorFromHtmlColor(options.material):(/^rgb/.test(options.material)&&(options.material=u._color.rgbaStringToRgbaObj(options.material)),1<options.material.r&&(options.material.r=options.material.r/255),1<options.material.g&&(options.material.g=options.material.g/255),1<options.material.b&&(options.material.b=options.material.b/255),1<options.material.a&&(options.material.a=options.material.a/255),options.material=u._color.createColor(options.material.r,options.material.g,options.material.b,options.material.a)));var t=a?u._cesium.Cartesian3.fromDegreesArrayHeights(e):u._cesium.Cartesian3.fromDegreesArray(e),t=(c.positions=t,n.positions=t,new Array(c.positions.length)),i=new Array(c.positions.length),o=void 0,r=void 0,o=/^\[/.test(l.minimumHeights)?(o=l.minimumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[o]._value):l.minimumHeights,r=/^\[/.test(l.maximumHeights)?(r=l.maximumHeights.replace(/\[/,"").replace("/]/",""),entity.properties[r]._value):l.maximumHeights,o=(t.fill(o),i.fill(r),c.minimumHeights=t,c.maximumHeights=i,n.treeID=l.id,n.VectorType="wall",n.VectorStyle={haveZ:a,minimumHeights:t,maximumHeights:i,positions:e,material:l.material},new u._cesium.GeometryInstance({id:n,geometry:new u._cesium.WallGeometry(c),attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.material)}})),r="material:"+255*l.material.red+","+255*l.material.green+","+255*l.material.blue,t=(u.Legend.push(r),new u._cesium.Primitive({geometryInstances:o,appearance:new u._cesium.MaterialAppearance({material:new u._cesium.Material({fabric:{type:"Color",uniforms:{color:l.material}}}),faceForward:!0,flat:!1}),vertexCacheOptimize:!0,interleave:!0,shadows:u._cesium.ShadowMode.ENABLED}));s.add(t)}}),s},l&&l.time&&(n.availability=new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({start:l.time.start?u._cesium.JulianDate.fromDate(new Date(l.time.start)):u._cesium.Iso8601.MINIMUM_VALUE,stop:l.time.end?u._cesium.JulianDate.fromDate(new Date(l.time.end)):u._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建墙图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:l.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineWallLayer",item:this,url:t.url,style:l});return this._Provider.treeID=l.id,this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},go.prototype.setTreeobj=function(e){this.treeobj=e},go.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},go.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},go.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},go.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},go.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(!e)},go.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},go.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},x.prototype.createSimpleGraphic=function(e,i={},o){let t=null;var r=(e,t)=>{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<t.indexOf("Primitive")&&(e.id=i.id,e.name=i.name),V.insertGroupId(e,i.GroupID)}return o},x.prototype.getDefaultLabelStyle=function(e){return{show:this._core.defaultValue(e.showLabel,!1),text:this._core.defaultValue(e.label_text,"新建文本"),font:this._core.defaultValue(e.label_font,"24px 宋体"),scale:this._core.defaultValue(e.label_scale,1),style:this._core.defaultValue(e.label_style,2),fillColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_fillColor,"#ffffff")),outlineColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_outlineColor,"#000000")),outlineWidth:this._core.defaultValue(e.label_outlineWidth,0),showBackground:this._core.defaultValue(e.label_showBackground,!1),backgroundColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_backgroundColor,"rgba(42,42,42,0.8)")),heightReference:this._core.defaultValue(e.label_heightReference,1),horizontalOrigin:this._core.defaultValue(e.label_horizontalOrigin,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._core.defaultValue(e.label_verticalOrigin,this._cesium.VerticalOrigin.CENTER),scaleByDistance:this._core.defaultValue(e.label_scaleByDistance,void 0),pixelOffset:this._core.defaultValue(e.label_pixelOffset,void 0),disableDepthTestDistance:this._core.defaultValue(e.label_disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:this._core.defaultValue(e.label_distanceDisplayCondition,new this._cesium.DistanceDisplayCondition(0,1e8))}},x.prototype.end=function(e){},x.prototype.createPoint=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),V.states=1,this.drawHandler.setInputAction(e=>{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(){V.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(){V.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),V.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(){V.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(){V.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),V.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(){V.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(){V.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),V.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),c=Cesium.Matrix4.fromRotationTranslation(i),u=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(){V.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,c,t),Cesium.Matrix4.multiply(t,u,t),a.modelMatrix=t):i&&(t=Cesium.Transforms.eastNorthUpToFixedFrame(i),Cesium.Matrix4.multiply(t,l,t),Cesium.Matrix4.multiply(t,c,t),Cesium.Matrix4.multiply(t,u,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(){V.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),V.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(){V.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),V.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(){V.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),V.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,u=e.lon,r=t.lat,n=t.lon,s=p(o),l=p(r),a=p(r)-p(o),c=p(n)-p(u),a=2*Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2)+Math.cos(s)*Math.cos(l)*Math.pow(Math.sin(c/2),2))),a*=m,a=Math.round(1e4*a)/1e4,{angle:h._core.TwoPointAzimuth(u,o,n,r),distance:a}),l=s.angle,c=s.distance,u=(i.push(t.lon,t.lat),d(e.lat,e.lon,c,l+120));return i.push(u[0],u[1]),u=d(e.lat,e.lon,c,l-120),i.push(u[0],u[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(){V.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),V.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(){V.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),V.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<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n.pop(),n.push(t),i.showSize&&(o.clearLastSizeData(),o.showSizeData("rectangle",n)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("circle",n[1],s)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.states=1,[]),l,c=[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},c&&(c[0]=e,c[1]=i),l.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,s[0].height+c[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(c)},!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<s.length){a.tooltip.showAt(t.endPosition,"再次点击结束绘制,右键取消");let e=a._getPosition.getMouseDegrees(t,l);var i,o,r;e&&(e.height=s[0].height,s[1]=e,i=a.Cdcl(s[0].lat,s[0].lon,s[0].lat,s[1].lon),o=a.Cdcl(s[0].lat,s[0].lon,s[1].lat,s[0].lon),r={lon:(s[0].lon+s[1].lon)/2,lat:(s[0].lat+s[1].lat)/2},c&&(c[0]=i,c[1]=o),l.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,s[0].height+c[2]/2),n.showSize&&(a.clearLastSizeData(),a.showSizeData("box",l.position,c)))}else a.tooltip.showAt(t.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("cylinder",n[1],s,200)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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<n.length?(o.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=o._getPosition.getMousePosition(e,a))&&(n[0]=t,s=o._cesium.Cartesian3.distance(n[0],n[1]),i.showSize&&(o.clearLastSizeData(),o.showSizeData("cone",n[1],s,200)))):o.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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<a.length?(r.tooltip.showAt(e.endPosition,"再次点击结束绘制,右键取消"),(t=r._getPosition.getMousePosition(e,s))&&(a[0]=t,l=r._cesium.Cartesian3.distance(a[0],a[1]),i.showSize&&(r.clearLastSizeData(),r.showSizeData("sphere",a[1],l)))):r.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(e=>{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(){V.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),V.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(){V.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;var c=language?language.getStr("draw_tip_info_radius"):"半径";let u=language?language.getStr("unit_m"):"米",h=language?language.getStr("unit_km"):"千米";switch(o){case"polyline":let e=Cesium.Cartesian3.distance(r[0],r[1]);s=1e3<=e?(e/=1e3).toFixed(2)+h:e.toFixed(2)+u,l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"polygon":var m=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);m.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=this._core.getArea(m,r);break;case"rectangle":var d=this.toDegrees(r[0]),p=this.toDegrees(r[1]),p=Cesium.Cartesian3.distance(r[0],Cesium.Cartesian3.fromDegrees(d.lon,p.lat,d.height))*Cesium.Cartesian3.distance(r[1],Cesium.Cartesian3.fromDegrees(d.lon,p.lat,d.height));s=1e6<=p?(p/=1e6).toFixed(2)+"平方千米":p.toFixed(2)+"平方米",l=Cesium.Cartesian3.midpoint(r[0],r[1],new Cesium.Cartesian3);break;case"circle":l=r,s=1e3<=n?c+":"+(n/=1e3).toFixed(2)+h:c+":"+n.toFixed(2)+u;break;case"box":let t=[],i=(n[0]<n[1]?(t.push(n[1]),t.push(n[0])):(t.push(n[0]),t.push(n[1])),t.push(n[2]),["长:","\n宽:","\n高:"]);t.forEach((e,t)=>{1e3<=e?(e/=1e3,s+=i[t]+e.toFixed(2)+h):s+=i[t]+e.toFixed(2)+u}),l=r;break;case"cylinder":case"cone":l=r,s=1e3<=n?c+":"+(n/=1e3).toFixed(2)+h+"\n":c+":"+n.toFixed(2)+u+"\n",1e3<=a?(a/=1e3,s+="高度:"+a.toFixed(2)+h):s+="高度:"+a.toFixed(2)+u;break;case"sphere":l=r,s=1e3<=n?c+":"+(n/=1e3).toFixed(2)+h:c+":"+n.toFixed(2)+u;break;case"polyhedron":m=[];l=new Cesium.Cartesian3,r.forEach(e=>{l=Cesium.Cartesian3.add(e,l,new Cesium.Cartesian3);e=this.toDegrees(e);m.push([e.lon,e.lat])}),l=Cesium.Cartesian3.divideByScalar(l,r.length,new Cesium.Cartesian3),s=1e3<=a?"高度:"+(a/=1e3).toFixed(2)+h:"高度:"+a.toFixed(2)+u,s+="\n面积:"+this._core.getArea(m,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='<table class="cesium-infoBox-defaultTable"><tbody>';for(let e=0;e<i.properties.propertyNames.length;e++){var t=i.properties.propertyNames[e],o=i.properties[t];i.description+=`<tr><th>${t}</th><td>${o}</td></tr>`}i.description+="</tbody></table>"}},x.prototype.getPropData=function(e){let t=e.properties,i=(t=t||new Cesium.PropertyBag,{});for(let e=0;e<t.propertyNames.length;e++){var o=t.propertyNames[e];i[o]=t[o]&&t[o].getValue?t[o].getValue():t[o]}return i},x.prototype.defaultEdit=function(){this.openEdit?this.SimpleGraphicObj.length&&!this.editHandler?this.edit(this.openEdit,this.editOption):!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1):this.editHandler&&this.edit(!1)},x.prototype.edit=function(e,a){let u=this,h=this._viewer,s=(void 0!==(a=a||this.editOption||{}).editProp&&(this.editProp=a.editProp),this._core.defaultValue(a.enableDelete,!0));var m,d,p,g;this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),void 0===e&&(e=!0),this.isEditting=!1;let l;this.endThisEdit=()=>{u.defaultEvent(!0),V.editPointID.edit.forEach(e=>{h.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{h.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{h.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{h.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&h.entities.remove(V.editPointID.move),V.editPointID.move=void 0,g=m=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},u.isEditting=!1,u.tooltip.show(!1),u.delButton(!1),u._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))u.isEditting&&(u.endThisEdit(),u.defaultEvent(!1));else if(!V.editVector){var i=t.position,o=h.scene.pick(i);if(u._cesium.defined(o)&&o.id instanceof Cesium.Entity){let e=o.id;u.isEditting||0!=V.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",u.defaultEvent(!1),"height_point"==e.name?(p={windowPosition:i,originHeight:u._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?(u.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||u.endThisEdit():-1!==u.SimpleGraphicObj.indexOf(e.id)&&(void 0===(m=e).GeoType&&(i=u.getEntityTypeAndObject(m),m.GeoType=i.type),g=m.GeoType,u.getSimpleGraphicData(g,m),"point"===g||"billboard"===g||"label"===g||"model"===g?(u.isEditting=!0,"model"===g?u._ModelEdit.start(m):u.tooltip.showAt(t.position,"拖拽修改位置")):(u.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint()),this.editProp&&u.openEditProp(m,a))}else o&&"modeEditAxis"===o.id||u.endThisEdit()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(t=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))u.isEditting&&(u.endThisEdit(),u.defaultEvent(!1));else if(!V.editVector){let e=h.scene.pick(t.endPosition);if(u._cesium.defined(e))if(u.isEditting&&!d){if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView))return void(u.isEditting&&(u.endThisEdit(),u.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<m.pottingPoint.length||"polygon"===g&&3<m.pottingPoint.length?u.tooltip.showAt(t.endPosition,"拖拽修改位置,右键删除点"):u.tooltip.showAt(t.endPosition,"拖拽修改位置"):!e.id||"move_point"!==e.id.name&&"size_point"!==e.id.name?e.id&&"add_point"===e.id.name?u.tooltip.showAt(t.endPosition,"拖拽增加节点"):e.id&&"height_point"===e.id.name?u.tooltip.showAt(t.endPosition,"拖拽修改高度"):e.id==m||"modeEditAxis"===e.id?u.tooltip.show(!1):e.id&&-1!==u.SimpleGraphicObj.indexOf(e.id.id)||(a.editProp||!u.isEditting||"point"!==g&&"billboard"!==g&&"label"!==g||u.endThisEdit(),u.tooltip.show(!1)):u.tooltip.showAt(t.endPosition,"拖拽修改位置"):s?u.tooltip.showAt(t.endPosition,"model"===g?"右键删除":"拖拽修改位置,右键删除"):"model"!==g&&u.tooltip.showAt(t.endPosition,"拖拽修改位置")}else u.isEditting||0!==V.states||(e.id&&-1<u.SimpleGraphicObj.indexOf(e.id.id)?!a.editProp&&(void 0===e.id.GeoType&&(r=u.getEntityTypeAndObject(e.id),e.id.GeoType=r.type),"point"===(r=e.id.GeoType)||"billboard"===r||"label"===r)?(m=e.id,g=r,u.getSimpleGraphicData(g,m),u.isEditting=!0,u.tooltip.showAt(t.endPosition,"拖拽修改位置")):u.tooltip.showAt(t.endPosition,"点击激活编辑"+(s?",右键删除":"")):u.tooltip.show(!1));else 0!=V.states||d||(a.editProp||!u.isEditting||"point"!==g&&"billboard"!==g&&"label"!==g||u.endThisEdit(),u.tooltip.show(!1));if(u.isEditting&&d){u.tooltip.showAt(t.endPosition,"释放后完成修改");let i=u._getPosition.getMousePosition(t,[d,m]);if(i||"height_point"===l)if("edit_point"===l){d.position=i;var r=V.editPointID.edit.indexOf(d.id);if(void 0!==m[g].height?(n=u.toDegrees(i),m.pottingPoint[r]=Cesium.Cartesian3.fromDegrees(n.lon,n.lat,m[g].height.getValue()),d.position=m.pottingPoint[r]):m.pottingPoint[r]=i,0<V.editPointID.height.length){let e=h.entities.getById(V.editPointID.height[r]);e&&(n=u.toDegrees(i),c=u._cesium.Cartographic.fromCartesian(e.position.getValue()),e.position=u._cesium.Cartesian3.fromDegrees(n.lon,n.lat,c.height))}if(0<V.editPointID.add.length){if(0<r){let i=h.entities.getById(V.editPointID.add[r-1]);if(i){let e=h.entities.getById(V.editPointID.edit[r-1]),t=h.entities.getById(V.editPointID.edit[r]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if(r<m.pottingPoint.length-1){let i=h.entities.getById(V.editPointID.add[r]);if(i){let e=h.entities.getById(V.editPointID.edit[r]),t=h.entities.getById(V.editPointID.edit[r+1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}if("polygon"===g&&(0===r||r===m.pottingPoint.length-1)){let i=h.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);if(i){let e=h.entities.getById(V.editPointID.edit[0]),t=h.entities.getById(V.editPointID.edit[m.pottingPoint.length-1]);i.position=Cesium.Cartesian3.midpoint(e.position.getValue(),t.position.getValue(),new Cesium.Cartesian3)}}}let e=m.pottingPoint.concat([]),t=new u._cesium.Cartesian3;var n=e.length;e.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=n,t.y/=n,t.z/=n,V.editPointID.move&&(V.editPointID.move.position=t),"polyline"!==g&&"polygon"!==g&&"rectangle"!==g||SmartEarthPopupData.editGraphic.setValue("positions",e)}else if("height_point"===l){var c=V.editPointID.height.indexOf(d.id);let e=h.entities.getById(V.editPointID.edit[c]),i=("ellipse"!==g&&"cylinder"!==g&&"box"!==g||(e=V.editPointID.move),u.toDegrees(e.position.getValue()));r=p.originHeight-i.height,n=h.scene.cartesianToCanvasCoordinates(e.position.getValue()),c=(p.windowPosition.y-t.endPosition.y)*r/Math.abs(n.y-p.windowPosition.y);let o=Math.abs(r+c);V.editPointID.height.forEach(e=>{let t=h.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))}),m[g].extrudedHeight?m[g].extrudedHeight=new u._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=V.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(V.editPointID.edit.splice(t+1,0,n.id),m.pottingPoint.splice(t+1,0,i.clone()),0<V.editPointID.height.length){let e=u.toDegrees(i);e.height=m[g].extrudedHeight.getValue();r=h.entities.add({name:"height_point",position:u._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),point:{color:u._cesium.Color.YELLOW,pixelSize:12,outlineColor:u._cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});V.editPointID.height.splice(t+1,0,r.id)}c=Cesium.Cartesian3.midpoint(m.pottingPoint[t],m.pottingPoint[t+1],new Cesium.Cartesian3),r=h.entities.add({name:"add_point",position:u.isClampToGround(m[g])?u.getClampToGroundPosition(c):c,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c=Cesium.Cartesian3.midpoint(m.pottingPoint[t+1],m.pottingPoint[t+2===m.pottingPoint.length?0:t+2],new Cesium.Cartesian3),c=h.entities.add({name:"add_point",position:u.isClampToGround(m[g])?u.getClampToGroundPosition(c):c,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),t=(V.editPointID.add.splice(t,1,r.id,c.id),d=n,l="edit_point",m.pottingPoint.concat([]));"polyline"!==g&&"polygon"!==g||SmartEarthPopupData.editGraphic.setValue("positions",t)}else if("size_point"===l){r=V.editPointID.move.position.getValue(),c=u._cesium.Cartesian3.distance(r,i);"ellipse"===g||"cylinder"===g||"ellipsoid"===g&&m.isSphere?(SmartEarthPopupData.editGraphic.setValue("radius",c),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+g+' input[name="radius"]')&&(SmartEarthPopupData.window.document.querySelector("."+g+' input[name="radius"]').value=parseFloat(c).toFixed(2))):"box"===g&&(n=90===d.angle?"long":"width",SmartEarthPopupData.editGraphic.setValue(n,2*c),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.box input[name="'+n+'"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="'+n+'"]').value=parseFloat(2*c).toFixed(2)))}else if("model"!==g)if("point"===g||"billboard"===g||"label"===g)d.position=i,SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+g+' input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector("."+g+' input[name="height"]').value=SmartEarthPopupData.editGraphic.getValue("pHeight").toFixed(2));else{t=u.toDegrees(i),r=(p=d.position.getValue(),u.toDegrees(p));let a=t.lon-r.lon,s=t.lat-r.lat,l=t.height-r.height;d.position=i,m[g].height&&(n=u.toDegrees(i).height,m[g].height=n,m.thisHeight=n),m.pottingPoint.forEach((e,t)=>{let i,o,r,n=h.entities.getById(V.editPointID.edit[t]);if(n=n||h.entities.getById(V.editPointID.size[t]),i=n?u.toDegrees(n.position.getValue()):u.toDegrees(e),r=u._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<V.editPointID.height.length){let e=h.entities.getById(V.editPointID.height[t]);e&&(i=e.position.getValue(),o=u._cesium.Cartographic.fromCartesian(i),i={lon:u._cesium.Math.toDegrees(o.longitude),lat:u._cesium.Math.toDegrees(o.latitude),height:o.height},e.position=u._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l))}if(0<V.editPointID.add.length&&V.editPointID.add[t]){let e=h.entities.getById(V.editPointID.add[t]);e&&(i=u.toDegrees(e.position.getValue()),e.position=u._cesium.Cartesian3.fromDegrees(i.lon+a,i.lat+s,i.height+l))}});var c=m.pottingPoint.concat([]);"polyline"===g||"polygon"===g||"rectangle"===g?(SmartEarthPopupData.editGraphic.setValue("positions",c),0<V.editPointID.height.length&&(SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+l),SmartEarthPopupData.window&&m[g].height&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseFloat(m[g].height.getValue()).toFixed(2))),SmartEarthPopupData.window&&m[g].height&&SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value=parseFloat(m[g].height.getValue()).toFixed(2))):"ellipse"===g?(m.pottingPoint[1]=i,m.position=i.clone(),SmartEarthPopupData.window&&m[g].height&&SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value=parseFloat(m[g].height.getValue()).toFixed(2))):"box"===g?(m.pottingPoint[2]=i,t=m.box.dimensions.getValue(),r=u.toDegrees(i),m.position=Cesium.Cartesian3.fromDegrees(r.lon,r.lat,r.height+t.z/2)):"cylinder"===g?(m.pottingPoint[1]=i,n=m.cylinder.length.getValue(),c=u.toDegrees(m.pottingPoint[1]),m.position=Cesium.Cartesian3.fromDegrees(c.lon,c.lat,c.height+n/2)):"ellipsoid"===g&&(m.pottingPoint[m.pottingPoint.length-1]=i,m.position=i.clone())}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(e=>{Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?u.isEditting&&(u.endThisEdit(),u.defaultEvent(!1)):V.editVector||(d&&a.callBack&&a.callBack.update&&a.callBack.update(d.name,m),h.container.style.cursor="default",d=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&&(u.endThisEdit(),u.defaultEvent(!1));else if(!V.editVector){var o=h.scene.pick(e.position);if(u._cesium.defined(o)&&0==V.states){let i=o.id;if(-1<u.SimpleGraphicObj.indexOf(i.id)&&s)u.tooltip.show(!1),u.delButton(!0,e.position,function(){i.treeobj&&V.delete(i.treeobj.id,h,u._cesium),h.entities.removeById(i.id);var e=u.SimpleGraphicObj.indexOf(i.id);u.SimpleGraphicObj.splice(e,1),u.delButton(!1),u.tooltip.show(!1),u.endThisEdit(),u.defaultEdit(),a.callBack&&a.callBack.delete&&a.callBack.delete(i)});else if(-1<V.editPointID.edit.indexOf(i.id)&&("polyline"===g&&2<V.editPointID.edit.length||"polygon"===g&&3<V.editPointID.edit.length)){o=V.editPointID.edit.indexOf(i.id);if(h.entities.removeById(i.id),V.editPointID.edit.splice(o,1),0<V.editPointID.height.length&&(h.entities.removeById(V.editPointID.height[o]),V.editPointID.height.splice(o,1)),m.pottingPoint.splice(o,1),0<V.editPointID.add.length)if(V.editPointID.add[o]){if(h.entities.removeById(V.editPointID.add[o]),V.editPointID.add.splice(o,1),0<=o-1){let e=h.entities.getById(V.editPointID.add[o-1]);e&&(e.position=Cesium.Cartesian3.midpoint(m.pottingPoint[o-1],m.pottingPoint[o===m.pottingPoint.length?0:o],new Cesium.Cartesian3))}else if(o-1==-1&&"polygon"===g){let e=h.entities.getById(V.editPointID.add[V.editPointID.add.length-1]);e&&(e.position=Cesium.Cartesian3.midpoint(m.pottingPoint[0],m.pottingPoint[m.pottingPoint.length-1],new Cesium.Cartesian3))}}else h.entities.removeById(V.editPointID.add[o-1]),V.editPointID.add.pop();let t=new u._cesium.Cartesian3;e=m.pottingPoint.length,o=(m.pottingPoint.forEach(e=>{t.x+=e.x,t.y+=e.y,t.z+=e.z}),t.x/=e,t.y/=e,t.z/=e,V.editPointID.move&&(V.editPointID.move.position=t),m.pottingPoint.concat([]));"polyline"!==g&&"polygon"!==g||SmartEarthPopupData.editGraphic.setValue("positions",o),u.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;
                        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 < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1)t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: e, graphic: n[e], getValue: function (e) { return "position" === e || "name" === e || "id" === e ? this.entity[e] && (this.entity[e].getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this.graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this.graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[e].getValue() : this.graphic.material[e]) : this.graphic[e] && (this.graphic[e].getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue("position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian(e).height) : void 0 }, changeHeightPoint: function (i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { 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 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { 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 < V.editPointID.size.length && V.editPointID.size.forEach(e => { 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 < V.editPointID.add.length && V.editPointID.add.forEach(e => { 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 = V.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 () { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID.move), V.editPointID.move = void 0 }, setTreeID: function (i) { V.editPointID.edit.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.height.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.add.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.size.forEach(e => { let t = s.entities.getById(e); t.treeID = i }), V.editPointID.move && (V.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) { "name" === e ? this.entity[e] = t : "color" === e || "outlineColor" === e ? (t = Cesium.Color.fromCssColorString(t), 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() } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(i.id) } } }) : "polygon" === 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, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void (this.graphic.material.color = i) } else { if ("image" === e || "repeat" === e) return void (this.graphic.material[e] = i); if ("alpha" === e) return void (this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void (this.graphic.outlineColor._value.alpha = i); if ("positions" === e) return void (this.graphic.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(i) }, !1)); if ("hierarchy" === e) return void (this.graphic.hierarchy = new Cesium.CallbackProperty(function () { return i }, !1)); function t(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t.forEach((e, t) => { let i = s.entities.getById(V.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 < V.editPointID.add.length && V.editPointID.add.forEach(e => { 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() } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "_add_point", position: i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(i.id) } var e = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), e = s.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, heightReference: this.graphic.heightReference && this.graphic.heightReference.getValue() } }); V.editPointID.add.push(e.id) } }) : "ellipse" === e || "cylinder" === e || n.isSphere ? ((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, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void (this.graphic.material.color = i) } else { if ("image" === e || "repeat" === e) return void (this.graphic.material[e] = i); if ("alpha" === e) return void (this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void (this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("semiMinorAxis" === e) return void (this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radii" === e) return void (this.graphic.radii = new Cesium.CallbackProperty(function () { return i }, !1)); if ("topRadius" === e) return void (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("bottomRadius" === e) return void (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material.image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function () { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint.length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void (t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t.position.getValue()), t.position = a._cesium.Cartesian3.fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium.Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this.changeHeightPoint(o.height + i); function t(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.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function () { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function () { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic.semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic.semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout(() => { 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, V.editPointID.size.push(e.id), V.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() } }); V.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, V.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 = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.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, V.editPointID.size.push(e.id), V.editPointID.size.push(t.id), V.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 }, S.prototype.createLabelPointGeoJsonFeatureLayer = function (e, t, s, i, l) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), c = this, o = (o.then(function (e) { for (var t = { Name: "", text: "", font: " 30px sans-serif", stylet: c._cesium.LabelStyle.OUTLINE, fillColor: c._cesium.Color.WHITE, outlineColor: c._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new c._cesium.Color(.165, .165, .165, .8), backgroundPadding: new c._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: c._cesium.HorizontalOrigin.CENTER, verticalOrigin: c._cesium.VerticalOrigin.CENTER, eyeOffset: c._cesium.Cartesian3.ZERO, pixelOffset: c._cesium.Cartesian2.ZERO, heightReference: c._cesium.HeightReference.NONE, scaleByDistance: new c._cesium.NearFarScalar(0, 0, 1, 1) }, i = (s.material, c._core.isnull(s) || c._core.isnull(s.fillColor) || /^\[/.test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s.fillColor.toString().charAt(s.fillColor.length - 1) || (c._core.isHtmlColor(s.fillColor) ? s.fillColor = c._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = c._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = c._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a))), c._core.isnull(s) || c._core.isnull(s.material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt(0) && "]" == s.material.toString().charAt(s.material.length - 1) || (c._core.isHtmlColor(s.material) ? s.material = c._color.colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s.material = c._color.rgbaStringToRgbaObj(s.material)), 1 < s.material.r && (s.material.r = s.fillColor.r / 255), 1 < s.material.g && (s.material.g = s.fillColor.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = c._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), c._core.isnull(s) || c._core.isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (c._core.isHtmlColor(s.outlineColor) ? s.outlineColor = c._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = c._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = c._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), c._core.isnull(s) || c._core.isnull(s.backgroundColor) || /^\[/.test(s.backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (c._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = c._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = c._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = c._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), c._core.extend(t, s, !0)), o = (c.item = e).entities.values, t = (c._core.isnull(s.near) && (s.near = 0), c._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), e = parseFloat(s.far), t = new c._cesium.DistanceDisplayCondition(t, e), r = (i.distanceDisplayCondition = t, c._core.isnull(s.font_size) && (s.font_size = "30px"), c._core.isnull(s.font_family) && (s.font_family = " sans-serif"), i.font = parseFloat(s.font_size) + "px " + s.font_family, new c._cesium.LabelCollection), n = 0; n < o.length; n++) { var a = o[n], a = (i.position = a.position._value, i.text = "a label", "fillColor:" + 255 * i.fillColor.red + "," + 255 * i.fillColor.green + "," + 255 * i.fillColor.blue + ";outlineColor:" + 255 * i.outlineColor.red + "," + 255 * i.outlineColor.green + "," + 255 * i.outlineColor.blue); c.Legend.push(a), r.add(i) } e = c._viewer.scene.primitives.add(r); "function" == typeof l && l(e) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, style: options, treeData: { name: e, geoOptions: t, styleOption: s, GroupID: i, checked: !0, disFnc: l } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, S.prototype.createLabelPolymerizationGeoJsonFeatureLayer = function (e, t, u, i, h, m) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0, pointHeight: 0 }, d = this, p = (this._core.isnull(u) || this._core.isnull(u.fillColor) || (this._core.isHtmlColor(u.fillColor) ? u.fillColor = this._color.colorFromHtmlColor(u.fillColor) : (/^rgb/.test(u.fillColor) && (u.fillColor = this._color.rgbaStringToRgbaObj(u.fillColor)), 1 < u.fillColor.r && (u.fillColor.r = u.fillColor.r / 255), 1 < u.fillColor.g && (u.fillColor.g = u.fillColor.g / 255), 1 < u.fillColor.b && (u.fillColor.b = u.fillColor.b / 255), 1 < u.fillColor.a && (u.fillColor.a = u.fillColor.a / 255), u.fillColor = this._color.createColor(u.fillColor.r, u.fillColor.g, u.fillColor.b, u.fillColor.a))), this._core.isnull(u) || this._core.isnull(u.outlineColor) || (this._core.isHtmlColor(u.outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : (/^rgb/.test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u.outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u.outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u.outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core.isnull(u) || this._core.isnull(u.backgroundColor) || (this._core.isHtmlColor(u.backgroundColor) ? u.backgroundColor = this._color.colorFromHtmlColor(u.backgroundColor) : (/^rgb/.test(u.backgroundColor) && (u.backgroundColor = this._color.rgbaStringToRgbaObj(u.backgroundColor)), 1 < u.backgroundColor.r && (u.backgroundColor.r = u.backgroundColor.r / 255), 1 < u.backgroundColor.g && (u.backgroundColor.g = u.backgroundColor.g / 255), 1 < u.backgroundColor.b && (u.backgroundColor.b = u.backgroundColor.b / 255), 1 < u.backgroundColor.a && (u.backgroundColor.a = u.backgroundColor.a / 255), u.backgroundColor = this._color.createColor(u.backgroundColor.r, u.backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))), d._core.isnull(u.near) && (u.near = 0), d._core.isnull(u.far) && (u.far = 999999999), this._core.extend(o, u, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))), d = this, o = (o.then(function (e) { var t = (d.item = e).entities.values; d._core.isnull(p.font_size) && (p.font_size = "30"), d._core.isnull(p.font_family) && (p.font_family = " sans-serif"), p.font = p.font_size + "px " + p.font_family; for (var i = 0; i < t.length; i++) { var o = t[i], r = (p.font = d._core.extendgl(o, u.font, p.font), p.style = parseInt(d._core.extendgl(o, p.stylet, p.style)), p.fillColor = d._core.extendgl(o, u.fillColor, p.fillColor), p.outlineColor = d._core.extendgl(o, u.outlineColor, p.outlineColor), p.outlineWidth = parseFloat(d._core.extendgl(o, u.outlineWidth, p.outlineWidth)), p.show = d._core.extendgl(o, u.show, p.show), p.showBackground = d._core.extendgl(o, u.showBackground, p.showBackground), p.backgroundColor = d._core.extendgl(o, u.backgroundColor, p.backgroundColor), p.backgroundPadding = d._core.extendgl(o, u.backgroundPadding, p.backgroundPadding), p.scale = parseFloat(d._core.extendgl(o, u.scale, p.scale)), p.horizontalOrigin = d._core.extendgl(o, u.horizontalOrigin, p.horizontalOrigin), p.pointHeight = parseFloat(d._core.extendgl(o, u.pointHeight, p.pointHeight)), p.text = d._core.extendgl(o, u.text, p.text), parseFloat(d._core.extendgl(o, p.near))), n = parseFloat(d._core.extendgl(o, p.far)), r = new d._cesium.DistanceDisplayCondition(r, n), n = (p.distanceDisplayCondition = r, p.text = null == o.properties[p.text] ? p.text : o.properties[p.text]._value, o.billboard.color = d._cesium.Color.WHITE.withAlpha(0), o.label = new d._cesium.LabelGraphics(p), d._viewer.scene.globe.ellipsoid, d._cesium.Cartographic.fromCartesian(o.position._value)), r = d._cesium.Math.toDegrees(n.longitude), a = d._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new d._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering.minimumClusterSize = 3; for (var s, l = new d._cesium.PinBuilder, c = (l.fromText("50+", d._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", d._cesium.Color.ORANGE, 48).toDataURL(), l.fromText("30+", d._cesium.Color.YELLOW, 48).toDataURL(), l.fromText("20+", d._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", d._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < c.length; ++i)c[i] = l.fromText("" + (i + 2), d._cesium.Color.VIOLET, 48).toDataURL(); s = d._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener(function (e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard.id = t.label.id, t.billboard.verticalOrigin = d._cesium.VerticalOrigin.BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.BLUE, 48).toDataURL() : t.billboard.image = c[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering.pixelRange = s, h || d.setVisibility(h), d._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: h, disFnc: m } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, S.prototype.createPointPolymerizationGeoJsonFeatureLayer = function (e, t, u, i, h, m) { var d, o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, p = (this._core.isnull(u) || this._core.isnull(u.color) || "[" == u.color.toString().charAt(0) && "]" == u.color.toString().charAt(u.color.length - 1) || (this._core.isHtmlColor(u.color) ? u.color = this._color.colorFromHtmlColor(u.color) : (/^rgb/.test(u.color) && (u.color = this._color.rgbaStringToRgbaObj(u.color)), 1 < u.color.r && (u.color.r = u.color.r / 255), 1 < u.color.g && (u.color.g = u.color.g / 255), 1 < u.color.b && (u.color.b = u.color.b / 255), 1 < u.color.a && (u.color.a = u.color.a / 255), u.color = this._color.createColor(u.color.r, u.color.g, u.color.b, u.color.a))), this._core.isnull(u) || this._core.isnull(u.outlineColor) || "[" == u.outlineColor.toString().charAt(0) && "]" == u.outlineColor.toString().charAt(u.outlineColor.length - 1) || (this._core.isHtmlColor(u.outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : (/^rgb/.test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u.outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u.outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u.outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core.extend(o, u, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))), g = this, o = (u && u.time && (d = new g._cesium.TimeIntervalCollection([new g._cesium.TimeInterval({ start: u.time.start ? g._cesium.JulianDate.fromDate(new Date(u.time.start)) : g._cesium.Iso8601.MINIMUM_VALUE, stop: u.time.end ? g._cesium.JulianDate.fromDate(new Date(u.time.end)) : g._cesium.Iso8601.MAXIMUM_VALUE })])), o.then(function (e) { for (var t = (g.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (p.color = g._core.extendgl(o, u.color, p.color), p.pixelSize = parseInt(g._core.extendgl(o, u.pixelSize, p.pixelSize)), p.outlineColor = g._core.extendgl(o, u.outlineColor, p.outlineColor), p.outlineWidth = parseFloat(g._core.extendgl(o, u.outlineWidth, p.outlineWidth)), p.show = g._core.extendgl(o, u.show, p.show), p.height = parseFloat(g._core.extendgl(o, u.height, p.height)), p.scaleByDistance = g._core.extendgl(o, u.scaleByDistance, p.scaleByDistance), parseFloat(g._core.extendgl(o, p.minDistanceDisplay))), n = parseFloat(g._core.extendgl(o, p.maxDistanceDisplay)), r = new g._cesium.DistanceDisplayCondition(r, n), n = (o.billboard.image = "", p.distanceDisplayCondition = r, o.point = new g._cesium.PointGraphics(p), p.pointHeight = g._core.extendgl(o, u.pointHeight, p.pointHeight), p.pointHeight = parseFloat(p.pointHeight), g._viewer.scene.globe.ellipsoid, g._cesium.Cartographic.fromCartesian(o.position._value)), r = g._cesium.Math.toDegrees(n.longitude), a = g._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new g._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r, d && (o.availability = d) } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering.minimumClusterSize = 3; for (var s, l = new g._cesium.PinBuilder, c = (l.fromText("50+", g._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", g._cesium.Color.ORANGE, 48).toDataURL(), l.fromText("30+", g._cesium.Color.YELLOW, 48).toDataURL(), l.fromText("20+", g._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", g._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < c.length; ++i)c[i] = l.fromText("" + (i + 2), g._cesium.Color.VIOLET, 48).toDataURL(); s = g._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener(function (e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard.id = t.label.id, t.billboard.verticalOrigin = g._cesium.VerticalOrigin.BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium.Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, g._cesium.Color.BLUE, 48).toDataURL() : t.billboard.image = c[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering.pixelRange = s, h || g.setVisibility(h), g._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: h, disFnc: m } }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, S.prototype._cameraMoveEndHandler = function () { if (this._viewer.camera.getMagnitude() < this.gd) { if (this.sj) { this._viewer.scene.primitives.remove(this.labelCollections), this.labelCollections = new this._cesium.LabelCollection; for (var e = 0; e < this.labelCollections1.length; e++)this.labelCollections.add(this.labelCollections1[e]); this._viewer.scene.primitives.add(this.labelCollections), this.sj = !1 } } else { this._viewer.scene.primitives.remove(this.labelCollections), new this._cesium.BillboardCollection; for (e = 0; e < this.labelCollections2.length; e++)this.BillboardCollections.add(this.labelCollections2[e]); this._viewer.scene.primitives.add(this.BillboardCollections), this.sj = !0 } }, S.prototype.createLabelpolymerizationGeoJsonFeatureLayer = function (e, t, i, o, r, n) { for (var a = t, s = (this._viewer.scene.primitives, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this.gd = i.height, new this._cesium.BillboardCollection, {}), l = [], c = 0; c < a.length; c++) { var u = { position: new this._cesium.Cartesian3.fromDegrees(a[c].lng, a[c].lat, 100), text: a[c].name }, h = (this.labelCollections1.push(u), a[c]); if (s[h[i.adminname]]) for (var m = 0; m < l.length; m++) { var d = l[m]; if (d.adminname == h[i.adminname]) { d.data.push(h); break } } else l.push({ adminname: h[i.adminname], name: h.name, showBackground: !0, lat: h.lat, lng: h.lng, data: [h] }), s[h[i.adminname]] = h } for (var p, c = 0; c < l.length; c++) { u = { position: new this._cesium.Cartesian3.fromDegrees(l[c].lng, l[c].lat, 100), image: pinBuilder.fromText(l[c].data.length + "", this._cesium.Color.BLACK, 48).toDataURL() }; this.labelCollections2.push(u), this.BillboardCollections.add(u) } i && i.time && (p = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: i.time.start ? this._cesium.JulianDate.fromDate(new Date(i.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: i.time.end ? this._cesium.JulianDate.fromDate(new Date(i.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this._viewer.scene.primitives.add(this.BillboardCollections, p) }, S.prototype.createLabelpolymerizationGeoJsonFeatureLayers = function (e, t, o, i, r, n) { var a = { height: 0, material: this._cesium.Color.WHITE, size: 50, fill: this._cesium.Color.RED, maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, 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._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) : /^http/.test(o.material) || (/^rgb/.test(o.material) && (o.material = this._color.rgbaStringToRgbaObj(o.material)), 1 < o.material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o.material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._core.isnull(o) || this._core.isnull(o.fill) || "[" == o.fill.toString().charAt(0) && "]" == o.fill.toString().charAt(o.fill.length - 1) || (this._core.isHtmlColor(o.fill) ? o.fill = this._color.colorFromHtmlColor(o.fill) : /^http/.test(o.fill) || (/^rgb/.test(o.fill) && (o.fill = this._color.rgbaStringToRgbaObj(o.fill)), 1 < o.fill.r && (o.fill.r = o.fill.r / 255), 1 < o.fill.g && (o.fill.g = o.fill.g / 255), 1 < o.fill.b && (o.fill.b = o.fill.b / 255), 1 < o.fill.a && (o.fill.a = o.fill.a / 255), o.fill = this._color.createColor(o.fill.r, o.fill.g, o.fill.b, o.fill.a))), this._core.extend(a, o, !0)), c = this, u = (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 = o.level_max - 1, this._Provider._minimumHeight = parseFloat(l.height) || 0, this._Provider.loadTile = function (t, i) { var e; i.state === Cesium.QuadtreeTileLoadState.START && (i.data = { lines: [], geometryPrimitive: void 0 }, i.level >= o.level_min && i.level < o.level_max && c.item.show ? (e = u.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i.level), c._cache && (e += "&" + c._core.getuid()), c._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { "" == cluster ? c.labelCollections = new c._cesium.PointPrimitiveCollection : c.labelCollections = new c._cesium.BillboardCollection; var o = new c._cesium.PinBuilder; null == e ? (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) : (e.features.forEach(function (e) { var t = (l.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(l.height) && /\]$/.test(l.height) ? (i = l.height.replace(/\[/, "").replace(/\]/, ""), t += parseFloat(e.properties[i])) : t += parseFloat(l.height) || 0, {}), t = new c._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t), i = "" == cluster ? { id: e, color: l.material, position: t } : { position: t, image: o.fromText(e.count + "", l.fill, l.size).toDataURL(), verticalOrigin: c._cesium.VerticalOrigin.BOTTOM }; c.labelCollections.add(i) }), 0 == e.features.length && (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0), i.data.geometryPrimitive = c.labelCollections, i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive.update(t, []), i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0)) }, error: function () { null == i.count && (i.count = 0), i.count += 1, 2 <= i.count ? (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) : i.state = Cesium.QuadtreeTileLoadState.START } }), i.state = Cesium.QuadtreeTileLoadState.LOADING) : (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0)) }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); a = this._viewer.scene.primitives, o && o.time && (this._Provider._availability = new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({ start: o.time.start ? c._cesium.JulianDate.fromDate(new Date(o.time.start)) : c._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? c._cesium.JulianDate.fromDate(new Date(o.time.end)) : c._cesium.Iso8601.MAXIMUM_VALUE })]), this._Provider.isAvailable = function (e) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), a.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, s = { id: l.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(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, S.prototype.createLabelGeoJsonFeatureLayerProvider = 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, c = (s.material, l._core.isnull(s) || l._core.isnull(s.fillColor) || /^\[/.test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s.fillColor.toString().charAt(s.fillColor.length - 1) || (l._core.isHtmlColor(s.fillColor) ? s.fillColor = l._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = l._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = l._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a))), l._core.isnull(s) || l._core.isnull(s.material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt(0) && "]" == s.material.toString().charAt(s.material.length - 1) || (l._core.isHtmlColor(s.material) ? s.material = l._color.colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s.material = l._color.rgbaStringToRgbaObj(s.material)), 1 < s.material.r && (s.material.r = s.material.r / 255), 1 < s.material.g && (s.material.g = s.material.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = l._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), l._core.isnull(s) || l._core.isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (l._core.isHtmlColor(s.outlineColor) ? s.outlineColor = l._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = l._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = l._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), l._core.isnull(s) || l._core.isnull(s.backgroundColor) || /^\[/.test(s.backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (l._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = l._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = l._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = l._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), 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 (o, a) { var e; a.state === Cesium.QuadtreeTileLoadState.START && (a.data = { lines: [], geometryPrimitive: void 0 }, a.level >= s.level_min && a.level < s.level_max && l.item.show ? (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) { var r, t, i, n; null == e ? (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0) : (i = { Name: "", text: "", font: " 30px sans-serif", style: l._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: l._cesium.Color.WHITE, outlineColor: l._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new l._cesium.Color(.165, .165, .165, .8), backgroundPadding: new l._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, eyeOffset: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, heightReference: l._cesium.HeightReference.NONE, scaleByDistance: new l._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, r = l._core.extend(i, s, !0), l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s.far) && (s.far = 999999999), i = parseFloat(s.near), t = parseFloat(s.far), i = new l._cesium.DistanceDisplayCondition(i, t), r.distanceDisplayCondition = i, l._core.isnull(s.font_size) && (s.font_size = "30px"), l._core.isnull(s.font_family) && (s.font_family = " sans-serif"), r.font = parseFloat(s.font_size) + "px " + s.font_family, n = new (null != r.image && null != r.image ? l._cesium.BillboardCollection : l._cesium.LabelCollection), e.features.forEach(function (e) { r.id = e; var t, i = r.pointHeight, o = (/^\[/.test(i) && /\]$/.test(i) ? (o = i.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : null != i && "" != i ? i = parseFloat(i) : null != e.properties.height && (i = parseFloat(e.properties.height)), r.position = new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(s.fillColor) && /\]$/.test(s.fillColor) && (t = s.fillColor.replace(/\[/, "").replace(/\]/, ""), r.fillColor = e.properties[t], l._core.isHtmlColor(r.fillColor) ? r.fillColor = l._color.colorFromHtmlColor(r.fillColor) : (/^rgb/.test(r.fillColor) && (r.fillColor = l._color.rgbaStringToRgbaObj(r.fillColor)), 1 < r.fillColor.r && (r.fillColor.r = r.fillColor.r / 255), 1 < r.fillColor.g && (r.fillColor.g = r.fillColor.g / 255), 1 < r.fillColor.b && (r.fillColor.b = r.fillColor.b / 255), 1 < r.fillColor.a && (r.fillColor.a = r.fillColor.a / 255), r.fillColor = l._color.createColor(r.fillColor.r, r.fillColor.g, r.fillColor.b, r.fillColor.a))), /^\[/.test(s.outlineColor) && /\]$/.test(s.outlineColor) && (t = s.outlineColor.replace(/\[/, "").replace(/\]/, ""), r.outlineColor = e.properties[t], l._core.isHtmlColor(r.outlineColor) ? r.outlineColor = l._color.colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r.outlineColor) && (r.outlineColor = l._color.rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor.r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r.outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r.outlineColor.a / 255), r.outlineColor = l._color.createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor.b, r.outlineColor.a))), "fillColor:" + 255 * r.fillColor.red + "," + 255 * r.fillColor.green + "," + 255 * r.fillColor.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r.outlineColor.green + "," + 255 * r.outlineColor.blue); l.Legend.push(o), /^\[/.test(s.text) && /\]$/.test(s.text) && (t = s.text.replace(/\[/, "").replace(/\]/, ""), r.text = e.properties[t]), r.id.treeID = s.id, r.id.VectorType = "label", r.id.VectorStyle = { position: r.position, pointHeight: i, text: r.text, font: r.font, scale: r.scale, style: r.style, fillColor: r.fillColor, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, showBackground: r.showBackground, backgroundColor: r.backgroundColor, heightReference: r.heightReference, horizontalOrigin: r.horizontalOrigin, verticalOrigin: r.verticalOrigin, scaleByDistance: r.scaleByDistance, distanceDisplayCondition: r.distanceDisplayCondition }, n.add(r) }), 0 == e.features.length && (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0), a.data.geometryPrimitive = n, a.state = Cesium.QuadtreeTileLoadState.LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a.data.geometryPrimitive.update(o, []), a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, 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) : (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), 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._Provider.treeID = s.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, S.prototype.createLabelImageGeoJsonFeatureLayerProvider = function (e, t, u, i, o, r) { var n, 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 }, h = this, s = (u.material, h._core.isnull(u) || h._core.isnull(u.fillColor) || "string" != typeof u.fillColor || /^\[/.test(u.fillColor) && /\]$/.test(u.fillColor) || (h._core.isHtmlColor(u.fillColor) || /^rgb/.test(u.fillColor)) && (u.fillColor = Cesium.Color.fromCssColorString(u.fillColor)), h._core.isnull(u) || h._core.isnull(u.outlineColor) || "string" != typeof u.outlineColor || /^\[/.test(u.outlineColor) && /\]$/.test(u.outlineColor) || (h._core.isHtmlColor(u.outlineColor) || /^rgb/.test(u.outlineColor)) && (u.outlineColor = Cesium.Color.fromCssColorString(u.outlineColor)), h._core.isnull(u) || h._core.isnull(u.color) || "string" != typeof u.color || /^\[/.test(u.color) && /\]$/.test(u.color) || (h._core.isHtmlColor(u.color) || /^rgb/.test(u.color)) && (u.color = Cesium.Color.fromCssColorString(u.color)), h._core.isnull(u) || h._core.isnull(u.backgroundColor) || "string" != typeof u.backgroundColor || /^\[/.test(u.backgroundColor) && /\]$/.test(u.backgroundColor) || (h._core.isHtmlColor(u.backgroundColor) || /^rgb/.test(u.backgroundColor)) && (u.backgroundColor = Cesium.Color.fromCssColorString(u.backgroundColor)), h._core.isnull(u.font) && (h._core.isnull(u.font_size) && (u.font_size = "30px"), h._core.isnull(u.font_family) && (u.font_family = " sans-serif"), u.font = u.font_size + " " + u.font_family, u.bold && (u.font = "bold " + u.font), u.italic && (u.font = "italic " + u.font)), h._core.isnull(u.near) && (u.near = 0), h._core.isnull(u.far) && (u.far = 999999999), parseFloat(u.near)), l = parseFloat(u.far), c = new h._cesium.DistanceDisplayCondition(s, l); u.distanceDisplayCondition = c; let m = -1 < t.url.indexOf("/gisserver/"); function d(e, t) { let i; var o, r; return i = (i = "string" == typeof t.value ? /^\[/.test(t.value) && /\]$/.test(t.value) ? (i = t.value.replace(/\[/, "").replace(/\]/, ""), e.properties[i]) : t.value : (r = (o = t.value).Condition, e = e.properties[r], o.Value[e])) || t.defaultValue, i = h._core.isHtmlColor(i) ? Cesium.Color.fromCssColorString(i) : i } function p() { return { 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 } } n = m ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._core._serialize(a.urlParams), this._urlTemplate = n, this._Provider = new T(this._viewer, this._cesium, m ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = u.level_max, this._Provider._minimumHeight = parseFloat(u.height) || 0, this.initThisProvider = () => { 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 >= u.level_min && i.level <= u.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.x < t.minCol || i.y > t.maxRow || i.y < t.minRow) return i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, void y() } if (h._Provider.EntityCollection.isShow && (h._Provider.EntityCollection.show = !0), h._Provider.EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y]) { let e = h._Provider.EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y]; return e.setVisibility(!0), i.data.geometryPrimitive = e, i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, void y() } t = n.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.reverseY || i.y).replace(window.encodeURIComponent("{z}"), i.level); h._cache && (t += "&" + h._core.getuid()), h._core.xhr({ url: t, type: "get", dataType: "json", success: function (e) { if (e && e.features && e.features.length) { var s, l, t = p(), c = h._core.extend(t, u, !0); c.image && !c.text ? l = !0 : s = !(c.image || !c.text) || (!c.image || !c.text || (l = !0)); let a = new _(h._viewer, h._Provider.EntityCollection, i); !async function (e) { e.features.forEach(function (e, t) { a.isDestroy || !async function (e) { c.id = e.id; var t = c.pointHeight; "string" == typeof t && /^\[/.test(t) && /\]$/.test(t) ? (i = t.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])) : null != t && "" != t ? t = parseFloat(t) : null != e.properties.height && (t = parseFloat(e.properties.height)); c.position = new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t), "object" == typeof u.font && (c.font = d(e, u.font)); "string" == typeof u.fillColor && /^\[/.test(u.fillColor) && /\]$/.test(u.fillColor) ? (o = u.fillColor.replace(/\[/, "").replace(/\]/, ""), c.fillColor = e.properties[o], (h._core.isHtmlColor(c.fillColor) || /^rgb/.test(c.fillColor)) && (c.fillColor = Cesium.Color.fromCssColorString(c.fillColor))) : "object" == typeof u.fillColor && u.fillColor.value && (c.fillColor = d(e, u.fillColor)); "string" == typeof u.outlineColor && /^\[/.test(u.outlineColor) && /\]$/.test(u.outlineColor) ? (o = u.outlineColor.replace(/\[/, "").replace(/\]/, ""), c.outlineColor = e.properties[o], (h._core.isHtmlColor(c.outlineColor) || /^rgb/.test(c.outlineColor)) && (c.outlineColor = Cesium.Color.fromCssColorString(c.outlineColor))) : "object" == typeof u.outlineColor && u.outlineColor.value && (c.outlineColor = d(e, u.outlineColor)); u.showBackground && ("string" == typeof u.backgroundColor && /^\[/.test(u.backgroundColor) && /\]$/.test(u.backgroundColor) ? (o = u.backgroundColor.replace(/\[/, "").replace(/\]/, ""), c.backgroundColor = e.properties[o], (h._core.isHtmlColor(c.backgroundColor) || /^rgb/.test(c.backgroundColor)) && (c.backgroundColor = Cesium.Color.fromCssColorString(c.backgroundColor))) : "object" == typeof u.backgroundColor && u.backgroundColor.value && (c.backgroundColor = d(e, u.backgroundColor))); var i = "fillColor:" + 255 * c.fillColor.red + "," + 255 * c.fillColor.green + "," + 255 * c.fillColor.blue + ";outlineColor:" + 255 * c.outlineColor.red + "," + 255 * c.outlineColor.green + "," + 255 * c.outlineColor.blue; h.Legend.push(i), "string" == typeof u.text && /^\[/.test(u.text) && /\]$/.test(u.text) ? (o = u.text.replace(/\[/, "").replace(/\]/, ""), c.text = e.properties[o]) : "object" == typeof u.text && (c.text = d(e, u.text)); { var o; "string" == typeof u.image && /^\[/.test(u.image) && /\]$/.test(u.image) ? (o = u.image.replace(/\[/, "").replace(/\]/, ""), c.image = e.properties[o]) : "object" == typeof u.image && (c.image = d(e, u.image)) } let r = { position: c.position }; if (s) { let e = c; c.labelData && (e = Object.assign({}, c, c.labelData, !0)), (c.offsetX || c.offsetY) && (e.pixelOffset = new Cesium.Cartesian2(c.offsetX || 0, c.offsetY || 0)), r.label = e } if (l) { let e = c; c.imageData && (e = Object.assign({}, c, c.imageData, !0)), r.billboard = e } let n = new Cesium.Entity(r); n.feature = e, a.add(n) }(e) }) }(e), i.data.geometryPrimitive = a, h._Provider.EntityCollection.childrenCollection[i.level + "-" + i.x + "-" + i.y] = a, i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0), y() } else i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0 }, error: function () { i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0, y() } }), i.state = Cesium.QuadtreeTileLoadState.LOADING } y() }, "function" == typeof r && r(this.item) }; let g, f; function _(e, t, i) { this.viewer = e, this.collection = t, this.key = i.level + "-" + i.x + "-" + i.y, this.isDestroy = !1, this.values = [], this._time = void 0, this.show = !0 } this.saveDefaultVectorData = () => { f = h._core.extend({}, u, !0) }, this.restoreVector = () => { if (f && (u = f, h._Provider._normalTile = u.level_max, h._Provider && h._Provider.EntityCollection)) { var e = p(); let r = h._core.extend(e, u, !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)), u = h._core.extend(u, a, !0), h._Provider._normalTile = u.level_max, u.font = u.font_size + " " + u.font_family, u.bold && (u.font = "bold " + u.font), u.italic && (u.font = "italic " + u.font), a.font = u.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(u.offsetX || 0, u.offsetY || 0)), Object.assign(o, a), t && (o.text = t), void 0 !== a.text && (o.show = !!a.text)) : a.text && (e.label = { ...u }, 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: u.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 }); c = this._viewer.scene.primitives, u && u.time && (this._Provider._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._Provider.isAvailable = function (e) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), c.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(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, a = { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: u, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: o, disFnc: r } }; return this._Provider.treeID = u.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, S.prototype.createLabelImageGeoJsonFeatureLayerProvider1 = function (e, t, u, 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 = (u.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(u.height) || 0, this._Provider.loadTile = function (i, o) { var e; o.state === Cesium.QuadtreeTileLoadState.START && (o.data = { lines: [], geometryPrimitive: void 0 }, o.level >= u.level_min && o.level < u.level_max && h.item.show ? (e = s.replace(window.encodeURIComponent("{x}"), o.x).replace(window.encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var s, l, c, t; null == e ? (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : ((s = h._core.extend(a, u, !0)).font = u.font, s.image && !s.text ? c = new h._cesium.BillboardCollection({ scene: h._viewer.scene }) : (s.image || !s.text) && s.image && s.text ? (l = new h._cesium.LabelCollection({ scene: h._viewer.scene }), c = new h._cesium.BillboardCollection({ scene: h._viewer.scene }), (t = new h._cesium.PrimitiveCollection).add(l), t.add(c)) : l = new h._cesium.LabelCollection({ scene: h._viewer.scene }), e.features.forEach(function (e) { s.id = e; var t, i, o = s.pointHeight; if (/^\[/.test(o) && /\]$/.test(o) ? (t = o.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[t])) : null != o && "" != o ? o = parseFloat(o) : null != e.properties.height && (o = parseFloat(e.properties.height)), s.position = new h._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), u.fillColor) /^\[/.test(u.fillColor) && /\]$/.test(u.fillColor) && (i = u.fillColor.replace(/\[/, "").replace(/\]/, ""), s.fillColor = e.properties[i]), h._core.isHtmlColor(s.fillColor) ? s.fillColor = h._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = h._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = h._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a)); else if (u.fillColor && u.fillColor.Class instanceof Array) { for (var r = 0; r < u.fillColor.Class.length; r++)if ((a = (n = u.fillColor.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), a[1] = a[1].replace(/\"/, "").replace(/\"/, ""), e.properties[a[0]] == a[1]) { s.fillColor = n.Value, h._core.isHtmlColor(s.fillColor) ? s.fillColor = h._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = h._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = h._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a)); break } } else (u.fillColor && "{}" != u.fillColor.Class.toString() || style.fillColor && "{}" != style.fillColor.toString()) && (s.fillColor = u.fillColor.Value, h._core.isHtmlColor(s.fillColor) ? s.fillColor = h._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = h._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = h._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a))); if (u.outlineColor) /^\[/.test(u.outlineColor) && /\]$/.test(u.outlineColor) && (i = u.outlineColor.replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), s.outlineColor = e.properties[i], h._core.isHtmlColor(s.outlineColor) ? s.outlineColor = h._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = h._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = h._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))); else if (u.outlineColor && u.outlineColor.Class instanceof Array) { for (r = 0; r < u.fillColor.Class.length; r++)if ((a = (n = u.fillColor.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), a[1] = a[1].replace(/\"/, "").replace(/\"/, ""), e.properties[a[0]] == a[1]) { s.outlineColor = a.Value, h._core.isHtmlColor(s.outlineColor) ? s.outlineColor = h._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = h._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = h._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a)); break } } else (u.outlineColor && "{}" != u.outlineColor.Class.toString() || u.outlineColorTe && "{}" != u.outlineColor.toString()) && (s.outlineColor = u.outlineColor.Value, h._core.isHtmlColor(s.outlineColor) ? s.outlineColor = h._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = h._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = h._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))); if (u.backgroundColor) /^\[/.test(u.backgroundColor) && /\]$/.test(u.backgroundColor) && (i = u.backgroundColor.replace(/\[/, "").replace(/\]/, ""), s.backgroundColor = e.properties[i], h._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = h._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = h._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = h._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))); else if (u.backgroundColor && u.backgroundColor.Class instanceof Array) { for (r = 0; r < u.backgroundColor.Class.length; r++)if ((a = (n = u.backgroundColor.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), a[1] = a[1].replace(/\"/, "").replace(/\"/, ""), e.properties[a[0]] == a[1]) { s.backgroundColor = getSGColor(a.Value), h._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = h._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = h._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = h._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a)); break } } else u.backgroundColor && "{}" != u.backgroundColor.Class.toString() ? (s.backgroundColor = getSGColor(u.backgroundColor.Value), h._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = h._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = h._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = h._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))) : u.backgroundColor && "{}" != u.backgroundColor.toString() && (s.backgroundColor = u.backgroundColor.Value, h._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = h._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = h._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = h._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))); if (u.scale) /^\[/.test(u.scale) && /\]$/.test(u.scale) && (i = u.scale.replace(/\[/, "").replace(/\]/, ""), s.scale = e.properties[i]); else if (u.scale && u.scale.Class instanceof Array) for (r = 0; r < u.scale.Class.length; r++)(a = (n = u.scale.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), a[1] = a[1].replace(/\"/, "").replace(/\"/, ""), e.properties[a[0]] == a[1] && (s.scale = n.Value); else u.scale && "{}" != u.scale.Class.toString() ? s.scale = u.scale.Value : u.scale && "[object Object]" != u.scale.toString() && "{}" != u.scale.toString() && (s.scale = u.scale); if (/^\[/.test(u.text) && /\]$/.test(u.text) || u.textTe ? u.textTe ? u.text.Class instanceof Object ? (t = u.text.Class.Value.replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), s.text = e.properties[t]) : (i = (u.text && u.text.Class && "{}" != u.text.Class.toString() ? u.text.Class.Value : u.text).replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), s.text = e.properties[i]) : u.text && "[object Object]" != u.text.toString() && "{}" != u.text.toString() ? s.text = u.text : (i = u.text.Class.Value.replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), s.text = e.properties[i]) : u.text && "[object Object]" != u.text.toString() && "{}" != u.text.toString() && (s.text = u.text), (s = s.labelData ? h._core.extend(s, s.labelData, !0) : s).verticalOrigin = Cesium.VerticalOrigin.CENTER, s.horizontalOrigin = Cesium.HorizontalOrigin.LEFT, l && l.add(s), u.image && u.image.Class instanceof Array) { for (var n, a, r = 0; r < u.image.Class.length; r++)if ((a = (n = u.image.Class[r]).Condition.replace("<", "").replace(">", "").split("="))[0] = a[0].replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), a[1] = a[1].replace(/\"/, "").replace(/\"/, ""), e.properties[a[0]] == a[1]) { s.image = n.Value; break } } else u.image && u.image.Class && "{}" != u.image.Class.toString() ? (i = u.image.Class.Value.replace(/\[/, "").replace(/\]/, "").replace(/\"/, "").replace(/\"/, ""), s.image = e.properties[i]) : u.image && "[object Object]" != u.image.toString() && "{}" != u.image.toString() && (s.image = u.image); o = C.cloneDeep(s); o.verticalOrigin = Cesium.VerticalOrigin.CENTER, o.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT, c && c.add(o) }), 0 == e.features.length && (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0), o.data.geometryPrimitive = t || c || l, 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) : (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0)) }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); n = this._viewer.scene.primitives, u && u.time && (this._Provider._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._Provider.isAvailable = function (e) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), n.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, n = { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: u, treeData: { name: e, geoOptions: t, styleOption: u, GroupID: i, checked: o, disFnc: r } }; return this._Provider.treeID = u.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, S.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, c = (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 }), u = (s.width && (c.width = s.width), s.height && (c.height = s.height), s.image && (c.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) { var e; a.state === Cesium.QuadtreeTileLoadState.START && (a.data = { lines: [], geometryPrimitive: void 0 }, a.level >= s.level_min && a.level <= s.level_max && l.item.show ? (e = u.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) a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0; else { 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; c.position = Cesium.Cartesian3.fromDegrees(o, i, r), t.add(c) } } 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) : (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), 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 }, S.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, c = (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) { var e; o.state === Cesium.QuadtreeTileLoadState.START && (o.data = { lines: [], geometryPrimitive: void 0 }, o.level >= r.level_min && o.level <= r.level_max && l.item.show ? (e = c.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) { var t; null == e ? (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : ("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) : (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0)) }, 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), 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 }, S.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 < i.length; o++) { var r, n, a = i[o], a = (r = /^\[/.test(h.text) && /\]$/.test(h.text) ? (r = h.text.replace(/\[/, "").replace(/\]/, ""), a.properties[r]._value) : h.text, p.optiontext.push(r), a.billboard = void 0, p._viewer.scene.globe.ellipsoid, p._cesium.Cartographic.fromCartesian(a.position._value)), a = [p._cesium.Math.toDegrees(a.longitude), p._cesium.Math.toDegrees(a.latitude), h.pointHeight || a.height], s = p._core.getuid(); a instanceof Array ? 2 === a.length ? n = p._cesium.Cartesian3.fromDegrees(a[0], a[1]) : 3 === a.length && (n = p._cesium.Cartesian3.fromDegrees(a[0], a[1], a[2])) : n = a.z ? p._cesium.Cartesian3.fromDegrees(a.x, a.y, a.z) : p._cesium.Cartesian3.fromDegrees(a.x, a.y), g.add({ id: "DivPoint" + s, position: n, color: p._cesium.Color.YELLOW, description: h.text }) } h && h.time && (t = new p._cesium.TimeIntervalCollection([new p._cesium.TimeInterval({ start: h.time.start ? p._cesium.JulianDate.fromDate(new Date(h.time.start)) : p._cesium.Iso8601.MINIMUM_VALUE, stop: h.time.end ? p._cesium.JulianDate.fromDate(new Date(h.time.end)) : p._cesium.Iso8601.MAXIMUM_VALUE })])), p.item = g, p.pointPrimitive = p._viewer.scene.primitives.add(g, t); var l, c, u = !0; p.pointPrimitive.update = function () { for (var e, t, i = 0; i < p.pointPrimitive.length; i++) { if (e = p.pointPrimitive.get(i), c = e.position, !(c = p._viewer.scene.cartesianToCanvasCoordinates(c))) return; (l = document.getElementById(e.id)) || (t = '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint1 + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + p.optiontext[i] + "</div>\n           </div>", $(".cesium-viewer").append(t), l = document.getElementById(e.id)), e.description ? l.style.transform = "matrix(1, 0, 0, 1, " + c.x + ", " + (c.y - 157) + ")" : l.style.transform = "matrix(1, 0, 0, 1, " + c.x + ", " + (c.y - 134) + ")", l && (l.style.display = p.pointPrimitive.show ? "block" : "none") } u && (m || p.setVisibility(!1), u = !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 }, S.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 }, c = this, r = new v(this._viewer, this._cesium, r), r = ((this._Provider = r)._loadTile = function (e) { var o, r, n = new c._cesium.PointPrimitiveCollection, a = (c.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 c._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]), c._core.getuid()); n.add({ id: "DivPoint" + i, position: Cartesian3, color: c._cesium.Color.YELLOW, description: s.text }), c.optiontext.push(option.text) }), c.pointPrimitive = c._viewer.scene.primitives.add(n), !0); return c.pointPrimitive.update = function () { for (var e, t, i = 0; i < c.pointPrimitive.length; i++) { if (e = c.pointPrimitive.get(i), r = e.position, !(r = c._viewer.scene.cartesianToCanvasCoordinates(r))) return; (o = document.getElementById(e.id)) || (t = '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint1 + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + c.optiontext[i] + "</div>\n           </div>", $(".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 || c.setVisibility(!1), a = !1) }, c.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 }, S.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, c = (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.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = l._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), 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) { var e; a.state === Cesium.QuadtreeTileLoadState.START && (a.data = { lines: [], geometryPrimitive: void 0 }, a.level >= s.level_min && a.level < s.level_max && l.item.show ? (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) { var o, t, i, r; null == e ? (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0) : (i = { url: "", modelMatrix: l._cesium.Transforms.eastNorthUpToFixedFrame(origin), color: l._cesium.Color.DARKSALMON, scale: 2 }, o = l._core.extend(i, s, !0), l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s.far) && (s.far = 999999999), i = parseFloat(s.near), t = parseFloat(s.far), i = new l._cesium.DistanceDisplayCondition(i, t), o.distanceDisplayCondition = i, r = new l._cesium.PrimitiveCollection, e.features.forEach(function (e) { o.id = e; var t = o.height, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(o.height) && /\]$/.test(o.height) && (i = o.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])), o.modelMatrix = l._cesium.Transforms.eastNorthUpToFixedFrame(l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t)), l._cesium.Model.fromGltf({ id: e, url: o.uri, color: o.color, modelMatrix: o.modelMatrix, scale: o.scale, heightReference: parseInt(o.heightReference), distanceDisplayCondition: o.distanceDisplayCondition })); r.add(i) }), 0 == e.features.length && (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0), a.data.geometryPrimitive = r, a.state = Cesium.QuadtreeTileLoadState.LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a.data.geometryPrimitive.update(n, []), a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, 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) : (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.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 }, S.prototype.createPointGeoJsonFeatureLayerProvider = 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, c = (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.color.r && (s.color.r = s.color.r / 255), 1 < s.color.g && (s.color.g = s.color.g / 255), 1 < s.color.b && (s.color.b = s.color.b / 255), 1 < s.color.a && (s.color.a = s.color.a / 255), s.color = l._color.createColor(s.color.r, s.color.g, s.color.b, s.color.a))), l._core.isnull(s) || l._core.isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (l._core.isHtmlColor(s.outlineColor) ? s.outlineColor = l._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = l._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = l._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), 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 (o, a) { var e; a.state === Cesium.QuadtreeTileLoadState.START && (a.data = { lines: [], geometryPrimitive: void 0 }, a.level >= s.level_min && a.level < s.level_max && l.item.show ? (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) { var r, t, i, n; null == e ? (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0) : (i = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: l._cesium.LabelStyle.OUTLINE, fillColor: l._cesium.Color.WHITE, outlineColor: l._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new l._cesium.Color(.165, .165, .165, .8), backgroundPadding: new l._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: l._cesium.HorizontalOrigin.CENTER, verticalOrigin: l._cesium.VerticalOrigin.CENTER, eyeOffset: l._cesium.Cartesian3.ZERO, pixelOffset: l._cesium.Cartesian2.ZERO, heightReference: l._cesium.HeightReference.NONE, scaleByDistance: new l._cesium.NearFarScalar(0, 0, 1, 1) }, s.material, l._core.isnull(s) || l._core.isnull(s.backgroundColor) || /^\[/.test(s.backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (l._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = l._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = l._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = l._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), r = l._core.extend(i, s, !0), l._core.isnull(s.near) && (s.near = 0), l._core.isnull(s.far) && (s.far = 999999999), i = parseFloat(s.near), t = parseFloat(s.far), i = new l._cesium.DistanceDisplayCondition(i, t), r.distanceDisplayCondition = i, l._core.isnull(s.font_size) && (s.font_size = "30px"), l._core.isnull(s.font_family) && (s.font_family = " sans-serif"), r.font = parseFloat(s.font_size) + "px " + s.font_family, n = new l._cesium.PointPrimitiveCollection, e.features.forEach(function (e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r.pointHeight) ? (i = r.pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])) : void 0 !== r.pointHeight && "" !== r.pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(s.color) && /\]$/.test(s.color) && (o = s.color.replace(/\[/, "").replace(/\]/, ""), r.color = e.properties[o], l._core.isHtmlColor(r.color) ? r.color = l._color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r.color = l._color.rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color.b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r.color = l._color.createColor(r.color.r, r.color.g, r.color.b, r.color.a))), /^\[/.test(s.outlineColor) && /\]$/.test(s.outlineColor) && (o = s.outlineColor.replace(/\[/, "").replace(/\]/, ""), r.outlineColor = e.properties[o], l._core.isHtmlColor(r.outlineColor) ? r.outlineColor = l._color.colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r.outlineColor) && (r.outlineColor = l._color.rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor.r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r.outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r.outlineColor.a / 255), r.outlineColor = l._color.createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor.b, r.outlineColor.a))), r.position = new l._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t), r.text = e.properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r.color.green + "," + 255 * r.color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r.outlineColor.green + "," + 255 * r.outlineColor.blue; l.Legend.push(o), n.add(i) }), 0 == e.features.length && (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0), a.data.geometryPrimitive = n, a.state = Cesium.QuadtreeTileLoadState.LOADING, a.state === Cesium.QuadtreeTileLoadState.LOADING && (a.data.geometryPrimitive.update(o, []), a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, 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) : (a.state = Cesium.QuadtreeTileLoadState.DONE, a.renderable = !0)) }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.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 }, S.prototype.setTreeobj = function (e) { this.treeobj = e }, S.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, S.prototype.deleteObject = function () { if (this._viewer.scene.primitives.remove(this.item), this.probj && 0 < this.probj.length && (this._viewer.scene.primitives.remove(this.probj[0]), this.probj.pop()), null != this.img && this._viewer.imageryLayers.remove(this.img), this.primitve && 0 < this.primitve.length) { for (var e = 0; e < this.primitve.length; e++)this._viewer.scene.primitives.remove(this.primitve[e]); this.primitve = [] } this.loadAllKey && 0 < this.loadAllKey.length && (this.loadAllKey = []); try { this._Provider.remove() } catch (e) { } if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (e = 0; e < this.items.length; e++)this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if (this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item._pointPrimitives && null != this.item._pointPrimitives) for (e = 0; e < this.item._pointPrimitives.length; e++) { var t = document.getElementById(this.item._pointPrimitives[e].id); t && t.remove() } try { this._Provider.remove() } catch (e) { } }, S.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t }, treeData: this.treeobj.treeData } }, S.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, S.prototype.setVisibility = function (e) { try { if (this.loadAllKey = [], null != this.item && null != this.item.show && (this.item.show = e), null != this.img && (this.img.show = e), this.primitve && 0 < this.primitve.length) for (var t = 0; t < this.primitve.length; t++)this.primitve[t].show = e; if (this._Provider && this._Provider.setStatus && void 0 !== this._Provider._state && this._Provider.setStatus(e), this._Provider && this._Provider.EntityCollection && (e || (this._Provider.EntityCollection.show = e), this._Provider.EntityCollection.isShow = e), this.probj && 0 < this.probj.length) for (t = 0; t < this.probj.length; t++)this.probj[t].show = e } catch (e) { } if (null != this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item._pointPrimitives && null != this.item._pointPrimitives) for (t = 0; t < this.item._pointPrimitives.length; t++) { var i = document.getElementById(this.item._pointPrimitives[t].id); i && (i.style.display = e ? "block" : "none") } null != this.item && (this.item.show = e), this._Provider && void 0 !== this._Provider._stop && this._Provider.setStatus(!e) }, S.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, S.prototype.forceRefresh = function () { try { this._cache = !0, this._forceRefreshPrvimitive || (this._forceRefreshPrvimitive = C.cloneDeep(this._primitive)); var e = C.cloneDeep(this._forceRefreshPrvimitive); this._viewer.scene.primitives.remove(this._primitive), this._viewer.scene.primitives.add(e), this.edit(this.isEditting, this.editoption) } catch (e) { } }, Object.defineProperties(S.prototype, { labelText: { set: C.debounce(function (e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities && this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++)if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) { } } else { try { i[o].point.show = !1 } catch (e) { } i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.style = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = e + "px  " + o } } }, 500) }, labelFontSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.font = e + "px  sans-serif" } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.fillColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.outlineColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, labelOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.outlineWidth = e } }, 200), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.backgroundColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.showBackground = e }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, labelShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].label && e ? (t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium.LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, modelShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)t[o].model ? t[o].model.uri = e : (/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500) }, modelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.shadows = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0].model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelLightColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.lightColor = e } }, 100), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, pointColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].point && e ? (t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium.PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.outlineColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.outlineWidth = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, billboardShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].billboard && e ? (t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard = new this._cesium.BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o].billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500) }, billboardScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.horizontalOrigin = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.verticalOrigin = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.width = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.height = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, billboardHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].billboard.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } } }); var Bi = "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 Vi(i, o, r, n, a, e, s, l) { var c = 0, u = []; if (e.map(function (e) { var t; !s || c <= 0 ? (t = 0, i.beginPath(), e.map(function (e) { e = o.project(e, r); 0 == t ? i.moveTo(n + e.x, a + e.y) : i.lineTo(n + e.x, a + e.y), t++ }), s && (i.closePath(), i.fill()), l && i.stroke()) : u.push(e), c++ }), s) return u; u = null } function Fi(e, t, i) { this._viewer = e, this._cesium = t, this._tree = i, this._core = new f } function Hi(e, t) { this._viewer = e, this._cesium = t, this.item = { show: !0 }, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._flyTo = new Fi(this._viewer, this._cesium, this._tree), this._Provider = void 0, this.Legend = [], this.model = [], this._cache = !1, this._forceRefreshPrvimitive = null, this._forceRefreshProvider = null } function P(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._createGroup = new Ei, this.model = [], this.heading = this._cesium.Math.toRadians(0), this.pitch = this._cesium.Math.toRadians(0), this.roll = this._cesium.Math.toRadians(0), this.rotate = 10, this.state = 0, this.modelPointArr = [], this.modifyModel = null, this.modifyPoint = null, this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.position = null, this.tempPoints = [], this.scale = 0, this.Radius = 20 } function Gi(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this._primitive = void 0, this._taskProcessor = new this._cesium.TaskProcessor("vectorTileProvider"), this.model = [], this.Legend = [], this._ajax = null, this.datas = null } E.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Bi(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, E.prototype.createHistogramVectorGeoJsonFeatureLayer = function (e, t, r, i, o, n) { var a = { radius: 50, height: 100, scale: 1, defaultColor: "#ffffff", showLabel: !0, label: { showBackground: !1, fillColor: "#ffffff", outlineColor: "#000000", backgroundColor: "rgba(0,0,0,0.5)", style: 2, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, outlineWidth: 1, font: "20px 微软雅黑" }, alpha: .5, level_max: 20, level_min: 10 }, 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 }; r.label && (a.label = this._core.extend(a.label, r.label, !0), delete r.label); let g = this._core.extend(a, r, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); let f, _ = (Array.isArray(g.color) && (f = { name: g.color[0].name, value: { ">": {}, "<": {} } }, g.color.forEach(e => { var t; e.value.indexOf && -1 < e.value.indexOf(">") ? (t = e.value.split(">"), f.value[">"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)) : e.value.indexOf && -1 < e.value.indexOf("<") ? (t = e.value.split("<"), f.value["<"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha)) : f.value[e.value] = Cesium.Color.fromCssColorString(e.color).withAlpha(g.alpha) })), Cesium.Color.fromCssColorString(g.defaultColor).withAlpha(g.alpha)); var l = this, C = { text: "", ...g.label, fillColor: Cesium.Color.fromCssColorString(g.label.fillColor), outlineColor: Cesium.Color.fromCssColorString(g.label.outlineColor), backgroundColor: Cesium.Color.fromCssColorString(g.label.backgroundColor) }, c = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = r.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function (t, e) { var i = t, o = e, p = l; if (o.state === Cesium.QuadtreeTileLoadState.START) if (o.data = { lines: [], geometryPrimitive: void 0 }, o.level >= r.level_min && o.level < r.level_max && p.item.show) { { t = c.replace(window.encodeURIComponent("{x}"), o.x).replace(window.encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o.level); p._cache && (t += "&" + p._core.getuid()); let m = [], d = new Cesium.LabelCollection, e = Cesium.GeoJsonDataSource.load(t); e.then(e => { let t = e.entities.values; if (t && t.length) { 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 < l) { r = f.value["<"][l]; break } } } r = r || _.clone(); let c; e.polygon ? (n = e.polygon.hierarchy.getValue().positions, c = Cesium.BoundingSphere.fromPoints(n).center, n = new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(n), height: 0, extrudedHeight: 0, vertexFormat: Cesium.VertexFormat.DEFAULT, perPositionHeight: !1 }), n = new Cesium.GeometryInstance({ id: t, geometry: n, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(r) } }), m.push(n)) : (e.point || e.billboard) && (c = e.position.getValue()); n = new Cesium.GeometryInstance({ geometry: new Cesium.EllipseGeometry({ extrudedHeight: o, center: c, semiMinorAxis: g.radius, semiMajorAxis: g.radius, vertexFormat: Cesium.VertexFormat.POSITION_AND_ST }), id: t }); let u = Cesium.Material.fromType("Color"); u.uniforms.color = r.withAlpha(1); e = new Cesium.Primitive({ geometryInstances: n, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: u }), shadows: g.shadows }); h.add(e), g.showLabel && (n = p._core.toDegrees(c), C.text = g.value ? g.value(i, t) : i + "", C.position = Cesium.Cartesian3.fromDegrees(n.lon, n.lat, 1.1 * o), C.useColorConfig && (C.fillColor = r), d.add(C)) }), m.length && (e = new Cesium.GroundPrimitive({ geometryInstances: m, appearance: new Cesium.PerInstanceColorAppearance({ translucent: g.alpha < 1 }), classificationType: Cesium.ClassificationType.BOTH, shadows: g.shadows }), h.add(e)), g.showLabel && h.add(d), p.probj.push(h), o.data.geometryPrimitive = h, o.state = Cesium.QuadtreeTileLoadState.LOADING, o.state === Cesium.QuadtreeTileLoadState.LOADING && (o.data.geometryPrimitive.update(i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) } else o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0 }, e => { 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 } else o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0 }, 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 }, E.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 u = 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(u.color) && (h = { name: u.color[0].name, value: { ">": {}, "<": {} } }, u.color.forEach(e => { var t; e.value.indexOf && -1 < e.value.indexOf(">") ? (t = e.value.split(">"), h.value[">"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha)) : e.value.indexOf && -1 < e.value.indexOf("<") ? (t = e.value.split("<"), h.value["<"][t[1]] = Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha)) : h.value[e.value] = Cesium.Color.fromCssColorString(e.color).withAlpha(u.alpha) })), Cesium.Color.fromCssColorString(u.defaultColor).withAlpha(u.alpha)); var s = this, l = (this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), t.url + "?" + this._serialize(a.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function (t, e) { var o = t, r = e, n = s; if (r.state === Cesium.QuadtreeTileLoadState.START) if (r.data = { lines: [], geometryPrimitive: void 0 }, r.level >= i.level_min && r.level < i.level_max && n.item.show) { { t = l.replace(window.encodeURIComponent("{x}"), r.x).replace(window.encodeURIComponent("{y}"), r.y).replace(window.encodeURIComponent("{z}"), r.level); n._cache && (t += "&" + n._core.getuid()); let c = [], e = Cesium.GeoJsonDataSource.load(t); e.then(e => { let i = e.entities.values; if (i && i.length) { i.forEach(e => { var t = e.properties.getValue(); let i, o; "3D" === u.type && (i = u.height, t && "string" == typeof u.height && /^\[/.test(u.height) && /\]$/.test(u.height) && (n = u.height.replace(/\[/, "").replace(/\]/, ""), i = t[n] || 100), o = i * u.scale); let r; if (t && "string" == typeof u.color && /^\[/.test(u.color) && /\]$/.test(u.color)) { var n = t[u.color.replace(/\[/, "").replace(/\]/, "")] || u.defaultColor; r = Cesium.Color.fromCssColorString(n).withAlpha(u.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 < l) { r = h.value["<"][l]; break } } } r = r || m.clone(), e.polygon && (n = e.polygon.hierarchy.getValue().positions, e = new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(n), height: 0, extrudedHeight: "3D" === u.type ? o : 0, vertexFormat: Cesium.VertexFormat.DEFAULT, perPositionHeight: !1 }), n = new Cesium.GeometryInstance({ id: t, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(r) } }), c.push(n)) }); let t; if (c.length) { let e = "3D" === u.type ? Cesium.Primitive : Cesium.GroundPrimitive; t = new e({ geometryInstances: c, appearance: new Cesium.PerInstanceColorAppearance({ translucent: u.alpha < 1 }), classificationType: Cesium.ClassificationType.BOTH, shadows: u.shadows }) } n.probj.push(t), r.data.geometryPrimitive = t, r.state = Cesium.QuadtreeTileLoadState.LOADING, r.state === Cesium.QuadtreeTileLoadState.LOADING && (r.data.geometryPrimitive.update(o, []), r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0) } else r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0 }, e => { 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 } else r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0 }, 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(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: u.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 }, E.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 c = this._core.extend(n, a, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); var u = this, h = (this._urlTemplate = t.url, t.url); this._Provider = new T(this._viewer, this._cesium, c.tilingScheme), this._Provider._normalTile = a.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function (i, e) { var o = i, r = e, n = u; if (r.state === Cesium.QuadtreeTileLoadState.START) if (r.data = { lines: [], geometryPrimitive: void 0 }, r.level >= a.level_min && r.level < a.level_max && n.item.show) { { i = h.replace("{x}", r.x - s).replace("{y}", r.y - l).replace("{z}", r.level); n._cache && (i += "&" + n._core.getuid()); let e = new Cesium.Cesium3DTileset({ url: i, ...c }), t = e.readyPromise.then(function (e) { n.probj.push(e), r.data.geometryPrimitive = e, n._viewer.scene.primitives.add(e), r.state = Cesium.QuadtreeTileLoadState.LOADING, r.state === Cesium.QuadtreeTileLoadState.LOADING && (r.data.geometryPrimitive.update(o, []), r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0) }); t.catch && t.catch(function (e) { 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 }), t.otherwise && t.otherwise(function (e) { 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 } else r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0 }, 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(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id); n = { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: a }; return this._Provider.treeID = n.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.createVector3DTilesFeatureLayerRelease = 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 c = this._core.extend(n, a, !0); null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"); var u = this, h = (u.models = 0, this._urlTemplate = t.url, t.url); this._Provider = new T(this._viewer, this._cesium, c.tilingScheme), this._Provider._normalTile = a.level_max - 1, this._Provider._minimumHeight = 0, this._Provider.loadTile = function (i, e) { var o = i, r = e, n = u; if (r.state === Cesium.QuadtreeTileLoadState.START) if (r.data = { lines: [], geometryPrimitive: void 0 }, r.level >= a.level_min && r.level < a.level_max && n.item.show) { { i = h.replace("{x}", r.x - s).replace("{y}", r.y - l).replace("{z}", 18); n._cache && (i += "&" + n._core.getuid()); let e = new Cesium.Cesium3DTileset({ url: i, ...c }), t = e.readyPromise.then(function (e) { function t(e) { Cesium.defined(e) && e.freeResources() } r.freeResources = function () { r.state = 0, r.renderable = !1, r.upsampledFromParent = !1, Cesium.defined(r.data) && Cesium.defined(r.data.freeResources) && r.data.freeResources(), Cesium.defined(this.data) && Cesium.defined(this.data.geometryPrimitive) && 18 <= r._level && (this.data.geometryPrimitive.destroy(), this.data.geometryPrimitive = void 0), t(r._southwestChild), r._southwestChild = void 0, t(r._southeastChild), r._southeastChild = void 0, t(r._northwestChild), r._northwestChild = void 0, t(r._northeastChild), r._northeastChild = void 0 }, n.probj.push(e), n._viewer.scene.primitives.add(e), r.state = Cesium.QuadtreeTileLoadState.LOADING, r.state === Cesium.QuadtreeTileLoadState.LOADING && (r.data.geometryPrimitive.update(o, []), r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0) }); t.catch && t.catch(function (e) { 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 }), t.otherwise && t.otherwise(function (e) { 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 } else r.state = Cesium.QuadtreeTileLoadState.DONE, r.renderable = !0 }, 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(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + c.id); n = { id: c.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: a }; return this._Provider.treeID = n.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.VectorGeoJsonFeatureLayer = function (e, t, g, i, o, r) { var n = this._core.VectorSlice(t, this._cesium), n = new v(this._viewer, this._cesium, n), f = this, n = ((this._Provider = n)._loadTile = function (e) { var t = new Cesium.PrimitiveCollection, c = new Cesium.PointPrimitiveCollection, u = new Cesium.LabelCollection, h = new Cesium.BillboardCollection, m = [], d = [], p = -1; return e.features.forEach(function (e) { var t, i = []; if (null != g.lable && null == e.geometry.coordinates[0][0] && (o = 0, null != g.lable.height && /^\[/.test(g.lable.height) && /\]$/.test(g.lable.height) && (l = g.lable.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (t = f._core.StyleContrast("lable", g.lable, Cesium)).fillColor = f._color.VectorColorTransformation(t.fillColor, e), t.outlineColor = f._color.VectorColorTransformation(t.outlineColor, e), t.backgroundColor = f._color.VectorColorTransformation(t.backgroundColor, e), t.text = f._core.Analysis(t.text, e), t.position = new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), u.add(t)), null != g.billboard && null == e.geometry.coordinates[0][0] && (o = 0, null != (s = g.billboard).height && /^\[/.test(s.height) && /\]$/.test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = f._core.StyleContrast("billboard", s, Cesium)).position = new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), h.add(r)), null != g.point && null == e.geometry.coordinates[0][0] && (o = 0, null != (s = g.point).height && /^\[/.test(s.height) && /\]$/.test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = f._core.StyleContrast("point", s, Cesium)).position = new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], o), r.color = f._color.VectorColorTransformation(r.color, e), r.outlineColor = f._color.VectorColorTransformation(r.outlineColor, e), c.add(r)), null != g.polyline) { var o = 0, r = (null != (s = g.polyline).height && /^\[/.test(s.height) && /\]$/.test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), f._core.StyleContrast("polyline", s, Cesium)); if (p = r.classificationType, delete r.classificationType, Array.isArray(e.geometry.coordinates) && 0 < e.geometry.coordinates.length) if (Array.isArray(e.geometry.coordinates[0][0])) for (var n = 0; n < e.geometry.coordinates.length; n++) { i = f._core.coordinate(i = [], e.geometry.coordinates[n]), r.positions = Cesium.Cartesian3.fromDegreesArray(i); var a = f._core.createPolyline(r, p, e, Cesium); m.push(a) } else { i = f._core.coordinate(i, e.geometry.coordinates), r.positions = Cesium.Cartesian3.fromDegreesArray(i); a = f._core.createPolyline(r, p, e, Cesium); m.push(a) } } if (null != g.polygon) { var s, l, o = 0; if (null != (s = g.polygon).height && /^\[/.test(s.height) && /\]$/.test(s.height) && (l = s.height.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[l])), (r = f._core.StyleContrast("polygon", s, Cesium)).material = f._color.VectorColorTransformation(r.material, e), p = r.classificationType, delete r.classificationType, Array.isArray(e.geometry.coordinates) && 0 < e.geometry.coordinates.length) if (Array.isArray(e.geometry.coordinates[0][0])) for (n = 0; n < e.geometry.coordinates.length; n++) { i = [], e.geometry.coordinates[n].pop(), i = f._core.coordinate(i, e.geometry.coordinates[n]), r.polygonHierarchy = new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)); a = f._core.createPolygon(r, p, e, Cesium); d.push(a) } else { i = f._core.coordinate(i, e.geometry.coordinates), r.polygonHierarchy = new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)); a = f._core.createPolygon(r, p, e, Cesium); d.push(a) } } }), t.add(u), t.add(h), t.add(c), 0 < m.length && (-1 != p ? t.add(new Cesium.GroundPolylinePrimitive({ geometryInstances: m, classificationType: p, appearance: new Cesium.PolylineMaterialAppearance })) : t.add(new Cesium.Primitive({ geometryInstances: m, appearance: new Cesium.PolylineMaterialAppearance }))), 0 < d.length && (-1 != p ? t.add(new Cesium.GroundPrimitive({ geometryInstances: d, classificationType: p, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: f._core.Shaders("vertexShaderSource"), fragmentShaderSource: f._core.Shaders("fragmentShaderSource") }) })) : t.add(new Cesium.Primitive({ geometryInstances: d, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: f._core.Shaders("vertexShaderSource"), fragmentShaderSource: f._core.Shaders("fragmentShaderSource") }) }))), t }, this.item = n._primitiveCollection, n.addTo(this._viewer), 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, { id: g.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "Vector", item: this, url: t.url, style: g, treeData: { name: e, geoOptions: t, styleOption: g, 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.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp = 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 }, m = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function (e, t) { var c, u, h; c = e, h = l, (u = t).state === Cesium.QuadtreeTileLoadState.START && (u.data = { lines: [], geometryPrimitive: void 0 }, u.level >= i.level_min && u.level < i.level_max && h.item.show ? (e = d.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { if (null == e) u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0; else { var i = []; h.Legend = []; for (var t = 0; t < e.features.length; t++) { var o = [], r = e.features[t]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), s(r.geometry.coordinates[n]), l(); else s(r.geometry.coordinates), l() } 0 == i.length && (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0); var a = new Cesium.Primitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), shadows: h._option.shadows }); u.data.geometryPrimitive = a, u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive.update(c, []), u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) } function s(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e, t; /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(r.properties[e])), m.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = r.properties[e], h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (h._option.material && (m.material = h._option.material), m.material && (h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= o.length && (e = Cesium.Cartesian3.fromDegreesArray(o), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: r, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, h.Legend.push(t), i.push(e)) } }, error: function () { null == u.count && (u.count = 0), u.count += 1, 2 <= u.count ? (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) : u.state = Cesium.QuadtreeTileLoadState.START } }), u.state = Cesium.QuadtreeTileLoadState.LOADING) : (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: m.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss = function (e, t, l, 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(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= l.level_min && t.level < l.level_max && d.item.show) { var o = C.filter(c, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: o[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++)if (d.PrimitiveData[r].key == i) return void (d.Primitivekey.includes(i) || d.Primitivekey.push(i)); if (!d.Primitivekey.includes(i)) { d.Primitivekey.push(i), c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }); for (var o = d._option.level_min + (d._option.level_max - d._option.level_min) / 2, n = Oi(t, o), r = 0; r < n.length; r++) { var a = n[r], s = "z" + a.level + "x" + a.x + "y" + a.y; d.loadAllKey.includes(s) || (d.loadAllKey.push(s), function (u) { var e = d._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), h = (d.tilesLength++, d._cache && (e += "&" + d._core.getuid()), "z" + u.level + "x" + u.x + "y" + u.y); d._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : s.push(e[t]) } function t() { var e, t; /^\[/.test(d._option.extrudedHeight) && /\]$/.test(d._option.extrudedHeight) && (e = d._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(l.properties[e])), m.material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? (e = d._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = l.properties[e], d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (d._option.material && (m.material = d._option.material), m.material && (d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= s.length && (e = Cesium.Cartesian3.fromDegreesArray(s), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, d.Legend.push(t), i.push(e)) } d.Legend = []; for (var r, n, a = 0; a < e.features.length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry.coordinates) && 0 < l.geometry.coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var c = 0; c < l.geometry.coordinates.length; c++)s = [], l.geometry.coordinates[c].pop(), o(l.geometry.coordinates[c]), t(); else o(l.geometry.coordinates), t() } 0 < i.length && (r = new Cesium.Primitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core.Shaders("vertexShaderSource"), fragmentShaderSource: d._core.Shaders("fragmentShaderSource") }), shadows: d._option.shadows }), n = { level: u.level, key: h, data: r }, d.probj.push(r), d.loadFinishKey.push(h), d.PrimitiveData.push(n), d._viewer.scene.primitives.add(r), d.returnCount++) }, error: function () { }, complete: function (e, t) { } }) }(a)) } } } } else t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0) } }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; n = { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }; this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, E.prototype.VolumeVectorGeoJsonFeatureLayerGis = function (e, t, a, 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 }, s = (t.url, t.layer, t.upperLevelLimit, t.lowerLevelLimit, this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), this._cesium, this._core.isnull(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._option = this._core.extend(n, a, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), l = [], m = { id: t.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this; this._urlTemplate = t.url + "/" + window.encodeURIComponent("{z}") + "/" + window.encodeURIComponent("{x}") + "/" + window.encodeURIComponent("{reverseY}") + ".json", this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= a.level_min && t.level < a.level_max && d.item.show) { var o = C.filter(s, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: o[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++)if (d.PrimitiveData[r].key == i) return void (d.Primitivekey.includes(i) || d.Primitivekey.push(i)); d.Primitivekey.includes(i) || (d.Primitivekey.push(i), s.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), o = (u = t).tilingScheme.getNumberOfYTilesAtLevel(u.level) - u.y - 1, n = d._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{reverseY}"), o).replace(window.encodeURIComponent("{z}"), u.level), d.tilesLength++, h = "z" + u.level + "x" + u.x + "y" + u.y, d._cache && (n += "&" + d._core.getuid()), 0 < C.filter(l, function (e) { return e.url == n }).length || (l.push({ url: n }), d._core.xhr({ url: n, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function t() { m.extrudedHeight = parseFloat(d._option.extrudedHeight), /^\[/.test(d._option.extrudedHeight) && /\]$/.test(d._option.extrudedHeight) && (t = d._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = 3 * parseFloat(a.properties[t])), m.material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? (t = d._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = a.properties[t], d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (d._option.material && (m.material = d._option.material), m.material && (d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))); var e, t = Cesium.Color.WHITE; 2 <= n.length && (e = Cesium.Cartesian3.fromDegreesArray(n), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, d.Legend.push(t), i.push(e)) } d.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)n = [], a.geometry.coordinates[s].pop(), o(a.geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = new Cesium.Primitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core.Shaders("vertexShaderSource"), fragmentShaderSource: d._core.Shaders("fragmentShaderSource") }), shadows: d._option.shadows }), c = (d.probj.push(l), { level: u.level, key: h, data: l }); d.loadFinishKey.push(h), d.PrimitiveData.push(c), d._viewer.scene.primitives.add(l), d.returnCount++; try { 2 == d.probj.length && (d._viewer.scene.primitives.remove(d.probj[0]), d.probj.pop()) } catch (e) { } }, error: function () { var e = d.Primitivekey.indexOf(h); -1 < e && d.Primitivekey.splice(e, 1), s = C.remove(s, function (e) { return e.x == u.x && e.y == u.y && e.level == u.level }) }, complete: function (e, t) { u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive && (u.state = Cesium.QuadtreeTileLoadState.DONE), u.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 u, n, h }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; n = { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a, treeData: { name: e, geoOptions: t, styleOption: a, 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.PointVectorGeoJsonFeatureLayerGis = function (e, t, h, 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 = (this._option = this._core.extend(n, h, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { id: t.id, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, arcType: this._cesium.ArcType.GEODESIC }, m = this, n = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new Li(this._viewer, this._cesium, { url: this._urlTemplate }, function (e) { if (m.Level = m.getLevel(), m.Level < m._option.level_min) { if (0 < m.primitve.length) { for (var t = 0; t < m.primitve.length; t++)m._viewer.scene.primitives.remove(m.primitve[t]); m.primitve = [] } if (0 < m.probj.length) { for (t = 0; t < m.probj.length; t++)m._viewer.scene.primitives.remove(m.probj[t]); m.probj = [] } a = [] } else { var s = new Cesium.PrimitiveCollection, l = new Cesium.PointPrimitiveCollection, c = new Cesium.LabelCollection, u = new Cesium.BillboardCollection, i = (e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e.data = { lines: [], geometryPrimitive: void 0 }, e.url.replace("png", "json")); 0 < C.filter(a, function (e) { return e.url == i }).length || 1 != m.start && (a.push({ url: i }), m._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { if (0 != e.features.length) { m.Legend = []; for (var t = 0; t < e.features.length; t++) { var n = [], a = e.features[t]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var i = 0; i < a.geometry.coordinates.length; i++)n = [], a.geometry.coordinates[i].pop(), o(a.geometry.coordinates[i]), r(); else o(a.geometry.coordinates), r() } 0 < c.length && s.add(c), 0 < u.length && s.add(u), 0 < l.length && s.add(l), m.primitve.push(s), m.probj.push(s), m._viewer.scene.primitives.add(s), m.returnCount++; try { 2 == m.probj.length && (m._viewer.scene.primitives.remove(m.probj[0]), m.probj.pop()) } catch (e) { } } function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function r() { var e, t, i, o, r; null != h.lable && (t = 0, null != h.lable.height && /^\[/.test(h.lable.height) && /\]$/.test(h.lable.height) && (o = h.lable.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(a.properties[o])), (e = m._core.StyleContrast("lable", h.lable, Cesium)).fillColor = m._color.VectorColorTransformation(e.fillColor, a), e.outlineColor = m._color.VectorColorTransformation(e.outlineColor, a), e.backgroundColor = m._color.VectorColorTransformation(e.backgroundColor, a), e.text = m._core.Analysis(e.text, a), e.position = new Cesium.Cartesian3.fromDegrees(n[0], n[1], t), c.add(e)), null != h.billboard && (t = 0, null != (i = h.billboard).height && /^\[/.test(i.height) && /\]$/.test(i.height) && (o = i.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(a.properties[o])), (r = m._core.StyleContrast("billboard", i, Cesium)).position = new Cesium.Cartesian3.fromDegrees(n[0], n[1], t), u.add(r)), null != h.point && (t = 0, null != (i = h.point).height && /^\[/.test(i.height) && /\]$/.test(i.height) && (o = i.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(a.properties[o])), (r = m._core.StyleContrast("point", i, Cesium)).position = new Cesium.Cartesian3.fromDegrees(n[0], n[1], t), r.color = m._color.VectorColorTransformation(r.color, a), r.outlineColor = m._color.VectorColorTransformation(r.outlineColor, a), l.add(r)) } } })) } }), this.img = this._Provider1.ent, o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: h, treeData: { name: e, geoOptions: t, styleOption: h, 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.PolylineVectorGeoJsonFeatureLayerGis = 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 = (this._option = this._core.extend(n, u, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { id: t.id, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, arcType: this._cesium.ArcType.GEODESIC }, h = this, n = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new Li(this._viewer, this._cesium, { url: this._urlTemplate }, function (e) { if (h.Level = h.getLevel(), h.Level < h._option.level_min) { if (0 < h.primitve.length) { for (var t = 0; t < h.primitve.length; t++)h._viewer.scene.primitives.remove(h.primitve[t]); h.primitve = [] } if (0 < h.probj.length) { for (t = 0; t < h.probj.length; t++)h._viewer.scene.primitives.remove(h.probj[t]); h.probj = [] } a = [] } else { var c = -1, i = (e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e.data = { lines: [], geometryPrimitive: void 0 }, e.url.replace("png", "json")); 0 < C.filter(a, function (e) { return e.url == i }).length || 1 != h.start && (a.push({ url: i }), h._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { if (0 != e.features.length) { var i = []; h.Legend = []; for (var t = 0; t < e.features.length; t++) { var o = [], r = e.features[t]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), s(r.geometry.coordinates[n]), l(); else s(r.geometry.coordinates), l() } var a = new Cesium.Primitive({ geometryInstances: i, appearance: new Cesium.PolylineColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._option.shadows, classificationType: c }); h.probj.push(a), h.primitve.push(a), h._viewer.scene.primitives.add(a), h.returnCount++; try { 2 == h.probj.length && (h._viewer.scene.primitives.remove(h.probj[0]), h.probj.pop()) } catch (e) { } } function s(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e = u, t = (null != e.height && /^\[/.test(e.height) && /\]$/.test(e.height) && (t = e.height.replace(/\[/, "").replace(/\]/, ""), parseFloat(r.properties[t])), h._core.StyleContrast("polyline", e, Cesium)); c = t.classificationType, delete t.classificationType, t.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), t.material = r.properties[e], h._core.isHtmlColor(t.material) ? t.material = h._color.colorFromHtmlColor(t.material) : (/^rgb/.test(t.material) && (t.material = h._color.rgbaStringToRgbaObj(t.material)), 1 < t.material.red && (t.material.red = t.material.red / 255), 1 < t.material.green && (t.material.green = t.material.green / 255), 1 < t.material.blue && (t.material.blue = t.material.blue / 255), 1 < t.material.alpha && (t.material.a = t.material.alpha / 255), t.material = h._color.createColor(t.material.red, t.material.green, t.material.blue, t.material.alpha))) : (h._option.material && (t.material = h._option.material), t.material && (h._core.isHtmlColor(t.material) ? t.material = h._color.colorFromHtmlColor(t.material) : (/^rgb/.test(t.material) && (t.material = h._color.rgbaStringToRgbaObj(t.material)), 1 < t.material.red && (t.material.red = t.material.red / 255), 1 < t.material.green && (t.material.green = t.material.green / 255), 1 < t.material.blue && (t.material.blue = t.material.blue / 255), 1 < t.material.alpha && (t.material.a = t.material.alpha / 255), t.material = h._color.createColor(t.material.red, t.material.green, t.material.blue, t.material.alpha)))), 2 <= o.length && (t.positions = Cesium.Cartesian3.fromDegreesArray(o), e = new Cesium.GeometryInstance({ id: r, geometry: new Cesium.PolylineGeometry(t), attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(t.material) } }), t = "material:" + 255 * t.material.red + "," + 255 * t.material.green + "," + 255 * t.material.blue, h.Legend.push(t), i.push(e)) } } })) } }), this.img = this._Provider1.ent, o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: u, treeData: { name: e, geoOptions: t, styleOption: u, 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.VolumeVectorGeoJsonFeatureLayerGisOptimization = 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 = (t.url, t.layer, t.upperLevelLimit, t.lowerLevelLimit, this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), this._cesium, this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.toString().charAt(0) && "]" == i.material.toString().charAt(i.material.length - 1) || (this._core.isHtmlColor(i.material) ? i.material = this._color.colorFromHtmlColor(i.material) : (/^rgb/.test(i.material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), c = { id: t.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, u = this, a = (this._urlTemplate = t.url + "/{z}/{x}/{reverseY}.json", this._Provider = {}, this._Provider1 = new Li(this._viewer, this._cesium, { url: this._urlTemplate }, function (e) { if (u.Level = u.getLevel(), u.Level < u._option.level_min) { if (0 < u.primitve.length) { for (var t = 0; t < u.primitve.length; t++)u._viewer.scene.primitives.remove(u.primitve[t]); u.primitve = [] } if (0 < u.probj.length) { for (t = 0; t < u.probj.length; t++)u._viewer.scene.primitives.remove(u.probj[t]); u.probj = [] } s = [] } else { e.templateValues.z, e.templateValues.x, e.templateValues.reverseY, e.data = { lines: [], geometryPrimitive: void 0 }; var i = e.url.replace("png", "json"); 0 < C.filter(s, function (e) { return e.url == i }).length || 1 != u.start && (s.push({ url: i }), u._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { if (0 != e.features.length) { var t = []; u.Legend = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = e.features[i]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), s(r.geometry.coordinates[n]), l(); else s(r.geometry.coordinates), l() } var a = new Cesium.Primitive({ geometryInstances: t, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: u._core.Shaders("vertexShaderSource"), fragmentShaderSource: u._core.Shaders("fragmentShaderSource") }), shadows: u._option.shadows }); u.primitve.push(a), u.probj.push(a), u._viewer.scene.primitives.add(a), u.returnCount++; try { 2 == u.probj.length && (u._viewer.scene.primitives.remove(u.probj[0]), u.probj.pop()) } catch (e) { } } function s(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e; c.extrudedHeight = u._option.extrudedHeight, /^\[/.test(u._option.extrudedHeight) && /\]$/.test(u._option.extrudedHeight) && (e = u._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), c.extrudedHeight = 3 * parseFloat(r.properties[e])), c.material = u._option.material, /^\[/.test(u._option.material) && /\]$/.test(u._option.material) ? (e = u._option.material.replace(/\[/, "").replace(/\]/, ""), c.material = r.properties[e], u._core.isHtmlColor(c.material) ? c.material = u._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = u._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.red && (c.material.red = c.material.red / 255), 1 < c.material.green && (c.material.green = c.material.green / 255), 1 < c.material.blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c.material.alpha / 255), c.material = u._color.createColor(c.material.red, c.material.green, c.material.blue, c.material.alpha))) : (u._option.material && (c.material = u._option.material), c.material && (u._core.isHtmlColor(c.material) ? c.material = u._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = u._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.red && (c.material.red = c.material.red / 255), 1 < c.material.green && (c.material.green = c.material.green / 255), 1 < c.material.blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c.material.alpha / 255), c.material = u._color.createColor(c.material.red, c.material.green, c.material.blue, c.material.alpha)))), 2 <= o.length && (e = Cesium.Cartesian3.fromDegreesArray(o), c.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(c), e = new Cesium.GeometryInstance({ id: r, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(c.material) } }), c.material.red, c.material.green, c.material.blue, t.push(e)) } } })) } }), this.img = this._Provider1.ent, 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, { 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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization = function (e, t, m, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, 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 }, d = (this._core.isnull(m) || this._core.isnull(m.material) || "[" == m.material.toString().charAt(0) && "]" == m.material.toString().charAt(m.material.length - 1) || (this._core.isHtmlColor(m.material) ? m.material = this._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = this._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.r && (m.material.r = m.material.r / 255), 1 < m.material.g && (m.material.g = m.material.g / 255), 1 < m.material.b && (m.material.b = m.material.b / 255), 1 < m.material.a && (m.material.a = m.material.a / 255), m.material = this._color.createColor(m.material.r, m.material.g, m.material.b, m.material.a))), this._core.extend(n, m, !0)), s = (null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), p = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = m.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && p.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= m.level_min && t.level < m.level_max && p.item.show) { var o = C.filter(s, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: o[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < p.PrimitiveData.length) for (var r = 0; r < p.PrimitiveData.length; r++)if (p.PrimitiveData[r].key == i) return void p.Primitivekey.push(i); p.Primitivekey.includes(i) || (p.Primitivekey.push(i), s.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), h = t, o = p._urlTemplate.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level), p.tilesLength++, p._cache && (o += "&" + p._core.getuid()), p._core.xhr({ url: o, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : (n.push(e[t]), 2 !== t || a || (a = !0)) } function t() { var e = a ? Cesium.Cartesian3.fromDegreesArrayHeights(n) : Cesium.Cartesian3.fromDegreesArray(n), t = (/^\[/.test(m.extrudedHeight) && /\]$/.test(m.extrudedHeight) && (t = m.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), d.extrudedHeight = parseFloat(s.properties[t])), d.extrudedHeight = parseFloat(d.extrudedHeight), 1 == d.heightReference && delete d.height, 1 == d.extrudedHeightReference && delete d.extrudedHeight, /^\[/.test(m.material) && /\]$/.test(m.material) && (t = m.material.replace(/\[/, "").replace(/\]/, ""), d.material = s.properties[t], p._core.isHtmlColor(d.material) ? d.material = p._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = p._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = p._color.createColor(d.material.r, d.material.g, d.material.b, d.material.a))), d.polygonHierarchy = new Cesium.PolygonHierarchy(e), new Cesium.PolygonGeometry(d)), e = (s.treeID = d.id, s.VectorType = "polygon", s.VectorStyle = { haveZ: a, extrudedHeight: d.extrudedHeight, positions: n, material: d.material }, new Cesium.GeometryInstance({ id: s, geometry: t, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(d.material) } })), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue; p.Legend.push(t), i.push(e) } p.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = !1, s = e.features[r]; if (Array.isArray(s.geometry.coordinates) && 0 < s.geometry.coordinates.length) if (Array.isArray(s.geometry.coordinates[0][0])) for (var l = 0; l < s.geometry.coordinates.length; l++)n = [], s.geometry.coordinates[l].pop(), o(s.geometry.coordinates[l]), t(); else o(s.geometry.coordinates), t() } var c = new Cesium.ClassificationPrimitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: p._core.Shaders("vertexShaderSource"), fragmentShaderSource: p._core.Shaders("fragmentShaderSource") }), classificationType: d.classificationType, shadows: Cesium.ShadowMode.ENABLED }), u = (p.PrimitiveObj.data = c, p.PrimitiveObj.key = p.Primitivekey[p.returnCount], { level: h.level, key: p.Primitivekey[p.returnCount], data: c }); p.loadFinishKey.push(p.Primitivekey[p.returnCount]), p.PrimitiveData.push(u), p._viewer.scene.primitives.add(c), p.returnCount++, p.returnCount >= p.tilesLength && (p.returnCount = 0, p.tilesLength = 0, p.Primitivekey = []) }, error: function () { s = C.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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), 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 }, E.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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), m = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function (e, t) { var l, c, u; l = e, u = m, (c = t).state === Cesium.QuadtreeTileLoadState.START && (c.data = { lines: [], geometryPrimitive: void 0 }, c.level >= i.level_min && c.level < i.level_max && u.item.show ? (e = d.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent("{y}"), c.y).replace(window.encodeURIComponent("{z}"), c.level), u._cache && (e += "&" + u._core.getuid()), u._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { if (null == e) c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0; else { var i = new Cesium.PrimitiveCollection; u.Legend = []; for (var t = 0; t < e.features.length; t++) { var o = [], r = e.features[t]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), a(r.geometry.coordinates[n]), s(); else a(r.geometry.coordinates), s() } c.data.geometryPrimitive = i, c.state = Cesium.QuadtreeTileLoadState.LOADING, c.state === Cesium.QuadtreeTileLoadState.LOADING && (c.data.geometryPrimitive.update(l, []), c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0) } function a(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? a(e[t]) : o.push(e[t]) } function s() { var e, t; u._option.extrudedHeight && (h.extrudedHeight = u._option.extrudedHeight), /^\[/.test(u._option.extrudedHeight) && /\]$/.test(u._option.extrudedHeight) && (e = u._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), h.extrudedHeight = parseFloat(r.properties[e])), h.material = u._option.material, /^\[/.test(u._option.material) && /\]$/.test(u._option.material) ? (e = u._option.material.replace(/\[/, "").replace(/\]/, ""), h.material = r.properties[e], u._core.isHtmlColor(h.material) ? h.material = u._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = u._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.red && (h.material.red = h.material.red / 255), 1 < h.material.green && (h.material.green = h.material.green / 255), 1 < h.material.blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h.material.alpha / 255), h.material = u._color.createColor(h.material.red, h.material.green, h.material.blue, h.material.alpha))) : (u._option.material && (h.material = u._option.material), h.material && (u._core.isHtmlColor(h.material) ? h.material = u._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = u._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.red && (h.material.red = h.material.red / 255), 1 < h.material.green && (h.material.green = h.material.green / 255), 1 < h.material.blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h.material.alpha / 255), h.material = u._color.createColor(h.material.red, h.material.green, h.material.blue, h.material.alpha)))), 2 <= o.length && (e = Cesium.Cartesian3.fromDegreesArray(o), h.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(h), e = new Cesium.GeometryInstance({ id: r, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }), e = new Cesium.ClassificationPrimitive({ geometryInstances: e, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: u._core.Shaders("vertexShaderSource"), fragmentShaderSource: u._core.Shaders("fragmentShaderSource") }), classificationType: u._option.classificationType }), t = "material:" + 255 * h.material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue, u.Legend.push(t), i.add(e)) } }, error: function () { null == c.count && (c.count = 0), c.count += 1, 2 <= c.count ? (c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0) : c.state = Cesium.QuadtreeTileLoadState.START } }), c.state = Cesium.QuadtreeTileLoadState.LOADING) : (c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: h.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3 = 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 }, m = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function (e, t) { var c, u, h; c = e, h = l, (u = t).state === Cesium.QuadtreeTileLoadState.START && (u.data = { lines: [], geometryPrimitive: void 0 }, u.level >= i.level_min && u.level < i.level_max && h.item.show ? (e = d.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { if (null == e) u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0; else { new Cesium.PrimitiveCollection, h.Legend = []; for (var t = [], i = 0; i < e.features.length; i++) { var o = [], r = e.features[i]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), s(r.geometry.coordinates[n]), l(); else s(r.geometry.coordinates), l() } var a = new Cesium.ClassificationPrimitive1({ geometryInstances: t, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), classificationType: h._option.classificationType }); u.data.geometryPrimitive = a, u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive.update(c, []), u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) } function s(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e; h._option.extrudedHeight && (m.extrudedHeight = h._option.extrudedHeight), /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(r.properties[e])), m.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = r.properties[e], h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (h._option.material && (m.material = h._option.material), m.material && (h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= o.length && (e = Cesium.Cartesian3.fromDegreesArray(o), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: r, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), t.push(e)) } }, error: function () { null == u.count && (u.count = 0), u.count += 1, 2 <= u.count ? (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) : u.state = Cesium.QuadtreeTileLoadState.START } }), u.state = Cesium.QuadtreeTileLoadState.LOADING) : (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: m.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization = function (e, t, n, i, o, r) { 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(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n.material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n.material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n.material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n.material.a && (n.material.a = n.material.a / 255), n.material = this._color.createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._option = this._core.extend(a, n, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = n.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= n.level_min && t.level < n.level_max && d.item.show) { var o = C.filter(l, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: o[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++)if (d.PrimitiveData[r].key == i) return void (d.Primitivekey.includes(i) || d.Primitivekey.push(i)); d.Primitivekey.includes(i) || (d.Primitivekey.push(i), l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), u = t, o = d._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), d.tilesLength++, h = "z" + u.level + "x" + u.x + "y" + u.y, d._cache && (o += "&" + d._core.getuid()), d._core.xhr({ url: o, type: "get", dataType: "json", success: function (e) { var i = new Cesium.PrimitiveCollection; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function t() { var e, t; d._option.extrudedHeight && (m.extrudedHeight = d._option.extrudedHeight), /^\[/.test(d._option.extrudedHeight) && /\]$/.test(d._option.extrudedHeight) && (e = d._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(a.properties[e])), m.material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? (e = d._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = a.properties[e], d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (d._option.material && (m.material = d._option.material), m.material && (d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= n.length && (e = Cesium.Cartesian3.fromDegreesArray(n), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), e = new Cesium.ClassificationPrimitive({ geometryInstances: e, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core.Shaders("vertexShaderSource"), fragmentShaderSource: d._core.Shaders("fragmentShaderSource") }), classificationType: d._option.classificationType }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, d.Legend.push(t), i.add(e)) } d.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)n = [], a.geometry.coordinates[s].pop(), o(a.geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = i, c = (d.probj.push(l), { level: u.level, key: h, data: l }); d.loadFinishKey.push(h), d.PrimitiveData.push(c), d._viewer.scene.primitives.add(l), d.returnCount++, d.removeObsoletePrimitives(u) }, error: function () { var e = d.Primitivekey.indexOf(h); -1 < e && d.Primitivekey.splice(e, 1), l = C.remove(l, function (e) { return e.x == u.x && e.y == u.y && e.level == u.level }) }, complete: function (e, t) { u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive && (u.state = Cesium.QuadtreeTileLoadState.DONE), u.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 u, h }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n, treeData: { name: e, geoOptions: t, styleOption: n, GroupID: i, checked: o, disFnc: r } }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1 = function (e, t, l, 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(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), m = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, d = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && d.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= l.level_min && t.level < l.level_max && d.item.show) { var o = C.filter(c, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: o[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < d.PrimitiveData.length) for (var r = 0; r < d.PrimitiveData.length; r++)if (d.PrimitiveData[r].key == i) return void (d.Primitivekey.includes(i) || d.Primitivekey.push(i)); if (!d.Primitivekey.includes(i)) { d.Primitivekey.push(i), c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }); for (var o = d._option.level_min + Math.floor((d._option.level_max - d._option.level_min) / 2), n = Oi(t, o), r = 0; r < n.length; r++) { var a = n[r], s = "z" + a.level + "x" + a.x + "y" + a.y; d.loadAllKey.includes(s) || (d.loadAllKey.push(s), function (u) { var e = d._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), h = (d.tilesLength++, "z" + u.level + "x" + u.x + "y" + u.y); d._cache && (e += "&" + d._core.getuid()), d._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : s.push(e[t]) } function t() { var e, t; d._option.extrudedHeight && (m.extrudedHeight = d._option.extrudedHeight), /^\[/.test(d._option.extrudedHeight) && /\]$/.test(d._option.extrudedHeight) && (e = d._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(l.properties[e])), m.material = d._option.material, /^\[/.test(d._option.material) && /\]$/.test(d._option.material) ? (e = d._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = l.properties[e], d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (d._option.material && (m.material = d._option.material), m.material && (d._core.isHtmlColor(m.material) ? m.material = d._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = d._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = d._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= s.length && (e = Cesium.Cartesian3.fromDegreesArray(s), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, d.Legend.push(t), i.push(e)) } d.Legend = []; for (var r, n, a = 0; a < e.features.length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry.coordinates) && 0 < l.geometry.coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var c = 0; c < l.geometry.coordinates.length; c++)s = [], l.geometry.coordinates[c].pop(), o(l.geometry.coordinates[c]), t(); else o(l.geometry.coordinates), t() } 0 < i.length && (r = new Cesium.GroundPrimitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: d._core.Shaders("vertexShaderSource"), fragmentShaderSource: d._core.Shaders("fragmentShaderSource") }), classificationType: d._option.classificationType, show: d.item.show }), d.probj.push(r), n = { level: u.level, key: h, data: r }, d.loadFinishKey.push(h), d.PrimitiveData.push(n), d._viewer.scene.primitives.add(r), d.returnCount++) }, error: function () { }, complete: function (e, t) { } }) }(a)) } } } } else t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0) } }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; n = { id: m.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, 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.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2 = 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 }, m = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, d = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function (e, t) { var c, u, h; c = e, h = l, (u = t).state === Cesium.QuadtreeTileLoadState.START && (u.data = { lines: [], geometryPrimitive: void 0 }, u.level >= i.level_min && u.level < i.level_max && h.item.show ? (e = d.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { if (null == e) u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0; else { var i = []; h.Legend = []; for (var t = 0; t < e.features.length; t++) { var o = [], r = e.features[t]; if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var n = 0; n < r.geometry.coordinates.length; n++)o = [], r.geometry.coordinates[n].pop(), s(r.geometry.coordinates[n]), l(); else s(r.geometry.coordinates), l() } 0 == i.length && (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0); var a = new Cesium.GroundPrimitive1({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), classificationType: h._option.classificationType }); u.data.geometryPrimitive = a, u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive.update1(c, []), u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) } function s(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? s(e[t]) : o.push(e[t]) } function l() { var e, t; h._option.extrudedHeight && (m.extrudedHeight = h._option.extrudedHeight), /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), m.extrudedHeight = parseFloat(r.properties[e])), m.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), m.material = r.properties[e], h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha))) : (h._option.material && (m.material = h._option.material), m.material && (h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.red && (m.material.red = m.material.red / 255), 1 < m.material.green && (m.material.green = m.material.green / 255), 1 < m.material.blue && (m.material.blue = m.material.blue / 255), 1 < m.material.alpha && (m.material.a = m.material.alpha / 255), m.material = h._color.createColor(m.material.red, m.material.green, m.material.blue, m.material.alpha)))), 2 <= o.length && (e = Cesium.Cartesian3.fromDegreesArray(o), m.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(m), e = new Cesium.GeometryInstance({ id: r, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), t = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, h.Legend.push(t), i.push(e)) } }, error: function () { u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0 } }), u.state = Cesium.QuadtreeTileLoadState.LOADING) : (u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: m.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3 = 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 }, d = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._option = this._core.extend(a, i, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, c = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url + "?" + this._serialize(s.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = i.level_max - 1, this._Provider.loadTile = function (e, t) { var u, h, m; u = e, m = l, (h = t).state === Cesium.QuadtreeTileLoadState.START && (h.data = { lines: [], geometryPrimitive: void 0 }, h.level >= i.level_min && h.level < i.level_max && m.item.show ? (e = c.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level), m._cache && (e += "&" + m._core.getuid()), m._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var i = ["#ffff00", "#ffcc00", "#ff3300", "#ccff00", "#cccc00", "#99ff66", "#999933", "#66cc99", "#6633ff", "#33ffff", "#3399cc", "#009933", "#ccccff", "#ff99ff", "#9966ff", "#336699"]; if (null == e) h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0; else { var o = []; m.Legend = []; for (var t = 0; t < e.features.length; t++) { var r = [], n = e.features[t]; if (Array.isArray(n.geometry.coordinates) && 0 < n.geometry.coordinates.length) if (Array.isArray(n.geometry.coordinates[0][0])) for (var a = 0; a < n.geometry.coordinates.length; a++)r = [], n.geometry.coordinates[a].pop(), l(n.geometry.coordinates[a]), c(); else l(n.geometry.coordinates), c() } 0 == o.length && (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); var s = new Cesium.ClassificationPrimitive1({ geometryInstances: o, classificationType: Cesium.ClassificationType.BOTH }); h.data.geometryPrimitive = s, h.state = Cesium.QuadtreeTileLoadState.LOADING, h.state === Cesium.QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive.update(u, []), h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } function l(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? l(e[t]) : r.push(e[t]) } function c() { var e, t; m._option.extrudedHeight && (d.extrudedHeight = m._option.extrudedHeight), /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m._option.extrudedHeight) && (e = m._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), d.extrudedHeight = parseFloat(n.properties[e])), d.material = m._option.material, /^\[/.test(m._option.material) && /\]$/.test(m._option.material) ? (e = m._option.material.replace(/\[/, "").replace(/\]/, ""), d.material = n.properties[e], m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = m._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.red && (d.material.red = d.material.red / 255), 1 < d.material.green && (d.material.green = d.material.green / 255), 1 < d.material.blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d.material.alpha / 255), d.material = m._color.createColor(d.material.red, d.material.green, d.material.blue, d.material.alpha))) : (m._option.material && (d.material = m._option.material), d.material && (m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = m._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.red && (d.material.red = d.material.red / 255), 1 < d.material.green && (d.material.green = d.material.green / 255), 1 < d.material.blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d.material.alpha / 255), d.material = m._color.createColor(d.material.red, d.material.green, d.material.blue, d.material.alpha)))), 2 <= r.length && (e = Cesium.Cartesian3.fromDegreesArray(r), d.polygonHierarchy = new Cesium.PolygonHierarchy(e), 0 != d.extrudedHeight && "0" != d.extrudedHeight && null != d.extrudedHeight && null != d.extrudedHeight || (d.extrudedHeight = 1e4), e = new Cesium.PolygonGeometry(d), t = i[Math.floor(Math.random() * i.length)], e = new Cesium.GeometryInstance({ id: n, geometry: e, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(t).withAlpha(.5)) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue, m.Legend.push(t), o.push(e)) } }, error: function () { h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 } }), h.state = Cesium.QuadtreeTileLoadState.LOADING) : (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(d.id) && (d.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + d.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: d.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, E.prototype.createPointGeoJsonFeatureLayerProvider = function (e, t, a, 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 }, s = ((s = this)._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color.toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core.isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a.color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a.color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a.color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a.outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color.colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), this), l = (this._urlTemplate = t.url + "?" + this._serialize(n.urlParams), t.url + "?" + this._serialize(n.urlParams)), n = (this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: Cesium.LabelStyle.OUTLINE, fillColor: Cesium.Color.WHITE, outlineColor: Cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new Cesium.Color(.165, .165, .165, .8), backgroundPadding: new Cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.CENTER, eyeOffset: Cesium.Cartesian3.ZERO, pixelOffset: Cesium.Cartesian2.ZERO, heightReference: Cesium.HeightReference.NONE, scaleByDistance: new Cesium.NearFarScalar(0, 0, 1, 1) }), c = (s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a.backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), s._core.extend(n, a, !0)), n = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), u = parseFloat(a.far), n = new Cesium.DistanceDisplayCondition(n, u); c.distanceDisplayCondition = n, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), c.font = parseFloat(a.font_size) + "px " + a.font_family, a.material, this._Provider.loadTile = function (e, t) { var i, o, n; i = e, n = s, (o = t).state === Cesium.QuadtreeTileLoadState.START && (o.data = { lines: [], geometryPrimitive: void 0 }, o.level >= a.level_min && o.level < a.level_max && n.item.show ? (e = l.replace(window.encodeURIComponent("{x}"), o.x).replace(window.encodeURIComponent("{y}"), o.y).replace(window.encodeURIComponent("{z}"), o.level), n._cache && (e += "&" + n._core.getuid()), n._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var r; null == e ? (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0) : (r = new Cesium.PointPrimitiveCollection, e.features.forEach(function (e) { c.id = e; var t, i = 0, o = (/^\[/.test(c.pointHeight) && /\]$/.test(c.pointHeight) ? (o = c.pointHeight.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : void 0 !== c.pointHeight && "" !== c.pointHeight ? i = parseFloat(c.pointHeight) : null != e.properties.height && (i = parseFloat(e.properties.height)), /^\[/.test(a.color) && /\]$/.test(a.color) && (t = a.color.replace(/\[/, "").replace(/\]/, ""), c.color = e.properties[t], n._core.isHtmlColor(c.color) ? c.color = n._color.colorFromHtmlColor(c.color) : (/^rgb/.test(c.color) && (c.color = n._color.rgbaStringToRgbaObj(c.color)), 1 < c.color.r && (c.color.r = c.color.r / 255), 1 < c.color.g && (c.color.g = c.color.g / 255), 1 < c.color.b && (c.color.b = c.color.b / 255), 1 < c.color.a && (c.color.a = c.color.a / 255), c.color = n._color.createColor(c.color.r, c.color.g, c.color.b, c.color.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a.outlineColor) && (t = a.outlineColor.replace(/\[/, "").replace(/\]/, ""), c.outlineColor = e.properties[t], n._core.isHtmlColor(c.outlineColor) ? c.outlineColor = n._color.colorFromHtmlColor(c.outlineColor) : (/^rgb/.test(c.outlineColor) && (c.outlineColor = n._color.rgbaStringToRgbaObj(c.outlineColor)), 1 < c.outlineColor.r && (c.outlineColor.r = c.outlineColor.r / 255), 1 < c.outlineColor.g && (c.outlineColor.g = c.outlineColor.g / 255), 1 < c.outlineColor.b && (c.outlineColor.b = c.outlineColor.b / 255), 1 < c.outlineColor.a && (c.outlineColor.a = c.outlineColor.a / 255), c.outlineColor = n._color.createColor(c.outlineColor.r, c.outlineColor.g, c.outlineColor.b, c.outlineColor.a))), c.position = new Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], i), c.text = e.properties.name, { show: c.show, position: c.position, pixelSize: c.pixelSize, color: c.color, outlineColor: c.outlineColor, outlineWidth: c.outlineWidth, id: e }); c.color && c.color.red && (t = "color:" + 255 * c.color.red + "," + 255 * c.color.green + "," + 255 * c.color.blue + ";outlineColor:" + 255 * c.outlineColor.red + "," + 255 * c.outlineColor.green + "," + 255 * c.outlineColor.blue, n.Legend.push(t)), o.id.treeID = a.id, o.id.VectorType = "point", o.id.VectorStyle = { show: o.show, pointHeight: i, position: o.position, pixelSize: o.pixelSize, color: o.color, outlineColor: o.outlineColor, outlineWidth: o.outlineWidth }, r.add(o) }), o.data.geometryPrimitive = r, o.state = Cesium.QuadtreeTileLoadState.LOADING, o.state === Cesium.QuadtreeTileLoadState.LOADING && (o.data.geometryPrimitive.update(i, []), o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0)) }, 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) : (o.state = Cesium.QuadtreeTileLoadState.DONE, o.renderable = !0)) }, this._primitive = new this._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 5 }); u = this._viewer.scene.primitives, a && a.time && (this._Provider._availability = new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({ start: a.time.start ? Cesium.JulianDate.fromDate(new Date(a.time.start)) : Cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? Cesium.JulianDate.fromDate(new Date(a.time.end)) : Cesium.Iso8601.MAXIMUM_VALUE })]), this._Provider.isAvailable = function (e) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), u.add(this._primitive), o ? (this.item.show = !0, this.setVisibility(!0)) : this.setVisibility(!1), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, n = { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a, treeData: { name: e, geoOptions: t, styleOption: a, GroupID: i, checked: o, disFnc: r } }; return this._Provider.treeID = a.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization = function (e, t, d, 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.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: 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 }, p = (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.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = this._color.createColor(d.material.r, d.material.g, d.material.b, d.material.a))), this._option = this._core.extend({ ...a }, d, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { id: this._option.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this; let c = -1 < t.url.indexOf("/gisserver/"); n = c ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._serialize(s.urlParams), this._urlTemplate = n, this._Provider = new T(this._viewer, this._cesium, c ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = d.level_max - 1, this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function (e, t) { var u = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) if (h.data = { lines: [], geometryPrimitive: void 0 }, h.level >= d.level_min && h.level < d.level_max && m.item.show) { if (c && (h.reverseY = m._Provider.tilingScheme.getNumberOfYTilesAtLevel(h.level) - h.y - 1), m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (!i || h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i.minRow) return void (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } i = n.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.reverseY || h.y).replace(window.encodeURIComponent("{z}"), h.level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { if (null == e) h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0; else { var i = []; m.Legend = []; for (var t, o = 0; o < e.features.length; o++) { var r = [], n = !1, a = e.features[o]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)r = [], a.geometry.coordinates[s].pop(), l(a.geometry.coordinates[s]), c(); else l(a.geometry.coordinates), c() } 0 == i.length && (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0), t = p.material.alpha < 1 ? new Cesium.PerInstanceColorAppearance({ translucent: !0 }) : new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: m._core.Shaders("vertexShaderSource"), fragmentShaderSource: m._core.Shaders("fragmentShaderSource") }), t = m._option.clampToGround ? new Cesium.GroundPrimitive({ geometryInstances: i, appearance: t, classificationType: m._option.classificationType }) : new Cesium.Primitive({ geometryInstances: i, appearance: t, shadows: m._option.shadows }), h.data.geometryPrimitive = t, h.state = Cesium.QuadtreeTileLoadState.LOADING, h.state === Cesium.QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive.update(u, []), h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } function l(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? l(e[t]) : (r.push(e[t]), 2 !== t || n || (n = !0)) } function c() { var e, t; /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m._option.extrudedHeight) ? (e = m._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), p.extrudedHeight = parseFloat(a.properties[e])) : m._option.extrudedHeight && (p.extrudedHeight = parseFloat(m._option.extrudedHeight)), /^\[/.test(m._option.height) && /\]$/.test(m._option.height) ? (e = m._option.height.replace(/\[/, "").replace(/\]/, ""), p.height = parseFloat(a.properties[e])) : m._option.height && (p.height = parseFloat(m._option.height)), p.material = m._option.material, /^\[/.test(m._option.material) && /\]$/.test(m._option.material) ? (e = m._option.material.replace(/\[/, "").replace(/\]/, ""), p.material = a.properties[e], m._core.isHtmlColor(p.material) ? p.material = m._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p.material) && (p.material = m._color.rgbaStringToRgbaObj(p.material)), 1 < p.material.red && (p.material.red = p.material.red / 255), 1 < p.material.green && (p.material.green = p.material.green / 255), 1 < p.material.blue && (p.material.blue = p.material.blue / 255), 1 < p.material.alpha && (p.material.a = p.material.alpha / 255), p.material = m._color.createColor(p.material.red, p.material.green, p.material.blue, p.material.alpha))) : (m._option.material && (p.material = m._option.material), p.material && (m._core.isHtmlColor(p.material) ? p.material = m._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p.material) && (p.material = m._color.rgbaStringToRgbaObj(p.material)), 1 < p.material.red && (p.material.red = p.material.red / 255), 1 < p.material.green && (p.material.green = p.material.green / 255), 1 < p.material.blue && (p.material.blue = p.material.blue / 255), 1 < p.material.alpha && (p.material.a = p.material.alpha / 255), p.material = m._color.createColor(p.material.red, p.material.green, p.material.blue, p.material.alpha)))), d.preLoad && d.preLoad(p, a), 2 <= r.length && (e = n ? Cesium.Cartesian3.fromDegreesArrayHeights(r) : Cesium.Cartesian3.fromDegreesArray(r), p.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(p), a.treeID = p.id, a.VectorType = "polygon", a.VectorStyle = { haveZ: n, extrudedHeight: p.extrudedHeight, positions: r, material: p.material }, e = new Cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(p.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(m._option.near, m._option.far) } }), t = "material:" + 255 * p.material.red + "," + 255 * p.material.green + "," + 255 * p.material.blue, m.Legend.push(t), i.push(e)) } }, error: function () { h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 } }), h.state = Cesium.QuadtreeTileLoadState.LOADING } else h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 }, "function" == typeof r && r(this.item) }; let u, h; this.saveDefaultVectorData = () => { 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(u), u = 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), s.add(this._primitive), this._core.getWMTSData({ url: t.url, layer: t.layer, srs: t.srs || "EPSG:4490", gisserverTMS: c }, 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 }, E.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 }, c = (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.color.r && (o.color.r = o.color.r / 255), 1 < o.color.g && (o.color.g = o.color.g / 255), 1 < o.color.b && (o.color.b = o.color.b / 255), 1 < o.color.a && (o.color.a = o.color.a / 255), o.color = a._color.createColor(o.color.r, o.color.g, o.color.b, o.color.a))), a._core.extend(s, o, !0)), s = (a._core.isnull(o.near) && (o.near = 0), a._core.isnull(o.far) && (o.far = 999999999), parseFloat(o.near)), u = parseFloat(o.far), s = new Cesium.DistanceDisplayCondition(s, u), h = (c.distanceDisplayCondition = s, o.material, this._urlTemplate = t.url + "?" + this._serialize(l.urlParams), t.url + "?" + this._serialize(l.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(c.height) || 0, this._Provider.loadTile = function (t, i) { var e; i.state === Cesium.QuadtreeTileLoadState.START && (i.data = { lines: [], geometryPrimitive: void 0 }, i.level >= o.level_min && i.level < o.level_max && a.item.show ? (e = h.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i.level), a._cache && (e += "&" + a._core.getuid()), a._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var o; null == e ? (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) : (o = new Cesium.PrimitiveCollection({ isModel: !0 }), e.features.forEach(function (e) { var t = (c.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(c.height) && /\]$/.test(c.height) ? (i = c.height.replace(/\[/, "").replace(/\]/, ""), t += parseFloat(e.properties[i])) : t += parseFloat(c.height) || 0, c.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t)), Cesium.Model.fromGltf({ id: e, url: c.uri, color: c.color, modelMatrix: c.modelMatrix, scale: c.scale, heightReference: parseInt(c.heightReference), distanceDisplayCondition: c.distanceDisplayCondition })); o.add(i) }), 0 == e.features.length && (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0), i.data.geometryPrimitive = o, i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive.update(t, []), i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0)) }, error: function () { null == i.count && (i.count = 0), i.count += 1, 2 <= i.count ? (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) : i.state = Cesium.QuadtreeTileLoadState.START } }), i.state = Cesium.QuadtreeTileLoadState.LOADING) : (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0)) }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); 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; u = { 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(u), this._tree.insertGroupId(u, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, E.prototype.createModelGeoJsonFeatureLayerProvider = function (e, t, o, i, r, n) { var a, s = this, l = { url: "", color: Cesium.Color.DARKSALMON, scale: 2 }, c = { 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 }, u = (s._core.isnull(o) || s._core.isnull(o.color) || /^\[/.test(o.color) && "[" == o.color.toString().charAt(0) && "]" == o.color.toString().charAt(o.color.length - 1) || (s._core.isHtmlColor(o.color) ? o.color = s._color.colorFromHtmlColor(o.color) : (/^rgb/.test(o.color) && (o.color = s._color.rgbaStringToRgbaObj(o.color)), 1 < o.color.r && (o.color.r = o.color.r / 255), 1 < o.color.g && (o.color.g = o.color.g / 255), 1 < o.color.b && (o.color.b = o.color.b / 255), 1 < o.color.a && (o.color.a = o.color.a / 255), o.color = s._color.createColor(o.color.r, o.color.g, o.color.b, o.color.a))), s._core.extend(l, o, !0)), h = (s._core.isnull(o.near) && (o.near = 0), s._core.isnull(o.far) && (o.far = 999999999), parseFloat(o.near)), m = parseFloat(o.far), h = new Cesium.DistanceDisplayCondition(h, m); u.distanceDisplayCondition = h, o.material; let d = -1 < t.url.indexOf("/gisserver/"); a = d ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._serialize(c.urlParams), this._urlTemplate = a, this._Provider = new T(this._viewer, this._cesium, d ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(u.height) || 0, this.initThisProvider = () => { 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.level < o.level_max && s.item.show) { if (d && (i.reverseY = s._Provider.tilingScheme.getNumberOfYTilesAtLevel(i.level) - i.y - 1), s.TileMatrixLimits) { var e = s.TileMatrixLimits[i.level]; if (!e || i.x > e.maxCol || i.x < e.minCol || i.y > e.maxRow || i.y < e.minRow) return i.state = Cesium.QuadtreeTileLoadState.DONE, void (i.renderable = !0) } e = a.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.reverseY || i.y).replace(window.encodeURIComponent("{z}"), i.level); s._cache && (e += "&" + s._core.getuid()), s._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { if (null == e) i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0; else { let a = [], s; Cesium.ModelInstanceCollection || (s = new Cesium.PrimitiveCollection), e.features.forEach(function (e) { var t = (u.id = e).geometry.coordinates[2] || 0, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(u.height) && /\]$/.test(u.height) ? (i = u.height.replace(/\[/, "").replace(/\]/, ""), t += parseFloat(e.properties[i])) : t += parseFloat(u.height) || 0, Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t))); let o = u.heading || 0, r = u.pitch || 0, n = u.roll || 0; /^\[/.test(o) && /\]$/.test(o) && (o = o.replace(/\[/, "").replace(/\]/, ""), o = parseFloat(e.properties[o])), /^\[/.test(r) && /\]$/.test(r) && (r = r.replace(/\[/, "").replace(/\]/, ""), r = parseFloat(e.properties[r])), /^\[/.test(n) && /\]$/.test(n) && (n = n.replace(/\[/, "").replace(/\]/, ""), n = parseFloat(e.properties[n])); t = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o), Cesium.Math.toRadians(r), Cesium.Math.toRadians(n)), t = Cesium.Matrix3.fromHeadingPitchRoll(t); Cesium.Matrix4.multiplyByMatrix3(i, t, i), Cesium.Matrix4.multiplyByUniformScale(i, u.scale, i), s ? s.add(Cesium.Model.fromGltf({ id: e, url: u.uri, modelMatrix: i, color: u.color })) : a.push({ modelMatrix: i, modelId: e }) }), s = s || new Cesium.ModelInstanceCollection({ url: u.uri, instances: a, color: u.color }), 0 == e.features.length && (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0), i.data.geometryPrimitive = s, i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive.update(t, []), i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) } }, error: function () { null == i.count && (i.count = 0), i.count += 1, 2 <= i.count ? (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) : i.state = Cesium.QuadtreeTileLoadState.START } }), i.state = Cesium.QuadtreeTileLoadState.LOADING } else i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0 }, "function" == typeof n && n(this.item) }; let p, g; this.saveDefaultVectorData = () => { g = s._core.extend({}, o, !0) }, this.restoreVector = () => { g && (o = g, u = 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), u = s._core.extend(u, 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), 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(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, h = { id: u.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 }, E.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1 = function (e, t, c, 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 }, u = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c.material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c.material.a && (c.material.a = c.material.a / 255), c.material = this._color.createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._option = this._core.extend(n, c, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = c.level_max - 1, h._defaultStyle = { outlineColor: Cesium.Color.fromCssColorString("rgba(209,204,226,0)"), lineWidth: 0, outline: !0, fill: !0, fillColor: Cesium.Color.fromCssColorString("rgba(220,20,60,1)"), fillShow: "nod", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: Cesium.Color.fromCssColorString("rgba(255,0,0,1)"), labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", pointColor: Cesium.Color.fromCssColorString("rgba(255,0,0,0)"), centerLabelPropertyName: "NAME" }, -1 != h._option.fill.indexOf("[") ? h._defaultStyle.fillShow = h._option.fill : h._defaultStyle.fillColor = Cesium.Color.fromCssColorString(h._option.fill), this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level > c.level_max + 2 && 0 < h.probj.length) for (; 0 < h.probj.length; n++) { h._viewer.entities.remove(h.probj[0]); var o = h.probj.indexOf(h.probj[0]); h.probj.splice(o, 1) } if (t.level >= c.level_min && t.level < c.level_max && h.item.show) { var r = C.filter(u, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != r.length && r[0].data && 0 < r[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: r[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < h.PrimitiveData.length) for (var n = 0; n < h.PrimitiveData.length; n++)if (h.PrimitiveData[n].key == i) return void (h.Primitivekey.includes(i) || h.Primitivekey.push(i)); h.Primitivekey.includes(i) || (h.Primitivekey.push(i), u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), a = t, r = h._urlTemplate.replace(window.encodeURIComponent("{x}"), a.x).replace(window.encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a.level), h.tilesLength++, s = "z" + a.level + "x" + a.x + "y" + a.y, h._cache && (r += "&" + h._core.getuid()), l = { xMin: Cesium.Math.toDegrees(a._rectangle.west), yMin: Cesium.Math.toDegrees(a._rectangle.south), xMax: Cesium.Math.toDegrees(a._rectangle.east), yMax: Cesium.Math.toDegrees(a._rectangle.north) }, h._core.xhr({ url: r, type: "get", dataType: "json", success: function (e) { var t = e, e = (h._tileWidth = 256, h._tileHeight = 256, h.x = a._x, h.y = a._y, h.level = a._level, h._createCanvas(), h._drawGeojson(h._context, 0, 0, e, l, h._tileWidth, h._tileHeight, h._fill, h._outline, h.x, h.y, h.level), h._viewer.entities.add({ ids: t, name: "Rotating rectangle with rotating texture coordinate", rectangle: { coordinates: a.rectangle, material: new Cesium.ImageMaterialProperty({ image: h._canvas, transparent: !0 }), zIndex: a.level, classificationType: Cesium.ClassificationType.BOTH } })), t = (h.probj.push(e), { level: a.level, key: s, data: e }); h.loadFinishKey.push(s), h.PrimitiveData.push(t), h.returnCount++, h.removeObsoleteEntitiesxp(a.rectangle) }, error: function () { a.state = Cesium.QuadtreeTileLoadState.DONE, a.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 a, s, l }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: n.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.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest = function (e, t, l, 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(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._option = this._core.extend(n, l, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, u = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = l.level_max - 1, u._defaultStyle = { outlineColor: Cesium.Color.fromCssColorString("rgba(209,204,226,0)"), lineWidth: 0, outline: !0, fill: !0, fillColor: Cesium.Color.fromCssColorString("rgba(220,20,60,1)"), fillShow: "nod", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: Cesium.Color.fromCssColorString("rgba(255,0,0,1)"), labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", pointColor: Cesium.Color.fromCssColorString("rgba(255,0,0,0)"), centerLabelPropertyName: "NAME" }, -1 != u._option.fill.indexOf("[") ? u._defaultStyle.fillShow = u._option.fill : u._defaultStyle.fillColor = Cesium.Color.fromCssColorString(u._option.fill), this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && u.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level > l.level_max + 2 && 0 < u.probj.length) for (; 0 < u.probj.length; n++) { u._viewer.entities.remove(u.probj[0]); var o = u.probj.indexOf(u.probj[0]); u.probj.splice(o, 1) } if (t.level >= l.level_min && t.level < l.level_max && u.item.show) { var r = C.filter(c, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != r.length && r[0].data && 0 < r[0].data.length) t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: r[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = Cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < u.PrimitiveData.length) for (var n = 0; n < u.PrimitiveData.length; n++)if (u.PrimitiveData[n].key == i) return void (u.Primitivekey.includes(i) || u.Primitivekey.push(i)); u.Primitivekey.includes(i) || (u.Primitivekey.push(i), c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), a = t, r = u._urlTemplate.replace(window.encodeURIComponent("{x}"), a.x).replace(window.encodeURIComponent("{y}"), a.y).replace(window.encodeURIComponent("{z}"), a.level), u.tilesLength++, s = "z" + a.level + "x" + a.x + "y" + a.y, u._cache && (r += "&" + u._core.getuid()), Cesium.Math.toDegrees(a._rectangle.west), Cesium.Math.toDegrees(a._rectangle.south), Cesium.Math.toDegrees(a._rectangle.east), Cesium.Math.toDegrees(a._rectangle.north), u._core.xhr({ url: r, type: "get", dataType: "json", success: function (e) { var t = e, t = (u._tileWidth = 256, u._tileHeight = 256, u.x = a._x, u.y = a._y, u.level = a._level, u._viewer.entities.add({ ids: t, name: "Rotating rectangle with rotating texture coordinate", rectangle: { coordinates: a.rectangle, material: new Cesium.ImageMaterialProperty({ image: e, transparent: !0 }), zIndex: a.level, classificationType: Cesium.ClassificationType.BOTH } })), e = (u.probj.push(t), { level: a.level, key: s, data: t }); u.loadFinishKey.push(s), u.PrimitiveData.push(e), u.returnCount++, u.removeObsoleteEntitiesxp(a.rectangle) }, error: function () { a.state = Cesium.QuadtreeTileLoadState.DONE, a.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 a, s }, this._primitive = new Cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.add(this._primitive), o || this.setVisibility(!1), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l, treeData: { name: e, geoOptions: t, styleOption: l, GroupID: i, checked: o, disFnc: r } }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, E.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest = 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: 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 }, d = (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.material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o.material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this._core.extend(a, o, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), { id: this._option.id, polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }), l = this, a = -1 < t.url.indexOf("/gisserver/"), c = a ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._serialize(s.urlParams); this._urlTemplate = c, this._Provider = new T(this._viewer, this._cesium, a ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = o.level_max - 1, this._Provider._minimumHeight = parseFloat(o.height || 0), this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function (e, t) { var u = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) if (h.data = { lines: [], geometryPrimitive: void 0 }, h.level >= o.level_min && h.level < o.level_max && m.item.show) { if (m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (!i || h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i.minRow) return void (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } i = c.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { var t = C.cloneDeep(e); if (t.features.length <= 0) h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0; else if (null == t) h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0; else { var i = []; m.Legend = []; for (var o = 0; o < t.features.length; o++) { var r = [], n = !1, a = t.features[o]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)r = [], a.geometry.coordinates[s].pop(), l(a.geometry.coordinates[s]), c(); else l(a.geometry.coordinates), c() } 0 == i.length && (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0); e = new Cesium.GroundPrimitive({ geometryInstances: i, appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: m._core.Shaders("vertexShaderSource"), fragmentShaderSource: m._core.Shaders("fragmentShaderSource") }), classificationType: m._option.classificationType, shadows: m._option.shadows }); m.probj.push(e), h.data.geometryPrimitive = e, h.state = Cesium.QuadtreeTileLoadState.LOADING, h.state === Cesium.QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive.update(u, []), h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } function l(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? l(e[t]) : (r.push(e[t]), 2 !== t || n || (n = !0)) } function c() { var e, t; /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m._option.extrudedHeight) && (e = m._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), d.extrudedHeight = parseFloat(a.properties[e])), d.material = m._option.material, /^\[/.test(m._option.material) && /\]$/.test(m._option.material) ? (e = m._option.material.replace(/\[/, "").replace(/\]/, ""), d.material = a.properties[e], m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = m._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.red && (d.material.red = d.material.red / 255), 1 < d.material.green && (d.material.green = d.material.green / 255), 1 < d.material.blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d.material.alpha / 255), d.material = m._color.createColor(d.material.red, d.material.green, d.material.blue, d.material.alpha))) : (m._option.material && (d.material = m._option.material), d.material && (m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = m._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.red && (d.material.red = d.material.red / 255), 1 < d.material.green && (d.material.green = d.material.green / 255), 1 < d.material.blue && (d.material.blue = d.material.blue / 255), 1 < d.material.alpha && (d.material.a = d.material.alpha / 255), d.material = m._color.createColor(d.material.red, d.material.green, d.material.blue, d.material.alpha)))), 2 <= r.length && (e = n ? Cesium.Cartesian3.fromDegreesArrayHeights(r) : Cesium.Cartesian3.fromDegreesArray(r), d.polygonHierarchy = new Cesium.PolygonHierarchy(e), e = new Cesium.PolygonGeometry(d), a.treeID = d.id, a.VectorType = "polygon", a.VectorStyle = { haveZ: n, extrudedHeight: d.extrudedHeight, positions: r, material: d.material }, e = new Cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(d.material) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue, m.Legend.push(t), i.push(e)) } }, 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 } else h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 } }, this._primitive = new 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:4490", gisserverTMS: a }, e => { 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 }, E.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; t < e.features.length; t++)e.features[t].properties.nod = 0 == t ? "rgba(255,255,0,1)" : 1 == t ? "rgba(220,20,60,1)" : 2 == t ? "rgba(75,0,130,1)" : 3 == t ? "rgba(0,0,255,1)" : 4 == t ? "rgba(30,144,255,1)" : "rgba(50,205,50,1)"; try { var i = new VectorTileImageryProvider({ source: e, zIndex: 99, removeDuplicate: !1, defaultStyle: { outlineColor: "rgba(209,204,226,1)", lineWidth: 0, outline: !0, fill: !0, fillColor: "rgba(209,204,226,1)", fillShow: "[nod]", tileCacheSize: 200, showMaker: !1, showCenterLabel: !0, fontColor: "rgba(255,0,0,1)", labelOffsetX: -10, labelOffsetY: -5, fontSize: 13, fontFamily: "黑体", centerLabelPropertyName: "NAME" }, maximumLevel: 20, minimumLevel: 15, simplify: !1 }); i.readyPromise.then(function () { viewer.imageryLayers.addImageryProvider(i), Cesium.Camera.DEFAULT_VIEW_RECTANGLE = i.rectangle }) } catch (e) { console.log(e) } }) }, E.prototype._drawGeojson = function (o, r, n, e, a, t, i, s, l, c, u, h) { var m, d, p, g, f, _, C, y, v, w, b, T, S, E = this; function P(e) { if (E._styleFilter) { if (0 == (d = e.style).show) return; p = { labelStroke: d.labelStroke, labelStrokeWidth: d.labelStrokeWidth, labelStrokeColor: d.labelStrokeColor, pointSize: d.pointSize, fontSize: d.fontSize, fontFamily: d.fontFamily, color: d.fontColor.toCssColorString(), backgroundColor: d.pointColor.toCssColorString(), pointStyle: d.pointStyle, ringRadius: d.ringRadius, circleLineWidth: d.circleLineWidth, showMaker: d.showMaker, showLabel: d.showLabel, labelOffsetX: d.labelOffsetX, labelOffsetY: d.labelOffsetY, markerSymbol: d.makerImage instanceof Image ? d.makerImage : d.makerImageEl } } else d = E._defaultStyle; if (o.lineWidth = d.lineWidth, o.strokeStyle = d.outlineColor.toCssColorString(), o.fillStyle = d.fillColor.toCssColorString(), -1 != d.fillShow.indexOf("[") && (i = d.fillShow.replace("[", "").replace("]", ""), o.fillStyle = e.properties[i]), d.lineDash && o.setLineDash(d.lineDash), o.lineCap = d.lineCap, d.shadowColor && d.shadowColor instanceof Cesium.Color ? o.shadowColor = d.shadowColor.toCssColorString() : o.shadowColor = d.shadowColor, o.shadowBlur = d.shadowBlur, o.shadowOffsetX = d.shadowOffsetX, o.shadowOffsetY = d.shadowOffsetY, o.miterLimit = d.miterLimit, o.lineJoin = d.lineJoin, "Point" == e.geometry.type) drawMarker(o, m, a, r, n, e, s, l, d.labelPropertyName, p); else if ("Polygon" == e.geometry.type && d.fill) { var t = turf.getCoords(e), i = Vi(o, m, a, r, n, t, !0, !1); i && i.map(function (e) { e.style = d, g.push(e) }) } else if ("MultiPolygon" == e.geometry.type && d.fill) try { turf.getCoords(e).map(function (e) { e = Vi(o, m, a, r, n, e, !0, !1); e && e.map(function (e) { e.style = d, g.push(e) }) }) } catch (e) { } else "MultiLineString" == e.geometry.type ? e.properties.isOutline && !d.outline || (t = turf.getCoords(e), Vi(o, m, a, r, n, t, !1, !0)) : "LineString" != e.geometry.type || e.properties.isOutline && !d.outline || (i = turf.getCoords(e), Vi(o, m, a, r, n, t = [i], !1, !0), i = null) } void 0 === l && (l = !0), ((s = void 0 === s ? !0 : s) || l) && (m = new Mi(t = void 0 === t ? o.canvas.width - r : t, i = void 0 === i ? o.canvas.height - n : i), d = this._defaultStyle, p = { labelStroke: d.labelStroke, labelStrokeWidth: d.labelStrokeWidth, labelStrokeColor: d.labelStrokeColor, pointSize: d.pointSize, fontSize: d.fontSize, fontFamily: d.fontFamily, color: d.fontColor.toCssColorString(), backgroundColor: d.pointColor.toCssColorString(), pointStyle: d.pointStyle, ringRadius: d.ringRadius, circleLineWidth: d.circleLineWidth, showMaker: d.showMaker, showLabel: d.showLabel, labelOffsetX: d.labelOffsetX, labelOffsetY: d.labelOffsetY, markerSymbol: d.makerImage instanceof Image ? d.makerImage : d.makerImageEl }, g = [], E._styleFilter && (turf.featureEach(e, function (e, t) { E._styleFilter && (d = E._defaultStyle.clone(), E._styleFilter(e, d, c, u, h), e.style = d) }), e.features.sort(function (e, t) { return e.style && e.style.lineDash ? 1 : t.style && t.style.lineDash ? -1 : 0 })), turf.featureEach(e, function (e, t) { "Polygon" != e.geometry.type && "MultiPolygon" != e.geometry.type || P(e) }), g && g.length && (f = m, _ = a, C = r, y = n, t = g, w = (i = o).canvas, b = i.getImageData(0, 0, w.width, w.height), (T = document.createElement("canvas")).width = w.width, T.height = w.height, S = T.getContext("2d"), t.map(function (e) { S.clearRect(0, 0, T.width, T.height), S.beginPath(); var t = 0; e.map(function (e) { e = f.project(e, _); 0 == t ? S.moveTo(C + e.x, y + e.y) : S.lineTo(C + e.x, y + e.y), t++ }), S.closePath(), S.fillStyle = "rgba(255,255,255,1)", S.fill(), v = S.getImageData(0, 0, T.width, T.height).data; for (var i = 3; i < v.length; i += 4)0 < v[i] && (b.data[i] = 0) }), i.putImageData(b, 0, 0)), turf.featureEach(e, function (e, t) { "LineString" != e.geometry.type && "MultiLineString" != e.geometry.type || P(e) }), turf.featureEach(e, function (e, t) { "Point" != e.geometry.type && "MultiPoint" != e.geometry.type || P(e) })) }, E.prototype._createCanvas = function () { this._canvas = document.createElement("canvas"), this._canvas.width = this._tileWidth, this._canvas.height = this._tileHeight, this._context = this._canvas.getContext("2d"), this._context.lineWidth = this._defaultStyle.lineWidth, this._context.strokeStyle = this._defaultStyle.outlineColor.toCssColorString(), this._context.fillStyle = this._defaultStyle.fillColor.toCssColorString() }, E.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, E.prototype.removeObsoletePrimitives1 = function (e) { }, E.prototype.removeObsoletePrimitives = function (e) { for (var t = this._viewer.scene.globe._surface._tilesToRender.map(function (e) { return e.level }), i = Math.min.apply(Math, Ri(t)), o = Math.max.apply(Math, Ri(t)), r = this.PrimitiveData.length - 1; 0 <= r; r--) { var n = this.PrimitiveData[r]; (n.level < i || n.level > o) && this._viewer.scene.primitives.remove(n.data) && (-1 < (u = this.Primitivekey.indexOf(this.loadFinishKey[r])) && this.Primitivekey.splice(u, 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 < s.length; r++)var l = s[r].children, a = a.concat(l); for (var c, u, r = 0; r < a.length; r++)a[r] && (c = "z" + a[r].level + "x" + a[r].x + "y" + a[r].y, -1 < (u = this.loadFinishKey.indexOf(c)) && this._viewer.scene.primitives.remove(this.PrimitiveData[u].data) && (-1 < (u = this.Primitivekey.indexOf(c)) && this.Primitivekey.splice(u, 1), this.PrimitiveData.splice(u, 1), this.loadFinishKey.splice(u, 1))) }, E.prototype.removeObsoleteEntities = function (e) { for (var t = this._viewer.scene.globe._surface._tilesToRender.map(function (e) { return e.level }), i = Math.min.apply(Math, Ri(t)) - 1, o = Math.max.apply(Math, Ri(t)) + 1, r = this.PrimitiveData.length - 1; 0 <= r; r--) { var n = this.PrimitiveData[r]; (n.level < i || n.level > o) && this._viewer.entities.remove(n.data) && (-1 < (u = this.Primitivekey.indexOf(this.loadFinishKey[r])) && this.Primitivekey.splice(u, 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 < s.length; r++)var l = s[r].children, a = a.concat(l); for (var c, u, r = 0; r < a.length; r++)a[r] && (c = "z" + a[r].level + "x" + a[r].x + "y" + a[r].y, -1 < (u = this.loadFinishKey.indexOf(c)) && this._viewer.entities.remove(this.PrimitiveData[u].data) && (-1 < (u = this.Primitivekey.indexOf(c)) && this.Primitivekey.splice(u, 1), this.PrimitiveData.splice(u, 1), this.loadFinishKey.splice(u, 1))) }, E.prototype.removeObsoleteEntitiesxp = function (e) { for (var t = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.west), this._cesium.Math.toDegrees(e.south)), i = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(e.east), this._cesium.Math.toDegrees(e.north)), o = 0; o < this.probj.length; o++)this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(), this._cesium.Cartographic.fromCartesian(t)), this._cesium.Rectangle.contains(this.probj[o].rectangle.coordinates.getValue(), this._cesium.Cartographic.fromCartesian(i)); for (var r = this._viewer.camera.computeViewRectangle(), n = 0; n < this.probj.length; n++) { var a = this.probj[n].rectangle.coordinates.getValue(), s = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.west), this._cesium.Math.toDegrees(a.south)), a = this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(a.east), this._cesium.Math.toDegrees(a.north)), s = this._cesium.Rectangle.contains(r, this._cesium.Cartographic.fromCartesian(s)), a = this._cesium.Rectangle.contains(r, this._cesium.Cartographic.fromCartesian(a)); this.probj[n].show = !(!s && !a) } }, E.prototype.computeCircle = function (e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, E.prototype.setTreeobj = function (e) { this.treeobj = e }, E.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t, pId: this.treeobj.pId }, treeData: this.treeobj.treeData } }, E.prototype.deleteObject = function () { if (this._viewer.scene.primitives.remove(this.item), this.probj && 0 < this.probj.length && (this._viewer.scene.primitives.remove(this.probj[0]), this.probj.pop()), null != this.img && this._viewer.imageryLayers.remove(this.img), this.primitve && 0 < this.primitve.length) { for (var e = 0; e < this.primitve.length; e++)this._viewer.scene.primitives.remove(this.primitve[e]); this.primitve = [] } this.loadAllKey && 0 < this.loadAllKey.length && (this.loadAllKey = []); try { this._Provider.remove() } catch (e) { } }, E.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) { } }, E.prototype.getLevel = function () { var e, t = this._viewer.camera; return t && t.positionCartographic && t.positionCartographic.height ? (e = (e = this._viewer.scene.globe.getHeight(t.positionCartographic)) || 0, t = t.positionCartographic.height - e, Math.round(80955.31 / (1 + Math.pow(t / 91610.74, 7096758e-11)) - 40467.74)) : 0 }, E.prototype.setVisibility = function (e) { try { if (this.loadAllKey = [], null != this.item && null != this.item.show && (this.item.show = e), null != this.img && (this.img.show = e), this.primitve && 0 < this.primitve.length) for (var t = 0; t < this.primitve.length; t++)this.primitve[t].show = e; if (this._Provider && this._Provider.setStatus && this._Provider.setStatus(e), this.probj && 0 < this.probj.length) for (t = 0; t < this.probj.length; t++)this.probj[t].show = e } catch (e) { } }, E.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, E.prototype.isCache = function (e) { this._cache = e }, E.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }, Fi.prototype.flyTo = function (e, t = {}) { return this._viewer.flyTo(e, { duration: t.time || 3, maximumHeight: t.maxHeight, offset: new Cesium.HeadingPitchRange(Cesium.Math.toRadians(t.heading || 0), Cesium.Math.toRadians(t.pitch || -45), t.range) }) }, Fi.prototype.flyToPointsInterest = function (e, t) { return this._viewer.camera.flyTo({ destination: e.destination, orientation: e.orientation, duration: e.duration, complete: t }) }, Fi.prototype.flyToPosition = function (e, t, i, o = {}) { o = { heading: this._core.defaultValue(o.heading, 0), pitch: this._core.defaultValue(o.pitch, -90), roll: this._core.defaultValue(o.roll, 0), time: this._core.defaultValue(o.time, 3) }; Math.abs(e) <= 180 && Math.abs(t) <= 90 ? this._viewer.camera.flyTo({ destination: this._cesium.Cartesian3.fromDegrees(e, t, i), orientation: new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading), Cesium.Math.toRadians(o.pitch), Cesium.Math.toRadians(o.roll)), duration: o.time }) : this._viewer.camera.flyTo({ destination: { x: e, y: t, z: i }, orientation: new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading), Cesium.Math.toRadians(o.pitch), Cesium.Math.toRadians(o.roll)), duration: o.time }) }, Hi.prototype.createPolylineGeoJsonFeatureLayer = function (e, t, p, i, g, f) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, _ = (this._core.isnull(p) || this._core.isnull(p.material) || "[" == p.material.toString().charAt(0) && "]" == p.material.toString().charAt(p.material.length - 1) || (this._core.isHtmlColor(p.material) ? p.material = this._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p.material) && (p.material = this._color.rgbaStringToRgbaObj(p.material)), 1 < p.material.r && (p.material.r = p.material.r / 255), 1 < p.material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p.material.a && (p.material.a = p.material.a / 255), p.material = this._color.createColor(p.material.r, p.material.g, p.material.b, p.material.a))), this._core.extend(o, p, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), C = this, o = (o.then(function (e) { for (var t, i = e.entities.values, o = new C._cesium.PrimitiveCollection, r = 0; r < i.length; r++) { var n = i[r], a = null; if (_.clampToGround) { _.positions = n.polyline.positions._value; var s = { positions: n.polyline.positions._value, width: _.width }, s = new C._cesium.GroundPolylineGeometry(s), a = new C._cesium.GeometryInstance({ id: n, geometry: s, attributes: { color: new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material) } }) } else { for (var l = [], r = 0; r < n.polyline.positions._value.length; r++) { C._viewer.scene.globe.ellipsoid; var c = C._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]), u = C._cesium.Math.toDegrees(c.longitude), h = C._cesium.Math.toDegrees(c.latitude), c = c.height + _.height, u = new C._cesium.Cartesian3.fromDegrees(u, h, c); l.push(u) } _.positions = l; var s = new C._cesium.PolylineGeometry(_), m = C._cesium.PolylineGeometry.createGeometry(s); a = new C._cesium.GeometryInstance({ id: n, geometry: m, attributes: { color: new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material) } }) } n.positions = _.positions; var m = "material:" + 255 * _.material.red + "," + 255 * _.material.green + "," + 255 * _.material.blue, d = (C.Legend.push(m), null), d = _.clampToGround ? new C._cesium.GroundPolylinePrimitive({ geometryInstances: a, appearance: new C._cesium.MaterialAppearance({ material: new C._cesium.Material({ fabric: { type: "Color", uniforms: { color: _.material } } }), faceForward: !0, flat: !1 }) }) : new C._cesium.Primitive({ geometryInstances: a, appearance: new C._cesium.PolylineMaterialAppearance({ material: new C._cesium.Material({ fabric: { type: "Color", uniforms: { color: _.material } } }) }), shadows: C._cesium.ShadowMode.ENABLED }); o.add(d) } p && p.time && (t = new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({ start: p.time.start ? C._cesium.JulianDate.fromDate(new Date(p.time.start)) : C._cesium.Iso8601.MINIMUM_VALUE, stop: p.time.end ? C._cesium.JulianDate.fromDate(new Date(p.time.end)) : C._cesium.Iso8601.MAXIMUM_VALUE })])), C._viewer.scene.primitives.add(o, t).show = _.show, C.item = o, g || C.setVisibility(!1), "function" == typeof f && f(C.item) }), this._core.isnull(_.id) && (_.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + _.id), { id: _.id, name: e, checked: g, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, style: _ }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Hi.prototype.createGroundPolylineGeoJsonFeatureLayer = function (e, t, p, i, g, f) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, _ = (this._core.isnull(p) || this._core.isnull(p.material) || "[" == p.material.toString().charAt(0) && "]" == p.material.toString().charAt(p.material.length - 1) || (this._core.isHtmlColor(p.material) ? p.material = this._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p.material) && (p.material = this._color.rgbaStringToRgbaObj(p.material)), 1 < p.material.r && (p.material.r = p.material.r / 255), 1 < p.material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p.material.a && (p.material.a = p.material.a / 255), p.material = this._color.createColor(p.material.r, p.material.g, p.material.b, p.material.a))), this._core.extend(o, p, !0)), o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), C = this, o = (o.then(function (e) { for (var t, i = e.entities.values, o = new C._cesium.PrimitiveCollection, r = 0; r < i.length; r++) { var n = i[r], a = null; if (_.clampToGround) { _.positions = n.polyline.positions._value; var s = { positions: n.polyline.positions._value, width: _.width }, s = new C._cesium.GroundPolylineGeometry(s), a = new C._cesium.GeometryInstance({ id: n, geometry: s, attributes: { color: new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material) } }) } else { for (var l = [], r = 0; r < n.polyline.positions._value.length; r++) { C._viewer.scene.globe.ellipsoid; var c = C._cesium.Cartographic.fromCartesian(n.polyline.positions._value[r]), u = C._cesium.Math.toDegrees(c.longitude), h = C._cesium.Math.toDegrees(c.latitude), c = c.height + _.height, u = new C._cesium.Cartesian3.fromDegrees(u, h, c); l.push(u) } _.positions = l; var s = new C._cesium.PolylineGeometry(_), m = C._cesium.PolylineGeometry.createGeometry(s); a = new C._cesium.GeometryInstance({ id: n, geometry: m, attributes: { color: new C._cesium.ColorGeometryInstanceAttribute.fromColor(_.material) } }) } n.positions = _.positions; var m = "material:" + 255 * _.material.red + "," + 255 * _.material.green + "," + 255 * _.material.blue, d = (C.Legend.push(m), null), d = _.clampToGround ? new C._cesium.GroundPolylinePrimitive({ geometryInstances: a, appearance: new C._cesium.MaterialAppearance({ material: new C._cesium.Material({ fabric: { type: "Color", uniforms: { color: _.material } } }), faceForward: !0, flat: !1 }) }) : new C._cesium.Primitive({ geometryInstances: a, appearance: new C._cesium.PolylineMaterialAppearance({ material: new C._cesium.Material({ fabric: { type: "Color", uniforms: { color: _.material } } }) }), shadows: C._cesium.ShadowMode.ENABLED }); o.add(d) } p && p.time && (t = new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({ start: p.time.start ? C._cesium.JulianDate.fromDate(new Date(p.time.start)) : C._cesium.Iso8601.MINIMUM_VALUE, stop: p.time.end ? C._cesium.JulianDate.fromDate(new Date(p.time.end)) : C._cesium.Iso8601.MAXIMUM_VALUE })])), C._viewer.scene.primitives.add(o, t).show = _.show, C.item = o, g || C.setVisibility(!1), "function" == typeof f && f(C.item) }), this._core.isnull(_.id) && (_.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + _.id), { id: _.id, name: e, checked: g, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t, style: _ }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1 = function (e, t, c, 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 }, u = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c.material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c.material.a && (c.material.a = c.material.a / 255), c.material = this._color.createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.extend(n, c, !0)), h = this, n = new v(this._viewer, this._cesium, a), a = ((this._Provider = n)._loadTile = function (e) { h.Legend = []; var l = new h._cesium.PrimitiveCollection; return e.features.forEach(function (a) { var e, i = [], s = !1; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : (i.push(e[t]), 2 !== t || s || (s = !0)) } if (/^\[/.test(c.material) && /\]$/.test(c.material) && (e = c.material.replace(/\[/, "").replace(/\]/, ""), u.material = a.properties[e], h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u.material.a && (u.material.a = u.material.a / 255), u.material = h._color.createColor(u.material.r, u.material.g, u.material.b, u.material.a))), Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var t = 0; t < a.geometry.coordinates.length; t++)i = [], o(a.geometry.coordinates[t]), r(i); else o(a.geometry.coordinates), r(i); function r(e) { var t = s ? h._cesium.Cartesian3.fromDegreesArrayHeights(e) : h._cesium.Cartesian3.fromDegreesArray(e), i = (u.positions = t, { positions: u.positions, width: u.width }), t = (a.positions = t, a.treeID = u.id, a.VectorType = "polyline", a.VectorStyle = { haveZ: s, width: u.width, positions: e, material: u.material, clampToGround: u.clampToGround }, null); if (u.clampToGround) i = new h._cesium.GroundPolylineGeometry(i), t = new h._cesium.GeometryInstance({ id: a, geometry: i, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }); else { var o = e, r = e.length / 2 + 1 + e.length; /^\[/.test(c.height) && /\]$/.test(c.height) && (i = c.height.replace(/\[/, "").replace(/\]/, ""), u.height = a.properties[i]); for (var n = 2; n < r; n += 3)o.splice(n, 0, parseFloat(u.height)); e = h._cesium.Cartesian3.fromDegreesArrayHeights(o), i = (u.positions = e, a.positions = e, new h._cesium.PolylineGeometry(u)); t = new h._cesium.GeometryInstance({ id: a, geometry: i, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }) } e = "material:" + 255 * u.material.red + "," + 255 * u.material.green + "," + 255 * u.material.blue, h.Legend.push(e), i = null, i = u.clampToGround ? new h._cesium.GroundPolylinePrimitive({ geometryInstances: t, appearance: new h._cesium.MaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: u.material } } }), faceForward: !0, flat: !1 }) }) : new h._cesium.Primitive({ geometryInstances: t, appearance: new h._cesium.PolylineMaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: u.material } } }) }), shadows: h._cesium.ShadowMode.ENABLED }); l.add(i) } }), l }, c && c.time && (n.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.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t.url, style: c }); return this._Provider.treeID = u.id, this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProvider = function (e, t, d, i, o, r) { var n, a = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, outlineWidth: 1, show: !0, material: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.WHITE, gapColor: this._cesium.Color.TRANSPARENT, height: 30 }, s = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: this._core.defaultValue(t.srs, "EPSG:4326") + ":{z}", TILEMATRIXSET: this._core.defaultValue(t.srs, "EPSG:4326"), FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: d.level_min, lowerLevelLimit: d.level_max, Cesium: this._cesium }, p = (this._core.isnull(d) || this._core.isnull(d.material) || "[" == d.material.toString().charAt(0) && "]" == d.material.toString().charAt(d.material.length - 1) || (d.material = Cesium.Color.fromCssColorString(d.material)), this._core.isnull(d) || this._core.isnull(d.outlineColor) || (d.outlineColor = Cesium.Color.fromCssColorString(d.outlineColor)), this._core.isnull(d) || this._core.isnull(d.gapColor) || (d.gapColor = Cesium.Color.fromCssColorString(d.gapColor)), this._core.extend({ ...a }, d, !0)), l = this; let c = -1 < t.url.indexOf("/gisserver/"); n = c ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._core._serialize(s.urlParams), this._urlTemplate = n, this._Provider = new T(this._viewer, this._cesium, c ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = d.level_max - 1, this.initThisProvider = () => { this.initThisProvider = void 0, this._Provider.loadTile = function (e, t) { var u = e, h = t, m = l; if (h.state === Cesium.QuadtreeTileLoadState.START) if (h.data = { lines: [], geometryPrimitive: void 0 }, h.level >= d.level_min && h.level < d.level_max && m.item.show) { if (c && (h.reverseY = m._Provider.tilingScheme.getNumberOfYTilesAtLevel(h.level) - h.y - 1), m.TileMatrixLimits) { var i = m.TileMatrixLimits[h.level]; if (!i || h.x > i.maxCol || h.x < i.minCol || h.y > i.maxRow || h.y < i.minRow) return void (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) } i = n.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.reverseY || h.y).replace(window.encodeURIComponent("{z}"), h.level); m._cache && (i += "&" + m._core.getuid()), m._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { var o, r = [], i = [], n = !1; for (o of e.features) { var t, i = []; function a(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? a(e[t]) : (2 === t && (e[t] = p.height || e[t], n = !0), i.push(e[t]), 1 === t && 2 === e.length && i.push(p.height || 0)) } if (/^\[/.test(d.material) && /\]$/.test(d.material) && (t = d.material.replace(/\[/, "").replace(/\]/, ""), p.material = o.properties[t], p.material = Cesium.Color.fromCssColorString(p.material)), /^\[/.test(d.height) && /\]$/.test(d.height) && (t = d.height.replace(/\[/, "").replace(/\]/, ""), p.height = o.properties[t]), Array.isArray(o.geometry.coordinates) && 0 < o.geometry.coordinates.length) if (Array.isArray(o.geometry.coordinates[0][0])) for (var s = 0; s < o.geometry.coordinates.length; s++)i = [], a(o.geometry.coordinates[s]), l(i); else a(o.geometry.coordinates), l(i); function l(e) { var t = m._cesium.Cartesian3.fromDegreesArrayHeights(e), i = (p.positions = t, { positions: p.positions, width: p.width }), t = (o.positions = t, d.preLoad && d.preLoad(p, o), o.treeID = p.id, o.VectorType = "polyline", o.VectorStyle = { haveZ: n, width: p.width, positions: e, material: p.material, clampToGround: p.clampToGround }, null), i = (t = p.clampToGround ? (i = new m._cesium.GroundPolylineGeometry(i), new m._cesium.GeometryInstance({ id: o, geometry: i, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(p.near, p.far) } })) : (e = new m._cesium.PolylineGeometry(p), new m._cesium.GeometryInstance({ id: o, geometry: e, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(p.near, p.far) } })), "material:" + 255 * p.material.red + "," + 255 * p.material.green + "," + 255 * p.material.blue); m.Legend.push(i), r.push(t) } } e = null; let c; c = p.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineDashType, { color: p.material, gapColor: p.gapColor || Cesium.Color.TRANSPARENT, dashLength: p.dashLength || 20 }) }) : new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: p.material, outlineColor: p.outlineColor, outlineWidth: p.outlineWidth } } }), faceForward: !0, flat: !1 }), e = p.clampToGround ? new m._cesium.GroundPolylinePrimitive({ geometryInstances: r, appearance: c, classificationType: p.classificationType }) : new m._cesium.Primitive({ geometryInstances: r, appearance: c, shadows: m._cesium.ShadowMode.ENABLED }), h.data.geometryPrimitive = e, h.state = Cesium.QuadtreeTileLoadState.LOADING, h.state === Cesium.QuadtreeTileLoadState.LOADING && (h.data.geometryPrimitive.update(u, []), h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0) }, 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 } else h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0 }, "function" == typeof r && r(this.item) }; let u, h; this.saveDefaultVectorData = () => { 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(u), u = 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: c }, 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 }, Hi.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete = function (e, t, c, 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 }, u = (this._core.isnull(c) || this._core.isnull(c.material) || "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) || (this._core.isHtmlColor(c.material) ? c.material = this._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = this._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.r && (c.material.r = c.material.r / 255), 1 < c.material.g && (c.material.g = c.material.g / 255), 1 < c.material.b && (c.material.b = c.material.b / 255), 1 < c.material.a && (c.material.a = c.material.a / 255), c.material = this._color.createColor(c.material.r, c.material.g, c.material.b, c.material.a))), this._core.extend(n, c, !0)), h = this, n = new v(this._viewer, this._cesium, a), a = ((this._Provider = n)._loadTile = function (e, t) { var s = new h._cesium.PrimitiveCollection, l = []; if (e.features.forEach(function (a) { var e, i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : i.push(e[t]) } if (/^\[/.test(c.material) && /\]$/.test(c.material) && (e = c.material.replace(/\[/, "").replace(/\]/, ""), u.material = a.properties[e], h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u.material.a && (u.material.a = u.material.a / 255), u.material = h._color.createColor(u.material.r, u.material.g, u.material.b, u.material.a))), Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var t = 0; t < a.geometry.coordinates.length; t++)i = [], o(a.geometry.coordinates[t]), r(i), n(i); else o(a.geometry.coordinates), r(i), n(i); function r(e) { var t = h._cesium.Cartesian3.fromDegreesArray(e), t = (u.positions = t, a.positions = t, { positions: u.positions, width: u.width }), i = null; if (u.clampToGround) t = new h._cesium.GroundPolylineGeometry(t), i = new h._cesium.GeometryInstance({ id: a, geometry: t, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }); else { for (var o = e, r = e.length / 2 + 1 + e.length, n = 2; n < r; n += 3)o.splice(n, 0, parseFloat(u.height)); t = h._cesium.Cartesian3.fromDegreesArrayHeights(o), e = (u.positions = t, new h._cesium.PolylineGeometry(u)), t = h._cesium.PolylineGeometry.createGeometry(e); i = new h._cesium.GeometryInstance({ id: a, geometry: t, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }) } e = null, e = u.clampToGround ? new h._cesium.GroundPolylinePrimitive({ geometryInstances: i, appearance: new h._cesium.MaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: u.material } } }), faceForward: !0, flat: !1 }) }) : new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PolylineMaterialAppearance({ material: new h._cesium.Material({ fabric: { type: "Color", uniforms: { color: u.material } } }) }), shadows: h._cesium.ShadowMode.ENABLED }); s.add(e) } function n(e) { for (var t = u.clampToGround ? h._cesium.Cartesian3.fromDegreesArray(e) : h._cesium.Cartesian3.fromDegreesArrayHeights(e), i = 1; i < t.length; i++) { var o = [], r = (o.push(t[i - 1]), o.push(t[i]), h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene, t[i - 1]).x), n = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene, t[i - 1]).y, a = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene, t[i]).x, s = h._cesium.SceneTransforms.wgs84ToWindowCoordinates(h._viewer.scene, t[i]).y; h.setPolylinemodels(o, r, n, a, s, u, function (e) { l.push(e) }) } } }), l.length) { let t; Cesium.ModelInstanceCollection ? t = new h._cesium.ModelInstanceCollection({ url: u.url, instances: l, color: u.color, lightColor: u.lightColor, scale: parseInt(u.scale), heightReference: parseInt(u.heightReference), distanceDisplayCondition: u.distanceDisplayCondition }) : (t = new Cesium.PrimitiveCollection, l.forEach(e => { t.add({ id: e.modelId, url: u.url, modelMatrix: e.modelMatrix, color: u.color, lightColor: u.lightColor, scale: parseInt(u.scale), heightReference: parseInt(u.heightReference), distanceDisplayCondition: u.distanceDisplayCondition }) })), s.add(t) } return s }, c && c.time && (n.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.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineLayer", item: this, url: t.url, style: c }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Hi.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.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = this._color.createColor(d.material.r, d.material.g, d.material.b, d.material.a))), this._core.extend(n, d, !0)), s = this, l = (this._urlTemplate = t.url + "?" + this._core._serialize(a.urlParams), t.url + "?" + this._core._serialize(a.urlParams)); this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = d.level_max - 1, this._Provider.loadTile = function (e, t) { var h, m; m = s, (h = t).state === Cesium.QuadtreeTileLoadState.START && (h.data = { lines: [], geometryPrimitive: void 0 }, h.level >= d.level_min && h.level < d.level_max && m.item.show ? (t = l.replace(window.encodeURIComponent("{x}"), h.x).replace(window.encodeURIComponent("{y}"), h.y).replace(window.encodeURIComponent("{z}"), h.level), m._cache && (t += "&" + m._core.getuid()), m._core.xhr({ url: t, type: "get", dataType: "json", success: function (e) { var l = [], a = new m._cesium.PrimitiveCollection, t = e.features, i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : i.push(e[t]) } function r(e) { var t = m._cesium.Cartesian3.fromDegreesArray(e), t = (p.positions = t, c.positions = t, { positions: p.positions, width: p.width }), i = null; if (p.clampToGround) t = new m._cesium.GroundPolylineGeometry(t), i = new m._cesium.GeometryInstance({ id: c, geometry: t, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material) } }); else { for (var o = e, r = e.length / 2 + 1 + e.length, n = 2; n < r; n += 3)o.splice(n, 0, parseFloat(p.height)); t = m._cesium.Cartesian3.fromDegreesArrayHeights(o), e = (p.positions = t, new m._cesium.PolylineGeometry(p)), t = m._cesium.PolylineGeometry.createGeometry(e); i = new m._cesium.GeometryInstance({ id: c, geometry: t, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(p.material) } }) } e = null, e = p.clampToGround ? new m._cesium.GroundPolylinePrimitive({ geometryInstances: i, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: p.material } } }), faceForward: !0, flat: !1 }) }) : new m._cesium.Primitive({ geometryInstances: i, appearance: new m._cesium.PolylineMaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: p.material } } }) }), shadows: m._cesium.ShadowMode.ENABLED }); a.add(e) } function n(e) { for (var t = p.clampToGround ? m._cesium.Cartesian3.fromDegreesArray(e) : m._cesium.Cartesian3.fromDegreesArrayHeights(e), i = 1; i < t.length; i++)try { var o = [], r = (o.push(t[i - 1]), o.push(t[i]), m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene, t[i - 1]).x), n = m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene, t[i - 1]).y, a = m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene, t[i]).x, s = m._cesium.SceneTransforms.wgs84ToWindowCoordinates(m._viewer.scene, t[i]).y; m.setPolylinemodels(o, r, n, a, s, p, function (e) { l.push(e) }) } catch (e) { } } /^\[/.test(d.material) && /\]$/.test(d.material) && (e = d.material.replace(/\[/, "").replace(/\]/, ""), p.material = c.properties[e], m._core.isHtmlColor(p.material) ? p.material = m._color.colorFromHtmlColor(p.material) : (/^rgb/.test(p.material) && (p.material = m._color.rgbaStringToRgbaObj(p.material)), 1 < p.material.r && (p.material.r = p.material.r / 255), 1 < p.material.g && (p.material.g = p.material.g / 255), 1 < p.material.b && (p.material.b = p.material.b / 255), 1 < p.material.a && (p.material.a = p.material.a / 255), p.material = m._color.createColor(p.material.r, p.material.g, p.material.b, p.material.a))); for (var s = 0; s < t.length; s++) { var c = t[s]; if (Array.isArray(c.geometry.coordinates) && 0 < c.geometry.coordinates.length) if (Array.isArray(c.geometry.coordinates[0][0])) for (var u = 0; u < c.geometry.coordinates.length; u++)i = [], o(c.geometry.coordinates[u]), r(i), n(i); else o(c.geometry.coordinates), r(i), n(i) } if (l.length) { let t; Cesium.ModelInstanceCollection ? t = new m._cesium.ModelInstanceCollection({ url: p.url, instances: l, color: p.color, lightColor: p.lightColor, scale: parseInt(p.scale), heightReference: parseInt(p.heightReference), distanceDisplayCondition: p.distanceDisplayCondition }) : (t = new Cesium.PrimitiveCollection, l.forEach(e => { 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) : (h.state = Cesium.QuadtreeTileLoadState.DONE, h.renderable = !0)) }, 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 }, Hi.prototype.setPolylinemodels = function (e, t, i, o, r, n, a) { for (var s = this._cesium, l = this._core.getSpaceDistancem(e, s), c = 10, u = parseFloat(n.distance), l = (0 != u && (c = parseInt(l / u)), e[0]), u = 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(u), e = s.Math.toDegrees(l.longitude), u = s.Math.toDegrees(l.latitude), d = c, p = s.Math.lerp(h, e, 1 / d) - h, g = s.Math.lerp(m, u, 1 / d) - m, f = 0; f < d; f++) { var _ = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(h + (f + 1) * p, m + (f + 1) * g, parseInt(n.height))); Cesium.Matrix4.multiplyByUniformScale(_, parseInt(n.scale), _), a && a({ modelMatrix: _, modelId: n }) } }, Hi.prototype.getType = function () { return { label: "线", value: "polylineLayer" } }, Hi.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Hi.prototype.deleteObject = function () { if (this._viewer.scene.primitives.remove(this.item), null != this.model && null != this.model && 0 < this.model.length) for (var e = 0; e < this.model.length; e++)this._viewer.scene.primitives.remove(this.model[e]); try { this._Provider.remove() } catch (e) { } }, Hi.prototype.setTreeobj = function (e) { this.treeobj = e }, Hi.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Hi.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, Hi.prototype.setVisibility = function (e) { if (null != this.item && (this.item.show = e), this._Provider && this._Provider.setStatus(e), null != this.model && null != this.model && 0 < this.model.length) for (var t = 0; t < this.model.length; t++)this.model[t].show = e }, Hi.prototype.edit = function (e, t) { return this.editoption = t, this.isEditting = e, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, Hi.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }, P.prototype.exectPointModel = function (e, t, f, i, _, C) { var o = { positions: [], arcType: this._cesium.ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE, height: 30 }, y = (this._core.isnull(f) || this._core.isnull(f.material) || "[" == f.material.toString().charAt(0) && "]" == f.material.toString().charAt(f.material.length - 1) || (this._core.isHtmlColor(f.material) ? f.material = this._color.colorFromHtmlColor(f.material) : (/^rgb/.test(f.material) && (f.material = this._color.rgbaStringToRgbaObj(f.material)), 1 < f.material.r && (f.material.r = f.material.r / 255), 1 < f.material.g && (f.material.g = f.material.g / 255), 1 < f.material.b && (f.material.b = f.material.b / 255), 1 < f.material.a && (f.material.a = f.material.a / 255), f.material = this._color.createColor(f.material.r, f.material.g, f.material.b, f.material.a))), this._core.isnull(f) || this._core.isnull(f.color) || "[" == f.color.toString().charAt(0) && "]" == f.color.toString().charAt(f.color.length - 1) || (this._core.isHtmlColor(f.color) ? f.color = this._color.colorFromHtmlColor(f.color) : (/^rgb/.test(f.color) && (f.color = this._color.rgbaStringToRgbaObj(f.color)), 1 < f.color.r && (f.color.r = f.color.r / 255), 1 < f.color.g && (f.color.g = f.color.g / 255), 1 < f.color.b && (f.color.b = f.color.b / 255), 1 < f.color.a && (f.color.a = f.color.a / 255), f.color = this._color.createColor(f.color.r, f.color.g, f.color.b, f.color.a))), this._core.isnull(f) || this._core.isnull(f.lightColor) || "[" == f.lightColor.toString().charAt(0) && "]" == f.lightColor.toString().charAt(f.lightColor.length - 1) || (this._core.isHtmlColor(f.lightColor) ? f.lightColor = this._color.colorFromHtmlColor(f.lightColor) : (/^rgb/.test(f.lightColor) && (f.lightColor = this._color.rgbaStringToRgbaObj(f.lightColor)), 1 < f.lightColor.r && (f.lightColor.r = f.lightColor.r / 255), 1 < f.lightColor.g && (f.lightColor.g = f.lightColor.g / 255), 1 < f.lightColor.b && (f.lightColor.b = f.lightColor.b / 255), 1 < f.lightColor.a && (f.lightColor.a = f.lightColor.a / 255), f.lightColor = this._color.createColor(f.lightColor.r, f.lightColor.g, f.lightColor.b, f.lightColor.a))), this._core.isnull(f) || this._core.isnull(f.linecolor) || "[" == f.linecolor.toString().charAt(0) && "]" == f.linecolor.toString().charAt(f.linecolor.length - 1) || (this._core.isHtmlColor(f.linecolor) ? f.linecolor = this._color.colorFromHtmlColor(f.linecolor) : (/^rgb/.test(f.linecolor) && (f.linecolor = this._color.rgbaStringToRgbaObj(f.linecolor)), 1 < f.linecolor.r && (f.linecolor.r = f.linecolor.r / 255), 1 < f.linecolor.g && (f.linecolor.g = f.linecolor.g / 255), 1 < f.linecolor.b && (f.linecolor.b = f.linecolor.b / 255), 1 < f.linecolor.a && (f.linecolor.a = f.linecolor.a / 255), f.linecolor = this._color.createColor(f.linecolor.r, f.linecolor.g, f.linecolor.b, f.linecolor.a))), this._core.extend(o, f, !0)), o = (this._core.isnull(f.near) && (f.near = 0), this._core.isnull(f.far) && (f.far = 999999999), parseFloat(f.near)), r = parseFloat(f.far), o = new this._cesium.DistanceDisplayCondition(o, r), r = (y.distanceDisplayCondition = o, null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), v = this, o = (r.then(function (e) { e.entities.values; for (var t, i = [], o = e.entities.values, i = [], r = 0; r < o.length; r++) { var n = o[r], a = new v._cesium.GeometryInstance({ id: n, geometry: new v._cesium.CorridorGeometry({ positions: n.polyline.positions._value, width: y.width, height: y.height, arcType: y.arcType, vertexFormat: v._cesium.VertexFormat.POSITION_ONLY }), attributes: { color: new v._cesium.ColorGeometryInstanceAttribute.fromColor(y.linecolor) } }); i.push(a) } f && f.time && (t = new v._cesium.TimeIntervalCollection([new v._cesium.TimeInterval({ start: f.time.start ? v._cesium.JulianDate.fromDate(new Date(f.time.start)) : v._cesium.Iso8601.MINIMUM_VALUE, stop: f.time.end ? v._cesium.JulianDate.fromDate(new Date(f.time.end)) : v._cesium.Iso8601.MAXIMUM_VALUE })])); for (var e = v._viewer.scene.primitives.add(new v._cesium.GroundPrimitive({ geometryInstances: i, classificationType: v._cesium.ClassificationType.BOTH }), t), s = (e.show = y.show, v.item = e, []), r = 0; r < o.length; r++)for (var l = (n = o[r]).polyline.positions.getValue(), c = 1; c < l.length; c++)try { var u = [], h = (u.push(l[c - 1]), u.push(l[c]), v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene, l[c - 1]).x), m = v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene, l[c - 1]).y, d = v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene, l[c]).x, p = v._cesium.SceneTransforms.wgs84ToWindowCoordinates(v._viewer.scene, l[c]).y, s = v.setPolylinemodels(u, h, m, d, p, s, y, v._cesium, v._viewer, t) } catch (e) { } let g; Cesium.ModelInstanceCollection ? g = new v._cesium.ModelInstanceCollection({ url: y.url, instances: s, color: y.color, lightColor: y.lightColor, scale: parseInt(y.scale), heightReference: parseInt(y.heightReference), distanceDisplayCondition: y.distanceDisplayCondition }) : (g = new Cesium.PrimitiveCollection, s.forEach(e => { 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, u) { 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 = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (n.point = e.point), "" != e.polyline && null != e.polyline && (n.polyline = e.polyline)), this._core.CreateTooltip()), y = { spot: [], distance: [], label: [], polyline: [], model: [] }, a = (m.setInputAction(function (e) { 0 === d.length ? C.showAt(e.endPosition, "左键开始,右键结束!") : C.showAt(e.endPosition, "右键结束!"); e = h._viewer.camera.getPickRay(e.endPosition); o = h._viewer.scene.globe.pick(e, h._viewer.scene), 2 <= d.length && (h._cesium.defined(t) ? (d.pop(), d.push(o)) : t = new a(d), i = h._core.getHorizontalDistance(d, h._cesium)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), m.setInputAction(function (e) { var t = h._viewer.camera.getPickRay(e.position), t = (o = h._viewer.scene.globe.pick(t, h._viewer.scene), 0 == d.length && d.push(o.clone()), { px: e.position.x, py: e.position.y }), e = (d.push(o), { positionsxp: o, lxy: t }); _.push(e), y.spot.push(o), y.distance.push(i) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), m.setInputAction(function (e) { m.destroy(), d.pop(); for (var t = 0; t < p.length; t++)h._viewer.entities.remove(p[t]); for (var i = [], o = 1; o < _.length; o++) { var r = [], n = _[o - 1].lxy.px, a = _[o - 1].lxy.py, s = _[o].lxy.px, l = _[o].lxy.py, c = g; r.push(_[o - 1].positionsxp), r.push(_[o].positionsxp), i = h.setPolylinemodel(r, n, a, s, l, c, f, h.modelurl, i, h._cesium, h._viewer) } y.model = i, "" != u && null != u && "function" == typeof u && u(y), C.show(!1) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), s.prototype._init = function () { var e = this, t = (this.options.polyline.positions = new h._cesium.CallbackProperty(function () { return e.positions }, !1), h._viewer.entities.add(this.options)); h.item = t, p.push(t), y.polyline.push(t) }, s); function s(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: n.polyline, width: 3, clampToGround: !0 } }, this.positions = e, this._init() } return this }, P.prototype.setPolylinemodel = function (e, t, i, o, r, n, a, s, l, c, u) { for (var h = this._core.getSpaceDistancem(e, c), h = (0 != a && (n = parseInt(h / a)), e[0]), a = e[e.length - 1], e = c.Cartographic.fromCartesian(h), m = c.Math.toDegrees(e.longitude), d = c.Math.toDegrees(e.latitude), h = (e.height, c.Cartographic.fromCartesian(a)), e = c.Math.toDegrees(h.longitude), a = c.Math.toDegrees(h.latitude), p = (h.height, n), g = c.Math.lerp(m, e, 1 / p) - m, f = c.Math.lerp(d, a, 1 / p) - d, _ = c.Math.lerp(t, o, 1 / p) - t, C = c.Math.lerp(i, r, 1 / p) - i, y = 0; y < p; y++) { var v = m + (y + 1) * g, w = d + (y + 1) * f; (0 == y || 1 == y) && new c.Cartesian3(v, w, 0); v = t + (y + 1) * _, w = i + (y + 1) * C; var b = u.camera.pickEllipsoid({ x: v, y: w }, u.scene.globe.ellipsoid), b = c.Cartographic.fromCartesian(b), v = c.Math.toDegrees(b.longitude), w = c.Math.toDegrees(b.latitude), b = c.Transforms.eastNorthUpToFixedFrame(c.Cartesian3.fromDegrees(v, w, 6)), v = c.Model.fromGltf({ url: s, modelMatrix: b, scale: 100 }); u.scene.primitives.add(v), l.push(v) } return l }, P.prototype.setPolylinemodels_obsolete = function (e, t, i, o, r, n, a, s, l, c) { var u = this._core.getSpaceDistancem(e, s), h = 10, m = parseFloat(a.distance), u = (0 != m && (h = parseInt(u / m)), e[0]), m = e[e.length - 1], e = s.Cartographic.fromCartesian(u), d = s.Math.toDegrees(e.longitude), p = s.Math.toDegrees(e.latitude), u = (e.height, s.Cartographic.fromCartesian(m)), m = s.Math.toDegrees(u.longitude), g = s.Math.toDegrees(u.latitude), f = (u.height, s.Math.toDegrees(e.height), h), _ = s.Math.lerp(d, m, 1 / f) - d, C = s.Math.lerp(p, g, 1 / f) - p; s.Math.lerp(t, o, 1 / f), s.Math.lerp(i, r, 1 / f); for (var y = 0; y < f; y++) { var v = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d + (y + 1) * _, p + (y + 1) * C, a.height)), v = (parseInt(a.heightReference), s.Model.fromGltf({ url: a.url, modelMatrix: v, color: a.color, lightColor: a.lightColor, scale: parseInt(a.scale), heightReference: parseInt(a.heightReference), distanceDisplayCondition: a.distanceDisplayCondition })); l.scene.primitives.add(v, c), n.push(v) } return n }, P.prototype.setPolylinemodels = function (e, t, i, o, r, n, a, s, l, c) { var u = this._core.getSpaceDistancem(e, s), h = 10, m = parseFloat(a.distance), u = (0 != m && (h = parseInt(u / m)), e[0]), m = e[e.length - 1], e = s.Cartographic.fromCartesian(u), d = s.Math.toDegrees(e.longitude), p = s.Math.toDegrees(e.latitude), u = (e.height, s.Cartographic.fromCartesian(m)), m = s.Math.toDegrees(u.longitude), g = s.Math.toDegrees(u.latitude), f = (u.height, s.Math.toDegrees(e.height), h), _ = s.Math.lerp(d, m, 1 / f) - d, C = s.Math.lerp(p, g, 1 / f) - p; s.Math.lerp(t, o, 1 / f), s.Math.lerp(i, r, 1 / f); for (var y = 0; y < f; y++) { var v = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(d + (y + 1) * _, p + (y + 1) * C, parseInt(a.height || 0))); parseInt(a.heightReference), Cesium.Matrix4.multiplyByUniformScale(v, parseInt(a.scale), v), n.push({ modelMatrix: v, modelId: a }) } return n }, P.prototype.createPolygonModel = function (e, t, m, i, o, d) { var p, r = { height: 0, extrudedHeight: 0, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, 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, scale: 1, classificationType: this._cesium.ClassificationType.BOTH }, g = m.modelurl, f = (this._core.isnull(m) || this._core.isnull(m.fill) || (this._core.isHtmlColor(m.fill) ? m.material = this._color.colorFromHtmlColor(m.fill) : (/^rgb/.test(m.fill) && (m.material = this._color.rgbaStringToRgbaObj(m.fill)), 1 < m.material.r && (m.material.r = m.material.r / 255), 1 < m.material.g && (m.material.g = m.material.g / 255), 1 < m.material.b && (m.material.b = m.material.b / 255), 1 < m.material.a && (m.material.a = m.material.a / 255), m.material = this._color.createColor(m.material.r, m.material.g, m.material.b, m.material.a))), this._core.isnull(m) || this._core.isnull(m.outlineColor) || (this._core.isHtmlColor(m.outlineColor) ? m.outlineColor = this._color.colorFromHtmlColor(m.outlineColor) : (/^rgb/.test(m.outlineColor) && (m.outlineColor = this._color.rgbaStringToRgbaObj(m.outlineColor)), 1 < m.outlineColor.r && (m.outlineColor.r = m.outlineColor.r / 255), 1 < m.outlineColor.g && (m.outlineColor.g = m.outlineColor.g / 255), 1 < m.outlineColor.b && (m.outlineColor.b = m.outlineColor.b / 255), 1 < m.outlineColor.a && (m.outlineColor.a = m.outlineColor.a / 255), m.outlineColor = this._color.createColor(m.outlineColor.r, m.outlineColor.g, m.outlineColor.b, m.outlineColor.a))), this._core.isnull(m) || this._core.isnull(m.color) || (this._core.isHtmlColor(m.color) ? m.color = this._color.colorFromHtmlColor(m.color) : (/^rgb/.test(m.color) && (m.color = this._color.rgbaStringToRgbaObj(m.color)), 1 < m.color.r && (m.color.r = m.color.r / 255), 1 < m.color.g && (m.color.g = m.color.g / 255), 1 < m.color.b && (m.color.b = m.color.b / 255), 1 < m.color.a && (m.color.a = m.color.a / 255), m.color = this._color.createColor(m.color.r, m.color.g, m.color.b, m.color.a))), this._core.isnull(m) || this._core.isnull(m.lightColor) || (this._core.isHtmlColor(m.lightColor) ? m.lightColor = this._color.colorFromHtmlColor(m.lightColor) : (/^rgb/.test(m.lightColor) && (m.lightColor = this._color.rgbaStringToRgbaObj(m.lightColor)), 1 < m.lightColor.r && (m.lightColor.r = m.lightColor.r / 255), 1 < m.lightColor.g && (m.lightColor.g = m.lightColor.g / 255), 1 < m.lightColor.b && (m.lightColor.b = m.lightColor.b / 255), 1 < m.lightColor.a && (m.lightColor.a = m.lightColor.a / 255), m.lightColor = this._color.createColor(m.lightColor.r, m.lightColor.g, m.lightColor.b, m.lightColor.a))), this._core.extend(r, m, !0)), r = (m.checked = o, f.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND, null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t, { clampToGround: !0 }), _ = (this._viewer.dataSources.add(r), this), r = (m && m.time && (p = 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 })])), r.then(function (e) { _.item = e, _.model = []; var t = e.entities.values, i = (_._core.isnull(m.near) && (m.near = 0), _._core.isnull(m.far) && (m.far = 999999999), parseFloat(m.near)), o = parseFloat(m.far), r = new _._cesium.DistanceDisplayCondition(i, o); f.distanceDisplayCondition = r; for (var n = 0; n < t.length; n++) { for (var a = t[n], s = (f.height = parseFloat(_._core.extendgl(a, m.height, f.height)), f.extrudedHeight = parseFloat(_._core.extendgl(a, m.extrudedHeight, f.extrudedHeight)), f.heightReference = _._core.extendgl(a, m.heightReference, f.heightReference), f.show = _._core.extendgl(a, m.show, f.show), f.material = _._core.extendgl(a, m.material, f.material), f.outline = _._core.extendgl(a, m.outline, f.outline), f.outlineColor = _._core.extendgl(a, m.outlineColor, f.outlineColor), f.outlineWidth = parseFloat(_._core.extendgl(a, m.outlineWidth, f.outlineWidth)), f.stRotation = _._core.extendgl(a, m.stRotation, f.stRotation), f.granularity = _._core.extendgl(a, m.granularity, f.granularity), f.distanceDisplayCondition = _._core.extendgl(a, m.distanceDisplayCondition, f.distanceDisplayCondition), f.perPositionHeight = _._core.extendgl(a, m.perPositionHeight, f.perPositionHeight), f.closeTop = _._core.extendgl(a, m.closeTop, f.closeTop), f.closeBottom = _._core.extendgl(a, m.closeBottom, f.closeBottom), f.shadows = _._core.extendgl(a, m.shadows, f.shadows), f.classificationType = _._core.extendgl(a, m.classificationType, f.classificationType), a.polygon._hierarchy._value.positions, a.polygon.heightReference = 1, a.polygon.show = f.show, a.polygon.material = f.material, a.polygon.outline = f.outline, a.polygon.outlineColor = f.outlineColor, a.polygon.outlineWidth = f.outlineWidth, a.polygon.stRotation = f.stRotation, a.polygon.granularity = f.granularity, a.polygon.distanceDisplayCondition = r, a.polygon.closeTop = f.closeTop, a.polygon.closeBottom = f.closeBottom, a.polygon.shadows = f.shadows, a.polygon.classificationType = f.classificationType, p && (a.availability = p), []), l = a.polygon.hierarchy.getValue().positions, c = 0; c < l.length; c++) { var u = _._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[c]).longitude), h = _._cesium.Math.toDegrees(_._cesium.Cartographic.fromCartesian(l[c]).latitude); s.push(u), s.push(h) } a = _.getTheBottomPoint(s); _.scanningPolygon(a, f.offset_x, f.offset_y, s).forEach(function (e) { e = _._cesium.Transforms.eastNorthUpToFixedFrame(_._cesium.Cartesian3.fromDegrees(e.lon, e.lat, f.height)), e = _._cesium.Model.fromGltf({ url: g, color: f.color, silhouetteColor: f.lightColor, silhouetteSize: f.lightWidth, modelMatrix: e, scale: f.scale, heightReference: parseInt(f.heightReference), distanceDisplayCondition: r }); _._viewer.scene.primitives.add(e, p), e.time = p, _.model.push(e) }) } m.checked || _.setVisibility(!1), "function" == typeof d && d(e) }), this._core.isnull(f.id) && (f.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + f.id), { id: f.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t, style: f }); return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i), this }, P.prototype.setItem = function (e) { this.item = e }, P.prototype.modelMove = function () { this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this.yd = !1; var r = this; this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this._tree.handler.setInputAction(function (e) { r._viewer.scene.pickPosition(e.position); var t, i, o, e = r._viewer.scene.pick(e.position); null != r.yd && r.yd && r._tree.handler.destroy(), r.yd = !0, null != e.tileset && (t = e.tileset, i = r._cesium.Cartographic.fromCartesian(t.boundingSphere.center), o = r._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, i.height), r._tree.handler.setInputAction(function (e) { e = r._viewer.scene.pickPosition(e.endPosition), e = r._cesium.Cartographic.fromCartesian(e), e = r._cesium.Cartesian3.fromRadians(e.longitude, e.latitude, i.height), e = r._cesium.Cartesian3.subtract(e, o, new r._cesium.Cartesian3); t.modelMatrix = r._cesium.Matrix4.fromTranslation(e) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE)) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK) }, P.prototype.getTheBottomPoint = function (e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2)t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, P.prototype.scanningPolygon = function (e, t, i, o) { for (var r, n, a, s = [], l = 180, c = -180, u = -90, h = 0; h < o.length; h += 2)u = u > o[h + 1] ? u : o[h + 1], l = l < o[h] ? l : o[h], c = c > o[h] ? c : 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 <= u; 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 <= c; 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; l < i.length - 2; l += 2)o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, P.prototype.createModel = function (e, t, i, o, r, n) { var t = { id: this._core.getuid(), uri: t, show: !0, heading: 0, pitch: 0, roll: 0, scale: 1 }, i = this._core.extend(t, i, !0), e = (this._position = e, { id: i.id, position: this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), model: i }), a = ((i.heading || i.pitch || i.roll) && (this.heading = i.heading, this.pitch = i.pitch, this.roll = i.roll, e.orientation = this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(i.heading, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(i.pitch, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(i.roll, 0))))), this); i.rotate && (e.orientation = new this._cesium.CallbackProperty(function () { return a.heading = a.heading + a.rotate, a._cesium.Transforms.headingPitchRollQuaternion(a._cesium.Cartesian3.fromDegrees(a._position[0], a._position[1], a._position[2]), new a._cesium.HeadingPitchRoll(a._cesium.Math.toRadians(a._cesium.defaultValue(a.heading, 0)), a._cesium.Math.toRadians(a._cesium.defaultValue(a.pitch, 0)), a._cesium.Math.toRadians(a._cesium.defaultValue(a.roll, 0)))) }, !1), a.rotate = i.rotate, delete i.rotate), delete i.heading, delete i.pitch, delete i.roll, e.model = i, this.item = this._viewer.entities.add(e), "function" == typeof n && n(this.item); i = { id: this.item.id, name: r || "新建模型" + t.id, pId: this._core.isnull(o) ? 0 : o, type: "Point", item: this.item }; return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, P.prototype.createModelEditable = function (e, t, i, o, r, n) { var t = { id: this._core.getuid(), uri: t, show: !0, heading: 0, pitch: 0, roll: 0, scale: 1 }, i = this._core.extend(t, i, !0), e = (this._position = e, { position: this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), model: i }), a = this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), s = this.createCylinder(a, new this._cesium.CallbackProperty(function () { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(l.pitch), l._cesium.Math.toRadians(l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(c, !1), new this._cesium.CallbackProperty(u, !1), this._cesium.Color.LIMEGREEN, !1), s = (s.oid = 1, this.modelPointArr.push(s), this.createCylinder(a, new this._cesium.CallbackProperty(function () { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(90 + l.pitch), l._cesium.Math.toRadians(l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(c, !1), new this._cesium.CallbackProperty(u, !1), this._cesium.Color.MEDIUMBLUE, !1)), s = (s.oid = 2, this.modelPointArr.push(s), this.createCylinder(a, new this._cesium.CallbackProperty(function () { var e = l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[2]), t = l._cesium.Math.toRadians(l.heading), t = new l._cesium.HeadingPitchRoll(t, l._cesium.Math.toRadians(l.pitch), l._cesium.Math.toRadians(90 + l.roll)); return l._cesium.Transforms.headingPitchRollQuaternion(e, t) }, !1), new this._cesium.CallbackProperty(c, !1), new this._cesium.CallbackProperty(u, !1), this._cesium.Color.RED, !1)), s = (s.oid = 3, this.modelPointArr.push(s), this.creatBillboard(a, new this._cesium.CallbackProperty(function () { return new l._cesium.Cartesian2(0, -(l.Radius * l.scale)) }, !1), "../../img/j.png", !1)), s = (s.oid = 4, this.modelPointArr.push(s), this.creatBillboard(a, new this._cesium.CallbackProperty(function () { return new l._cesium.Cartesian2(-(l.Radius * l.scale), 0) }, !1), "../../img/s.png", !1)), l = (s.oid = 5, this.modelPointArr.push(s), (i.heading || i.pitch || i.roll) && (this.heading = i.heading, this.pitch = i.pitch, this.roll = i.roll, e.orientation = this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(i.heading, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(i.pitch, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(i.roll, 0))))), this); function c() { return l.Radius * l.scale } function u() { return 100 * l.Radius } i.rotate && (e.orientation = new this._cesium.CallbackProperty(function () { return l.heading = l.heading + l.rotate, l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[2]), new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading, 0)), l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch, 0)), l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll, 0)))) }, !1), l.rotate = i.rotate, delete i.rotate), e.orientation = new this._cesium.CallbackProperty(function () { return l._cesium.Transforms.headingPitchRollQuaternion(l._cesium.Cartesian3.fromDegrees(l._position[0], l._position[1], l._position[2]), new l._cesium.HeadingPitchRoll(l._cesium.Math.toRadians(l._cesium.defaultValue(l.heading, 0)), l._cesium.Math.toRadians(l._cesium.defaultValue(l.pitch, 0)), l._cesium.Math.toRadians(l._cesium.defaultValue(l.roll, 0)))) }, !1), l.scale = i.scale, e.model.scale = new this._cesium.CallbackProperty(function () { return l.scale }, !1), delete i.heading, delete i.pitch, delete i.roll, e.model = i, this.item = this._viewer.entities.add(e), this.item.objId = this.objId, this.state = 1, "function" == typeof n && n(this.item); a = { id: this.item.id, name: r || "新建模型" + t.id, pId: this._core.isnull(o) ? 0 : o, type: "Point", item: this.item }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), this }, P.prototype.createOrientation = function (e, t, i) { var o = this._cesium.Math.toRadians(0), o = new this._cesium.HeadingPitchRoll(o, this._cesium.Math.toRadians(t), this._cesium.Math.toRadians(i)); return this._cesium.Transforms.headingPitchRollQuaternion(e, o) }, P.prototype.createCylinder = function (e, t, i, o, r, n) { if (e) return this._viewer.entities.add({ position: e, orientation: t, cylinder: { length: 10, topRadius: i, bottomRadius: i, fill: !1, material: r.withAlpha(.5), outline: !0, outlineWidth: 10, outlineColor: r, numberOfVerticalLines: o, slices: o }, show: n }) }, P.prototype.startModify = function () { if (2 == this.state || 1 == this.state) { var r = this; this.modifyHandler || (this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas)); for (var n, a, s, l, c, u, e = 0; e < r.modelPointArr.length; e++) { var t = r.modelPointArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function (e) { var t = r._viewer.scene.pick(e.position), t = (r._cesium.defined(t) && t.id && (t.id.objId ? r.modifyModel = t.id : !r.modifyPoint || 4 != r.modifyPoint.oid && 5 != r.modifyPoint.oid ? r.modifyPoint = t.id : (t.id.oid != r.modifyPoint.oid && (r.modifyPoint = t.id), 4 == r.modifyPoint.oid ? r.scale = r.scale + 1 : r.scale = r.scale - 1), r.forbidDrawWorld(!0)), r._cesium.Cartesian3.fromDegrees(r._position[0], r._position[1], r._position[2])); n = r._cesium.SceneTransforms.wgs84ToWindowCoordinates(r._viewer.scene, t), a = e.position, l = r.heading + 0, u = r.roll + 0, c = r.pitch + 0, r.state = 2 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function (e) { e = r._viewer.scene.pick(e.position); if (!r._cesium.defined(e) || !e.id) { for (var t = 0; t < r.modelPointArr.length; t++) { var i = r.modelPointArr[t]; i && (i.show = !1) } r.modifyHandler && (r.modifyHandler.destroy(), r.modifyHandler = null) } }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.modifyHandler.setInputAction(function (e) { if (r._viewer.scene.pick(e.endPosition), r.modifyModel || r.modifyPoint) { var t = r._viewer.scene.pickPosition(e.endPosition); if (t) if (r.modifyModel) { r.item.position.setValue(t); for (var i = 0; i < r.modelPointArr.length; i++) { var o = r.modelPointArr[i]; o && o.position.setValue(t) } } else r.modifyPoint && (s = e.endPosition, e = r.arge(n, a, s), 1 == r.modifyPoint.oid ? r.heading = l + e : 2 == r.modifyPoint.oid ? r.roll = u + e : 3 == r.modifyPoint.oid && (r.pitch = c + e)) } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function (e) { !r.modifyPoint && !r.modifyModel || r.modifyPoint && (4 == r.modifyPoint.oid || 5 == r.modifyPoint.oid) || (r.modifyPoint = null, r.modifyModel = null, r.forbidDrawWorld(!1)) }, this._cesium.ScreenSpaceEventType.LEFT_UP) } }, P.prototype.creatBillboard = function (e, t, i, o) { e = this._viewer.entities.add({ position: e, show: o, billboard: { image: i, pixelOffset: t, verticalOrigin: this._cesium.VerticalOrigin.BOTTOM } }); return e.attr = "editPoint", e }, P.prototype.arge = function (e, t, i) { var o = Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)), e = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), t = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2)), i = (Math.pow(o, 2) + Math.pow(e, 2) - Math.pow(t, 2)) / (2 * o * e); return Math.round(180 * Math.acos(i) / Math.PI) }, P.prototype.forbidDrawWorld = function (e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene.screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController.enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, P.prototype.getCatesian3FromPX = function (e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++)if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, P.prototype.setTreeobj = function (e) { this.treeobj = e }, P.prototype.setVisibility = function (e) { if (this.item.item ? this.item.item.show = e : this.item.show = e, 0 < this.model.length) for (var t = 0; t < this.model.length; t++)this.model[t].show = e, this.model[t]._availability && !e ? this.model[t]._availability = void 0 : this.model[t].time && e && (this.model[t]._availability = this.model[t].time) }, P.prototype.setOrientation = function (e) { (e.heading || e.pitch || e.roll) && (this.item.orientation = this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2]), new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(e.heading, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(e.pitch, 0)), this._cesium.Math.toRadians(this._cesium.defaultValue(e.roll, 0))))) }, P.prototype.setScale = function (e) { this.item && this.item.model && (this.item.model.scale = e) }, P.prototype.setPosition = function (e) { this.item && this.item.model && (this._position = e, this.item.position = this._cesium.Cartesian3.fromDegrees(this._position[0], this._position[1], this._position[2])) }, P.prototype.getVisibility = function () { return this.item.show }, P.prototype.deleteObject = function () { if (this.model && this.model.length) for (var e = 0; e < this.model.length; e++)this._viewer.scene.primitives.remove(this.model[e]); try { this._viewer.scene.primitives.remove(this.item) } catch (e) { } try { this._viewer.entities.remove(this.item) } catch (e) { } try { this._viewer.dataSources.remove(this.item) } catch (e) { } try { this._Provider.remove() } catch (e) { } }, Gi.prototype.createPolygonGeoJsonFeatureLayer = function (e, t, i, o, n) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, a = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.extend(r, i, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), s = this, l = [], i = (r.then(function (e) { for (var t = e.entities.values, i = 0; i < t.length; i++) { var o = t[i], o = (a.polygonHierarchy = new s._cesium.PolygonHierarchy(o.polygon.hierarchy._value.positions), new s._cesium.PolygonGeometry(a)), o = s._cesium.PolygonGeometry.createGeometry(o), o = new s._cesium.GeometryInstance({ geometry: o }); l.push(o) } var e = s._viewer.scene.primitives.add(new s._cesium.Primitive({ geometryInstances: l, appearance: new s._cesium.MaterialAppearance({ material: new s._cesium.Material({ fabric: { type: "Color", uniforms: { color: a.material } } }), faceForward: !0, flat: !1 }) })), r = "material:" + 255 * a.material.red + "," + 255 * a.material.green + "," + 255 * a.material.blue; s.Legend.push(r), s.item = e, 0 == a.show && (e.show = !1), "function" == typeof n && n(e) }), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), { id: a.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t, style: a }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, Gi.prototype.deleteObject = function () { if (null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++)this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if (null != this.model && null != this.model && 0 < this.model.length) for (e = 0; e < this.model.length; e++)this._viewer.scene.primitives.remove(this.model[e]); try { this._Provider.remove() } catch (e) { } }, Gi.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, Gi.prototype.setVisibility = function (e) { if (null != this.items && null != this.items && 0 < this.items.length) for (var t = 0; t < this.items.length; t++)this.items[t].show = e; else this.item.show = e; if (null != this.model && null != this.model && 0 < this.model.length) for (t = 0; t < this.model.length; t++)this.model[t].show = e; this._Provider && this._Provider.setStatus(!e) }, Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProvider = function (e, t, a, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, 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(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core.extend(n, a, !0)), c = (0 == l.extrudedHeight && (l.extrudedHeight = 999999), this.items = [], this), u = new v(this._viewer, this._cesium, s), n = ((this._Provider = u)._loadTile = function (e) { var n = []; if (scene.primitives, c.Legend = [], new c._cesium.PrimitiveCollection, e.features.forEach(function (i) { if (u._isCameraMoving) return null; var o = []; function r(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? r(e[t]) : o.push(e[t]) } if (Array.isArray(i.geometry.coordinates) && 0 < i.geometry.coordinates.length) if (Array.isArray(i.geometry.coordinates[0][0])) for (var e = 0; e < i.geometry.coordinates.length; e++)o = [], r(i.geometry.coordinates[e]), t(o); else r(i.geometry.coordinates), t(o); function t(e) { var t; u._isCameraMoving || (e = c._cesium.Cartesian3.fromDegreesArray(e), /^\[/.test(a.extrudedHeight) && /\]$/.test(a.extrudedHeight) && (t = a.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), l.extrudedHeight = parseFloat(i.properties[t])), l.extrudedHeight = parseFloat(l.extrudedHeight), 1 == l.heightReference && delete l.height, 1 == l.extrudedHeightReference && delete l.extrudedHeight, /^\[/.test(a.material) && /\]$/.test(a.material) && (t = a.material.replace(/\[/, "").replace(/\]/, ""), l.material = i.properties[t], c._core.isHtmlColor(l.material) ? l.material = c._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = c._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = c._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), l.polygonHierarchy = new c._cesium.PolygonHierarchy(e), i.positions = e, t = new c._cesium.PolygonGeometry(l), e = null, e = new c._cesium.GeometryInstance({ id: i, geometry: t, attributes: { color: new c._cesium.ColorGeometryInstanceAttribute.fromColor(l.material) } }), t = "material:" + 255 * l.material.red + "," + 255 * l.material.green + "," + 255 * l.material.blue, c.Legend.push(t), n.push(e)) } }), 0 < n.length) return new c._cesium.GroundPrimitive({ geometryInstances: n, appearance: new c._cesium.PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: l.classificationType }) }, this.item = u._primitiveCollection, u.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel = function (e, t, l, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 999999, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, 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, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, c = l.material, u = l.height, h = (this._core.isnull(l) || this._core.isnull(l.color) || (this._core.isHtmlColor(l.color) ? l.color = this._color.colorFromHtmlColor(l.color) : (/^rgb/.test(l.color) && (l.color = this._color.rgbaStringToRgbaObj(l.color)), 1 < l.color.r && (l.color.r = l.color.r / 255), 1 < l.color.g && (l.color.g = l.color.g / 255), 1 < l.color.b && (l.color.b = l.color.b / 255), 1 < l.color.a && (l.color.a = l.color.a / 255), l.color = this._color.createColor(l.color.r, l.color.g, l.color.b, l.color.a))), this._core.isnull(l) || this._core.isnull(l.lightColor) || (this._core.isHtmlColor(l.lightColor) ? l.lightColor = this._color.colorFromHtmlColor(l.lightColor) : (/^rgb/.test(l.lightColor) && (l.lightColor = this._color.rgbaStringToRgbaObj(l.lightColor)), 1 < l.lightColor.r && (l.lightColor.r = l.lightColor.r / 255), 1 < l.lightColor.g && (l.lightColor.g = l.lightColor.g / 255), 1 < l.lightColor.b && (l.lightColor.b = l.lightColor.b / 255), 1 < l.lightColor.a && (l.lightColor.a = l.lightColor.a / 255), l.lightColor = this._color.createColor(l.lightColor.r, l.lightColor.g, l.lightColor.b, l.lightColor.a))), this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), this._core.extend(n, l, !0)), m = (0 == h.extrudedHeight && (h.extrudedHeight = 999999), this.items = [], this), d = new v(this._viewer, this._cesium, a), n = ((this._Provider = d)._loadTile = function (e) { var a = null, s = (scene.primitives, new m._cesium.PrimitiveCollection); return m.Legend = [], e.features.forEach(function (o) { if (d._isCameraMoving) return null; var i = []; function r(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? r(e[t]) : i.push(e[t]) } if (Array.isArray(o.geometry.coordinates) && 0 < o.geometry.coordinates.length) if (Array.isArray(o.geometry.coordinates[0][0])) for (var e = 0; e < o.geometry.coordinates.length; e++)i = [], r(o.geometry.coordinates[e]), t(i), n(i); else r(o.geometry.coordinates), t(i), n(i); function t(e) { var t, i; d._isCameraMoving || (e = m._cesium.Cartesian3.fromDegreesArray(e), /^\[/.test(l.extrudedHeight) && /\]$/.test(l.extrudedHeight) && (t = l.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), h.extrudedHeight = parseFloat(o.properties[t])), h.extrudedHeight = parseFloat(h.extrudedHeight), 1 == h.heightReference && delete h.height, 1 == h.extrudedHeightReference && delete h.extrudedHeight, /^\[/.test(l.material) && /\]$/.test(l.material) && (t = l.material.replace(/\[/, "").replace(/\]/, ""), h.material = o.properties[t], m._core.isHtmlColor(h.material) ? h.material = m._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = m._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h.material.b = h.material.b / 255), 1 < h.material.a && (h.material.a = h.material.a / 255), h.material = m._color.createColor(h.material.r, h.material.g, h.material.b, h.material.a))), h.polygonHierarchy = new m._cesium.PolygonHierarchy(e), t = new m._cesium.PolygonGeometry(h), i = null, o.positions = e, i = new m._cesium.GeometryInstance({ id: o, geometry: t, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }), e = "material:" + 255 * h.material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue, m.Legend.push(e), a = new m._cesium.ClassificationPrimitive({ geometryInstances: i, appearance: new m._cesium.PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: h.classificationType, shadows: m._cesium.ShadowMode.ENABLED }), s.add(a)) } function n(e) { for (var e = m._cesium.Cartesian3.fromDegreesArray(e), t = [], i = new m._cesium.PolygonHierarchy(e).positions, o = 0; o < i.length; o++) { var r = m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).longitude), n = m._cesium.Math.toDegrees(m._cesium.Cartographic.fromCartesian(i[o]).latitude); t.push(r), t.push(n) } e = m.getTheBottomPoint(t); m.scanningPolygon(e, h.offset_x, h.offset_y, t).forEach(function (e) { e = m._cesium.Transforms.eastNorthUpToFixedFrame(m._cesium.Cartesian3.fromDegrees(e.lon, e.lat, u)), e = m._cesium.Model.fromGltf({ url: c, color: h.color, lightColor: h.lightColor, modelMatrix: e, scale: h.scale }); s.add(e) }) } }), s }, l && l.time && (d.availability = new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({ start: l.time.start ? m._cesium.JulianDate.fromDate(new Date(l.time.start)) : m._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? m._cesium.JulianDate.fromDate(new Date(l.time.end)) : m._cesium.Iso8601.MAXIMUM_VALUE })])), this.item = d._primitiveCollection, d.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: l }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gi.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] }, Gi.prototype.getTheBottomPoint = function (e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2)t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, Gi.prototype.scanningPolygon = function (e, t, i, o) { for (var r, n, a, s = [], l = 180, c = -180, u = -90, h = 0; h < o.length; h += 2)u = u > o[h + 1] ? u : o[h + 1], l = l < o[h] ? l : o[h], c = c > o[h] ? c : 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 <= u; 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 <= c; n.lon += m)this.IsInPolygon(n.lon, n.lat, o) && s.push({ lon: n.lon, lat: n.lat }) } return s }, Gi.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 < i.length - 2; l += 2)o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, Gi.prototype.setPolylinemodels = function (e, t, i, o, r, n, a, s, l) { var c = this._core.getSpaceDistancem(e, s), u = 10, h = parseFloat(a.distance), c = (0 != h && (u = parseInt(c / h)), e[0]), h = e[e.length - 1], e = s.Cartographic.fromCartesian(c), m = s.Math.toDegrees(e.longitude), d = s.Math.toDegrees(e.latitude), c = (e.height, s.Cartographic.fromCartesian(h)), h = s.Math.toDegrees(c.longitude), p = s.Math.toDegrees(c.latitude), g = (c.height, s.Math.toDegrees(e.height), u), f = s.Math.lerp(m, h, 1 / g) - m, _ = s.Math.lerp(d, p, 1 / g) - d; s.Math.lerp(t, o, 1 / g), s.Math.lerp(i, r, 1 / g); for (var C = 0; C < g; C++) { var y = s.Transforms.eastNorthUpToFixedFrame(s.Cartesian3.fromDegrees(m + (C + 1) * f, d + (C + 1) * _, a.height)), y = (parseInt(a.heightReference), s.Model.fromGltf({ url: a.url, modelMatrix: y, color: a.color, lightColor: a.lightColor, scale: a.scale, heightReference: parseInt(a.heightReference) })); l.scene.primitives.add(y), n.push(y) } return n }, Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl = function (e, t, i, o, r, n) { var a = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, 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(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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.extend(a, i, !0)), c = this, u = new v(this._viewer, this._cesium, s), a = ((this._Provider = u)._loadTile = function (e, t) { var a, e = c._taskProcessor.scheduleTask({ json: e, styleOption: i, options: l, tileKey: t }); c._cesium.defined(e) && (a = c)._cesium.when(e, function (e) { if (!u._primitiveByTile[e.tileKey]) { for (var t = new a._cesium.PrimitiveCollection, i = 0; i < e.geomInstances.length; i++) { var o = null, r = e.geomInstances[i], n = r.id.id; u._primitiveByTile[n] || (n = new a._cesium.Material({ fabric: { type: "Color", uniforms: { color: e.materials[i] } } }), new a._cesium.MaterialAppearance({ material: n, faceForward: !0, flat: !1 }), o = new a._cesium.Primitive({ allowPicking: !0, appearance: new a._cesium.PerInstanceColorAppearance, geometryInstances: r, shadows: c._cesium.ShadowMode.ENABLED }), t.add(o)) } u._primitiveCollection.add(t), u._primitiveByTile[e.tileKey] = t } }) }, this.item = u._primitiveCollection, u.addTo(this._viewer), r || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls = function (e, t, a, i, o, r) { var n = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, shadows: this._cesium.ShadowMode.ENABLED, show: !0 }, 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(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : /^http/.test(a.material) || (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._core.isnull(a) || this._core.isnull(a.fill) || "[" == a.fill.toString().charAt(0) && "]" == a.fill.toString().charAt(a.fill.length - 1) || (this._core.isHtmlColor(a.fill) ? a.fill = this._color.colorFromHtmlColor(a.fill) : /^http/.test(a.fill) || (/^rgb/.test(a.fill) && (a.fill = this._color.rgbaStringToRgbaObj(a.fill)), 1 < a.fill.r && (a.fill.r = a.fill.r / 255), 1 < a.fill.g && (a.fill.g = a.fill.g / 255), 1 < a.fill.b && (a.fill.b = a.fill.b / 255), 1 < a.fill.a && (a.fill.a = a.fill.a / 255), a.fill = this._color.createColor(a.fill.r, a.fill.g, a.fill.b, a.fill.a))), this._core.extend(n, a, !0)), c = this, n = new v(this._viewer, this._cesium, s), s = ((this._Provider = n)._loadTile = function (e) { c.Legend = []; var n = new c._cesium.PrimitiveCollection; return e.features.forEach(function (r) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : i.push(e[t]) } if (Array.isArray(r.geometry.coordinates) && 0 < r.geometry.coordinates.length) if (Array.isArray(r.geometry.coordinates[0][0])) for (var e = 0; e < r.geometry.coordinates.length; e++)i = [], o(r.geometry.coordinates[e]), t(i); else o(r.geometry.coordinates), t(i); function t(e) { var e = c._cesium.Cartesian3.fromDegreesArray(e), t = (/^\[/.test(a.extrudedHeight) && /\]$/.test(a.extrudedHeight) && (t = a.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), l.extrudedHeight = parseFloat(r.properties[t])), l.extrudedHeight = parseFloat(l.extrudedHeight), 1 == l.heightReference && delete l.height, 1 == l.extrudedHeightReference && delete l.extrudedHeight, /^\[/.test(a.material) && /\]$/.test(a.material) && (t = a.material.replace(/\[/, "").replace(/\]/, ""), l.material = r.properties[t], c._core.isHtmlColor(l.material) ? l.material = c._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = c._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = c._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), l.polygonHierarchy = new c._cesium.PolygonHierarchy(e), r.positions = e, new c._cesium.PolygonGeometry(l)), e = new c._cesium.ColorGeometryInstanceAttribute.fromColor(l.fill), i = {}, i = /^http/.test(l.material) ? new c._cesium.Material({ fabric: { type: "Image", uniforms: { image: l.material } } }) : (o = "material:" + 255 * l.material.red + "," + 255 * l.material.green + "," + 255 * l.material.blue, c.Legend.push(o), new c._cesium.Material({ fabric: { type: "Color", uniforms: { color: l.material } } })), o = new c._cesium.GeometryInstance({ id: r, geometry: t, attributes: { color: e } }), t = new c._cesium.Primitive({ allowPicking: !0, appearance: new c._cesium.MaterialAppearance({ material: i }), geometryInstances: o, shadows: c._cesium.ShadowMode.ENABLED }); n.add(t) } }), n }, a && a.time && (n.availability = new c._cesium.TimeIntervalCollection([new c._cesium.TimeInterval({ start: a.time.start ? c._cesium.JulianDate.fromDate(new Date(a.time.start)) : c._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? c._cesium.JulianDate.fromDate(new Date(a.time.end)) : c._cesium.Iso8601.MAXIMUM_VALUE })])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: a }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Gi.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd = 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 }, l = (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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.isnull(i) || this._core.isnull(i.outlineColor) || "[" == i.outlineColor.toString().charAt(0) && "]" == i.outlineColor.toString().charAt(i.outlineColor.length - 1) || (this._core.isHtmlColor(i.outlineColor) ? i.outlineColor = this._color.colorFromHtmlColor(i.outlineColor) : (/^rgb/.test(i.outlineColor) && (i.outlineColor = this._color.rgbaStringToRgbaObj(i.outlineColor)), 1 < i.outlineColor.r && (i.outlineColor.r = i.outlineColor.r / 255), 1 < i.outlineColor.g && (i.outlineColor.g = i.outlineColor.g / 255), 1 < i.outlineColor.b && (i.outlineColor.b = i.outlineColor.b / 255), 1 < i.outlineColor.a && (i.outlineColor.a = i.outlineColor.a / 255), i.outlineColor = this._color.createColor(i.outlineColor.r, i.outlineColor.g, i.outlineColor.b, i.outlineColor.a))), this._option = this._core.extend(a, i, !0), this), a = t.urlinit, c = { polygonHierarchy: void 0, height: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, a = ($.ajax({ url: a, type: "get", async: !1, dataType: "json", success: function (e) { l.datas = e.features } }), new v(this._viewer, this._cesium, s)), s = ((this._Provider = a)._loadTile = function (e) { l.Legend = [], new l._cesium.PrimitiveCollection; var a = [], s = [], t = new Cesium.PrimitiveCollection; return e.features.forEach(function (e) { var o = []; var t = e.id, t = parseInt(t.split(".")[1]) - 1; if (e = l.datas[t], Array.isArray(e.geometry.coordinates) && 0 < e.geometry.coordinates.length && Array.isArray(e.geometry.coordinates[0][0][0])) for (var i = 0; i < e.geometry.coordinates[0].length; i++) { o = [], !function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? (3 == t[i].length && t[i].splice(2, 1), t[i].push(l._option.height), e(t[i])) : o.push(t[i]) }(e.geometry.coordinates[0][i]), n = r = n = r = r = r = n = n = n = r = void 0; var r = o, n = (/^\[/.test(l._option.extrudedHeight) && /\]$/.test(l._option.extrudedHeight) && (n = l._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), c.extrudedHeight = parseFloat(e.properties[n])), c.material = l._option.material, /^\[/.test(l._option.material) && /\]$/.test(l._option.material) ? (n = l._option.material.replace(/\[/, "").replace(/\]/, ""), c.material = e.properties[n], l._core.isHtmlColor(c.material) ? c.material = l._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = l._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.red && (c.material.red = c.material.red / 255), 1 < c.material.green && (c.material.green = c.material.green / 255), 1 < c.material.blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c.material.alpha / 255), c.material = l._color.createColor(c.material.red, c.material.green, c.material.blue, c.material.alpha))) : (l._option.material && (c.material = l._option.material), c.material && (l._core.isHtmlColor(c.material) ? c.material = l._color.colorFromHtmlColor(c.material) : (/^rgb/.test(c.material) && (c.material = l._color.rgbaStringToRgbaObj(c.material)), 1 < c.material.red && (c.material.red = c.material.red / 255), 1 < c.material.green && (c.material.green = c.material.green / 255), 1 < c.material.blue && (c.material.blue = c.material.blue / 255), 1 < c.material.alpha && (c.material.a = c.material.alpha / 255), c.material = l._color.createColor(c.material.red, c.material.green, c.material.blue, c.material.alpha)))), l._cesium.Cartesian3.fromDegreesArrayHeights(r)), r = (c.polygonHierarchy = new l._cesium.PolygonHierarchy(n), new l._cesium.PolygonGeometry(c)), r = new Cesium.GeometryInstance({ id: e, geometry: r, attributes: { color: new l._cesium.ColorGeometryInstanceAttribute.fromColor(l._option.randomColor ? Cesium.Color.fromRandom().withAlpha(c.material.alpha) : c.material) } }), r = (a.push(r), { positions: n, width: l._option.width }), n = new l._cesium.GroundPolylineGeometry(r), r = new l._cesium.GeometryInstance({ geometry: n }), n = (s.push(r), "material:" + 255 * c.material.red + "," + 255 * c.material.green + "," + 255 * c.material.blue); l.Legend.push(n) } }), 0 < a.length && (c.extrudedHeight ? t.add(new l._cesium.Primitive({ geometryInstances: a, appearance: new l._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: l._core.Shaders("vertexShaderSource"), fragmentShaderSource: l._core.Shaders("fragmentShaderSource") }) })) : t.add(new l._cesium.GroundPrimitive({ geometryInstances: a, appearance: new l._cesium.PerInstanceColorAppearance({ translucent: !0, vertexShaderSource: l._core.Shaders("vertexShaderSource") }) }))), 0 < s.length && t.add(new l._cesium.GroundPolylinePrimitive({ geometryInstances: s, appearance: new l._cesium.PolylineMaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: l._option.outlineColor } } }) }), shadows: l._cesium.ShadowMode.ENABLED })), t }, this.item = a._primitiveCollection, a.addTo(this._viewer), 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, { id: c.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, Gi.prototype.setTreeobj = function (e) { this.treeobj = e }, Gi.prototype.createPolygonVectorFeatureLayerProvider = function (e, t, n, i, o) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, 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 }, s = (this._core.isnull(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n.material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n.material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n.material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n.material.a && (n.material.a = n.material.a / 255), n.material = this._color.createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._core.extend(r, n, !0)), l = this, r = new v(this._viewer, this._cesium, a), a = ((this._Provider = r)._loadTile = function (e) { var r = []; return l.Legend = [], e.features.forEach(function (e) { var o = []; !function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? e(t[i]) : o.push(t[i]) }(e.geometry.coordinates[0]); var t = l._cesium.Cartesian3.fromDegreesArray(o), e = (/^\[/.test(n.extrudedHeight) && /\]$/.test(n.extrudedHeight) && (i = n.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), s.extrudedHeight = parseFloat(e.properties[i])), s.polygonHierarchy = new l._cesium.PolygonHierarchy(t), new l._cesium.PolygonGeometry(s)), i = l._cesium.PolygonGeometry.createGeometry(e), t = "material:" + 255 * s.material.red + "," + 255 * s.material.green + "," + 255 * s.material.blue, e = (l.Legend.push(t), new l._cesium.GeometryInstance({ geometry: i, attributes: { color: new l._cesium.ColorGeometryInstanceAttribute.fromColor(s.material) }, shadows: l._cesium.ShadowMode.ENABLED })); r.push(e) }), new this._cesium.Primitive({ allowPicking: !1, appearance: new this._cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0, faceForward: !0, closed: !0 }), geometryInstances: r }) }, this.item = r._primitiveCollection, r.addTo(this._viewer), this._core.isnull(s.id) && (s.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item) }, Gi.prototype.createPolygonVectorMonomerFeatureLayerProvider = function (e, t, n, i, o) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.WHITE, show: !0 }, 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 }, s = (this._core.isnull(n) || this._core.isnull(n.material) || "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) || (this._core.isHtmlColor(n.material) ? n.material = this._color.colorFromHtmlColor(n.material) : (/^rgb/.test(n.material) && (n.material = this._color.rgbaStringToRgbaObj(n.material)), 1 < n.material.r && (n.material.r = n.material.r / 255), 1 < n.material.g && (n.material.g = n.material.g / 255), 1 < n.material.b && (n.material.b = n.material.b / 255), 1 < n.material.a && (n.material.a = n.material.a / 255), n.material = this._color.createColor(n.material.r, n.material.g, n.material.b, n.material.a))), this._core.extend(r, n, !0)), r = new v(this._viewer, this._cesium, a), l = (this._Provider = r, this), a = (r._loadTile = function (e) { var r = []; return e.features.forEach(function (e) { var o = []; !function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? e(t[i]) : o.push(t[i]) }(e.geometry.coordinates[0]); var t = l._cesium.Cartesian3.fromDegreesArray(o), e = (/^\[/.test(n.extrudedHeight) && /\]$/.test(n.extrudedHeight) && (i = n.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), s.extrudedHeight = parseFloat(e.properties[i])), s.polygonHierarchy = new l._cesium.PolygonHierarchy(t), new l._cesium.PolygonGeometry(s)), i = new l._cesium.GeometryInstance({ geometry: e, attributes: { color: l._cesium.ColorGeometryInstanceAttribute.fromColor(l._cesium.Color.fromCssColorString("#004FFF").withAlpha(.5)), show: new l._cesium.ShowGeometryInstanceAttribute(!0) } }); r.push(i) }), new l._cesium.GroundPrimitive({ classificationType: l._cesium.ClassificationType.BOTH, geometryInstances: r }) }, this.item = r._primitiveCollection, r.addTo(this._viewer), this._core.isnull(s.id) && (s.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + s.id), { id: s.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: n }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof o && o(this.item) }, Gi.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Gi.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }; var ki = {}; function Ni(e) { this.buf = ArrayBuffer.isView && ArrayBuffer.isView(e) ? e : new Uint8Array(e || 0), this.pos = 0, this.type = 0, this.length = this.buf.length } ki.read = function (e, t, i, o, r) { var n, a, s = 8 * r - o - 1, l = (1 << s) - 1, c = l >> 1, u = -7, h = i ? r - 1 : 0, m = i ? -1 : 1, r = e[t + h]; for (h += m, n = r & (1 << -u) - 1, r >>= -u, u += s; 0 < u; n = 256 * n + e[t + h], h += m, u -= 8); for (a = n & (1 << -u) - 1, n >>= -u, u += o; 0 < u; a = 256 * a + e[t + h], h += m, u -= 8); if (0 === n) n = 1 - c; else { if (n === l) return a ? NaN : 1 / 0 * (r ? -1 : 1); a += Math.pow(2, o), n -= c } return (r ? -1 : 1) * a * Math.pow(2, n - o) }, ki.write = function (e, t, i, o, r, n) { var a, s, l = 8 * n - r - 1, c = (1 << l) - 1, u = c >> 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 = c) : (a = Math.floor(Math.log(t) / Math.LN2), t * (o = Math.pow(2, -a)) < 1 && (a--, o *= 2), 2 <= (t += 1 <= a + u ? h / o : h * Math.pow(2, 1 - u)) * o && (a++, o /= 2), c <= a + u ? (s = 0, a = c) : 1 <= a + u ? (s = (t * o - 1) * Math.pow(2, r), a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r), a = 0)); 8 <= r; e[i + m] = 255 & s, m += d, s /= 256, r -= 8); for (a = a << r | s, l += r; 0 < l; e[i + m] = 255 & a, m += d, a /= 256, l -= 8); e[i + m - d] |= 128 * n }, Ni.Varint = 0, Ni.Fixed64 = 1, Ni.Bytes = 2, Ni.Fixed32 = 5; var ji = 4294967296, Ui = 1 / ji; function zi(e) { return e.type === Ni.Bytes ? e.readVarint() + e.pos : e.pos + 1 } function Wi(e, t, i) { return i ? 4294967296 * t + (e >>> 0) : 4294967296 * (t >>> 0) + (e >>> 0) } function Yi(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 < e.length; i++)t.writeVarint(e[i]) } function Ki(e, t) { for (var i = 0; i < e.length; i++)t.writeSVarint(e[i]) } function Qi(e, t) { for (var i = 0; i < e.length; i++)t.writeFloat(e[i]) } function qi(e, t) { for (var i = 0; i < e.length; i++)t.writeDouble(e[i]) } function Xi(e, t) { for (var i = 0; i < e.length; i++)t.writeBoolean(e[i]) } function Zi(e, t) { for (var i = 0; i < e.length; i++)t.writeFixed32(e[i]) } function $i(e, t) { for (var i = 0; i < e.length; i++)t.writeSFixed32(e[i]) } function eo(e, t) { for (var i = 0; i < e.length; i++)t.writeFixed64(e[i]) } function to(e, t) { for (var i = 0; i < e.length; i++)t.writeSFixed64(e[i]) } function io(e, t) { return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + 16777216 * e[t + 3] } function oo(e, t, i) { e[i] = t, e[i + 1] = t >>> 8, e[i + 2] = t >>> 16, e[i + 3] = t >>> 24 } function ro(e, t) { return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + (e[t + 3] << 24) } function no(e, t) { this.x = e, this.y = t } function ao(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(so, this, t) } function so(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 < n;) { var a = r._keys[o.readVarint()], s = r._values[o.readVarint()]; r.properties[a] = s } else 3 == e ? t.type = i.readVarint() : 4 == e && (t._geometry = i.pos) } function lo(e, t) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = e, this._keys = [], this._values = [], this._features = [], e.readFields(co, this, t), this.length = this._features.length } function co(e, t, i) { 15 === e ? t.version = i.readVarint() : 1 === e ? t.name = i.readString() : 5 === e ? t.extent = i.readVarint() : 2 === e ? t._features.push(i.pos) : 3 === e ? t._keys.push(i.readString()) : 4 === e && t._values.push(function (e) { var t = null, i = e.readVarint() + e.pos; for (; e.pos < i;) { var o = e.readVarint() >> 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 uo(e, t) { this.layers = e.readFields(ho, {}, t) } function ho(e, t, i) { 3 === e && (e = new lo(i, i.readVarint() + i.pos)).length && (t[e.name] = e) } function mo(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, 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 = [] } Ni.prototype = { destroy: function () { this.buf = null }, readFields: function (e, t, i) { for (i = i || this.length; this.pos < i;) { var o = this.readVarint(), r = o >> 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 = io(this.buf, this.pos); return this.pos += 4, e }, readSFixed32: function () { var e = ro(this.buf, this.pos); return this.pos += 4, e }, readFixed64: function () { var e = io(this.buf, this.pos) + io(this.buf, this.pos + 4) * ji; return this.pos += 8, e }, readSFixed64: function () { var e = io(this.buf, this.pos) + ro(this.buf, this.pos + 4) * ji; return this.pos += 8, e }, readFloat: function () { var e = ki.read(this.buf, this.pos, !0, 23, 4); return this.pos += 4, e }, readDouble: function () { var e = ki.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 Wi(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 3, n < 128) return Wi(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 10, n < 128) return Wi(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 17, n < 128) return Wi(i, r, t); if (n = e[o.pos++], r |= (127 & n) << 24, n < 128) return Wi(i, r, t); if (n = e[o.pos++], r |= (1 & n) << 31, n < 128) return Wi(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 < i;) { var l = e[s], c = null, u = 239 < l ? 4 : 223 < l ? 3 : 191 < l ? 2 : 1; if (i < s + u) break; 1 === u ? l < 128 && (c = l) : 2 === u ? 128 == (192 & (o = e[s + 1])) && (c = (31 & l) << 6 | 63 & o) <= 127 && (c = null) : 3 === u ? (o = e[s + 1], r = e[s + 2], 128 == (192 & o) && 128 == (192 & r) && ((c = (15 & l) << 12 | (63 & o) << 6 | 63 & r) <= 2047 || 55296 <= c && c <= 57343) && (c = null)) : 4 === u && (o = e[s + 1], r = e[s + 2], n = e[s + 3], 128 == (192 & o) && 128 == (192 & r) && 128 == (192 & n) && ((c = (15 & l) << 18 | (63 & o) << 12 | (63 & r) << 6 | 63 & n) <= 65535 || 1114112 <= c) && (c = null)), null === c ? (c = 65533, u = 1) : 65535 < c && (c -= 65536, a += String.fromCharCode(c >>> 10 & 1023 | 55296), c = 56320 | 1023 & c), a += String.fromCharCode(c), s += u } 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 = zi(this); for (e = e || []; this.pos < i;)e.push(this.readVarint(t)); return e }, readPackedSVarint: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readSVarint()); return e }, readPackedBoolean: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readBoolean()); return e }, readPackedFloat: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readFloat()); return e }, readPackedDouble: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readDouble()); return e }, readPackedFixed32: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readFixed32()); return e }, readPackedSFixed32: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readSFixed32()); return e }, readPackedFixed64: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readFixed64()); return e }, readPackedSFixed64: function (e) { var t = zi(this); for (e = e || []; this.pos < t;)e.push(this.readSFixed64()); return e }, skip: function (e) { e &= 7; if (e === Ni.Varint) for (; 127 < this.buf[this.pos++];); else if (e === Ni.Bytes) this.pos = this.readVarint() + this.pos; else if (e === Ni.Fixed32) this.pos += 4; else { if (e !== Ni.Fixed64) throw new Error("Unimplemented type: " + e); this.pos += 8 } }, writeTag: function (e, t) { this.writeVarint(e << 3 | t) }, realloc: function (e) { for (var t, i = this.length || 16; i < this.pos + e;)i *= 2; i !== this.length && ((t = new Uint8Array(i)).set(this.buf), this.buf = t, this.length = i) }, finish: function () { return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length) }, writeFixed32: function (e) { this.realloc(4), oo(this.buf, e, this.pos), this.pos += 4 }, writeSFixed32: function (e) { this.realloc(4), oo(this.buf, e, this.pos), this.pos += 4 }, writeFixed64: function (e) { this.realloc(8), oo(this.buf, -1 & e, this.pos), oo(this.buf, Math.floor(e * Ui), this.pos + 4), this.pos += 8 }, writeSFixed64: function (e) { this.realloc(8), oo(this.buf, -1 & e, this.pos), oo(this.buf, Math.floor(e * Ui), this.pos + 4), this.pos += 8 }, writeVarint: function (e) { if (268435455 < (e = +e || 0) || e < 0) { var t = e, i = this; if (0 <= t ? (o = t % 4294967296 | 0, r = t / 4294967296 | 0) : (r = ~(-t / 4294967296), 4294967295 ^ (o = ~(-t % 4294967296)) ? o = o + 1 | 0 : r = r + 1 | (o = 0)), 0x10000000000000000 <= t || t < -0x10000000000000000) throw new Error("Given varint doesn't fit into 10 bytes"); i.realloc(10); var t = o, o = i, t = (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 | 128, t >>>= 7, o.buf[o.pos] = 127 & t, r), r = i, i = (7 & t) << 4; r.buf[r.pos++] |= i | ((t >>>= 3) ? 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 | ((t >>>= 7) ? 128 : 0), t && (r.buf[r.pos++] = 127 & t))))) } else this.realloc(4), this.buf[this.pos++] = 127 & e | (127 < e ? 128 : 0), e <= 127 || (this.buf[this.pos++] = 127 & (e >>>= 7) | (127 < e ? 128 : 0), e <= 127 || (this.buf[this.pos++] = 127 & (e >>>= 7) | (127 < e ? 128 : 0), e <= 127 || (this.buf[this.pos++] = e >>> 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 < t.length; n++) { if (55295 < (o = t.charCodeAt(n)) && o < 57344) { if (!r) { 56319 < o || n + 1 === t.length ? (e[i++] = 239, e[i++] = 191, e[i++] = 189) : r = o; continue } if (o < 56320) { e[i++] = 239, e[i++] = 191, e[i++] = 189, r = o; continue } o = r - 55296 << 10 | o - 56320 | 65536, r = null } else r && (e[i++] = 239, e[i++] = 191, e[i++] = 189, r = null); o < 128 ? e[i++] = o : (o < 2048 ? e[i++] = o >> 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 && Yi(t, e, this), this.pos = t - 1, this.writeVarint(e), this.pos += e }, writeFloat: function (e) { this.realloc(4), ki.write(this.buf, e, this.pos, !0, 23, 4), this.pos += 4 }, writeDouble: function (e) { this.realloc(8), ki.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 < t; i++)this.buf[this.pos++] = e[i] }, writeRawMessage: function (e, t) { this.pos++; var i = this.pos, e = (e(t, this), this.pos - i); 128 <= e && Yi(i, e, this), this.pos = i - 1, this.writeVarint(e), this.pos += e }, writeMessage: function (e, t, i) { this.writeTag(e, Ni.Bytes), this.writeRawMessage(t, i) }, writePackedVarint: function (e, t) { this.writeMessage(e, Ji, t) }, writePackedSVarint: function (e, t) { this.writeMessage(e, Ki, t) }, writePackedBoolean: function (e, t) { this.writeMessage(e, Xi, t) }, writePackedFloat: function (e, t) { this.writeMessage(e, Qi, t) }, writePackedDouble: function (e, t) { this.writeMessage(e, qi, t) }, writePackedFixed32: function (e, t) { this.writeMessage(e, Zi, t) }, writePackedSFixed32: function (e, t) { this.writeMessage(e, $i, t) }, writePackedFixed64: function (e, t) { this.writeMessage(e, eo, t) }, writePackedSFixed64: function (e, t) { this.writeMessage(e, to, t) }, writeBytesField: function (e, t) { this.writeTag(e, Ni.Bytes), this.writeBytes(t) }, writeFixed32Field: function (e, t) { this.writeTag(e, Ni.Fixed32), this.writeFixed32(t) }, writeSFixed32Field: function (e, t) { this.writeTag(e, Ni.Fixed32), this.writeSFixed32(t) }, writeFixed64Field: function (e, t) { this.writeTag(e, Ni.Fixed64), this.writeFixed64(t) }, writeSFixed64Field: function (e, t) { this.writeTag(e, Ni.Fixed64), this.writeSFixed64(t) }, writeVarintField: function (e, t) { this.writeTag(e, Ni.Varint), this.writeVarint(t) }, writeSVarintField: function (e, t) { this.writeTag(e, Ni.Varint), this.writeSVarint(t) }, writeStringField: function (e, t) { this.writeTag(e, Ni.Bytes), this.writeString(t) }, writeFloatField: function (e, t) { this.writeTag(e, Ni.Fixed32), this.writeFloat(t) }, writeDoubleField: function (e, t) { this.writeTag(e, Ni.Fixed64), this.writeDouble(t) }, writeBooleanField: function (e, t) { this.writeVarintField(e, Boolean(t)) } }, no.prototype = { clone: function () { return new no(this.x, this.y) }, add: function (e) { return this.clone()._add(e) }, sub: function (e) { return this.clone()._sub(e) }, multByPoint: function (e) { return this.clone()._multByPoint(e) }, divByPoint: function (e) { return this.clone()._divByPoint(e) }, mult: function (e) { return this.clone()._mult(e) }, div: function (e) { return this.clone()._div(e) }, rotate: function (e) { return this.clone()._rotate(e) }, rotateAround: function (e, t) { return this.clone()._rotateAround(e, t) }, matMult: function (e) { return this.clone()._matMult(e) }, unit: function () { return this.clone()._unit() }, perp: function () { return this.clone()._perp() }, round: function () { return this.clone()._round() }, mag: function () { return Math.sqrt(this.x * this.x + this.y * this.y) }, equals: function (e) { return this.x === e.x && this.y === e.y }, dist: function (e) { return Math.sqrt(this.distSqr(e)) }, distSqr: function (e) { var t = e.x - this.x, e = e.y - this.y; return t * t + e * e }, angle: function () { return Math.atan2(this.y, this.x) }, angleTo: function (e) { return Math.atan2(this.y - e.y, this.x - e.x) }, angleWith: function (e) { return this.angleWithSep(e.x, e.y) }, angleWithSep: function (e, t) { return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t) }, _matMult: function (e) { var t = e[0] * this.x + e[1] * this.y, e = e[2] * this.x + e[3] * this.y; return this.x = t, this.y = e, this }, _add: function (e) { return this.x += e.x, this.y += e.y, this }, _sub: function (e) { return this.x -= e.x, this.y -= e.y, this }, _mult: function (e) { return this.x *= e, this.y *= e, this }, _div: function (e) { return this.x /= e, this.y /= e, this }, _multByPoint: function (e) { return this.x *= e.x, this.y *= e.y, this }, _divByPoint: function (e) { return this.x /= e.x, this.y /= e.y, this }, _unit: function () { return this._div(this.mag()), this }, _perp: function () { var e = this.y; return this.y = this.x, this.x = -e, this }, _rotate: function (e) { var t = Math.cos(e), e = Math.sin(e), i = t * this.x - e * this.y, e = e * this.x + t * this.y; return this.x = i, this.y = e, this }, _rotateAround: function (e, t) { var i = Math.cos(e), e = Math.sin(e), o = t.x + i * (this.x - t.x) - e * (this.y - t.y), e = t.y + e * (this.x - t.x) + i * (this.y - t.y); return this.x = o, this.y = e, this }, _round: function () { return this.x = Math.round(this.x), this.y = Math.round(this.y), this } }, no.convert = function (e) { return !(e instanceof no) && Array.isArray(e) ? new no(e[0], e[1]) : e }, ao.types = ["Unknown", "Point", "LineString", "Polygon"], ao.prototype.loadGeometry = function () { for (var e, t, i = this._pbf, o = (i.pos = this._geometry, i.readVarint() + i.pos), r = 1, n = 0, a = 0, s = 0, l = []; i.pos < o;)if (n <= 0 && (r = 7 & (t = i.readVarint()), n = t >> 3), n--, 1 === r || 2 === r) a += i.readSVarint(), s += i.readSVarint(), 1 === r && (e && l.push(e), e = []), e.push(new no(a, s)); else { if (7 !== r) throw new Error("unknown command " + r); e && e.push(e[0].clone()) } return e && l.push(e), l }, ao.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, c = 1 / 0, u = -1 / 0; t.pos < i;)if (r <= 0 && (o = 7 & (e = t.readVarint()), r = e >> 3), r--, 1 === o || 2 === o) (n += t.readSVarint()) < s && (s = n), l < n && (l = n), (a += t.readSVarint()) < c && (c = a), u < a && (u = a); else if (7 !== o) throw new Error("unknown command " + o); return [s, c, l, u] }, ao.prototype.toGeoJSON = function (e, t, i, o) { var r, n = this.extent * Math.pow(2, i), a = this.extent * e, s = this.extent * t / 2, l = this.loadGeometry(), i = ao.types[this.type]; function c(e) { for (var t = 0; t < e.length; t++) { var i = e[t], o = 90 - 180 * (i.y + s) / (n / 2); e[t] = [360 * (i.x + a) / n - 180, o] } } switch (this.type) { case 1: for (var u = [], h = 0; h < l.length; h++)u[h] = l[h][0]; c(l = u); break; case 2: for (h = 0; h < l.length; h++)c(l[h]); break; case 3: for (l = function (e) { var t = e.length; if (t <= 1) return [e]; for (var i, o, r = [], n = 0; n < t; n++) { var a = function (e) { for (var t, i, o = 0, r = 0, n = e.length, a = n - 1; r < n; a = r++)t = e[r], i = e[a], o += (i.x - t.x) * (t.y + i.y); return o }(e[n]); 0 !== a && ((o = void 0 === o ? a < 0 : o) === a < 0 ? (i && r.push(i), i = [e[n]]) : i.push(e[n])) } i && r.push(i); return r }(l), h = 0; h < l.length; h++)for (r = 0; r < l[h].length; r++)c(l[h][r]) }1 === l.length ? l = l[0] : i = "Multi" + i; e = { type: "Feature", geometry: { type: i, coordinates: l }, properties: this.properties }; return "id" in this && (e.id = this.id), e }, lo.prototype.feature = function (e) { if (e < 0 || e >= 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 ao(this._pbf, e, this.extent, this._keys, this._values) }; var po = "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 go(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, 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 f, this._tree = V, this._getPosition = new y(this._viewer, this._cesium), this._ModelEdit = new Jt(this._viewer), this._popupmessage = new Si(this._viewer, this._cesium), this._createGroup = new Ei(this._viewer, this._cesium), this._billboardGeoJsonFeatureLayer = new Ii(this._viewer, this._cesium), this._GeoJsonFeatureLayer = new w(this._viewer, this._cesium), this._LabelGeoJsonFeatureLayercopy = new S(this._viewer, this._cesium), this._VectorGeoJsonFeatureLayer = new E(this._viewer, this._cesium), this._PolylineGeoJsonFeatureLayer = new Hi(this._viewer, this._cesium), this._PointModel = new P(this._viewer, this._cesium), this._PolygonGeoJsonFeatureLayer = new Gi(this._viewer, this._cesium), this._PolygonVectorTileLayerArcgis = new mo(this._viewer, this._cesium), this._WallGeoFeatureLayer = new go(this._viewer, this._cesium), this.tooltip = this._core.CreateTooltip(), this.objectsToExclude = [], this.SimpleGraphicObj = [], V.editPointID || (V.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 } mo.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : po(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, mo.prototype.createVolumeVectorGeoJsonFeatureLayer = function (e, t, E, 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(E) || this._core.isnull(E.fill) || "[" == E.fill.toString().charAt(0) && "]" == E.fill.toString().charAt(E.fill.length - 1) || (this._core.isHtmlColor(E.fill) ? E.fill = this._color.colorFromHtmlColor(E.fill) : (/^rgb/.test(E.fill) && (E.fill = this._color.rgbaStringToRgbaObj(E.fill)), 1 < E.fill.r && (E.fill.r = E.fill.r / 255), 1 < E.fill.g && (E.fill.g = E.fill.g / 255), 1 < E.fill.b && (E.fill.b = E.fill.b / 255), 1 < E.fill.a && (E.fill.a = E.fill.a / 255), E.fill = this._color.createColor(E.fill.r, E.fill.g, E.fill.b, E.fill.a))), this._core.isnull(E) || this._core.isnull(E.polylinefill) || "[" == E.polylinefill.toString().charAt(0) && "]" == E.polylinefill.toString().charAt(E.polylinefill.length - 1) || (this._core.isHtmlColor(E.polylinefill) ? E.polylinefill = this._color.colorFromHtmlColor(E.polylinefill) : (/^rgb/.test(E.polylinefill) && (E.polylinefill = this._color.rgbaStringToRgbaObj(E.polylinefill)), 1 < E.polylinefill.r && (E.polylinefill.r = E.polylinefill.r / 255), 1 < E.polylinefill.g && (E.polylinefill.g = E.polylinefill.g / 255), 1 < E.polylinefill.b && (E.polylinefill.b = E.polylinefill.b / 255), 1 < E.polylinefill.a && (E.polylinefill.a = E.polylinefill.a / 255), E.polylinefill = this._color.createColor(E.polylinefill.r, E.polylinefill.g, E.polylinefill.b, E.polylinefill.a))), this._core.isnull(E) || this._core.isnull(E.outlineColor) || "[" == E.outlineColor.toString().charAt(0) && "]" == E.outlineColor.toString().charAt(E.outlineColor.length - 1) || (this._core.isHtmlColor(E.outlineColor) ? E.outlineColor = this._color.colorFromHtmlColor(E.outlineColor) : (/^rgb/.test(E.outlineColor) && (E.outlineColor = this._color.rgbaStringToRgbaObj(E.outlineColor)), 1 < E.outlineColor.r && (E.outlineColor.r = E.outlineColor.r / 255), 1 < E.outlineColor.g && (E.outlineColor.g = E.outlineColor.g / 255), 1 < E.outlineColor.b && (E.outlineColor.b = E.outlineColor.b / 255), 1 < E.outlineColor.a && (E.outlineColor.a = E.outlineColor.a / 255), E.outlineColor = this._color.createColor(E.outlineColor.r, E.outlineColor.g, E.outlineColor.b, E.outlineColor.a))), this._option = this._core.extend(r, E, !0), null == t && console.log("url is required"), null == e && console.log("layername is required"), this); Cesium.VertexFormat.DEFAULT, Cesium.Ellipsoid.WGS84, Cesium.ArcType.GEODESIC, Cesium.Color.WHITE; P._core.xhr({ url: "http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json", type: "get", dataType: "json", success: function (e) { var T = [], S = 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 < e.length; t++)Array.isArray(e[t]) ? i(e[t]) : T.push(e[t]) } function t(e) { e = { positions: Cesium.Cartesian3.fromDegreesArray(e), width: 10, color: Cesium.ColorGeometryInstanceAttribute.fromColor(P._option.polylinefill) }, e = new Cesium.PolylineGeometry(e), e = new Cesium.GeometryInstance({ geometry: e }); a.push(e) } function o(e) { e = new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e)) }), e = Cesium.PolygonGeometry.createGeometry(e), e = new Cesium.GeometryInstance({ geometry: e, attributes: { color: b } }); s.push(e) } var r, n = new uo(new Ni(e)), a = [], s = []; for (r in P.labelCollections = new P._cesium.LabelCollection, n.layers) for (var l = n.layers[r], c = 0; c < l.length; c++)for (var u = l.feature(c), h = u.loadGeometry(), m = 0; m < h.length; m++)for (var d = h[m], p = 0; p < d.length; p++) { d[p]; var g = null; if (null != u.properties._symbol) for (var f = u.properties._symbol, _ = 0; _ < S.length; _++)null != S[_].filter && "==" == S[_].filter[0] && "_symbol" == S[_].filter[1] && S[_].filter[2] == f && (g = S[_]); else if (null != l.name) for (var C = l.name, _ = 0; _ < S.length; _++)null != S[_]["source-layer"] && S[_]["source-layer"] == C && (g = S[_]); if (1 == u.type) try { var y, v = u.toGeoJSON(0, 0, 0, P.extent), w = (null != E.text && /^\[/.test(E.text) && /\]$/.test(E.text) && (y = E.text.replace(/\[/, "").replace(/\]/, ""), P._option.text = u.properties[y]), null != g.paint && g.paint["icon-color"] && (P._option.fill = P._color.createColorTransformation(g.paint["icon-color"])), P._option.position = new P._cesium.Cartesian3.fromDegrees(v.geometry.coordinates[0], v.geometry.coordinates[1], P._option.height), {}), w = "point" == v.geometry.type ? { id: v, color: P._option.fill, position: P._option.position } : P._option; P.labelCollections.add(w) } catch (e) { } if (2 == u.type) { d[0]; v = u.toGeoJSON(0, 0, 0, P.extent); if (!P._core.isnull(E.polylinefill) && null != g.paint && g.paint["icon-color"] && (P._option.polylinefill = P._color.createColorTransformation(g.paint["icon-color"])), Array.isArray(v.geometry.coordinates) && 0 < v.geometry.coordinates.length) if (Array.isArray(v.geometry.coordinates[0][0])) for (m = 0; m < v.geometry.coordinates.length; m++)T = [], i(v.geometry.coordinates[m]), t(T); else i(v.geometry.coordinates), t(T) } if (3 == u.type) try { d[0]; var v = u.toGeoJSON(0, 0, 0, P.extent), b = Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA); if (null != g.paint["fill-color"] && (b = Cesium.ColorGeometryInstanceAttribute.fromColor(P._color.createColorTransformation(g.paint["fill-color"]))), Array.isArray(v.geometry.coordinates) && 0 < v.geometry.coordinates.length) if (Array.isArray(v.geometry.coordinates[0][0])) for (m = 0; m < v.geometry.coordinates.length; m++)T = [], i(v.geometry.coordinates[m]), o(T); else i(v.geometry.coordinates), o(T) } catch (e) { } } 0 < P.labelCollections.length && P._viewer.scene.primitives.add(P.labelCollections), 0 < a.length && P._viewer.scene.primitives.add(new Cesium.Primitive({ geometryInstances: a, appearance: new Cesium.PolylineColorAppearance })), 0 < s.length && P._viewer.scene.primitives.add(new Cesium.Primitive({ geometryInstances: s, appearance: new P._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color.fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })) }) } }) }, mo.prototype.createVolumeVectorGeoJsonFeatureLayers = function (e, t, o, i, 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 }, s = (this.extent = { XMin: t.minx || 0, YMin: t.miny || 0, XMax: t.maxx || 0, YMax: t.maxy || 0 }, 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.material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o.material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this._core.extend(n, o, !0), null == t && console.log("url is required"), null == e && console.log("layername is required"), []), w = { polygonHierarchy: void 0, height: 0, extrudedHeight: 100, vertexFormat: Cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: Cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: Cesium.ArcType.GEODESIC, material: Cesium.Color.WHITE }, b = this; this._urlTemplate = t.url + "?" + this._serialize(a.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = styleOption.level_max - 1, this._Provider.loadTile = function (e, t) { var i, v; (this.tile = t).state === Cesium.QuadtreeTileLoadState.START && b.item.show && (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max ? 0 != (i = C.filter(s, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && i[0].data && 0 < i[0].data.length ? (t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: i[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (v = t, Cesium.Resource.createIfNeeded("http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf").fetchArrayBuffer().then(function (e) { var t, i = new uo(new Ni(e)), o = (b.labelCollections = new b._cesium.PointPrimitiveCollection, []), r = []; for (t in i.layers) for (var n = i.layers[t], a = 0; a < n.length; a++)for (var s = n.feature(a), l = s.loadGeometry(), c = 0; c < l.length; c++)for (var u = l[c], h = 0; h < u.length; h++) { if (u[h], 1 == s.type) try { var m, d = s.toGeoJSON(0, 0, 0, b.extent), p = (null != b._option.text && /^\[/.test(b._option.text) && /\]$/.test(b._option.text) && (m = b._option.text.replace(/\[/, "").replace(/\]/, ""), w.text = s.properties[m]), w.position = new b._cesium.Cartesian3.fromDegrees(d.geometry.coordinates[0], d.geometry.coordinates[1], w.height), {}), p = "point" == d.geometry.type ? { id: d, color: w.material, position: w.position } : w; b.labelCollections.add(p) } catch (e) { } if (2 == s.type) { u[0]; for (d = s.toGeoJSON(v.x, v.y, v.level, b.extent), h = 0; h < d.geometry.coordinates.length; h++)try { var g = [], f = (d.geometry.coordinates[h].forEach(function (e) { g.push(e[0], e[1]) }), new Cesium.PolylineGeometry({ positions: Cesium.Cartesian3.fromDegreesArray(g), width: 10 })), _ = Cesium.PolylineGeometry.createGeometry(f), C = new Cesium.GeometryInstance({ geometry: _ }); o.push(C) } catch (e) { } } if (3 == s.type) { u[0]; for (d = s.toGeoJSON(v.x, v.y, v.level, b.extent), h = 0; h < d.geometry.coordinates.length; h++)try { var g = [], y = (d.geometry.coordinates[h].forEach(function (e) { g.push(e[0], e[1]) }), new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(g)) })), _ = Cesium.PolygonGeometry.createGeometry(y), C = new Cesium.GeometryInstance({ geometry: _ }); r.push(C) } catch (e) { } } } 0 < b.labelCollections.length && b._viewer.scene.primitives.add(b.labelCollections), 0 < o.length && b._viewer.scene.primitives.add(new Cesium.Primitive({ geometryInstances: o, appearance: new b._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color.fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })), 0 < r.length && b._viewer.scene.primitives.add(new Cesium.Primitive({ geometryInstances: r, appearance: new b._cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: Cesium.Color.fromRandom({ alpha: 1 }) } } }), faceForward: !0, flat: !1 }), shadows: Cesium.ShadowMode.ENABLED })) })) : (t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.data.geometryPrimitive.update(e, []), t._parent && t._parent.data && t._parent.data.geometryPrimitive && (t._parent.data.geometryPrimitive.destroy(), t._parent.data.geometryPrimitive = null, t._parent.state = Cesium.QuadtreeTileLoadState.START), t._southwestChild && t._southwestChild.data && t._southwestChild.data.geometryPrimitive && (t._southwestChild.data.geometryPrimitive.destroy(), t._southwestChild.data.geometryPrimitive = null, t._southwestChild.state = Cesium.QuadtreeTileLoadState.START), t._southeastChild && t._southeastChild.data && t._southeastChild.data.geometryPrimitive && (t._southeastChild.data.geometryPrimitive.destroy(), t._southeastChild.data.geometryPrimitive = null, t._southeastChild.state = Cesium.QuadtreeTileLoadState.START), t._northwestChild && t._northwestChild.data && t._northwestChild.data.geometryPrimitive && (t._northwestChild.data.geometryPrimitive.destroy(), t._northwestChild.data.geometryPrimitive = null, t._northwestChild.state = Cesium.QuadtreeTileLoadState.START), t._northeastChild && t._northeastChild.data && t._northeastChild.data.geometryPrimitive && (t._northeastChild.data.geometryPrimitive.destroy(), t._northeastChild.data.geometryPrimitive = null, t._northeastChild.state = Cesium.QuadtreeTileLoadState.START)), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new b._cesium.QuadtreePrimitive({ tileProvider: this._Provider }), this._viewer.scene.primitives.add(this._primitive) }, mo.prototype.createVolumeGeoJsonFeatureLayer = function (e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, c = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function (e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n.material) || (t = "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) ? n.material.replace(/\[/, "").replace("/]/", "") : C.clone(n.material), t = l._core.isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t.r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t.r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium.PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); c.push(r) } e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: c, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, mo.prototype.computeCircle = function (e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, mo.prototype.createVolumeGeoJsonFeatureLayerProvider = 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.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, h = (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 < u.material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u.material.a && (u.material.a = u.material.a / 255), u.material = this._color.createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.extend(n, u, !0)), n = new v(this._viewer, this._cesium, a), m = (this._Provider = n, this), a = (n._loadTile = function (e) { var c = new m._cesium.PrimitiveCollection; return e.features.forEach(function (e) { var t = []; /^\[/.test(u.material) && /\]$/.test(u.material) && (s = u.material.replace(/\[/, "").replace(/\]/, ""), h.material = e.properties[s], that._core.isHtmlColor(h.material) ? h.material = that._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = that._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h.material.b = h.material.b / 255), 1 < h.material.a && (h.material.a = h.material.a / 255), h.material = that._color.createColor(h.material.r, h.material.g, h.material.b, h.material.a))); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = m._cesium.Cartesian3.fromDegrees(n[0], n[1], h.height); t.push(n) } else { var a = m._cesium.Cartesian3.fromDegrees(o[0], o[1], h.height); t.push(a) } } h.position = t, "0" == h.slttype || 0 == h.slttype ? h.shape = m._core.computeCircle(h.radius) : "1" == h.slttype || 1 == h.slttype ? h.shape = m._core.starPositions(h.number, h.exradius, h.inradius) : "2" != h.slttype && 2 != h.slttype || (s = h.orth_width / 2, l = h.orth_height / 2, h.shape = [new m._cesium.Cartesian2(-s, -l), new m._cesium.Cartesian2(s, -l), new m._cesium.Cartesian2(s, l), new m._cesium.Cartesian2(-s, l)]), e.positions = t; var s = { polylinePositions: h.position, shapePositions: h.shape, cornerType: h.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new m._cesium.PolylineVolumeGeometry(s), s = m._cesium.PolylineVolumeGeometry.createGeometry(l), l = new m._cesium.GeometryInstance({ id: e, geometry: s, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }), s = new m._cesium.Primitive({ allowPicking: !0, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: h.material } } }), faceForward: !0, flat: !1 }), shadows: h.shadows, geometryInstances: l }); c.add(s) }), c }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: u }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, mo.prototype.setTreeobj = function (e) { this.treeobj = e }, mo.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, mo.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, mo.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) { } }, mo.prototype.setVisibility = function (e) { this.item.show = e, this._Provider && this._Provider.setStatus(e) }, go.prototype.createWallGeoFeatureLayer = function (o, r, e, a, s, t, i) { var n = { 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 }, l = (this._core.isnull(e) || this._core.isnull(e.material) || "[" == e.material.toString().charAt(0) && "]" == e.material.toString().charAt(e.material.length - 1) || (this._core.isHtmlColor(e.material) ? e.material = this._color.colorFromHtmlColor(e.material) : (/^rgb/.test(e.material) && (e.material = this._color.rgbaStringToRgbaObj(e.material)), 1 < e.material.r && (e.material.r = e.material.r / 255), 1 < e.material.g && (e.material.g = e.material.g / 255), 1 < e.material.b && (e.material.b = e.material.b / 255), 1 < e.material.a && (e.material.a = e.material.a / 255), e.material = this._color.createColor(e.material.r, e.material.g, e.material.b, e.material.a))), this._core.extend(n, e, !0)), c = (this._core.isnull(a) && (a = 16), this._core.isnull(s) && (s = 14), null == r && console.log("url is required"), null == o && console.log("layername is required"), this), u = []; this._VectorTileProvider.loadTile = function (e, t) { var i, n; (this.tile = t).state === c._cesium.QuadtreeTileLoadState.START && (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= s && t.level < a ? 0 != (i = C.filter(u, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && i[0].data && 0 < i[0].data.length ? (t.data.geometryPrimitive = new c._cesium.Primitive({ geometryInstances: i[0].data, appearance: new c._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: c._cesium.ShadowMode.ENABLED }), t.state = c._cesium.QuadtreeTileLoadState.LOADING, t.state === c._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = c._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (u.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, c._core.xhr({ url: r + "?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=" + o + "&STYLE=&TILEMATRIX=EPSG:4490:" + n.level + "&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL=" + n.x + "&TILEROW=" + n.y, type: "get", dataType: "json", success: function (e) { var t = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = (!function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? e(t[i]) : o.push(t[i]) }(e.features[i].geometry.coordinates[0]), c._cesium.Cartesian3.fromDegreesArray(o)), r = (l.positions = r, new c._cesium.GeometryInstance({ geometry: new c._cesium.WallGeometry({ positions: l.positions }), attributes: { color: new c._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE) } })); t.push(r) } C.filter(u, function (e) { return e.x == n.x && e.y == n.y })[0].data = t, n.data.geometryPrimitive = new c._cesium.Primitive({ geometryInstances: t, appearance: new c._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: c._cesium.ShadowMode.ENABLED }) }, error: function () { u = C.remove(u, function (e) { return e.x == n.x && e.y == n.y && e.level == n.level }) }, complete: function () { n.state = c._cesium.QuadtreeTileLoadState.LOADING, n.state === c._cesium.QuadtreeTileLoadState.LOADING && (n.data.geometryPrimitive && n.data.geometryPrimitive.update(e, []), n.state = c._cesium.QuadtreeTileLoadState.DONE, n.renderable = !0) } })) : (t.state = c._cesium.QuadtreeTileLoadState.LOADING, t.state === c._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = c._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new c._cesium.QuadtreePrimitive({ tileProvider: this._VectorTileProvider }), this._viewer.scene.primitives.add(this._primitive) }, go.prototype.createWallPrimitiveGeoFeatureLayer = function (e, t, c, i, u, h) { var m = { positions: void 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, maximumHeights: 0, minimumHeights: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), d = this, p = [], o = (o.then(function (e) { for (var t, i = e.entities.values, o = 0; o < i.length; o++) { var r = i[o], n = (m.positions = r.polyline.positions._value, new Array(m.positions.length)), a = new Array(m.positions.length), s = void 0, l = void 0, s = /^\[/.test(c.minimumHeights) ? (s = c.minimumHeights.replace(/\[/, "").replace("/]/", ""), r.properties[s]._value) : c.minimumHeights, l = /^\[/.test(c.maximumHeights) ? (l = c.maximumHeights.replace(/\[/, "").replace("/]/", ""), r.properties[l]._value) : c.maximumHeights, s = (n.fill(s), a.fill(l), m.minimumHeights = n, m.maximumHeights = a, d._cesium.Color.WHITE), l = (d._core.isnull(c) || d._core.isnull(c.material) || (s = "[" == c.material.toString().charAt(0) && "]" == c.material.toString().charAt(c.material.length - 1) ? c.material.replace(/\[/, "").replace("/]/", "") : C.clone(c.material), s = d._core.isHtmlColor(s) ? d._color.colorFromHtmlColor(c.material) : (1 < (s = /^rgb/.test(s) ? d._color.rgbaStringToRgbaObj(s) : s).r && (s.r = s.r / 255), 1 < s.g && (s.g = s.g / 255), 1 < s.b && (s.b = s.b / 255), 1 < s.a && (s.a = s.a / 255), d._color.createColor(s.r, s.g, s.b, s.a))), "material:" + 255 * s.red + "," + 255 * s.green + "," + 255 * s.blue), n = (d.Legend.push(l), new d._cesium.GeometryInstance({ id: r, geometry: new d._cesium.WallGeometry(m), attributes: { color: new d._cesium.ColorGeometryInstanceAttribute.fromColor(s) } })); p.push(n) } c && c.time && (t = new d._cesium.TimeIntervalCollection([new d._cesium.TimeInterval({ start: c.time.start ? d._cesium.JulianDate.fromDate(new Date(c.time.start)) : d._cesium.Iso8601.MINIMUM_VALUE, stop: c.time.end ? d._cesium.JulianDate.fromDate(new Date(c.time.end)) : d._cesium.Iso8601.MAXIMUM_VALUE })])); e = d._viewer.scene.primitives.add(new d._cesium.Primitive({ geometryInstances: p, appearance: new d._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }) }), t); d.item = e, u || _this.setVisibility(!1), "function" == typeof h && h(e) }), this._core.isnull(c.id) && (c.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + options.id), { id: c.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t, style: options }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, go.prototype.createWallGeoJsonFeatureLayerProvider = function (e, t, l, i, o, r) { var c = { positions: void 0, granularity: this._cesium.Math.RADIANS_PER_DEGREE, maximumHeights: 0, minimumHeights: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT }, n = { 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 }, n = (this._core.isnull(l) || this._core.isnull(l.material) || "[" == l.material.toString().charAt(0) && "]" == l.material.toString().charAt(l.material.length - 1) || (this._core.isHtmlColor(l.material) ? l.material = this._color.colorFromHtmlColor(l.material) : (/^rgb/.test(l.material) && (l.material = this._color.rgbaStringToRgbaObj(l.material)), 1 < l.material.r && (l.material.r = l.material.r / 255), 1 < l.material.g && (l.material.g = l.material.g / 255), 1 < l.material.b && (l.material.b = l.material.b / 255), 1 < l.material.a && (l.material.a = l.material.a / 255), l.material = this._color.createColor(l.material.r, l.material.g, l.material.b, l.material.a))), new v(this._viewer, this._cesium, n)), u = (this._Provider = n, this), n = (n._loadTile = function (e) { u.Legend = []; var s = new u._cesium.PrimitiveCollection; return e.features.forEach(function (n) { var i = [], a = !1; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : (i.push(e[t]), 2 !== t || a || (a = !0)) } if (Array.isArray(n.geometry.coordinates) && 0 < n.geometry.coordinates.length) if (Array.isArray(n.geometry.coordinates[0][0])) for (var e = 0; e < n.geometry.coordinates.length; e++)i = [], o(n.geometry.coordinates[e]), t(i); else o(n.geometry.coordinates), t(i); function t(e) { /^\[/.test(l.material) && /\]$/.test(l.material) && (t = l.material.replace(/\[/, "").replace(/\]/, ""), options.material = n.properties[t], u._core.isHtmlColor(options.material) ? options.material = u._color.colorFromHtmlColor(options.material) : (/^rgb/.test(options.material) && (options.material = u._color.rgbaStringToRgbaObj(options.material)), 1 < options.material.r && (options.material.r = options.material.r / 255), 1 < options.material.g && (options.material.g = options.material.g / 255), 1 < options.material.b && (options.material.b = options.material.b / 255), 1 < options.material.a && (options.material.a = options.material.a / 255), options.material = u._color.createColor(options.material.r, options.material.g, options.material.b, options.material.a))); var t = a ? u._cesium.Cartesian3.fromDegreesArrayHeights(e) : u._cesium.Cartesian3.fromDegreesArray(e), t = (c.positions = t, n.positions = t, new Array(c.positions.length)), i = new Array(c.positions.length), o = void 0, r = void 0, o = /^\[/.test(l.minimumHeights) ? (o = l.minimumHeights.replace(/\[/, "").replace("/]/", ""), entity.properties[o]._value) : l.minimumHeights, r = /^\[/.test(l.maximumHeights) ? (r = l.maximumHeights.replace(/\[/, "").replace("/]/", ""), entity.properties[r]._value) : l.maximumHeights, o = (t.fill(o), i.fill(r), c.minimumHeights = t, c.maximumHeights = i, n.treeID = l.id, n.VectorType = "wall", n.VectorStyle = { haveZ: a, minimumHeights: t, maximumHeights: i, positions: e, material: l.material }, new u._cesium.GeometryInstance({ id: n, geometry: new u._cesium.WallGeometry(c), attributes: { color: new u._cesium.ColorGeometryInstanceAttribute.fromColor(l.material) } })), r = "material:" + 255 * l.material.red + "," + 255 * l.material.green + "," + 255 * l.material.blue, t = (u.Legend.push(r), new u._cesium.Primitive({ geometryInstances: o, appearance: new u._cesium.MaterialAppearance({ material: new u._cesium.Material({ fabric: { type: "Color", uniforms: { color: l.material } } }), faceForward: !0, flat: !1 }), vertexCacheOptimize: !0, interleave: !0, shadows: u._cesium.ShadowMode.ENABLED })); s.add(t) } }), s }, l && l.time && (n.availability = new u._cesium.TimeIntervalCollection([new u._cesium.TimeInterval({ start: l.time.start ? u._cesium.JulianDate.fromDate(new Date(l.time.start)) : u._cesium.Iso8601.MINIMUM_VALUE, stop: l.time.end ? u._cesium.JulianDate.fromDate(new Date(l.time.end)) : u._cesium.Iso8601.MAXIMUM_VALUE })])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建墙图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineWallLayer", item: this, url: t.url, style: l }); return this._Provider.treeID = l.id, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, go.prototype.setTreeobj = function (e) { this.treeobj = e }, go.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, go.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, go.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, go.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, go.prototype.setVisibility = function (e) { this.item.show = e, this._Provider && this._Provider.setStatus(!e) }, go.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, go.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }, x.prototype.createSimpleGraphic = function (e, i = {}, o) { let t = null; var r = (e, t) => { 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 < t.indexOf("Primitive") && (e.id = i.id, e.name = i.name), V.insertGroupId(e, i.GroupID) } return o }, x.prototype.getDefaultLabelStyle = function (e) { return { show: this._core.defaultValue(e.showLabel, !1), text: this._core.defaultValue(e.label_text, "新建文本"), font: this._core.defaultValue(e.label_font, "24px 宋体"), scale: this._core.defaultValue(e.label_scale, 1), style: this._core.defaultValue(e.label_style, 2), fillColor: this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_fillColor, "#ffffff")), outlineColor: this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_outlineColor, "#000000")), outlineWidth: this._core.defaultValue(e.label_outlineWidth, 0), showBackground: this._core.defaultValue(e.label_showBackground, !1), backgroundColor: this._cesium.Color.fromCssColorString(this._core.defaultValue(e.label_backgroundColor, "rgba(42,42,42,0.8)")), heightReference: this._core.defaultValue(e.label_heightReference, 1), horizontalOrigin: this._core.defaultValue(e.label_horizontalOrigin, this._cesium.HorizontalOrigin.CENTER), verticalOrigin: this._core.defaultValue(e.label_verticalOrigin, this._cesium.VerticalOrigin.CENTER), scaleByDistance: this._core.defaultValue(e.label_scaleByDistance, void 0), pixelOffset: this._core.defaultValue(e.label_pixelOffset, void 0), disableDepthTestDistance: this._core.defaultValue(e.label_disableDepthTestDistance, Number.POSITIVE_INFINITY), distanceDisplayCondition: this._core.defaultValue(e.label_distanceDisplayCondition, new this._cesium.DistanceDisplayCondition(0, 1e8)) } }, x.prototype.end = function (e) { }, x.prototype.createPoint = 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), V.states = 1, this.drawHandler.setInputAction(e => { 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 () { V.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 () { V.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), V.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 () { V.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 () { V.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), V.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 () { V.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 () { V.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), V.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), c = Cesium.Matrix4.fromRotationTranslation(i), u = 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 () { V.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, c, t), Cesium.Matrix4.multiply(t, u, t), a.modelMatrix = t) : i && (t = Cesium.Transforms.eastNorthUpToFixedFrame(i), Cesium.Matrix4.multiply(t, l, t), Cesium.Matrix4.multiply(t, c, t), Cesium.Matrix4.multiply(t, u, 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 () { V.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), V.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 () { V.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), V.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 () { V.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), V.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, u = e.lon, r = t.lat, n = t.lon, s = p(o), l = p(r), a = p(r) - p(o), c = p(n) - p(u), a = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(s) * Math.cos(l) * Math.pow(Math.sin(c / 2), 2))), a *= m, a = Math.round(1e4 * a) / 1e4, { angle: h._core.TwoPointAzimuth(u, o, n, r), distance: a }), l = s.angle, c = s.distance, u = (i.push(t.lon, t.lat), d(e.lat, e.lon, c, l + 120)); return i.push(u[0], u[1]), u = d(e.lat, e.lon, c, l - 120), i.push(u[0], u[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 () { V.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), V.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 () { V.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), V.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 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition.getMousePosition(e, a)) && (n.pop(), n.push(t), i.showSize && (o.clearLastSizeData(), o.showSizeData("rectangle", n)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition.getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("circle", n[1], s)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition.getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.states = 1, []), l, c = [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 }, c && (c[0] = e, c[1] = i), l.position = Cesium.Cartesian3.fromDegrees(o.lon, o.lat, s[0].height + c[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(c) }, !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 < s.length) { a.tooltip.showAt(t.endPosition, "再次点击结束绘制,右键取消"); let e = a._getPosition.getMouseDegrees(t, l); var i, o, r; e && (e.height = s[0].height, s[1] = e, i = a.Cdcl(s[0].lat, s[0].lon, s[0].lat, s[1].lon), o = a.Cdcl(s[0].lat, s[0].lon, s[1].lat, s[0].lon), r = { lon: (s[0].lon + s[1].lon) / 2, lat: (s[0].lat + s[1].lat) / 2 }, c && (c[0] = i, c[1] = o), l.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, s[0].height + c[2] / 2), n.showSize && (a.clearLastSizeData(), a.showSizeData("box", l.position, c))) } else a.tooltip.showAt(t.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition.getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("cylinder", n[1], s, 200)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 < n.length ? (o.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = o._getPosition.getMousePosition(e, a)) && (n[0] = t, s = o._cesium.Cartesian3.distance(n[0], n[1]), i.showSize && (o.clearLastSizeData(), o.showSizeData("cone", n[1], s, 200)))) : o.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 < a.length ? (r.tooltip.showAt(e.endPosition, "再次点击结束绘制,右键取消"), (t = r._getPosition.getMousePosition(e, s)) && (a[0] = t, l = r._cesium.Cartesian3.distance(a[0], a[1]), i.showSize && (r.clearLastSizeData(), r.showSizeData("sphere", a[1], l)))) : r.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(e => { 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 () { V.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), V.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 () { V.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; var c = language ? language.getStr("draw_tip_info_radius") : "半径"; let u = language ? language.getStr("unit_m") : "米", h = language ? language.getStr("unit_km") : "千米"; switch (o) { case "polyline": let e = Cesium.Cartesian3.distance(r[0], r[1]); s = 1e3 <= e ? (e /= 1e3).toFixed(2) + h : e.toFixed(2) + u, l = Cesium.Cartesian3.midpoint(r[0], r[1], new Cesium.Cartesian3); break; case "polygon": var m = []; l = new Cesium.Cartesian3, r.forEach(e => { l = Cesium.Cartesian3.add(e, l, new Cesium.Cartesian3); e = this.toDegrees(e); m.push([e.lon, e.lat]) }), l = Cesium.Cartesian3.divideByScalar(l, r.length, new Cesium.Cartesian3), s = this._core.getArea(m, r); break; case "rectangle": var d = this.toDegrees(r[0]), p = this.toDegrees(r[1]), p = Cesium.Cartesian3.distance(r[0], Cesium.Cartesian3.fromDegrees(d.lon, p.lat, d.height)) * Cesium.Cartesian3.distance(r[1], Cesium.Cartesian3.fromDegrees(d.lon, p.lat, d.height)); s = 1e6 <= p ? (p /= 1e6).toFixed(2) + "平方千米" : p.toFixed(2) + "平方米", l = Cesium.Cartesian3.midpoint(r[0], r[1], new Cesium.Cartesian3); break; case "circle": l = r, s = 1e3 <= n ? c + ":" + (n /= 1e3).toFixed(2) + h : c + ":" + n.toFixed(2) + u; break; case "box": let t = [], i = (n[0] < n[1] ? (t.push(n[1]), t.push(n[0])) : (t.push(n[0]), t.push(n[1])), t.push(n[2]), ["长:", "\n宽:", "\n高:"]); t.forEach((e, t) => { 1e3 <= e ? (e /= 1e3, s += i[t] + e.toFixed(2) + h) : s += i[t] + e.toFixed(2) + u }), l = r; break; case "cylinder": case "cone": l = r, s = 1e3 <= n ? c + ":" + (n /= 1e3).toFixed(2) + h + "\n" : c + ":" + n.toFixed(2) + u + "\n", 1e3 <= a ? (a /= 1e3, s += "高度:" + a.toFixed(2) + h) : s += "高度:" + a.toFixed(2) + u; break; case "sphere": l = r, s = 1e3 <= n ? c + ":" + (n /= 1e3).toFixed(2) + h : c + ":" + n.toFixed(2) + u; break; case "polyhedron": m = []; l = new Cesium.Cartesian3, r.forEach(e => { l = Cesium.Cartesian3.add(e, l, new Cesium.Cartesian3); e = this.toDegrees(e); m.push([e.lon, e.lat]) }), l = Cesium.Cartesian3.divideByScalar(l, r.length, new Cesium.Cartesian3), s = 1e3 <= a ? "高度:" + (a /= 1e3).toFixed(2) + h : "高度:" + a.toFixed(2) + u, s += "\n面积:" + this._core.getArea(m, 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 = '<table class="cesium-infoBox-defaultTable"><tbody>'; for (let e = 0; e < i.properties.propertyNames.length; e++) { var t = i.properties.propertyNames[e], o = i.properties[t]; i.description += `<tr><th>${t}</th><td>${o}</td></tr>` } i.description += "</tbody></table>" } }, x.prototype.getPropData = function (e) { let t = e.properties, i = (t = t || new Cesium.PropertyBag, {}); for (let e = 0; e < t.propertyNames.length; e++) { var o = t.propertyNames[e]; i[o] = t[o] && t[o].getValue ? t[o].getValue() : t[o] } return i }, x.prototype.defaultEdit = function () { this.openEdit ? this.SimpleGraphicObj.length && !this.editHandler ? this.edit(this.openEdit, this.editOption) : !this.SimpleGraphicObj.length && this.editHandler && this.edit(!1) : this.editHandler && this.edit(!1) }, x.prototype.edit = function (e, a) { let u = this, h = this._viewer, s = (void 0 !== (a = a || this.editOption || {}).editProp && (this.editProp = a.editProp), this._core.defaultValue(a.enableDelete, !0)); var m, d, p, g; this.editHandler && (this.editHandler.destroy(), this.editHandler = void 0), void 0 === e && (e = !0), this.isEditting = !1; let l; this.endThisEdit = () => { u.defaultEvent(!0), V.editPointID.edit.forEach(e => { h.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { h.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { h.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { h.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && h.entities.remove(V.editPointID.move), V.editPointID.move = void 0, g = m = void 0, window.layuiLayer.close(SmartEarthPopupData.layerIndex), SmartEarthPopupData.editGraphic = {}, u.isEditting = !1, u.tooltip.show(!1), u.delButton(!1), u._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)) u.isEditting && (u.endThisEdit(), u.defaultEvent(!1)); else if (!V.editVector) { var i = t.position, o = h.scene.pick(i); if (u._cesium.defined(o) && o.id instanceof Cesium.Entity) { let e = o.id; u.isEditting || 0 != V.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", u.defaultEvent(!1), "height_point" == e.name ? (p = { windowPosition: i, originHeight: u._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 ? (u.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 || u.endThisEdit() : -1 !== u.SimpleGraphicObj.indexOf(e.id) && (void 0 === (m = e).GeoType && (i = u.getEntityTypeAndObject(m), m.GeoType = i.type), g = m.GeoType, u.getSimpleGraphicData(g, m), "point" === g || "billboard" === g || "label" === g || "model" === g ? (u.isEditting = !0, "model" === g ? u._ModelEdit.start(m) : u.tooltip.showAt(t.position, "拖拽修改位置")) : (u.isEditting = !0, SmartEarthPopupData.editGraphic.updataEditPoint()), this.editProp && u.openEditProp(m, a)) } else o && "modeEditAxis" === o.id || u.endThisEdit() } }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.editHandler.setInputAction(t => { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) u.isEditting && (u.endThisEdit(), u.defaultEvent(!1)); else if (!V.editVector) { let e = h.scene.pick(t.endPosition); if (u._cesium.defined(e)) if (u.isEditting && !d) { if (Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView)) return void (u.isEditting && (u.endThisEdit(), u.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 < m.pottingPoint.length || "polygon" === g && 3 < m.pottingPoint.length ? u.tooltip.showAt(t.endPosition, "拖拽修改位置") : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : !e.id || "move_point" !== e.id.name && "size_point" !== e.id.name ? e.id && "add_point" === e.id.name ? u.tooltip.showAt(t.endPosition, "拖拽增加节点") : e.id && "height_point" === e.id.name ? u.tooltip.showAt(t.endPosition, "拖拽修改高度") : e.id == m || "modeEditAxis" === e.id ? u.tooltip.show(!1) : e.id && -1 !== u.SimpleGraphicObj.indexOf(e.id.id) || (a.editProp || !u.isEditting || "point" !== g && "billboard" !== g && "label" !== g || u.endThisEdit(), u.tooltip.show(!1)) : u.tooltip.showAt(t.endPosition, "拖拽修改位置") : s ? u.tooltip.showAt(t.endPosition, "model" === g ? "" : "拖拽修改位置") : "model" !== g && u.tooltip.showAt(t.endPosition, "拖拽修改位置") } else u.isEditting || 0 !== V.states || (e.id && -1 < u.SimpleGraphicObj.indexOf(e.id.id) ? !a.editProp && (void 0 === e.id.GeoType && (r = u.getEntityTypeAndObject(e.id), e.id.GeoType = r.type), "point" === (r = e.id.GeoType) || "billboard" === r || "label" === r) ? (m = e.id, g = r, u.getSimpleGraphicData(g, m), u.isEditting = !0, u.tooltip.showAt(t.endPosition, "拖拽修改位置")) : u.tooltip.showAt(t.endPosition, "点击激活编辑" + (s ? "" : "")) : u.tooltip.show(!1)); else 0 != V.states || d || (a.editProp || !u.isEditting || "point" !== g && "billboard" !== g && "label" !== g || u.endThisEdit(), u.tooltip.show(!1)); if (u.isEditting && d) { u.tooltip.showAt(t.endPosition, "释放后完成修改"); let i = u._getPosition.getMousePosition(t, [d, m]); if (i || "height_point" === l) if ("edit_point" === l) { d.position = i; var r = V.editPointID.edit.indexOf(d.id); if (void 0 !== m[g].height ? (n = u.toDegrees(i), m.pottingPoint[r] = Cesium.Cartesian3.fromDegrees(n.lon, n.lat, m[g].height.getValue()), d.position = m.pottingPoint[r]) : m.pottingPoint[r] = i, 0 < V.editPointID.height.length) { let e = h.entities.getById(V.editPointID.height[r]); e && (n = u.toDegrees(i), c = u._cesium.Cartographic.fromCartesian(e.position.getValue()), e.position = u._cesium.Cartesian3.fromDegrees(n.lon, n.lat, c.height)) } if (0 < V.editPointID.add.length) { if (0 < r) { let i = h.entities.getById(V.editPointID.add[r - 1]); if (i) { let e = h.entities.getById(V.editPointID.edit[r - 1]), t = h.entities.getById(V.editPointID.edit[r]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if (r < m.pottingPoint.length - 1) { let i = h.entities.getById(V.editPointID.add[r]); if (i) { let e = h.entities.getById(V.editPointID.edit[r]), t = h.entities.getById(V.editPointID.edit[r + 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } if ("polygon" === g && (0 === r || r === m.pottingPoint.length - 1)) { let i = h.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); if (i) { let e = h.entities.getById(V.editPointID.edit[0]), t = h.entities.getById(V.editPointID.edit[m.pottingPoint.length - 1]); i.position = Cesium.Cartesian3.midpoint(e.position.getValue(), t.position.getValue(), new Cesium.Cartesian3) } } } let e = m.pottingPoint.concat([]), t = new u._cesium.Cartesian3; var n = e.length; e.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= n, t.y /= n, t.z /= n, V.editPointID.move && (V.editPointID.move.position = t), "polyline" !== g && "polygon" !== g && "rectangle" !== g || SmartEarthPopupData.editGraphic.setValue("positions", e) } else if ("height_point" === l) { var c = V.editPointID.height.indexOf(d.id); let e = h.entities.getById(V.editPointID.edit[c]), i = ("ellipse" !== g && "cylinder" !== g && "box" !== g || (e = V.editPointID.move), u.toDegrees(e.position.getValue())); r = p.originHeight - i.height, n = h.scene.cartesianToCanvasCoordinates(e.position.getValue()), c = (p.windowPosition.y - t.endPosition.y) * r / Math.abs(n.y - p.windowPosition.y); let o = Math.abs(r + c); V.editPointID.height.forEach(e => { let t = h.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)) }), m[g].extrudedHeight ? m[g].extrudedHeight = new u._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 = V.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 (V.editPointID.edit.splice(t + 1, 0, n.id), m.pottingPoint.splice(t + 1, 0, i.clone()), 0 < V.editPointID.height.length) { let e = u.toDegrees(i); e.height = m[g].extrudedHeight.getValue(); r = h.entities.add({ name: "height_point", position: u._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), point: { color: u._cesium.Color.YELLOW, pixelSize: 12, outlineColor: u._cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.height.splice(t + 1, 0, r.id) } c = Cesium.Cartesian3.midpoint(m.pottingPoint[t], m.pottingPoint[t + 1], new Cesium.Cartesian3), r = h.entities.add({ name: "add_point", position: u.isClampToGround(m[g]) ? u.getClampToGroundPosition(c) : c, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c = Cesium.Cartesian3.midpoint(m.pottingPoint[t + 1], m.pottingPoint[t + 2 === m.pottingPoint.length ? 0 : t + 2], new Cesium.Cartesian3), c = h.entities.add({ name: "add_point", position: u.isClampToGround(m[g]) ? u.getClampToGroundPosition(c) : c, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), t = (V.editPointID.add.splice(t, 1, r.id, c.id), d = n, l = "edit_point", m.pottingPoint.concat([])); "polyline" !== g && "polygon" !== g || SmartEarthPopupData.editGraphic.setValue("positions", t) } else if ("size_point" === l) { r = V.editPointID.move.position.getValue(), c = u._cesium.Cartesian3.distance(r, i); "ellipse" === g || "cylinder" === g || "ellipsoid" === g && m.isSphere ? (SmartEarthPopupData.editGraphic.setValue("radius", c), SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="radius"]') && (SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="radius"]').value = parseFloat(c).toFixed(2))) : "box" === g && (n = 90 === d.angle ? "long" : "width", SmartEarthPopupData.editGraphic.setValue(n, 2 * c), SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector('.box input[name="' + n + '"]') && (SmartEarthPopupData.window.document.querySelector('.box input[name="' + n + '"]').value = parseFloat(2 * c).toFixed(2))) } else if ("model" !== g) if ("point" === g || "billboard" === g || "label" === g) d.position = i, SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="height"]') && (SmartEarthPopupData.window.document.querySelector("." + g + ' input[name="height"]').value = SmartEarthPopupData.editGraphic.getValue("pHeight").toFixed(2)); else { t = u.toDegrees(i), r = (p = d.position.getValue(), u.toDegrees(p)); let a = t.lon - r.lon, s = t.lat - r.lat, l = t.height - r.height; d.position = i, m[g].height && (n = u.toDegrees(i).height, m[g].height = n, m.thisHeight = n), m.pottingPoint.forEach((e, t) => { let i, o, r, n = h.entities.getById(V.editPointID.edit[t]); if (n = n || h.entities.getById(V.editPointID.size[t]), i = n ? u.toDegrees(n.position.getValue()) : u.toDegrees(e), r = u._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 < V.editPointID.height.length) { let e = h.entities.getById(V.editPointID.height[t]); e && (i = e.position.getValue(), o = u._cesium.Cartographic.fromCartesian(i), i = { lon: u._cesium.Math.toDegrees(o.longitude), lat: u._cesium.Math.toDegrees(o.latitude), height: o.height }, e.position = u._cesium.Cartesian3.fromDegrees(i.lon + a, i.lat + s, i.height + l)) } if (0 < V.editPointID.add.length && V.editPointID.add[t]) { let e = h.entities.getById(V.editPointID.add[t]); e && (i = u.toDegrees(e.position.getValue()), e.position = u._cesium.Cartesian3.fromDegrees(i.lon + a, i.lat + s, i.height + l)) } }); var c = m.pottingPoint.concat([]); "polyline" === g || "polygon" === g || "rectangle" === g ? (SmartEarthPopupData.editGraphic.setValue("positions", c), 0 < V.editPointID.height.length && (SmartEarthPopupData.editGraphic.setValue("extrudedHeight", SmartEarthPopupData.editGraphic.getValue("extrudedHeight") + l), SmartEarthPopupData.window && m[g].height && SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]') && (SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value = parseFloat(m[g].height.getValue()).toFixed(2))), SmartEarthPopupData.window && m[g].height && SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]') && (SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value = parseFloat(m[g].height.getValue()).toFixed(2))) : "ellipse" === g ? (m.pottingPoint[1] = i, m.position = i.clone(), SmartEarthPopupData.window && m[g].height && SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]') && (SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value = parseFloat(m[g].height.getValue()).toFixed(2))) : "box" === g ? (m.pottingPoint[2] = i, t = m.box.dimensions.getValue(), r = u.toDegrees(i), m.position = Cesium.Cartesian3.fromDegrees(r.lon, r.lat, r.height + t.z / 2)) : "cylinder" === g ? (m.pottingPoint[1] = i, n = m.cylinder.length.getValue(), c = u.toDegrees(m.pottingPoint[1]), m.position = Cesium.Cartesian3.fromDegrees(c.lon, c.lat, c.height + n / 2)) : "ellipsoid" === g && (m.pottingPoint[m.pottingPoint.length - 1] = i, m.position = i.clone()) } } } }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.editHandler.setInputAction(e => { Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? u.isEditting && (u.endThisEdit(), u.defaultEvent(!1)) : V.editVector || (d && a.callBack && a.callBack.update && a.callBack.update(d.name, m), h.container.style.cursor = "default", d = 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 && (u.endThisEdit(), u.defaultEvent(!1)); else if (!V.editVector) { var o = h.scene.pick(e.position); if (u._cesium.defined(o) && 0 == V.states) { let i = o.id; if (-1 < u.SimpleGraphicObj.indexOf(i.id) && s) u.tooltip.show(!1), u.delButton(!0, e.position, function () { i.treeobj && V.delete(i.treeobj.id, h, u._cesium), h.entities.removeById(i.id); var e = u.SimpleGraphicObj.indexOf(i.id); u.SimpleGraphicObj.splice(e, 1), u.delButton(!1), u.tooltip.show(!1), u.endThisEdit(), u.defaultEdit(), a.callBack && a.callBack.delete && a.callBack.delete(i) }); else if (-1 < V.editPointID.edit.indexOf(i.id) && ("polyline" === g && 2 < V.editPointID.edit.length || "polygon" === g && 3 < V.editPointID.edit.length)) { o = V.editPointID.edit.indexOf(i.id); if (h.entities.removeById(i.id), V.editPointID.edit.splice(o, 1), 0 < V.editPointID.height.length && (h.entities.removeById(V.editPointID.height[o]), V.editPointID.height.splice(o, 1)), m.pottingPoint.splice(o, 1), 0 < V.editPointID.add.length) if (V.editPointID.add[o]) { if (h.entities.removeById(V.editPointID.add[o]), V.editPointID.add.splice(o, 1), 0 <= o - 1) { let e = h.entities.getById(V.editPointID.add[o - 1]); e && (e.position = Cesium.Cartesian3.midpoint(m.pottingPoint[o - 1], m.pottingPoint[o === m.pottingPoint.length ? 0 : o], new Cesium.Cartesian3)) } else if (o - 1 == -1 && "polygon" === g) { let e = h.entities.getById(V.editPointID.add[V.editPointID.add.length - 1]); e && (e.position = Cesium.Cartesian3.midpoint(m.pottingPoint[0], m.pottingPoint[m.pottingPoint.length - 1], new Cesium.Cartesian3)) } } else h.entities.removeById(V.editPointID.add[o - 1]), V.editPointID.add.pop(); let t = new u._cesium.Cartesian3; e = m.pottingPoint.length, o = (m.pottingPoint.forEach(e => { t.x += e.x, t.y += e.y, t.z += e.z }), t.x /= e, t.y /= e, t.z /= e, V.editPointID.move && (V.editPointID.move.position = t), m.pottingPoint.concat([])); "polyline" !== g && "polygon" !== g || SmartEarthPopupData.editGraphic.setValue("positions", o), u.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;
@@ -90,7 +119,11 @@
                                    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=c("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.alpha=100*e.alpha}function l(e){SmartEarthPopupData.editGraphic.outlineColor=c("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")"),SmartEarthPopupData.editGraphic.outlineAlpha=100*e.alpha}function c(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<o.length;t++){let e=Number(o[t]).toString(16);"0"===(e=1===e.length?"0"+e:e)&&(e+=e),i+=e}return i=7!==i.length?t:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t))return t;var i=t.replace(/#/,"").split("");if(6===i.length)return t;if(3===i.length){let t="#";for(let e=0;e<i.length;e+=1)t+=i[e]+i[e];return t}}SmartEarthPopupData.editGraphic={entity:n,type:r,graphic:n[r],labelGraphic:n.label,getValue:function(e){return"position"===e||"name"===e||"id"===e||"orientation"===e||"heading"===e||"pitch"===e||"roll"===e?this.entity[e]&&(this.entity[e].getValue?this.entity[e].getValue():this.entity[e]):"radius"===e?"ellipse"===this.type?this.graphic.semiMajorAxis.getValue():"ellipsoid"===this.type?this.graphic.radii.getValue().x:"cylinder"===this.type?this.graphic.bottomRadius.getValue():void 0:"pHeight"!==e?"repeat"===e?this.graphic.material[e]&&(this.graphic.material[e].getValue?this.graphic.material[e].getValue():this.graphic.material[e]):-1<e.indexOf("label_")?(e=e.replace("label_",""),this.labelGraphic&&this.labelGraphic[e]&&(this.labelGraphic[e].getValue?this.labelGraphic[e].getValue():this.labelGraphic[e])):this.graphic[e]&&(this.graphic[e].getValue?this.graphic[e].getValue():this.graphic[e]):this.getValue("position")?(e=this.getValue("position"),Cesium.Cartographic.fromCartesian(e).height):void 0},changeHeightPoint:function(i){0<V.editPointID.height.length&&V.editPointID.height.forEach(e=>{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<V.editPointID.edit.length&&V.editPointID.edit.forEach(e=>{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<V.editPointID.size.length&&V.editPointID.size.forEach(e=>{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<V.editPointID.add.length&&V.editPointID.add.forEach(e=>{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=V.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(){V.editPointID.edit.forEach(e=>{s.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{s.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{s.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{s.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&s.entities.remove(V.editPointID.move),V.editPointID.move=void 0}},"billboard"===r&&((e=SmartEarthPopupData.editGraphic.getValue("label_fillColor"))?(e=e,SmartEarthPopupData.editGraphic.label_fillColor=c("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=c("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=c("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=c("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<this.entity.heading&&(this.entity.heading-=360),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value=this.entity.heading),Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll)))),!1),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!0))):!1===t&&(this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll))),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!1)));else if("heading"!==e&&"pitch"!==e&&"roll"!==e||"model"!==this.type)if("pHeight"===e){if(this.getValue("position")){var o=this.getValue("position");let e=Cesium.Cartographic.fromCartesian(o);e.height=t,this.entity.position=Cesium.Cartographic.toCartesian(e)}}else if(-1<e.indexOf("label_")){if("color"===(e=e.replace("label_",""))||"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(this.labelGraphic.fillColor._value.alpha=t);if("outlineAlpha"===e)return void(this.labelGraphic.outlineColor._value.alpha=t);if("backgroundAlpha"===e)return void(this.labelGraphic.backgroundColor._value.alpha=t)}this.labelGraphic[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)}this.graphic[e]=t}else this.entity[e]=t,this.entity.orientation=Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading),Cesium.Math.toRadians(this.entity.pitch),Cesium.Math.toRadians(this.entity.roll)))}):"polyline"===r?((i=SmartEarthPopupData.editGraphic.getValue("material")).color?o(i.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),i.outlineColor?l(i.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(e,t){"name"===e?this.entity[e]=t:"color"===e||"outlineColor"===e?(t=Cesium.Color.fromCssColorString(t),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 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(V.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}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"add_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(i):i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});V.editPointID.add.push(i.id)}}}):"polygon"===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.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(t)},!1));if("hierarchy"===e)return void(this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return t},!1));function i(e,t,i){i?(e.perPositionHeight=!1,e.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(e.perPositionHeight=!0,e.heightReference=Cesium.HeightReference.NONE),0<V.editPointID.edit.length&&!i&&t.forEach((e,t)=>{let i=s.entities.getById(V.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(V.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}});V.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,V.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.length-1;e++){var i=Cesium.Cartesian3.midpoint(t[e],t[e+1],new Cesium.Cartesian3),i=s.entities.add({name:"add_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(i):i,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});V.editPointID.add.push(i.id)}var o=Cesium.Cartesian3.midpoint(t[0],t[t.length-1],new Cesium.Cartesian3),o=s.entities.add({name:"add_point",position:a.isClampToGround(this.graphic)?a.getClampToGroundPosition(o):o,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});V.editPointID.add.push(o.id)}}):"ellipse"===r||"cylinder"===r||n.isSphere?((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,i){if("name"===e)this.entity[e]=i;else{if("color"===e||"outlineColor"===e){if(i=Cesium.Color.fromCssColorString(i),"color"===e)return void(this.graphic.material.color=i)}else{if("image"===e||"repeat"===e)return void(this.graphic.material[e]=i);if("alpha"===e)return void(this.graphic.material.color._value.alpha=i);if("outlineAlpha"===e)return void(this.graphic.outlineColor._value.alpha=i);if("semiMajorAxis"===e)return void(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("semiMinorAxis"===e)return void(this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1));if("radii"===e)return void(this.graphic.radii=new Cesium.CallbackProperty(function(){return i},!1));if("topRadius"===e)return void(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1));if("bottomRadius"===e)return void(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1));if("radius"===e){"ellipse"===this.type?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return i},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return i},!1)):"ellipsoid"===this.type?null!==this.graphic.material.image.getValue()?this.graphic.radii=new Cesium.Cartesian3(i,i,i):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(i,i,i)},!1):"cylinder"===this.type&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return i},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return i},!1)));var o=V.editPointID.move.position.getValue(),r=a.GetPositionFromA_D(o,i,90);let e=s.entities.getById(V.editPointID.size[0]),t=(e.position=r,n.pottingPoint[0]=r,n.pottingPoint[n.pottingPoint.length-1]=o,s.entities.getById(V.editPointID.height[0]));return void(t&&(o=a.toDegrees(r),r=a._cesium.Cartographic.fromCartesian(t.position.getValue()),t.position=a._cesium.Cartesian3.fromDegrees(o.lon,o.lat,r.height)))}if("cylinder"===this.type&&"length"===e)return this.graphic.length=i,o=a.toDegrees(this.entity.pottingPoint[1]),this.entity.position=Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height+i/2),void this.changeHeightPoint(o.height+i);function t(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.semiMinorAxis.getValue();t.semiMinorAxis=new Cesium.CallbackProperty(function(){return o},!1),t.semiMajorAxis=new Cesium.CallbackProperty(function(){return o},!1)}if("ellipse"===this.type&&"clampToGround"===e)return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{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,V.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}});V.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}}),V.editPointID.height.push(void 0,o.id));V.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(V.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}});V.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,V.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=V.editPointID.move.position.getValue(),o=a.GetPositionFromA_D(n,i/2,o);let e=s.entities.getById(V.editPointID.size[r]);e.position=o,this.entity.pottingPoint[r]=o,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=n}else{r=a.toDegrees(V.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,V.editPointID.size.push(e.id),V.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}});V.editPointID.height.push(void 0,void 0,o.id),V.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.indexOf("label_")?(e=e.replace("label_",""),t.label&&t.label[e]&&(t.label[e].getValue?t.label[e].getValue():t.label[e])):t[i][e]&&(t[i][e].getValue?t[i][e].getValue():t[i][e])}return"point"===i?e={id:n("id"),name:n("name"),position:n("position"),pixelSize:n("pixelSize"),scaleByDistance:n("scaleByDistance"),color:n("color")&&n("color").toCssColorString(),outlineWidth:n("outlineWidth"),outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"billboard"===i?(r={showLabel:n("label_show"),label_text:n("label_text"),label_font:n("label_font"),label_style:n("label_style"),label_scale:n("label_scale"),label_scaleByDistance:n("label_scaleByDistance"),label_fillColor:n("label_fillColor")&&n("label_fillColor").toCssColorString(),label_outlineColor:n("label_outlineColor")&&n("label_outlineColor").toCssColorString(),label_outlineWidth:n("label_outlineWidth"),label_showBackground:n("label_showBackground"),label_backgroundColor:n("label_backgroundColor")&&n("label_backgroundColor").toCssColorString(),label_horizontalOrigin:n("label_horizontalOrigin"),label_verticalOrigin:n("label_verticalOrigin"),label_heightReference:n("label_heightReference"),label_distanceDisplayCondition:r&&{near:r.near,far:r.far}},e={id:n("id"),name:n("name"),position:n("position"),image:n("image"),scale:n("scale"),scaleByDistance:n("scaleByDistance"),rotation:n("rotation"),width:n("width"),height:n("height"),color:n("color")&&n("color").toCssColorString(),horizontalOrigin:n("horizontalOrigin"),verticalOrigin:n("verticalOrigin"),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far},...r}):"label"===i?e={id:n("id"),name:n("name"),position:n("position"),text:n("text"),font:n("font"),style:n("style"),scale:n("scale"),scaleByDistance:n("scaleByDistance"),fillColor:n("fillColor")&&n("fillColor").toCssColorString(),outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outlineWidth:n("outlineWidth"),showBackground:n("showBackground"),backgroundColor:n("backgroundColor")&&n("backgroundColor").toCssColorString(),horizontalOrigin:n("horizontalOrigin"),verticalOrigin:n("verticalOrigin"),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"model"===i?e={id:n("id"),name:n("name"),position:n("position"),url:n("uri"),minimumPixelSize:n("minimumPixelSize"),runAnimations:n("runAnimations"),scale:n("scale"),heading:t.heading,pitch:t.pitch,roll:t.roll,color:n("color")&&n("color").toCssColorString(),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"polyline"===i?e={id:n("id"),name:n("name"),positions:n("positions"),clampToGround:n("clampToGround"),color:n("material")&&n("material").color.toCssColorString(),outlineWidth:n("material")&&n("material").outlineWidth,outlineColor:n("material")&&n("material").outlineColor.toCssColorString(),width:n("width"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"polylineVolume"!==i&&"corridor"!==i&&"wall"!==i&&"path"!==i&&"plane"!==i&&("polygon"===i?e={id:n("id"),name:n("name"),positions:n("hierarchy").positions,color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),perPositionHeight:n("perPositionHeight"),height:n("height"),extrudedHeight:n("extrudedHeight"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"ellipse"===i?(e={id:n("id"),name:n("name"),position:n("position"),radius:n("radius"),semiMajorAxis:n("semiMajorAxis"),semiMinorAxis:n("semiMinorAxis"),color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),height:n("height"),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}},i="circle"):"rectangle"===i?e={id:n("id"),name:n("name"),coordinates:n("coordinates"),color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),height:n("height"),rotation:n("rotation"),heightReference:n("heightReference"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"box"===i?e={id:n("id"),name:n("name"),position:n("position"),dimensions:n("dimensions"),color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far}}:"cylinder"===i?e={id:n("id"),name:n("name"),position:n("position"),radius:n("radius"),topRadius:n("topRadius"),bottomRadius:n("bottomRadius"),length:n("length"),color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far},changeTop:t.changeTop}:"ellipsoid"===i&&(e={id:n("id"),name:n("name"),position:n("position"),radius:n("radius"),radii:n("radii"),color:n("material")&&n("material").color.toCssColorString(),image:n("material")&&n("material").image,repeat:n("material")&&n("material").repeat,outlineColor:n("outlineColor")&&n("outlineColor").toCssColorString(),outline:n("outline"),distanceDisplayCondition:o&&{near:o.near,far:o.far},isSphere:t.isSphere})),e.type=i,e.propData=this.getPropData(t),e},x.prototype.addPlotting=function(e){var t;let i=new this._cesium.EntityCollection;("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<this.SimpleGraphicObj.indexOf(e.style.id)||(t=this.addSimpleGraphic(e.type,e.style,e.treeobj),e.removeEdit||this.SimpleGraphicObj.push(t.id),i.add(t))},x.prototype.addFeatures=function(e){let t=new this._cesium.EntityCollection;return e.forEach(e=>{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<this.SimpleGraphicObj.indexOf(e.style.id)))return this.addSimpleGraphic(e.type,e.style)},x.prototype.open=function(e,t){let i=this,o=this._viewer,r=new FileReader;r.readAsText(e),r.onload=function(){var e=JSON.parse(this.result).features,e=i.addFeatures(e);o.flyTo(e),t&&"function"==typeof t&&t(e)}},x.prototype.ImportPlotting=function(e,t){let i=this,o=this._viewer,r=new FileReader;r.readAsText(e),r.onload=function(){var e=JSON.parse(this.result).features,e=i.addFeatures(e);o.flyTo(e),t&&"function"==typeof t&&t(e)}},x.prototype.analysisJson=function(t,e){this.featuresPlotting=[];for(let e=0;e<t.length;e++)t[e]instanceof Array?this.analysisJson(t[e]):this.ScreenPlotting(t[e]);var i=that.addFeatures(featuresPlotting);viewer.flyTo(i),e&&"function"==typeof e&&e(i)},x.prototype.ScreenPlotting=function(e){-1!=e.treeobj.type.indexOf("Plotting")&&this.featuresPlotting.push(e)};var fo,_o,Co=[];function yo(e){this._viewer=e,this._core=new f,this.points=[],this._SimpleGraphic=new x(this._viewer),this._SimpleGraphic.setEdit(!1)}x.prototype.createsj=function(t){let i=0,e="";if(0!=t.style.pId)for(let e=0;e<Co.length;e++)Co[e].id===t.style.pId&&(i=Co[e].real);"group"===t.type?e=this._createGroup.createGroup(t.style.name,!1,i):t.treeData?(t.treeData.GroupID=i,this.CreateLayer(t)):this.addPlotting(t);var o={pid:i,real:e,id:t.style.id};Co.push(o)},x.prototype.CreateLayer=function(e){let t=e.treeData.geoOptions.styletype,i=e.treeData.geoOptions.servertype;void 0===t&&(t="polygonbase"),void 0===i&&(i="geojson"),e.treeobj.pId&&(e.treeData.GroupID=e.treeobj.pId),"billboardlayer"==t?"vector"==i?this._billboardGeoJsonFeatureLayer.createBillboardGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createBillboardGeoJsonFeature(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"labellayer"==t?"vector"==i?"rich"!=e.treeData.styleOption.textType&&(1==e.treeData.styleOption.heightReference&&(e.treeData.styleOption.heightReference=void 0),this._LabelGeoJsonFeatureLayercopy.createPrimitiveLabelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):e.treeData.styleOption.collect?this._LabelGeoJsonFeatureLayercopy.createLabelPolymerizationGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"rich"==e.treeData.styleOption.textType?this._LabelGeoJsonFeatureLayercopy.createLabelRichtextGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._LabelGeoJsonFeatureLayercopy.createLabelPointGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"SXTLabellayer"==t?"vector"==i&&"rich"!=e.treeData.styleOption.textType&&this._LabelGeoJsonFeatureLayercopy.createSXTLabelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"pointlayer"==t?"vector"==i?this._VectorGeoJsonFeatureLayer.createPointGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):e.treeData.styleOption.collect?this._LabelGeoJsonFeatureLayercopy.createPointPolymerizationGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPointGeojsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"Streetscape"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):(e.treeData.styleOption.opacity&&e.treeData.styleOption.material&&-1<e.treeData.styleOption.material.indexOf("#")&&1==!e.treeData.styleOption.opacity&&(e.treeData.styleOption.material+=100*e.treeData.styleOption.opacity),this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):"polylinelayer"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylinemodellayer"==t?"vector"==i?this._PolylineGeoJsonFeatureLayer.createPolylineVectorGeoJsonFeatureLayerProviderModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._PointModel.exectPointModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonmodellayer"==t?"vector"==i?this._PolygonGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayerProviderModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._PointModel.createPolygonModel(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonbase"==t?"vector"==i?"1"==e.treeData.styleOption.ground?(e.treeData.styleOption.extrudedHeightReference=1,this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):this._VectorGeoJsonFeatureLayer.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):e.treeData.styleOption.material&&-1!=e.treeData.styleOption.material.indexOf(".jpg")?this._GeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polygonlayer"==t?"vector"==i?(e.treeData.styleOption.classificationType=0)==e.treeData.styleOption.classificationType?this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):(e.treeData.styleOption.classificationType=2,e.treeData.styleOption.ground="1",this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderClassOptimization(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)):e.treeData.styleOption.material&&-1!=e.treeData.styleOption.material.indexOf(".jpg")?this._PolygonVectorTileLayerArcgis.createPolygonMapGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"modellayer"==t?"vector"==i?this._VectorGeoJsonFeatureLayer.createModelGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createModelPointGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylinevolumelayer"==t?"vector"==i?this._VolumeGeoJsonFeatureLayer.createVolumeGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createpolylineVolumeGeojsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"polylineWallLayer"==t?"vector"==i?this._WallGeoFeatureLayer.createWallGeoJsonFeatureLayerProvider(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):this._GeoJsonFeatureLayer.createWallGeoFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"primiviteModels"==t?this._PolygonVectorGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.styleOption.level_max,e.treeData.styleOption.level_min,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"primiviteWall"==t?"vector"!=i&&this._WallGeoFeatureLayer.createWallPrimitiveGeoFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc):"model"!=t&&"pointcloudmodel"!=t&&"rasterlayer"!=t&&this._GeoJsonFeatureLayer.createGeoJsonFeatureLayer(e.treeData.name,e.treeData.geoOptions,e.treeData.styleOption,e.treeData.GroupID,e.treeData.checked,e.treeData.disFnc)},x.prototype.remove=function(e){let t=this._viewer;var i=this.SimpleGraphicObj.indexOf(e);-1<i&&(t.entities.removeById(e),this.SimpleGraphicObj.splice(i,1),SmartEarthPopupData&&SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.getValue&&SmartEarthPopupData.editGraphic.getValue("id")===e&&(V.editPointID.edit.forEach(e=>{t.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{t.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{t.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{t.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&t.entities.remove(V.editPointID.move),V.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(),V.editPointID.edit.forEach(e=>{t.entities.removeById(e)}),V.editPointID.edit=[],V.editPointID.height.forEach(e=>{t.entities.removeById(e)}),V.editPointID.height=[],V.editPointID.add.forEach(e=>{t.entities.removeById(e)}),V.editPointID.add=[],V.editPointID.size.forEach(e=>{t.entities.removeById(e)}),V.editPointID.size=[],V.editPointID.move&&t.entities.remove(V.editPointID.move),V.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&&(V.delete(e.treeobj.id,this._viewer,this._cesium),o=e.treeobj.pId),new Ti(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){}},yo.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},yo.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})},yo.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})},yo.prototype.setVisibility=function(e){},yo.prototype.deleteObject=function(){this._SimpleGraphic.clear()};let vo;function wo(e){this._viewer=e,this.left=[],this.right=[]}function bo(){window.removeEventListener("mousemove",So,!1),window.removeEventListener("mouseup",bo,!1)}function To(e){vo.dragStartX=e.clientX-vo.slider.offsetLeft,window.addEventListener("mousemove",So,!1),window.addEventListener("mouseup",bo,!1)}function So(e){e=(e.clientX-vo.dragStartX)/vo.slider.parentElement.offsetWidth;vo.slider.style.left=100*e+"%",vo.scene.splitPosition=e}function Eo(e){this._core=new f,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 Po(e,t){this._viewer=e,this._cesium=t}function xo(e,t){this._viewer=e,this._cesium=t,this._core=new f,this.Fireworks=[],this.Smog=[],this.Fountain=[],this.Flame=[],this.Blast=[]}function Do(e){this._viewer=e,this._depth=100,this.show=!1}function Io(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,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}wo.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",To,!1),this.slider=e,vo={dragStartX:0,slider:e,scene:this._viewer.scene}},wo.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},wo.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)},wo.prototype.close=function(){this.slider&&(this._viewer.scene.splitPosition=0,this.slider.removeEventListener("mousedown",To,!1),window.removeEventListener("mouseup",bo,!1),window.removeEventListener("mousemove",So,!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=[],vo=null)},Eo.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;`, 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 = c("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.alpha = 100 * e.alpha } function l(e) { SmartEarthPopupData.editGraphic.outlineColor = c("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")"), SmartEarthPopupData.editGraphic.outlineAlpha = 100 * e.alpha } function c(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 < o.length; t++) { let e = Number(o[t]).toString(16); "0" === (e = 1 === e.length ? "0" + e : e) && (e += e), i += e } return i = 7 !== i.length ? t : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) return t; var i = t.replace(/#/, "").split(""); if (6 === i.length) return t; if (3 === i.length) { let t = "#"; for (let e = 0; e < i.length; e += 1)t += i[e] + i[e]; return t } } SmartEarthPopupData.editGraphic = { entity: n, type: r, graphic: n[r], labelGraphic: n.label, getValue: function (e) { return "position" === e || "name" === e || "id" === e || "orientation" === e || "heading" === e || "pitch" === e || "roll" === e ? this.entity[e] && (this.entity[e].getValue ? this.entity[e].getValue() : this.entity[e]) : "radius" === e ? "ellipse" === this.type ? this.graphic.semiMajorAxis.getValue() : "ellipsoid" === this.type ? this.graphic.radii.getValue().x : "cylinder" === this.type ? this.graphic.bottomRadius.getValue() : void 0 : "pHeight" !== e ? "repeat" === e ? this.graphic.material[e] && (this.graphic.material[e].getValue ? this.graphic.material[e].getValue() : this.graphic.material[e]) : -1 < e.indexOf("label_") ? (e = e.replace("label_", ""), this.labelGraphic && this.labelGraphic[e] && (this.labelGraphic[e].getValue ? this.labelGraphic[e].getValue() : this.labelGraphic[e])) : this.graphic[e] && (this.graphic[e].getValue ? this.graphic[e].getValue() : this.graphic[e]) : this.getValue("position") ? (e = this.getValue("position"), Cesium.Cartographic.fromCartesian(e).height) : void 0 }, changeHeightPoint: function (i) { 0 < V.editPointID.height.length && V.editPointID.height.forEach(e => { 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 < V.editPointID.edit.length && V.editPointID.edit.forEach(e => { 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 < V.editPointID.size.length && V.editPointID.size.forEach(e => { 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 < V.editPointID.add.length && V.editPointID.add.forEach(e => { 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 = V.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 () { V.editPointID.edit.forEach(e => { s.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { s.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { s.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { s.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && s.entities.remove(V.editPointID.move), V.editPointID.move = void 0 } }, "billboard" === r && ((e = SmartEarthPopupData.editGraphic.getValue("label_fillColor")) ? (e = e, SmartEarthPopupData.editGraphic.label_fillColor = c("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 = c("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 = c("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 = c("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 < this.entity.heading && (this.entity.heading -= 360), SmartEarthPopupData.window && SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value = this.entity.heading), Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading), Cesium.Math.toRadians(this.entity.pitch), Cesium.Math.toRadians(this.entity.roll)))), !1), SmartEarthPopupData.window && (SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled = !0), SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled = !0), SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled = !0))) : !1 === t && (this.entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading), Cesium.Math.toRadians(this.entity.pitch), Cesium.Math.toRadians(this.entity.roll))), SmartEarthPopupData.window && (SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled = !1), SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled = !1), SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]') && (SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled = !1))); else if ("heading" !== e && "pitch" !== e && "roll" !== e || "model" !== this.type) if ("pHeight" === e) { if (this.getValue("position")) { var o = this.getValue("position"); let e = Cesium.Cartographic.fromCartesian(o); e.height = t, this.entity.position = Cesium.Cartographic.toCartesian(e) } } else if (-1 < e.indexOf("label_")) { if ("color" === (e = e.replace("label_", "")) || "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 (this.labelGraphic.fillColor._value.alpha = t); if ("outlineAlpha" === e) return void (this.labelGraphic.outlineColor._value.alpha = t); if ("backgroundAlpha" === e) return void (this.labelGraphic.backgroundColor._value.alpha = t) } this.labelGraphic[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) } this.graphic[e] = t } else this.entity[e] = t, this.entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(this.getValue("position"), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.entity.heading), Cesium.Math.toRadians(this.entity.pitch), Cesium.Math.toRadians(this.entity.roll))) }) : "polyline" === r ? ((i = SmartEarthPopupData.editGraphic.getValue("material")).color ? o(i.color) : (SmartEarthPopupData.editGraphic.fillColor = "#00ff00", SmartEarthPopupData.editGraphic.alpha = 60), i.outlineColor ? l(i.outlineColor) : (SmartEarthPopupData.editGraphic.outlineColor = "#ffffff", SmartEarthPopupData.editGraphic.outlineAlpha = 60), SmartEarthPopupData.editGraphic.setValue = function (e, t) { "name" === e ? this.entity[e] = t : "color" === e || "outlineColor" === e ? (t = Cesium.Color.fromCssColorString(t), 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 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 (V.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 } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(i) : i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(i.id) } } }) : "polygon" === 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.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(t) }, !1)); if ("hierarchy" === e) return void (this.graphic.hierarchy = new Cesium.CallbackProperty(function () { return t }, !1)); function i(e, t, i) { i ? (e.perPositionHeight = !1, e.heightReference = Cesium.HeightReference.CLAMP_TO_GROUND) : (e.perPositionHeight = !0, e.heightReference = Cesium.HeightReference.NONE), 0 < V.editPointID.edit.length && !i && t.forEach((e, t) => { let i = s.entities.getById(V.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 (V.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 } }); V.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, V.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.length - 1; e++) { var i = Cesium.Cartesian3.midpoint(t[e], t[e + 1], new Cesium.Cartesian3), i = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(i) : i, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(i.id) } var o = Cesium.Cartesian3.midpoint(t[0], t[t.length - 1], new Cesium.Cartesian3), o = s.entities.add({ name: "add_point", position: a.isClampToGround(this.graphic) ? a.getClampToGroundPosition(o) : o, point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE.withAlpha(.4), outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.4), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); V.editPointID.add.push(o.id) } }) : "ellipse" === r || "cylinder" === r || n.isSphere ? ((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, i) { if ("name" === e) this.entity[e] = i; else { if ("color" === e || "outlineColor" === e) { if (i = Cesium.Color.fromCssColorString(i), "color" === e) return void (this.graphic.material.color = i) } else { if ("image" === e || "repeat" === e) return void (this.graphic.material[e] = i); if ("alpha" === e) return void (this.graphic.material.color._value.alpha = i); if ("outlineAlpha" === e) return void (this.graphic.outlineColor._value.alpha = i); if ("semiMajorAxis" === e) return void (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("semiMinorAxis" === e) return void (this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radii" === e) return void (this.graphic.radii = new Cesium.CallbackProperty(function () { return i }, !1)); if ("topRadius" === e) return void (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("bottomRadius" === e) return void (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1)); if ("radius" === e) { "ellipse" === this.type ? (this.graphic.semiMajorAxis = new Cesium.CallbackProperty(function () { return i }, !1), this.graphic.semiMinorAxis = new Cesium.CallbackProperty(function () { return i }, !1)) : "ellipsoid" === this.type ? null !== this.graphic.material.image.getValue() ? this.graphic.radii = new Cesium.Cartesian3(i, i, i) : this.graphic.radii = new Cesium.CallbackProperty(function () { return new Cesium.Cartesian3(i, i, i) }, !1) : "cylinder" === this.type && (this.graphic.bottomRadius = new Cesium.CallbackProperty(function () { return i }, !1), this.entity.changeTop && (this.graphic.topRadius = new Cesium.CallbackProperty(function () { return i }, !1))); var o = V.editPointID.move.position.getValue(), r = a.GetPositionFromA_D(o, i, 90); let e = s.entities.getById(V.editPointID.size[0]), t = (e.position = r, n.pottingPoint[0] = r, n.pottingPoint[n.pottingPoint.length - 1] = o, s.entities.getById(V.editPointID.height[0])); return void (t && (o = a.toDegrees(r), r = a._cesium.Cartographic.fromCartesian(t.position.getValue()), t.position = a._cesium.Cartesian3.fromDegrees(o.lon, o.lat, r.height))) } if ("cylinder" === this.type && "length" === e) return this.graphic.length = i, o = a.toDegrees(this.entity.pottingPoint[1]), this.entity.position = Cesium.Cartesian3.fromDegrees(o.lon, o.lat, o.height + i / 2), void this.changeHeightPoint(o.height + i); function t(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.semiMinorAxis.getValue(); t.semiMinorAxis = new Cesium.CallbackProperty(function () { return o }, !1), t.semiMajorAxis = new Cesium.CallbackProperty(function () { return o }, !1) } if ("ellipse" === this.type && "clampToGround" === e) return this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty ? (this.graphic.semiMinorAxis = this.graphic.semiMinorAxis.getValue(), this.graphic.semiMajorAxis = this.graphic.semiMajorAxis.getValue(), setTimeout(() => { 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, V.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 } }); V.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 } }), V.editPointID.height.push(void 0, o.id)); V.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 (V.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 } }); V.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, V.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 = V.editPointID.move.position.getValue(), o = a.GetPositionFromA_D(n, i / 2, o); let e = s.entities.getById(V.editPointID.size[r]); e.position = o, this.entity.pottingPoint[r] = o, this.entity.pottingPoint[this.entity.pottingPoint.length - 1] = n } else { r = a.toDegrees(V.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, V.editPointID.size.push(e.id), V.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 } }); V.editPointID.height.push(void 0, void 0, o.id), V.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.indexOf("label_") ? (e = e.replace("label_", ""), t.label && t.label[e] && (t.label[e].getValue ? t.label[e].getValue() : t.label[e])) : t[i][e] && (t[i][e].getValue ? t[i][e].getValue() : t[i][e]) } return "point" === i ? e = { id: n("id"), name: n("name"), position: n("position"), pixelSize: n("pixelSize"), scaleByDistance: n("scaleByDistance"), color: n("color") && n("color").toCssColorString(), outlineWidth: n("outlineWidth"), outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "billboard" === i ? (r = { showLabel: n("label_show"), label_text: n("label_text"), label_font: n("label_font"), label_style: n("label_style"), label_scale: n("label_scale"), label_scaleByDistance: n("label_scaleByDistance"), label_fillColor: n("label_fillColor") && n("label_fillColor").toCssColorString(), label_outlineColor: n("label_outlineColor") && n("label_outlineColor").toCssColorString(), label_outlineWidth: n("label_outlineWidth"), label_showBackground: n("label_showBackground"), label_backgroundColor: n("label_backgroundColor") && n("label_backgroundColor").toCssColorString(), label_horizontalOrigin: n("label_horizontalOrigin"), label_verticalOrigin: n("label_verticalOrigin"), label_heightReference: n("label_heightReference"), label_distanceDisplayCondition: r && { near: r.near, far: r.far } }, e = { id: n("id"), name: n("name"), position: n("position"), image: n("image"), scale: n("scale"), scaleByDistance: n("scaleByDistance"), rotation: n("rotation"), width: n("width"), height: n("height"), color: n("color") && n("color").toCssColorString(), horizontalOrigin: n("horizontalOrigin"), verticalOrigin: n("verticalOrigin"), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far }, ...r }) : "label" === i ? e = { id: n("id"), name: n("name"), position: n("position"), text: n("text"), font: n("font"), style: n("style"), scale: n("scale"), scaleByDistance: n("scaleByDistance"), fillColor: n("fillColor") && n("fillColor").toCssColorString(), outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outlineWidth: n("outlineWidth"), showBackground: n("showBackground"), backgroundColor: n("backgroundColor") && n("backgroundColor").toCssColorString(), horizontalOrigin: n("horizontalOrigin"), verticalOrigin: n("verticalOrigin"), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "model" === i ? e = { id: n("id"), name: n("name"), position: n("position"), url: n("uri"), minimumPixelSize: n("minimumPixelSize"), runAnimations: n("runAnimations"), scale: n("scale"), heading: t.heading, pitch: t.pitch, roll: t.roll, color: n("color") && n("color").toCssColorString(), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "polyline" === i ? e = { id: n("id"), name: n("name"), positions: n("positions"), clampToGround: n("clampToGround"), color: n("material") && n("material").color.toCssColorString(), outlineWidth: n("material") && n("material").outlineWidth, outlineColor: n("material") && n("material").outlineColor.toCssColorString(), width: n("width"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "polylineVolume" !== i && "corridor" !== i && "wall" !== i && "path" !== i && "plane" !== i && ("polygon" === i ? e = { id: n("id"), name: n("name"), positions: n("hierarchy").positions, color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), perPositionHeight: n("perPositionHeight"), height: n("height"), extrudedHeight: n("extrudedHeight"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "ellipse" === i ? (e = { id: n("id"), name: n("name"), position: n("position"), radius: n("radius"), semiMajorAxis: n("semiMajorAxis"), semiMinorAxis: n("semiMinorAxis"), color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), height: n("height"), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } }, i = "circle") : "rectangle" === i ? e = { id: n("id"), name: n("name"), coordinates: n("coordinates"), color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), height: n("height"), rotation: n("rotation"), heightReference: n("heightReference"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "box" === i ? e = { id: n("id"), name: n("name"), position: n("position"), dimensions: n("dimensions"), color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far } } : "cylinder" === i ? e = { id: n("id"), name: n("name"), position: n("position"), radius: n("radius"), topRadius: n("topRadius"), bottomRadius: n("bottomRadius"), length: n("length"), color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far }, changeTop: t.changeTop } : "ellipsoid" === i && (e = { id: n("id"), name: n("name"), position: n("position"), radius: n("radius"), radii: n("radii"), color: n("material") && n("material").color.toCssColorString(), image: n("material") && n("material").image, repeat: n("material") && n("material").repeat, outlineColor: n("outlineColor") && n("outlineColor").toCssColorString(), outline: n("outline"), distanceDisplayCondition: o && { near: o.near, far: o.far }, isSphere: t.isSphere })), e.type = i, e.propData = this.getPropData(t), e }, x.prototype.addPlotting = function (e) { var t; let i = new this._cesium.EntityCollection; ("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 < this.SimpleGraphicObj.indexOf(e.style.id) || (t = this.addSimpleGraphic(e.type, e.style, e.treeobj), e.removeEdit || this.SimpleGraphicObj.push(t.id), i.add(t)) }, x.prototype.addFeatures = function (e) { let t = new this._cesium.EntityCollection; return e.forEach(e => { 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 < this.SimpleGraphicObj.indexOf(e.style.id))) return this.addSimpleGraphic(e.type, e.style) }, x.prototype.open = function (e, t) { let i = this, o = this._viewer, r = new FileReader; r.readAsText(e), r.onload = function () { var e = JSON.parse(this.result).features, e = i.addFeatures(e); o.flyTo(e), t && "function" == typeof t && t(e) } }, x.prototype.ImportPlotting = function (e, t) { let i = this, o = this._viewer, r = new FileReader; r.readAsText(e), r.onload = function () { var e = JSON.parse(this.result).features, e = i.addFeatures(e); o.flyTo(e), t && "function" == typeof t && t(e) } }, x.prototype.analysisJson = function (t, e) { this.featuresPlotting = []; for (let e = 0; e < t.length; e++)t[e] instanceof Array ? this.analysisJson(t[e]) : this.ScreenPlotting(t[e]); var i = that.addFeatures(featuresPlotting); viewer.flyTo(i), e && "function" == typeof e && e(i) }, x.prototype.ScreenPlotting = function (e) { -1 != e.treeobj.type.indexOf("Plotting") && this.featuresPlotting.push(e) }; var fo, _o, Co = []; function yo(e) { this._viewer = e, this._core = new f, this.points = [], this._SimpleGraphic = new x(this._viewer), this._SimpleGraphic.setEdit(!1) } x.prototype.createsj = function (t) { let i = 0, e = ""; if (0 != t.style.pId) for (let e = 0; e < Co.length; e++)Co[e].id === t.style.pId && (i = Co[e].real); "group" === t.type ? e = this._createGroup.createGroup(t.style.name, !1, i) : t.treeData ? (t.treeData.GroupID = i, this.CreateLayer(t)) : this.addPlotting(t); var o = { pid: i, real: e, id: t.style.id }; Co.push(o) }, x.prototype.CreateLayer = function (e) { let t = e.treeData.geoOptions.styletype, i = e.treeData.geoOptions.servertype; void 0 === t && (t = "polygonbase"), void 0 === i && (i = "geojson"), e.treeobj.pId && (e.treeData.GroupID = e.treeobj.pId), "billboardlayer" == t ? "vector" == i ? this._billboardGeoJsonFeatureLayer.createBillboardGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createBillboardGeoJsonFeature(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "labellayer" == t ? "vector" == i ? "rich" != e.treeData.styleOption.textType && (1 == e.treeData.styleOption.heightReference && (e.treeData.styleOption.heightReference = void 0), this._LabelGeoJsonFeatureLayercopy.createPrimitiveLabelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc)) : e.treeData.styleOption.collect ? this._LabelGeoJsonFeatureLayercopy.createLabelPolymerizationGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "rich" == e.treeData.styleOption.textType ? this._LabelGeoJsonFeatureLayercopy.createLabelRichtextGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._LabelGeoJsonFeatureLayercopy.createLabelPointGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "SXTLabellayer" == t ? "vector" == i && "rich" != e.treeData.styleOption.textType && this._LabelGeoJsonFeatureLayercopy.createSXTLabelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "pointlayer" == t ? "vector" == i ? this._VectorGeoJsonFeatureLayer.createPointGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : e.treeData.styleOption.collect ? this._LabelGeoJsonFeatureLayercopy.createPointPolymerizationGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createPointGeojsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "Streetscape" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : (e.treeData.styleOption.opacity && e.treeData.styleOption.material && -1 < e.treeData.styleOption.material.indexOf("#") && 1 == !e.treeData.styleOption.opacity && (e.treeData.styleOption.material += 100 * e.treeData.styleOption.opacity), this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc)) : "polylinelayer" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polylinemodellayer" == t ? "vector" == i ? this._PolylineGeoJsonFeatureLayer.createPolylineVectorGeoJsonFeatureLayerProviderModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._PointModel.exectPointModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonmodellayer" == t ? "vector" == i ? this._PolygonGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayerProviderModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._PointModel.createPolygonModel(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonbase" == t ? "vector" == i ? "1" == e.treeData.styleOption.ground ? (e.treeData.styleOption.extrudedHeightReference = 1, this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc)) : this._VectorGeoJsonFeatureLayer.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : e.treeData.styleOption.material && -1 != e.treeData.styleOption.material.indexOf(".jpg") ? this._GeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polygonlayer" == t ? "vector" == i ? (e.treeData.styleOption.classificationType = 0) == e.treeData.styleOption.classificationType ? this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : (e.treeData.styleOption.classificationType = 2, e.treeData.styleOption.ground = "1", this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderClassOptimization(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc)) : e.treeData.styleOption.material && -1 != e.treeData.styleOption.material.indexOf(".jpg") ? this._PolygonVectorTileLayerArcgis.createPolygonMapGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "modellayer" == t ? "vector" == i ? this._VectorGeoJsonFeatureLayer.createModelGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createModelPointGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polylinevolumelayer" == t ? "vector" == i ? this._VolumeGeoJsonFeatureLayer.createVolumeGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createpolylineVolumeGeojsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "polylineWallLayer" == t ? "vector" == i ? this._WallGeoFeatureLayer.createWallGeoJsonFeatureLayerProvider(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : this._GeoJsonFeatureLayer.createWallGeoFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "primiviteModels" == t ? this._PolygonVectorGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.styleOption.level_max, e.treeData.styleOption.level_min, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "primiviteWall" == t ? "vector" != i && this._WallGeoFeatureLayer.createWallPrimitiveGeoFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) : "model" != t && "pointcloudmodel" != t && "rasterlayer" != t && this._GeoJsonFeatureLayer.createGeoJsonFeatureLayer(e.treeData.name, e.treeData.geoOptions, e.treeData.styleOption, e.treeData.GroupID, e.treeData.checked, e.treeData.disFnc) }, x.prototype.remove = function (e) { let t = this._viewer; var i = this.SimpleGraphicObj.indexOf(e); -1 < i && (t.entities.removeById(e), this.SimpleGraphicObj.splice(i, 1), SmartEarthPopupData && SmartEarthPopupData.editGraphic && SmartEarthPopupData.editGraphic.getValue && SmartEarthPopupData.editGraphic.getValue("id") === e && (V.editPointID.edit.forEach(e => { t.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { t.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { t.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { t.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && t.entities.remove(V.editPointID.move), V.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(), V.editPointID.edit.forEach(e => { t.entities.removeById(e) }), V.editPointID.edit = [], V.editPointID.height.forEach(e => { t.entities.removeById(e) }), V.editPointID.height = [], V.editPointID.add.forEach(e => { t.entities.removeById(e) }), V.editPointID.add = [], V.editPointID.size.forEach(e => { t.entities.removeById(e) }), V.editPointID.size = [], V.editPointID.move && t.entities.remove(V.editPointID.move), V.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 && (V.delete(e.treeobj.id, this._viewer, this._cesium), o = e.treeobj.pId), new Ti(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) { } }, yo.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 }, yo.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 }) }, yo.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 }) }, yo.prototype.setVisibility = function (e) { }, yo.prototype.deleteObject = function () { this._SimpleGraphic.clear() }; let vo; function wo(e) { this._viewer = e, this.left = [], this.right = [] } function bo() { window.removeEventListener("mousemove", So, !1), window.removeEventListener("mouseup", bo, !1) } function To(e) { vo.dragStartX = e.clientX - vo.slider.offsetLeft, window.addEventListener("mousemove", So, !1), window.addEventListener("mouseup", bo, !1) } function So(e) { e = (e.clientX - vo.dragStartX) / vo.slider.parentElement.offsetWidth; vo.slider.style.left = 100 * e + "%", vo.scene.splitPosition = e } function Eo(e) { this._core = new f, 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 Po(e, t) { this._viewer = e, this._cesium = t } function xo(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.Fireworks = [], this.Smog = [], this.Fountain = [], this.Flame = [], this.Blast = [] } function Do(e) { this._viewer = e, this._depth = 100, this.show = !1 } function Io(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, 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 } wo.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", To, !1), this.slider = e, vo = { dragStartX: 0, slider: e, scene: this._viewer.scene } }, wo.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 }, wo.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) }, wo.prototype.close = function () { this.slider && (this._viewer.scene.splitPosition = 0, this.slider.removeEventListener("mousedown", To, !1), window.removeEventListener("mouseup", bo, !1), window.removeEventListener("mousemove", So, !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 = [], vo = null) }, Eo.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);
@@ -100,7 +133,9 @@
            font-family: 微软雅黑;
            border-radius: 5px;
            z-index: 999;
        `,r)this.explainContainer.style[o]=r[o];this.explainContainer.innerHTML="W:前;S:后;A:左;D:右<br>Q:上;E:下<br>双击:碰撞检测;滚轮:移动速度<br>鼠标移动:方向控制;Esc:退出",this._viewer.container.append(this.explainContainer)}return this},Eo.prototype.dblclick=function(e){0===e.button&&(this.collision=!this.collision,layuiLayer.msg(this.collision?"开启碰撞检测":"关闭碰撞检测"))},Eo.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&&0<this.camera.pitch&&0<e)&&(e=0),this.camera.rotate(this.camera.position,t*this.indoor_data.X_speedScale),this.camera.lookUp(e*this.indoor_data.Y_speedScale)}},Eo.prototype.mousewheel=function(e){0<e.wheelDelta?this.indoor_data.moveRate+=.02:this.indoor_data.moveRate-=.02,1<this.indoor_data.moveRate&&(this.indoor_data.moveRate=1),this.indoor_data.moveRate<.1&&(this.indoor_data.moveRate=.1)},Eo.prototype.pointerlockchange=function(){document.pointerLockElement?this.indoor_data.enable_looking=!0:this.indoor_data.enable_looking&&this.close()},Eo.prototype.keydown=function(e){e=this.getFlagForKeyCode(e.keyCode);void 0!==e&&(this.flags[e]=!0)},Eo.prototype.keyup=function(e){e=this.getFlagForKeyCode(e.keyCode);void 0!==e&&(this.flags[e]=!1)},Eo.prototype.getFlagForKeyCode=function(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"Q".charCodeAt(0):return"moveUp";case"E".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}},Eo.prototype.onTick=function(){let e=this.camera;var t=this._viewer.scene.globe.getHeight(e.positionCartographic),i=e.positionCartographic.height,i=(this.indoor_data.moveFactor=i-t,100<this.indoor_data.moveFactor?this.indoor_data.moveFactor/100:this.indoor_data.moveRate);this.oldCameraPosition={position:e.position.clone(),heading:e.heading,pitch:e.pitch,roll:e.roll},this.flags.moveForward&&e.moveForward(i),this.flags.moveBackward&&e.moveBackward(i),this.flags.moveUp&&e.moveUp(i),this.flags.moveDown&&e.moveDown(i),this.flags.moveLeft&&e.moveLeft(i),this.flags.moveRight&&e.moveRight(i),this.collision&&this.checkCollision()},Eo.prototype.checkCollision=function(){let e=this._core.pickFromRay(this._viewer,this.oldCameraPosition.position,this.camera.position),t=(e&&e.position&&Cesium.Cartesian3.distance(this.oldCameraPosition.position,e.position)<1&&this.camera.setView({destination:this.oldCameraPosition.position,orientation:{heading:this.oldCameraPosition.heading,pitch:this.oldCameraPosition.pitch,roll:this.oldCameraPosition.roll}}),this.camera.positionCartographic.clone());var i;--t.height,t=Cesium.Cartographic.toCartesian(t),(e=this._core.pickFromRay(this._viewer,this.camera.position,t))&&e.position&&1.65!==Cesium.Cartesian3.distance(this.camera.position,e.position)&&(i=1.65-Cesium.Cartesian3.distance(this.camera.position,e.position),(t=this.camera.positionCartographic.clone()).height+=i,t=Cesium.Cartographic.toCartesian(t),this.camera.setView({destination:t,orientation:{heading:this.oldCameraPosition.heading,pitch:this.oldCameraPosition.pitch,roll:this.oldCameraPosition.roll}}))},Eo.prototype.close=function(){this._handler&&this._handler.destroy(),this._handler=null,this.bindEvent&&(document.removeEventListener("pointerlockchange",this.bindEvent.pointerlockchange,!1),document.removeEventListener("mousemove",this.bindEvent.mousemove,!1),document.removeEventListener("keydown",this.bindEvent.keydown,!1),document.removeEventListener("keyup",this.bindEvent.keyup,!1),document.removeEventListener("mousewheel",this.bindEvent.mousewheel,!1),document.removeEventListener("dblclick",this.bindEvent.dblclick,!1),this.bindEvent=null),this.collision=!1,this._viewer.clock.onTick.removeEventListener(this.onTick,this),this.explainContainer&&this.explainContainer.remove(),this.explainContainer=null,document.exitPointerLock(),this.indoor_data.enable_looking=!1,document.body.style.cursor="default",this._viewer.scene.screenSpaceCameraController.enableRotate=!0,this._viewer.scene.screenSpaceCameraController.enableTranslate=!0,this._viewer.scene.screenSpaceCameraController.enableZoom=!0,this._viewer.scene.screenSpaceCameraController.enableTilt=!0,this._viewer.scene.screenSpaceCameraController.enableLook=!0},Po.prototype.createWeather=function(e,t,i){var o=this._viewer.scene.postProcessStages,r=null,n=null,a=null,s=null,l={min:10,max:160},c={min:.5,max:3},u={min:-1,max:1},h={min:0,max:1},m={min:10,max:160},d={min:0,max:1},p={min:0,max:.7},g={min:.1,max:.9};if("sun"===e)this.createWeather("rain",!1),this.createWeather("snow",!1),this.createWeather("fog",!1);else switch(e){case"rain":if(r=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"rain"===e.name&&o.remove(e)}),t){if(r?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.3,test3:-.4,test4:1},r={test1:7,test2:.3,test3:-.4,test4:1}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=2.5*parseFloat(n.test2)+.5,n.test1>l.max||n.test1<l.min)return;if(n.test2>c.max||n.test2<c.min)return;if(n.test3>u.max||n.test3<u.min)return;if(n.test4>h.max||n.test4<h.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");var f=new this._cesium.PostProcessStage({name:"rain",fragmentShader:"uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates;\n\nfloat hash(float x){\nreturn fract(sin(x*133.3)*13.13);\n}\n\nvoid main(void){\nfloat time = czm_frameNumber / "+n.test1+";\nvec2 resolution = czm_viewport.zw; \nvec2 uv=(gl_FragCoord.xy*"+n.test2+"-resolution.xy)/min(resolution.x,resolution.y); \nvec3 c=vec3(.6,.7,.8);\nfloat a="+n.test3+";\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+"+n.test4+";\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b; //屏幕上雨的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); \n }"});o.add(f)}break;case"snow":if(a=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"snow"===e.name&&o.remove(e)}),t){if(a?n={test1:i.test1,test2:i.test2,test3:i.test3,test4:i.test4}:(n={test1:7,test2:.1,test3:.5,test4:.5},a={test1:7,test2:.1,test3:.5,test4:.5}),n.test1=15*(10-parseFloat(n.test1))+10,n.test2=parseFloat(n.test2)/10,n.test3=.7*parseFloat(n.test3),n.test4=.8*(1-parseFloat(n.test4))+.1,parseFloat(n.test1)>m.max||parseFloat(n.test1)<m.min)return;if(parseFloat(n.test2)>d.max||parseFloat(n.test2)<d.min)return;if(parseFloat(n.test3)>p.max||parseFloat(n.test3)<p.min)return;if(parseFloat(n.test4)>g.max||parseFloat(n.test4)<g.min)return;n.test1=this.getValue(n.test1+""),n.test2=this.getValue(n.test2+""),n.test3=this.getValue(n.test3+""),n.test4=this.getValue(n.test4+"");f=new this._cesium.PostProcessStage({name:"snow",fragmentShader:"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale){\nfloat time = czm_frameNumber / "+n.test1+";\nfloat w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<"+n.test2+")return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np="+n.test3+"+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c)); //屏幕上雪的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), "+n.test4+");  //将雪和三维场景融合\n}"});o.add(f)}break;case"fog":if(s=i,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(e){e&&"fog"===e.name&&o.remove(e)}),t){if(s?n={distance:i.distance,color:i.color&&Cesium.Color.fromCssColorString(i.color)}:(n={distance:200,color:"#ffffff"},s={distance:200,color:"#ffffff"}),n.distance<10)return;f=new Cesium.PostProcessStage({name:"fog",fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n    float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n    if (depth == 0.0) { \n        return czm_infinity; \n    } \n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n    return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n    float startDistance = nearFarScalar.x; \n    float startValue = nearFarScalar.y; \n    float endDistance = nearFarScalar.z; \n    float endValue = nearFarScalar.w; \n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n    return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n    float distance = getDistance(depthTexture, v_textureCoordinates); \n    vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n    float blendAmount = interpolateByDistance(fogByDistance, distance); \n    vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n    gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new Cesium.Cartesian4(10,0,n.distance||200,1),fogColor:n.color||Cesium.Color.WHITE}});o.add(f)}}},Po.prototype.getValue=function(e){return""===e||"-"===e||"."===e||void 0===e||2<(e="-"===e[e.length-1]?e.substr(0,e.length-1):e).split(".").length?"0.0":e.split(".")[1]&&e.split(".")[1].length?e:parseFloat(e).toFixed(1)},xo.prototype.createParticleEffect=function(e,t,i,o){switch(this._viewer.clockViewModel.shouldAnimate||(this._viewer.clockViewModel.shouldAnimate=!0),e){case"fireworks":this.createFireworks(t,i,o);break;case"smog":this.createSmog(t,i,o);break;case"fountain":this.createFountain(t,i,o);break;case"flame":this.createFlame(t,i,o);break;case"blast":this.createBlast(t,i,o)}return this},xo.prototype.deleteObject=function(){var t=this._viewer.scene;0<this.Fireworks.length&&(this.Fireworks.forEach(function(e){t.primitives.remove(e)}),this.Fireworks=[]),0<this.Smog.length&&(this.Smog.forEach(function(e){t.primitives.remove(e)}),this.Smog=[]),0<this.Fountain.length&&(this.Fountain.forEach(function(e){t.primitives.remove(e)}),this.Fountain=[]),0<this.Flame.length&&(this.Flame.forEach(function(e){t.primitives.remove(e)}),this.Flame=[]),0<this.Blast.length&&(this.Blast.forEach(function(e){t.primitives.remove(e)}),this.Blast=[])},xo.prototype.removeParticleEffect=function(e){var t=this._viewer.scene;switch(e){case"fireworks":0<this.Fireworks.length&&(this.Fireworks.forEach(function(e){t.primitives.remove(e)}),this.Fireworks=[]);break;case"smog":0<this.Smog.length&&(this.Smog.forEach(function(e){t.primitives.remove(e)}),this.Smog=[]);break;case"fountain":0<this.Fountain.length&&(this.Fountain.forEach(function(e){t.primitives.remove(e)}),this.Fountain=[]);break;case"flame":0<this.Flame.length&&(this.Flame.forEach(function(e){t.primitives.remove(e)}),this.Flame=[]);break;case"blast":0<this.Blast.length&&(this.Blast.forEach(function(e){t.primitives.remove(e)}),this.Blast=[])}},xo.prototype.createFireworks=function(e,t,i){var l,c=this._viewer.scene,o=this._viewer,u=this._cesium,h=(t=t||{},u.Math.setRandomNumberSeed(315),this.computeModelMatrix(e)),m=new u.Cartesian3(0,0,100);var d=u.defaultValue(t.minSize,30),p=u.defaultValue(t.maxSize,100),e=u.defaultValue(t.size,7),g=new u.Cartesian2(e,e),f=10,r=u.defaultValue(t.num,20),_=new u.Matrix4;function n(e,t,i){var o,e=u.Cartesian3.add(m,e,new u.Cartesian3),e=u.Matrix4.fromTranslation(e,_),r=u.Matrix4.multiply(h,e,new u.Matrix4),n=u.Matrix4.inverseTransformation(r,r),a=u.Math.randomBetween(d,p),s=new u.Cartesian3,r=.7*((a-d)/(p-d))+.3;return c.primitives.add(new u.ParticleSystem({image:(u.defined(l)||((l=document.createElement("canvas")).width=20,l.height=20,(o=l.getContext("2d")).beginPath(),o.arc(8,8,8,0,u.Math.TWO_PI,!0),o.closePath(),o.fillStyle="rgb(255, 255, 255)",o.fill()),l),startColor:t,endColor:t.withAlpha(0),particleLife:r,speed:100,imageSize:g,emissionRate:0,emitter:new u.SphereEmitter(.1),bursts:i,lifetime:f,updateCallback:function(e){var t=u.Matrix4.multiplyByPoint(n,e.position,s);u.Cartesian3.magnitudeSquared(t)>=a*a&&u.Cartesian3.clone(u.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<r;++s){for(var C=u.Math.randomBetween(-100,100),y=u.Math.randomBetween(-80,100),v=u.Math.randomBetween(-50,50),C=new u.Cartesian3(C,y,v),y=u.Color.fromRandom(a[s%a.length]),w=[],b=0;b<3;++b)w.push(new u.ParticleBurst({time:u.Math.nextRandomNumber()*f,minimum:400,maximum:400}));this.Fireworks.push(n(C,y,w))}i&&"function"==typeof i?i(this.Fireworks):(e=o.scene.camera,t=new u.Cartesian3(-300,0,0),e.lookAtTransform(h,t),e.lookAtTransform(u.Matrix4.IDENTITY),i=u.Cartesian3.subtract(m,t,new u.Cartesian3),u.Cartesian3.normalize(i,i),o=u.Math.PI_OVER_TWO-Math.acos(u.Cartesian3.dot(i,u.Cartesian3.UNIT_Z)),e.lookUp(o))},xo.prototype.createSmog=function(e,o,t){this._viewer.scene;var r,n=this._viewer,a=this._cesium,s=this,l=(o&&""!==o||(o={}),a.Math.setRandomNumberSeed(3),{image:window.SmartEarthRootUrl+I.smog,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:1.2,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:5,particleSize:1,lifetime:6}),c=(this._core.extend(l,o,!0),new a.Cartesian3),e=function(i){var e=n.scene;r=e.primitives.add(new a.ParticleSystem({image:l.image,startColor:a.Color.LIGHTSEAGREEN.withAlpha(.7),endColor:a.Color.WHITE.withAlpha(0),startScale:l.startScale,endScale:l.endScale,sizeInMeters:!0,minimumParticleLife:l.minimumParticleLife,maximumParticleLife:l.maximumParticleLife,minimumSpeed:l.minimumSpeed,maximumSpeed:l.maximumSpeed,imageSize:new a.Cartesian2(l.particleSize,l.particleSize),emissionRate:l.emissionRate,lifetime:l.lifetime,emitter:new a.CircleEmitter(2),emitterModelMatrix:s.computeEmitterModelMatrix(o.translation,o.rotation),updateCallback:u})),l.type&&function(e){"圆形放射"===e?r.emitter=new a.CircleEmitter(2):"球体放射"===e?r.emitter=new a.SphereEmitter(2.5):"圆锥体放射"===e?r.emitter=new a.ConeEmitter(a.Math.toRadians(45)):"盒状放射"===e&&(r.emitter=new a.BoxEmitter(new a.Cartesian3(10,10,10)))}(l.type);return n.scene.preUpdate.addEventListener(function(e,t){r&&(r.modelMatrix=s.computeModelMatrix(i,t),r.emitterModelMatrix=s.computeEmitterModelMatrix(o.translation,o.rotation))}),r}(e);function u(e,t){var i=e.position;a.Cartesian3.normalize(i,c),a.Cartesian3.multiplyByScalar(c,l.gravity*t,c),e.velocity=a.Cartesian3.add(e.velocity,c,e.velocity)}this.Smog.push(e),t&&"function"==typeof t&&t(this.Smog)},xo.prototype.createFountain=function(i,o,e){this._viewer.scene;var r,t=this._viewer,n=this._cesium,a=this,s=(o&&""!==o||(o={}),{image:window.SmartEarthRootUrl+I.penquan,emissionRate:50,minimumParticleLife:3,maximumParticleLife:4,minimumSpeed:9,maximumSpeed:9.5,startScale:1,endScale:15,particleSize:1,lifetime:6,gravity:-3.5}),l=(this._core.extend(s,o,!0),new n.Cartesian3),t=(r=t.scene.primitives.add(new n.ParticleSystem({image:s.image,startColor:new n.Color(1,1,1,.3),endColor:new n.Color(.8,.86,1,.4),startScale:s.startScale,endScale:s.endScale,minimumParticleLife:s.minimumParticleLife,maximumParticleLife:s.maximumParticleLife,minimumSpeed:s.minimumSpeed,maximumSpeed:s.maximumSpeed,imageSize:new n.Cartesian2(s.particleSize,2*s.particleSize),emissionRate:s.emissionRate,lifetime:s.lifetime,loop:!0,emitter:new n.ConeEmitter(n.Math.toRadians(n.defaultValue(s.angle,7))),updateCallback:c,sizeInMeters:!0})),t.scene.preUpdate.addEventListener(function(e,t){r&&(r.modelMatrix=a.computeModelMatrix(i,t),r.emitterModelMatrix=a.computeEmitterModelMatrix(o.translation,o.rotation))}),r);function c(e,t){var i=e.position;n.Cartesian3.normalize(i,l),n.Cartesian3.multiplyByScalar(l,s.gravity*t,l),e.velocity=n.Cartesian3.add(e.velocity,l,e.velocity)}this.Fountain.push(t),e&&"function"==typeof e&&e(this.Fountain)},xo.prototype.createFlame=function(e,t,i){this._viewer.scene;var o=this._viewer,r=this._cesium,n=this,a=(t&&""!==t||(t={}),{image:window.SmartEarthRootUrl+I.fire,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:6,particleSize:1,lifetime:16}),e=(this._core.extend(a,t,!0),t=e,o.scene.primitives.add(new r.ParticleSystem({image:a.image,startColor:r.Color.RED.withAlpha(.7),endColor:r.Color.YELLOW.withAlpha(.3),startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new r.Cartesian2(a.particleSize,a.particleSize),emissionRate:a.emissionRate,sizeInMeters:!0,lifetime:a.lifetime,emitter:new r.ConeEmitter(r.Math.toRadians(30)),modelMatrix:n.computeModelMatrix(t),emitterModelMatrix:n.computeEmitterModelMatrix(a.translation,a.rotation)})));this.Flame.push(e),i&&"function"==typeof i&&i(this.Flame)},xo.prototype.createBlast=function(e,t,i){this._viewer.scene;var o=this._viewer,r=this._cesium,n=this,a=(t&&""!==t||(t={}),{image:window.SmartEarthRootUrl+I.fire2,emissionRate:10,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:5,maximumSpeed:20,startScale:1,endScale:10,particleSize:5,lifetime:3}),t=(this._core.extend(a,t,!0),function(e){let t=new r.ParticleSystem({image:a.image,startColor:a.startColor,endColor:a.endColor,startScale:a.startScale,endScale:a.endScale,minimumParticleLife:a.minimumParticleLife,maximumParticleLife:a.maximumParticleLife,minimumSpeed:a.minimumSpeed,maximumSpeed:a.maximumSpeed,imageSize:new r.Cartesian2(a.particleSize,a.particleSize),emissionRate:a.emissionRate,sizeInMeters:!0,lifetime:a.lifetime,emitter:new r.ConeEmitter(r.Math.toRadians(30)),emitterModelMatrix:n.computeEmitterModelMatrix(a.translation,a.rotation),bursts:a.bursts,updateCallback:()=>{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)},xo.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},xo.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)},Do.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)},Do.prototype.add=function(e){if(this.show=!0,this._depth=e||100,!this.item)return this._viewer.scene.primitives.add(this),this.refreshGridLines(),this},Do.prototype.update=function(e){this.item&&this.show&&(this.getRelativeHeight(),this.item.show&&this.item.update(e))},Do.prototype.destroy=function(){this.item&&(this._viewer.scene.primitives.remove(this),this.item=null)},Do.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)}}},Do.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),0<this._relativeHeight?this.item&&(this.item.show=!1):(this.item&&(this.item.show=!0),(Math.abs(this.oldCameraHeight-e.positionCartographic.height)>this._depth/10||1e4<Cesium.Cartesian3.distance(this.oldCameraPosition,e.position))&&(this.oldCameraPosition=e.position.clone(),this.oldCameraHeight=e.positionCartographic.height,this.refreshGridLines()))},Io.prototype.StreetViewOpen=function(e,t,i){var o,r=this,n=this._viewer;return this.isStreetView||(0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&n.entities.remove(e)}),this.StreetViewSphere=[null,null]),this.StreetViewType=t.type,this.StreetViewData.linkImagesData=[],this.URL=this.extend(this.URL,t,!1),this.CallBack=this.extend(this.CallBack,t,!1),this.defaultSkyAtmosphere=!!n.scene.skyAtmosphere.show,n.scene.skyAtmosphere.show||(n.scene.skyAtmosphere.show=!0),o=n.camera,this.getInitImageByPosition(e,function(e){r.isStreetView=!0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!0),o.flyTo({destination:new r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),orientation:{heading:o.heading,pitch:o.pitch>r._cesium.Math.toRadians(45)||o.pitch<r._cesium.Math.toRadians(-45)?0:o.pitch,roll:0},duration:t.flyTime,complete:function(){i&&"function"==typeof i&&i()}}),r.attachMouseEvent(),r.createNavigation(),r.StreetViewSphereIndex=0,r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e,r.StreetViewSphere[r.StreetViewSphereIndex]=r.createScene(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),r.StreetViewSphere[r.StreetViewSphereIndex].show=!0,r.StreetViewSphere[r.StreetViewSphereIndex].orientation=r._cesium.Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon,r.StreetViewData.lat,r.StreetViewData.height),new r._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.heading+("lide"===r.StreetViewType?90:0)),r._cesium.Math.toRadians(-r.StreetViewData.HeadingPitchRoll.roll),r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.pitch))),"lide"===r.StreetViewType?r._core.xhr({url:r.URL.getImageInfo+r.StreetViewData.getImageTileID,type:"get",dataType:"json",success:function(e){r.CallBack&&r.CallBack.setImageDataCallback&&"function"==typeof r.CallBack.setImageDataCallback&&r.CallBack.setImageDataCallback(r.StreetViewData,e),r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID,function(e){e.index===r.StreetViewSphereIndex&&!1===r.StreetViewData.isTwoTextures&&(r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e.canvas),r.StreetViewData.isTwoTextures=!0,r.StreetViewData.isThreeTextures=!1})}}):r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID,function(e){e.index===r.StreetViewSphereIndex&&!1===r.StreetViewData.isTwoTextures&&(r.StreetViewSphere_Canvas[r.StreetViewSphereIndex]=e.canvas),r.StreetViewData.isTwoTextures=!0,r.StreetViewData.isThreeTextures=!1})})),this},Io.prototype.exit=function(){var e,t,i;this.isStreetView&&(t=(e=this)._viewer,0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&t.entities.remove(e)}),this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null]),0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){t.entities.remove(e)}),this.StreetViewNavigation=[]),this.setCesiumFov(this.StreetViewData.defaultFov),this.detachMouseEvent(),t.scene.skyAtmosphere.show=this.defaultSkyAtmosphere,this.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),i=t.camera.positionCartographic,t.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height+3e3),orientation:{heading:t.camera.heading,pitch:this._cesium.Math.toRadians(-90),roll:0},complete:function(){e.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1)}}))},Io.prototype.extend=function(e,t,i){for(var o in t)t.hasOwnProperty(o)&&(e.hasOwnProperty(o)||i)&&(e[o]=t[o]);return e},Io.prototype.getInitImageByPositionURL=function(e){var t,i,o;return o=this.URL&&this.URL.getInitImageByPosition?1<(i=this.URL.getInitImageByPosition.split("{lon}"))[0].split("{lat}").length?(t=i[0].split("{lat}"))[0]+e.lat+t[1]+e.lon+i[1]:(t=i[1].split("{lat}"),i[0]+e.lon+t[0]+e.lat+t[1]):o},Io.prototype.getImageByIdURL=function(e,t){var i,o;switch(e){case"one":i=this.URL.getInitImageById;break;case"two":i=this.URL.getSecondImageById;break;case"three":i=this.URL.getThirdImageById;break;case"init":i=this.URL.getInitImageInfoById}return"lide"===this.StreetViewType&&(t=t.replace("-0-","-X-"),"one"===e&&(i+="&row=0&col=0")),o=i?(e=i.split("{id}"))[0]+t+e[1]:o},Io.prototype.getInitImageByPosition=function(e,n){var a=this,e=this.getInitImageByPositionURL(e);this.StreetViewData.linkImagesData=[],this._core.xhr({url:e,type:"get",dataType:"json",success:e=>{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){}})},Io.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},Io.prototype.getSecondTexturesFromAtlasFile=function(e,o){var r,n,a,s,l=this.StreetViewSphereIndex,t=this.getImageByIdURL("two",e),c=null,u=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==c&&(c=document.createElement("canvas"),u=c.getContext("2d"),c.height=s>f?f:s,c.width=a>g?g:a,u.translate(c.width,0),u.scale(-1,1));var e=r,t=n;"lide"===this.StreetViewType&&(e=512,t=256),u.drawImage(this.FirstImage,0,0,e,t,0,0,c.width,c.height);for(var i=0;i<m.length;i++)m[i].src&&u.drawImage(m[i],0,0,r,n,r*(i%p),n*Math.floor(i/p),r,n);o({index:l,canvas:c})}},C=0;C<d;C++)for(var y=0;y<p;y++){var v=(v=t+i).replace("{row}",C).replace("{col}",y),w=new Image;w.onload=function(){r=this.width,n=this.height,a=r*p,s=n*d,_()},w.onerror=function(){this.src="",this.onerror=void 0,_()},w.setAttribute("crossOrigin","Anonymous");try{w.src=v}catch(e){w.src=""}m.push(w)}},Io.prototype.getThreeTexturesFromAtlasFile=function(e,r){for(var n=this.StreetViewSphereIndex,t=this.getImageByIdURL("three",e),a=null,s=null,l=0,c=[],i=0;i<8;i++)for(var o=0;o<16;o++){var u=t+i+"-"+o,h=new Image;!function(o){o.onload=function(){var e=o.width,t=o.height;if(128==++l){null==a&&(a=document.createElement("canvas"),s=a.getContext("2d"),a.height=4096,a.width=8192,s.translate(8192,0),s.scale(-1,1));for(var i=0;i<c.length;i++)s.drawImage(c[i],0,0,e,t,e*(i%16),t*Math.floor(i/16),e,t);r({index:n,canvas:a})}}}(h),h.setAttribute("crossOrigin","Anonymous");try{h.src=u}catch(e){h.src=""}c.push(h)}},Io.prototype.InitSceneByID=function(t){var i=this,o=this._viewer;this.updateStreetSphereIndex(),this.StreetViewSphere[this.StreetViewSphereIndex]=this.createScene(this.StreetViewData.lon,this.StreetViewData.lat,this.StreetViewData.height),this.getInitImage(this.StreetViewData.getImageTileID,function(e){i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,setTimeout(function(){i.StreetViewSphere[i.StreetViewSphereIndex].show=!0},300)}),this.StreetViewData.isTwoTextures=!1,"lide"!==this.StreetViewType?this.getImageInfoById(this.StreetViewData.getImageTileID,function(e){i.StreetViewData.linkImagesData=[],i.CallBack&&i.CallBack.getImageInfoByIdCallBack?("function"==typeof i.CallBack.getImageInfoByIdCallBack&&i.CallBack.getImageInfoByIdCallBack(i.StreetViewData,e),i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getInitImage(i.StreetViewData.getImageTileID,function(e){i.StreetViewData.isTwoTextures||(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e)}),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1}),i.createNavigation()):console.log("the getImageInfoByIdCallBack is undefined!")}):this.getInitImageByPosition(i.StreetViewData,function(e){i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading+90),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1})})},Io.prototype.getImageInfoById=function(e,t){e=this.getImageByIdURL("init",e);this._core.xhr({url:e,type:"get",dataType:"json",success:function(e){"function"==typeof t&&t(e)}})},Io.prototype.createScene=function(e,t,i){var o=this,r=this._viewer,n=this.StreetViewSphereIndex,a=new this._cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return o.StreetViewSphere_Canvas[n]},!1),transparent:!0,color:this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha)}),e={show:!1,position:this._cesium.Cartesian3.fromDegrees(e,t,i),ellipsoid:{radii:new this._cesium.Cartesian3(this.StreetViewData.radius,this.StreetViewData.radius,this.StreetViewData.radius),material:a}},t=r.entities.add(e);return t.geometryName="街景",t};var Ao,Lo,Mo=null,Ro=null,Oo={looking:!(Io.prototype.detachMouseEvent=function(){var e=this._viewer.scene;this._viewer.canvas,this.StreetViewData._handler&&(this.StreetViewData._handler.destroy(),this.StreetViewData._handler=void 0),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=void 0),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick,this),e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0})};function Bo(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,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:"",getImageById:""},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,x:void 0,y:void 0,height:0,HeadingPitchRoll:null,getImageTileID:"",linkImagesData:[],isTwoTextures:!1,isThreeTextures:!1,_handler:null,navigation_handler:null},this.FirstImage=void 0}Io.prototype.attachMouseEvent=function(){var t=this;Mo=this._viewer.scene,Ro=this._viewer.canvas,this.StreetViewData._handler=new this._cesium.ScreenSpaceEventHandler(Ro),Ro.setAttribute("tabindex","0"),Ro.focus(),Ro.onclick=function(){Ro.focus()},setTimeout(function(){t.setCesiumFov(t.StreetViewData.fov)},4e3),Mo.screenSpaceCameraController.enableRotate=!1,Mo.screenSpaceCameraController.enableTranslate=!1,Mo.screenSpaceCameraController.enableZoom=!1,Mo.screenSpaceCameraController.enableTilt=!1,Mo.screenSpaceCameraController.enableLook=!1,this.StreetViewData._handler.setInputAction(function(e){Oo.looking=!0},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.StreetViewData._handler.setInputAction(function(e){Oo.looking&&(fo=e.startPosition,_o=e.endPosition,t.StreetView_mouseMove())},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.StreetViewData._handler.setInputAction(function(e){Oo.looking=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this.StreetViewData._handler.setInputAction(function(e){e=t.StreetViewData.fov+e/-10;30<e&&e<120&&(t.StreetViewData.fov=e,t.setCesiumFov(t.StreetViewData.fov))},this._cesium.ScreenSpaceEventType.WHEEL),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.addEventListener(t.StreetView_onTick,this)},Io.prototype.StreetView_onTick=function(){var t=this;!this.StreetViewData.isThreeTextures&&this.StreetViewData.fov<50&&(this.StreetViewData.isThreeTextures=!0,this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID,function(e){e.index===t.StreetViewSphereIndex&&(t.StreetViewSphere_Canvas[t.StreetViewSphereIndex]=e.canvas)}))},Io.prototype.StreetView_mouseMove=function(){var e,t,i=this._viewer.camera;Oo.looking&&(e=Ro.clientWidth,t=Ro.clientHeight,e=-(_o.x-fo.x)/e,t=(_o.y-fo.y)/t,(!i.roll&&i.pitch<0&&t<0||!i.roll&&0<i.pitch&&0<t)&&(t=0),i.rotate(i.position,e*this.StreetViewData.speedScale),i.lookUp(t*this.StreetViewData.speedScale))},Io.prototype.setOpacity=function(t){var i=this;this.StreetViewSphere.forEach(function(e){e&&(e.ellipsoid.material.color._value=i._cesium.Color.WHITE.withAlpha(t))}),this.StreetViewData.alpha=t},Io.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},Io.prototype.MoveToLinkImage=function(e){e?"lide"!==this.StreetViewType||e.ImageID?(this.StreetViewData.name=e.name,this.StreetViewData.lon=e.Position[0],this.StreetViewData.lat=e.Position[1],this.StreetViewData.height=e.Position[2],this.StreetViewData.getImageTileID=e.ImageID,this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])):this.CallBack&&this.CallBack.selectJoinsCallBack&&"function"==typeof this.CallBack.selectJoinsCallBack&&this.CallBack.selectJoinsCallBack():alert("暂无街景数据")},Io.prototype.updateStreetSphereIndex=function(){this.StreetViewSphereIndex=0===this.StreetViewSphereIndex?1:0},Io.prototype.createNavigation=function(){var t,i=this,a=this._viewer,s=(0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){a.entities.remove(e)}),this.StreetViewNavigation=[]),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=null),6378137),n=6356725,o={lon:this.StreetViewData.lon,lat:this.StreetViewData.lat,height:this.StreetViewData.height-1};function l(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=n+(s-n)*(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]}function c(e){return e*Math.PI/180}this.StreetViewData.linkImagesData.forEach(function(t){var e=a.entities.add({polygon:{hierarchy:new i._cesium.CallbackProperty(function(){var e=function(e,t){var i=[],e=l(e.lon,e.lat,3.5,180*a.camera.heading/Math.PI),o={lon:e[0],lat:e[1]};e=l(e[0],e[1],1.1,0),i.push(e[0],e[1]),e=l(e[0],e[1],.5758,135),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,180),i.push(e[0],e[1]),e=l(e[0],e[1],.4,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,0),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]);for(var r,n=0;n<i.length-1;n+=2)r=function(e,t,i){t=function(e,t,i,o){var r=c(t),n=c(o),o=c(o)-c(t),t=c(i)-c(e);i=(i=2*Math.asin(Math.sqrt(Math.pow(Math.sin(o/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(t/2),2))))*s,i=Math.round(1e4*i)/1e4,e=0==o&&0<t?90:0==o&&t<0?270:o<0&&0==t?180:0<=o&&0==t?0:o<0&&0<t?180-180*Math.atan(t/-o)/Math.PI:o<0&&t<0?180+180*Math.atan(t/o)/Math.PI:0<o&&t<0?360-180*Math.atan(-t/o)/Math.PI:180*Math.atan(t/o)/Math.PI;return{angle:e,distance:i}}(e.lon,e.lat,t.lon,t.lat);return l(e.lon,e.lat,t.distance,i-t.angle)}(o,{lon:i[n],lat:i[n+1]},t),i[n]=r[0],i[n+1]=r[1];return i}(o,t.NavigationAngle);return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3.fromDegreesArray(e))},!1),fill:!0,outline:!0,outlineColor:i._cesium.Color.BLACK.withAlpha(.2),height:o.height}});e.geometryName="街景",e.isNavigation=!0,e.linkImageData=t,i.StreetViewNavigation.push(e)}),i.StreetViewData.navigation_handler=new i._cesium.ScreenSpaceEventHandler(Ro),i.StreetViewData.navigation_handler.setInputAction(function(e){e=a.scene.pick(e.position);i._cesium.defined(e)&&(e&&e.id&&e.id.isNavigation?(t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE),(t=e.id).polygon.outlineColor=i._cesium.Color.BLUE,t.polygon.material=i._cesium.Color.WHITE.withAlpha(.9)):t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE,t=void 0)),t&&i.MoveToLinkImage(t.linkImageData)},i._cesium.ScreenSpaceEventType.LEFT_CLICK)},Bo.prototype.StreetViewOpenYZ=function(e,i,o){var r,t,n=this,a=this._viewer;return this.isStreetView||(0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&a.entities.remove(e)}),this.StreetViewSphere=[null,null]),this.StreetViewType=i.type,this.StreetViewData.linkImagesData=[],this.StreetViewData.x=e.x,this.StreetViewData.y=e.y,this.URL=this.extend(this.URL,i,!1),this.CallBack=this.extend(this.CallBack,i,!1),this.defaultSkyAtmosphere=!!a.scene.skyAtmosphere.show,a.scene.skyAtmosphere.show||(a.scene.skyAtmosphere.show=!0),r=a.camera,t=(1e5*Math.random()).toFixed(0),this.URL.getInitImageByPosition+="&fn="+(t="SmartEarth_"+t),window[t]=function(e){n.isStreetView=!0,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!0);try{n.StreetViewData.height=e.content[0].Z,n.StreetViewData.HeadingPitchRoll=n.StreetViewData.HeadingPitchRoll||{},n.StreetViewData.HeadingPitchRoll.heading=e.content[0].Heading,n.StreetViewData.HeadingPitchRoll.roll=e.content[0].Roll,n.StreetViewData.HeadingPitchRoll.pitch=e.content[0].Pitch,n.imageJoin(e,function(t){r.flyTo({destination:new n._cesium.Cartesian3.fromDegrees(n.StreetViewData.x,n.StreetViewData.y,n.StreetViewData.height),orientation:{heading:r.heading,pitch:r.pitch>n._cesium.Math.toRadians(45)||r.pitch<n._cesium.Math.toRadians(-45)?0:r.pitch,roll:0},duration:i.flyTime||1,complete:function(){n.attachMouseEvent(),n.createNavigation(),n.StreetViewSphereIndex=0,n.StreetViewSphere_Canvas[n.StreetViewSphereIndex]=t;var e=n.StreetViewData.height+n.StreetViewData.radius/2;n.StreetViewSphere[n.StreetViewSphereIndex]=n.createScene(n.StreetViewData.x,n.StreetViewData.y,e),n.StreetViewSphere[n.StreetViewSphereIndex].show=!0,n.StreetViewSphere[n.StreetViewSphereIndex].orientation=n._cesium.Transforms.headingPitchRollQuaternion(n._cesium.Cartesian3.fromDegrees(n.StreetViewData.x,n.StreetViewData.y,n.StreetViewData.height),new n._cesium.HeadingPitchRoll(n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.heading+("lide"===n.StreetViewType?90:0)),n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.roll),n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.pitch))),o&&"function"==typeof o&&o()}})})}catch(e){alert("获取街景失败!")}delete window[t]},this.getInfoByPosition(e)),this},Bo.prototype.imageJoin=function(e,o){let r=this,n=e.content[0].ID;var t=parseInt(e.content[0].LayerCount)-2,e=e.content[0].ImgLayer[t];let a=e.ImgLevel;var i=e.BlockY/2,s=e.BlockX/2;let l=i*s,c=null,u=(c=document.createElement("canvas")).getContext("2d"),h=(c.height=512*i,c.width=512*s,document.body.appendChild(c),0);for(let t=0;t<i;t++)for(let e=0;e<s;e++)!function(e,t){let i=new Image;i.onload=function(){u.drawImage(this,0,0,512,512,512*t,512*e,512,512),h++,l==h&&o(c)},i.setAttribute("crossOrigin","Anonymous"),i.src=r.URL.getImageById+"&sid="+n+"&pos="+e+"_"+t+"&z="+a}(t,e)},Bo.prototype.getInfoByPosition=function(e){var e=this.getInitImageByPositionURL(e),t=document.createElement("script");t.type="text/javascript",t.src=e,t.addEventListener?t.addEventListener("load",function(e){(e=e.target).parentNode.removeChild(e)},!1):t.attachEvent&&t.attachEvent("onreadystatechange",function(){var e=window.event.srcElement;!e||"loaded"!=e.readyState&&"complete"!=e.readyState||e.parentNode.removeChild(e)}),setTimeout(function(){document.getElementsByTagName("head")[0].appendChild(t),t=null},1)},Bo.prototype.exit=function(){var e,t,i;this.isStreetView&&(t=(e=this)._viewer,0<this.StreetViewSphere.length&&(this.StreetViewSphere.forEach(function(e){e&&t.entities.remove(e)}),this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null]),0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){t.entities.remove(e)}),this.StreetViewNavigation=[]),this.setCesiumFov(this.StreetViewData.defaultFov),this.detachMouseEvent(),t.scene.skyAtmosphere.show=this.defaultSkyAtmosphere,this.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1),i=t.camera.positionCartographic,t.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,i.height+3e3),orientation:{heading:t.camera.heading,pitch:this._cesium.Math.toRadians(-90),roll:0},complete:function(){e.isStreetView=!1,Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.isStreetView=!1)}}))},Bo.prototype.extend=function(e,t,i){for(var o in t)t.hasOwnProperty(o)&&(e.hasOwnProperty(o)||i)&&(e[o]=t[o]);return e},Bo.prototype.getInitImageByPositionURL=function(e){var t,i,o;return o=this.URL&&this.URL.getInitImageByPosition?1<(i=this.URL.getInitImageByPosition.split("{lon}"))[0].split("{lat}").length?(t=i[0].split("{lat}"))[0]+e.lat+t[1]+e.lon+i[1]:(t=i[1].split("{lat}"),i[0]+e.lon+t[0]+e.lat+t[1]):o},Bo.prototype.getImageByIdURL=function(e,t){var i,o;switch(e){case"one":i=this.URL.getInitImageById;break;case"two":i=this.URL.getSecondImageById;break;case"three":i=this.URL.getThirdImageById;break;case"init":i=this.URL.getInitImageInfoById}return"lide"===this.StreetViewType&&(t=t.replace("-0-","-X-"),"one"===e&&(i+="&row=0&col=0")),o=i?(e=i.split("{id}"))[0]+t+e[1]:o},Bo.prototype.getInitImageByPosition=function(e,n){var a=this,e=this.getInitImageByPositionURL(e);this.StreetViewData.linkImagesData=[],this._core.xhr({url:e,type:"get",dataType:"json",success:e=>{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){}})},Bo.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},Bo.prototype.getSecondTexturesFromAtlasFile=function(e,o){var r,n,a,s,l=this.StreetViewSphereIndex,t=this.getImageByIdURL("two",e),c=null,u=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==c&&(c=document.createElement("canvas"),u=c.getContext("2d"),c.height=s>f?f:s,c.width=a>g?g:a,u.translate(c.width,0),u.scale(-1,1));var e=r,t=n;"lide"===this.StreetViewType&&(e=512,t=256),u.drawImage(this.FirstImage,0,0,e,t,0,0,c.width,c.height);for(var i=0;i<m.length;i++)m[i].src&&u.drawImage(m[i],0,0,r,n,r*(i%p),n*Math.floor(i/p),r,n);o({index:l,canvas:c})}},C=0;C<d;C++)for(var y=0;y<p;y++){var v=(v=t+i).replace("{row}",C).replace("{col}",y),w=new Image;w.onload=function(){r=this.width,n=this.height,a=r*p,s=n*d,_()},w.onerror=function(){this.src="",this.onerror=void 0,_()},w.setAttribute("crossOrigin","Anonymous");try{w.src=v}catch(e){w.src=""}m.push(w)}},Bo.prototype.getThreeTexturesFromAtlasFile=function(e,r){for(var n=this.StreetViewSphereIndex,t=this.getImageByIdURL("three",e),a=null,s=null,l=0,c=[],i=0;i<8;i++)for(var o=0;o<16;o++){var u=t+i+"-"+o,h=new Image;!function(o){o.onload=function(){var e=o.width,t=o.height;if(128==++l){null==a&&(a=document.createElement("canvas"),s=a.getContext("2d"),a.height=4096,a.width=8192,s.translate(8192,0),s.scale(-1,1));for(var i=0;i<c.length;i++)s.drawImage(c[i],0,0,e,t,e*(i%16),t*Math.floor(i/16),e,t);r({index:n,canvas:a})}}}(h),h.setAttribute("crossOrigin","Anonymous");try{h.src=u}catch(e){h.src=""}c.push(h)}},Bo.prototype.InitSceneByID=function(t){var i=this,o=this._viewer;this.updateStreetSphereIndex(),this.StreetViewSphere[this.StreetViewSphereIndex]=this.createScene(this.StreetViewData.lon,this.StreetViewData.lat,this.StreetViewData.height),this.getInitImage(this.StreetViewData.getImageTileID,function(e){i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,setTimeout(function(){i.StreetViewSphere[i.StreetViewSphereIndex].show=!0},300)}),this.StreetViewData.isTwoTextures=!1,"lide"!==this.StreetViewType?this.getImageInfoById(this.StreetViewData.getImageTileID,function(e){i.StreetViewData.linkImagesData=[],i.CallBack&&i.CallBack.getImageInfoByIdCallBack?("function"==typeof i.CallBack.getImageInfoByIdCallBack&&i.CallBack.getImageInfoByIdCallBack(i.StreetViewData,e),i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getInitImage(i.StreetViewData.getImageTileID,function(e){i.StreetViewData.isTwoTextures||(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e)}),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1}),i.createNavigation()):console.log("the getImageInfoByIdCallBack is undefined!")}):this.getInitImageByPosition(i.StreetViewData,function(e){i.StreetViewSphere[i.StreetViewSphereIndex].position=i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e,o.camera.cancelFlight(),o.camera.flyTo({destination:i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),orientation:{heading:o.camera.heading,pitch:o.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){o.entities.remove(t),t=null},1300),i.StreetViewSphere[i.StreetViewSphereIndex].orientation=i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon,i.StreetViewData.lat,i.StreetViewData.height),new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading+90),i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll),i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))),i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID,function(e){e.index===i.StreetViewSphereIndex&&!1===i.StreetViewData.isTwoTextures&&(i.StreetViewSphere_Canvas[i.StreetViewSphereIndex]=e.canvas),i.StreetViewData.isTwoTextures=!0,i.StreetViewData.isThreeTextures=!1})})},Bo.prototype.getImageInfoById=function(e,t){e=this.getImageByIdURL("init",e);this._core.xhr({url:e,type:"get",dataType:"json",success:function(e){"function"==typeof t&&t(e)}})},Bo.prototype.createScene=function(e,t,i){var o=this,r=this._viewer,n=this.StreetViewSphereIndex,a=new this._cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return o.StreetViewSphere_Canvas[n]},!1),transparent:!0,color:this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha)}),e={show:!1,position:this._cesium.Cartesian3.fromDegrees(e,t,i),ellipsoid:{radii:new this._cesium.Cartesian3(this.StreetViewData.radius,this.StreetViewData.radius,this.StreetViewData.radius),material:a}},t=r.entities.add(e);return t.geometryName="街景",t};var Vo,Fo,Ho,Go,ko,No,jo,Uo,zo,Wo=null,Yo=null,Jo={looking:!(Bo.prototype.detachMouseEvent=function(){var e=this._viewer.scene;this._viewer.canvas,this.StreetViewData._handler&&(this.StreetViewData._handler.destroy(),this.StreetViewData._handler=void 0),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=void 0),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick,this),e.screenSpaceCameraController.enableRotate=!0,e.screenSpaceCameraController.enableTranslate=!0,e.screenSpaceCameraController.enableZoom=!0,e.screenSpaceCameraController.enableTilt=!0,e.screenSpaceCameraController.enableLook=!0})};function Ko(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function Qo(e,t){this._viewer=e,this._cesium=t}Bo.prototype.attachMouseEvent=function(){var t=this;Wo=this._viewer.scene,Yo=this._viewer.canvas,this.StreetViewData._handler=new this._cesium.ScreenSpaceEventHandler(Yo),Yo.setAttribute("tabindex","0"),Yo.focus(),Yo.onclick=function(){Yo.focus()},setTimeout(function(){t.setCesiumFov(t.StreetViewData.fov)},4e3),Wo.screenSpaceCameraController.enableRotate=!1,Wo.screenSpaceCameraController.enableTranslate=!1,Wo.screenSpaceCameraController.enableZoom=!1,Wo.screenSpaceCameraController.enableTilt=!1,Wo.screenSpaceCameraController.enableLook=!1,this.StreetViewData._handler.setInputAction(function(e){Jo.looking=!0},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.StreetViewData._handler.setInputAction(function(e){Jo.looking&&(Ao=e.startPosition,Lo=e.endPosition,t.StreetView_mouseMove())},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.StreetViewData._handler.setInputAction(function(e){Jo.looking=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this.StreetViewData._handler.setInputAction(function(e){e=t.StreetViewData.fov+e/-10;30<e&&e<120&&(t.StreetViewData.fov=e,t.setCesiumFov(t.StreetViewData.fov))},this._cesium.ScreenSpaceEventType.WHEEL),"lide"!==this.StreetViewType&&this._viewer.clock.onTick.addEventListener(t.StreetView_onTick,this)},Bo.prototype.StreetView_onTick=function(){var t=this;!this.StreetViewData.isThreeTextures&&this.StreetViewData.fov<50&&(this.StreetViewData.isThreeTextures=!0,this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID,function(e){e.index===t.StreetViewSphereIndex&&(t.StreetViewSphere_Canvas[t.StreetViewSphereIndex]=e.canvas)}))},Bo.prototype.StreetView_mouseMove=function(){var e,t,i=this._viewer.camera;Jo.looking&&(e=Yo.clientWidth,t=Yo.clientHeight,e=-(Lo.x-Ao.x)/e,t=(Lo.y-Ao.y)/t,(!i.roll&&i.pitch<0&&t<0||!i.roll&&0<i.pitch&&0<t)&&(t=0),i.rotate(i.position,e*this.StreetViewData.speedScale),i.lookUp(t*this.StreetViewData.speedScale))},Bo.prototype.setOpacity=function(t){var i=this;this.StreetViewSphere.forEach(function(e){e&&(e.ellipsoid.material.color._value=i._cesium.Color.WHITE.withAlpha(t))}),this.StreetViewData.alpha=t},Bo.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},Bo.prototype.MoveToLinkImage=function(e){e?"lide"!==this.StreetViewType||e.ImageID?(this.StreetViewData.name=e.name,this.StreetViewData.lon=e.Position[0],this.StreetViewData.lat=e.Position[1],this.StreetViewData.height=e.Position[2],this.StreetViewData.getImageTileID=e.ImageID,this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])):this.CallBack&&this.CallBack.selectJoinsCallBack&&"function"==typeof this.CallBack.selectJoinsCallBack&&this.CallBack.selectJoinsCallBack():alert("暂无街景数据")},Bo.prototype.updateStreetSphereIndex=function(){this.StreetViewSphereIndex=0===this.StreetViewSphereIndex?1:0},Bo.prototype.createNavigation=function(){var t,i=this,a=this._viewer,s=(0<this.StreetViewNavigation.length&&(this.StreetViewNavigation.forEach(function(e){a.entities.remove(e)}),this.StreetViewNavigation=[]),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=null),6378137),n=6356725,o={lon:this.StreetViewData.lon,lat:this.StreetViewData.lat,height:this.StreetViewData.height-1};function l(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=n+(s-n)*(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]}function c(e){return e*Math.PI/180}this.StreetViewData.linkImagesData.forEach(function(t){var e=a.entities.add({polygon:{hierarchy:new i._cesium.CallbackProperty(function(){var e=function(e,t){var i=[],e=l(e.lon,e.lat,3.5,180*a.camera.heading/Math.PI),o={lon:e[0],lat:e[1]};e=l(e[0],e[1],1.1,0),i.push(e[0],e[1]),e=l(e[0],e[1],.5758,135),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,180),i.push(e[0],e[1]),e=l(e[0],e[1],.4,270),i.push(e[0],e[1]),e=l(e[0],e[1],.5,0),i.push(e[0],e[1]),e=l(e[0],e[1],.2,270),i.push(e[0],e[1]);for(var r,n=0;n<i.length-1;n+=2)r=function(e,t,i){t=function(e,t,i,o){var r=c(t),n=c(o),o=c(o)-c(t),t=c(i)-c(e);i=(i=2*Math.asin(Math.sqrt(Math.pow(Math.sin(o/2),2)+Math.cos(r)*Math.cos(n)*Math.pow(Math.sin(t/2),2))))*s,i=Math.round(1e4*i)/1e4,e=0==o&&0<t?90:0==o&&t<0?270:o<0&&0==t?180:0<=o&&0==t?0:o<0&&0<t?180-180*Math.atan(t/-o)/Math.PI:o<0&&t<0?180+180*Math.atan(t/o)/Math.PI:0<o&&t<0?360-180*Math.atan(-t/o)/Math.PI:180*Math.atan(t/o)/Math.PI;return{angle:e,distance:i}}(e.lon,e.lat,t.lon,t.lat);return l(e.lon,e.lat,t.distance,i-t.angle)}(o,{lon:i[n],lat:i[n+1]},t),i[n]=r[0],i[n+1]=r[1];return i}(o,t.NavigationAngle);return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3.fromDegreesArray(e))},!1),fill:!0,outline:!0,outlineColor:i._cesium.Color.BLACK.withAlpha(.2),height:o.height}});e.geometryName="街景",e.isNavigation=!0,e.linkImageData=t,i.StreetViewNavigation.push(e)}),i.StreetViewData.navigation_handler=new i._cesium.ScreenSpaceEventHandler(Yo),i.StreetViewData.navigation_handler.setInputAction(function(e){e=a.scene.pick(e.position);i._cesium.defined(e)&&(e&&e.id&&e.id.isNavigation?(t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE),(t=e.id).polygon.outlineColor=i._cesium.Color.BLUE,t.polygon.material=i._cesium.Color.WHITE.withAlpha(.9)):t&&(t.polygon.outlineColor=i._cesium.Color.BLACK.withAlpha(.5),t.polygon.material=i._cesium.Color.WHITE,t=void 0)),t&&i.MoveToLinkImage(t.linkImageData)},i._cesium.ScreenSpaceEventType.LEFT_CLICK)},Ko.prototype.createCircleScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),e=(this._position=e,this._cesium.Color.fromCssColorString(i)),i=(this.item=this.AddCircleScanPostStage(n,t,e,o,r),{id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Ko.prototype.createMultiCircleScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),e=(this._position=e,this._cesium.Color.fromCssColorString(i)),i=(this.item=this.AddCircleScanMultiPostStage(n,t,e,o,r),{id:this._core.getuid(),name:"新建扩散圆扫描",pId:0,type:"scan",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Ko.prototype.createRadarScan=function(e,t=1500,i="#ff0000",o=4e3,r=!0){var n=new this._cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),e=(this._position=e,this._cesium.Color.fromCssColorString(i)),i=(this.item=this.AddRadarScanPostStage(n,t,e,o,r),{id:this._core.getuid(),name:"新建雷达扫描",pId:0,type:"scan",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},Ko.prototype.createSectorScan=function(e,t=1500,i="#ff0000",o=90,r=0,n=4e3,a=!0){var s=this._cesium,l=new s.Cartesian3.fromDegrees(e.lon,e.lat,e.height),e=(this._position=e,s.Color.fromCssColorString(i)),s=(this.item=this.AddSectorScanPostStage(l,t,e,o,r,n,a),{id:this._core.getuid(),name:"新建扇形扩散扫描",pId:0,type:"scan",item:this});return this.setTreeobj(s),this._tree.insertGroupId(s,0),this},Ko.prototype.AddSectorScanPostStage=function(e,t,i,o,r,n,a){var s=this._viewer,l=this._cesium,c=this._core.defaultValue(this._position.height,0);function u(e,t,i){this._definitionChanged=new l.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=i,this._angle=t,this._time=(new Date).getTime()}return l.EllipsoidFadeMaterialProperty||(Object.defineProperties(u.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:l.createPropertyDescriptor("color"),angle:l.createPropertyDescriptor("angle")}),u.prototype.getType=function(e){return"EllipsoidFade"},u.prototype.getValue=function(e,t){return(t=l.defined(t)?t:{}).color=l.Property.getValueOrClonedDefault(this._color,e,l.ColorWHITE,t.color),t.angle=this._angle,t},u.prototype.equals=function(e){return this===e||e instanceof u&&Property.equals(this._color,e._color)},l.EllipsoidFadeMaterialProperty=u,l.Material.EllipsoidFadeType="EllipsoidFade",l.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}",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:c,semiMinorAxis:t,semiMajorAxis:t,stRotation:r*Math.PI/180,material:new l.EllipsoidFadeMaterialProperty(i,o,n)}},s.entities.add(e)},Ko.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<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }",a.Material._materialCache.addMaterial(a.Material.CircleScanType,{fabric:{type:a.Material.CircleScanType,uniforms:{color:new a.Color(1,0,0,1),time:0},source:a.Material.CircleScanSource},translucent:function(e){return!0}}));e={name:"CircleScan",position:e,ellipse:{height:r?void 0:s,semiMinorAxis:t,semiMajorAxis:t,material:new a.CircleScanMaterialProperty(i,o)}};return n.entities.add(e)},Ko.prototype.AddCircleScanMultiPostStage=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.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=t,this._time=(new Date).getTime()}a.CircleScanMultiMaterialProperty||(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"CircleScanMulti"},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.time<1/3&&0===this.u_radius2&&0===this.u_radius1?this.u_radius3=t.time:t.time>=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)},Ko.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),.5<this.old&&t.time<.5&&(t.inverse=!t.inverse),this.old=t.time,t.gradient?t.inverse?(t.angle2=this.range*(1-t.time),t._angle=this.range-t.angle2,t._angle>this._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)},Ko.prototype.setRadius=function(e){this.item&&(this.item.ellipse.semiMinorAxis=parseFloat(e),this.item.ellipse.semiMajorAxis=parseFloat(e))},Ko.prototype.setTime=function(e){this.item&&(this.item.ellipse.material.duration=parseFloat(e))},Ko.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<e?t:parseFloat(e))},Ko.prototype.setRadarRange=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.range=360<e?360:parseFloat(e))},Ko.prototype.setRadarIsReturn=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.isReturn=e)},Ko.prototype.setRadarIsGradient=function(e){this.item&&"RadarScan"===this.item.ellipse.material.getType()&&(this.item.ellipse.material.isGradient=e)},Ko.prototype.setPosition=function(e){this.item&&(this.item.position=new Cesium.Cartesian3.fromDegrees(e.lon,e.lat))},Ko.prototype.remove=function(){this._viewer.entities.remove(this.item)},Ko.prototype.setTreeobj=function(e){this.treeobj=e},Ko.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},Ko.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},Qo.prototype.depthTestAgainstTerrain=function(e){this._viewer.scene.globe.depthTestAgainstTerrain=e},Qo.prototype.show=function(){return this._viewer.scene.globe.depthTestAgainstTerrain};var D,qo=[1,1e5];function Xo(e,t){var i,o;if(!(D.canvas.width<=0||D.canvas.height<=0))return(o=D.camera.getPickRay(e))&&(i=D.scene.globe.pick(o,D.scene)),(o=(o=D.scene.pick(e))&&o.id instanceof Cesium.Entity?void 0:o)&&(o=D.scene.pickPosition(e))?o:i}function Zo(e,t){this._normalShadowMap=e.scene.shadowMap,D=e,Cesium.Scene.prototype.screenToWorld=Xo,this._viewer=e,this._cesium=t,this._core=new f,this._getPosition=new y(e),this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._prevRadius=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._viewshedDirection=null,this._scratchCartesian3=new Cesium.Cartesian3,this._texture=null,this._canEnlarge=!1,this._viewshedPrimitive=null,this._eventListener=null,this._viewshedMap=void 0,this._firstTime=!0,this._editingMode=!1,this._isSliderClicked=!1,this._currentObject=void 0,this._setNewPosition=!1,this._setNewPositionCanDrag=!1,this._setNewName=!1,this._listControl=void 0,this._addingViewshedMode=!1,this._initialCameraParams={},this._isCancelledTerrain=!1,this._isCancelledPrimitives=!1,this._isSpherical=!1,this._occluder=void 0,this._horizonCullingDistanceFromPoint=void 0,this._mousePositionX=void 0,this._mousePositionY=void 0,this._zAxisNewPosition=void 0,this._startingRepoZHeight=void 0,this._viewshedCartoPos=void 0,this._propertiesChanged=!1,this._calculations=[],this._exposures=[],this._calculating=!1,this._calculatingExposure=!1,this.viewshedCalculateNormals=!1,this._txtUnit="meters_short",this.isLoadingScreenOn=!1,this._primitiveColor=Cesium.Color.WHITE,this._predefinedPrimitiveColors={BEYOND_THE_HORIZON:Cesium.Color.WHITE,DEFAULT:Cesium.Color.WHITE},this._layersStorage=null,this.getId=function(){return"Viewshed"},this.maxNumViewshed=8,Vo=53*Cesium.Math.RADIANS_PER_DEGREE,Fo=53*Cesium.Math.RADIANS_PER_DEGREE,Ho=6371010,Go={ABOVE_SEA_LEVEL:0,ABOVE_GROUND_LEVEL:1,ABOVE_MODEL:2},ko=new Cesium.Cartesian3,Uo=new Cesium.Matrix4,No=new Cesium.Cartesian4,jo=new Cesium.Cartesian3,Uo=new Cesium.Matrix4,(zo=new Array(4))[0]=new Cesium.Cartesian4(-1,-1,1,1),zo[1]=new Cesium.Cartesian4(1,-1,1,1),zo[2]=new Cesium.Cartesian4(1,1,1,1),zo[3]=new Cesium.Cartesian4(-1,1,1,1)}Zo.prototype.setOptions=function(e){this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}}},Zo.prototype.startDraw=function(e){this._viewshedPrimitive&&(D.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null),this._core.setDepthTest("open",this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._eventListener&&this._eventListener.destroy(),this._eventListener=new Cesium.ScreenSpaceEventHandler(D.scene.canvas),void 0===this._viewshedDefaultNamingArray&&(this._viewshedDefaultNamingArray=new Array(this.maxNumViewshed)),this._addingViewshedMode=!0,this._editingMode=!1,this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:e||{}},this._isSpherical=e.isSpherical,this._setNewPosition=!1,"pc"!=this._core.getBrowser().pc?(this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),D.scene.preRender.addEventListener(this.onPreFrameMobile,this)):(this._eventListener.setInputAction($.proxy(this.setViewshedPosition,this),Cesium.ScreenSpaceEventType.LEFT_CLICK),D.scene.preRender.addEventListener(this.onPreFrame,this)),this.end=e=>{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)}},Zo.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)},Zo.prototype.setVisibility=function(e){this._viewshedPrimitive.show=e,D.shadowMap.enabled=e},Zo.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},Zo.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)},Zo.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},Zo.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},Zo.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<i.length&&(t=i[i.length-2],o=D.scene.primitives._primitives[t],D.scene.primitives.remove(o))))):Cesium.defined(e)&&void 0!==this._currentObject&&void 0!==(t=this._getPosition.getMousePosition(e))&&(o=0,this._startPositionCartographic=D.scene.globe.ellipsoid.cartesianToCartographic(t),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(o=this._currentObject.viewshedObjOptions.height),e=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+o),this._startPositionCartesian=e,t=this._startPositionCartesian,o=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),Ho),this._occluder=new Cesium.Occluder(o,t),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},Zo.prototype.update=function(t={}){if(this._currentObject&&this._currentObject.viewshedMap){var i,o=this._currentObject.direction;Object.assign(o,t);let e=this._currentObject.position;void 0===t.lon&&void 0===t.lat&&void 0===t.height||(i=this._core.toDegrees(e),Object.assign(i,t),e=Cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),this._currentObject.position=e),void 0!==t.distance&&(this._currentRadius=t.distance),this._currentRadius?this._currentObject.viewshedMap._lightCamera.frustum.far=this._currentRadius:this._currentRadius=this._currentObject.viewshedMap._lightCamera.frustum.far,this._currentObject.viewshedMap._lightCamera.lookAt(e,o),this._isSpherical?this.createViewshedSpherePrimitive(e):this.createViewshedCameraPrimitive(e,this._currentObject.viewshedMap._lightCamera)}},Zo.prototype.setViewshedPositionMobile=function(e){var i,t,o;this._setNewPosition||(this.onMouseMove(e),this.createViewshedCameraPrimitive(),this._canEnlarge&&null!=this._viewshedPrimitive?(this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this.createViewshedMap(),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._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<i.length&&(t=i[i.length-2],o=D.scene.primitives._primitives[t],D.scene.primitives.remove(o))))):Cesium.defined(e)&&void 0!==this._currentObject&&void 0!==(t=this._getPosition.getMousePosition(e))&&(o=0,this._startPositionCartographic=D.scene.globe.ellipsoid.cartesianToCartographic(t),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,void 0!==this._currentObject.viewshedObjOptions.height&&(o=this._currentObject.viewshedObjOptions.height),e=new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+0+o),this._startPositionCartesian||(this._startPositionCartesian=e),t=this._startPositionCartesian,o=new Cesium.BoundingSphere(new Cesium.Cartesian3(0,0,0),Ho),this._occluder=new Cesium.Occluder(o,t),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),Cesium.ScreenSpaceEventType.MOUSE_MOVE)))},Zo.prototype.onMouseMove=function(e){var t,i,o,r;Cesium.defined(e)&&(i={},null!=(t=this._getPosition.getMousePosition(e))?null!=i.pickPrimitive&&null!=i.pickPrimitive._camera||(i={},this._setNewPosition?this._setNewPositionCanDrag?(o=void 0,r=D.scene.globe.ellipsoid.cartesianToCartographic(t),this._currentObject.viewshedObjOptions.pickHeight=r.height,this._currentObject.viewshedObjOptions.terrainHeight=D.scene.globe.getHeight(r),o=this._zAxisNewPosition?(e=e.endPosition.y-this._startingRepoZ.y,e=-1*Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position,D.camera.position,this._scratchCartesian3),this._scratchCartesian3)*(e/D.canvas.height),null==this._viewshedCartoPos&&(this._viewshedCartoPos=new Cesium.Cartographic.fromCartesian(this._currentObject.position)),new Cesium.Cartesian3.fromRadians(this._viewshedCartoPos.longitude,this._viewshedCartoPos.latitude,this._viewshedCartoPos.height+e)):this._currentObject.viewshedObjOptions.altitudeMethod==Go.ABOVE_SEA_LEVEL?new Cesium.Cartesian3.fromRadians(r.longitude,r.latitude,this._startingRepoZHeight):t,this._newPosition=o):(e=Cesium.Matrix4.multiplyByVector(D.camera._viewMatrix,Cesium.Cartesian4.fromElements(t.x,t.y,t.z,1,No),No),r=Cesium.Matrix4.multiplyByVector(D.camera.frustum.projectionMatrix,e,No),o=Cesium.Cartesian3.divideByScalar(r,r.w,jo),e=Math.floor((.5*o.x+.5)*D.canvas.width),r=Math.floor((.5*o.y+.5)*D.canvas.height),this._mousePositionX=e,this._mousePositionY=r):null!=this._startPositionCartesian&&(Cesium.Cartesian3.subtract(t,this._startPositionCartesian,i),isNaN(i.x)||isNaN(i.y)||isNaN(i.z)||(this._viewshedDirection=Cesium.Cartesian3.normalize(i,this._scratchCartesian3),this._currentRadius=Cesium.Cartesian3.magnitude(i)))):(this._mousePositionX=void 0,this._mousePositionY=void 0))},Zo.prototype.createViewshedSpherePrimitive=function(e,t){try{var i=null!=e?e:this._startPositionCartesian,o=null!=t?t:this._currentRadius;if(o<=1)return!1;null!=this._viewshedPrimitive&&D.scene.primitives.remove(this._viewshedPrimitive);var r=Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i),new Cesium.Cartesian3(0,0,0),Uo),n=new Cesium.GeometryInstance({geometry:new Cesium.SphereOutlineGeometry({radius:o,stackPartitions:12,slicePartitions:12}),modelMatrix:r,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1,1,1,.5))}}),a=(this._viewshedPrimitive=D.scene.primitives.add(new Cesium.Primitive({geometryInstances:n,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,renderState:{lineWidth:1}}),allowPicking:!1,asynchronous:!1})),new Cesium.Camera(D.scene));a.position=i,a.direction=Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z,this._scratchCartesian3),this._viewshedPrimitive._camera=a}catch(e){return!1}return this._viewshedPrimitive},Zo.prototype.createViewshedCameraPrimitive=function(e,t){null!=this._viewshedPrimitive&&D.scene.primitives.remove(this._viewshedPrimitive);var i=new Cesium.Camera(D.scene);if(this._startPositionCartesian||e)return i.position=null!=e?e:this._startPositionCartesian,null==this._viewshedDirection||isNaN(this._viewshedDirection.x)||isNaN(this._viewshedDirection.y)||(i.direction=this._viewshedDirection.clone(),i.up=D.scene.globe.ellipsoid.geodeticSurfaceNormal(i.position,ko)),i.frustum.isViewshed=!0,i.frustum.fov=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov,Vo),i.frustum._fovy=Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy,Fo),i.frustum.aspectRatio=Math.tan(i.frustum.fov/2)/Math.tan(i.frustum._fovy/2),i.frustum.near=1,!(this._currentRadius<=1)&&(i.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),this._viewshedPrimitive=D.scene.primitives.add(new Cesium.DebugCameraPrimitive({camera:t||i,color:this._primitiveColor})),this._viewshedPrimitive._numFrustrums=0,this._viewshedPrimitive._outlineOnlyFrustum=!0,this._viewshedPrimitive.update=this.updateViewshedPrimitive,this._viewshedPrimitive)},Zo.prototype.createViewshedMap=function(){null==D.scene.viewsheds&&D.scene.viewsheds,null!=this._viewshedPrimitive._camera&&this._canEnlarge&&(null==this._viewshedMap?(this._viewshedMap=new Cesium.ShadowMap({context:D.scene.context,lightCamera:this._viewshedPrimitive._camera,enabled:1,isSpotLight:!0,fromLightSource:!0,softShadows:!1,isPointLight:this._isSpherical,pointLightRadius:Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)}),this._viewshedMap.show=!0,this._viewshedMap.isPreviewMode=!0,this._viewshedMap.guid="SamplerViewshed",this._viewshedMap):(this._viewshedMap._lightCamera.direction=this._viewshedPrimitive._camera.direction,this._viewshedMap._lightCamera.frustum.far=Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)))},Zo.prototype.updateViewshedPrimitive=function(e){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy()),!Cesium.defined(this._outlinePrimitive)){for(var t,i,o=this._camera,r=o.frustum,n=e.frustumSplits,a=n.length-1,s=((a=this._numFrustrums)<=0&&((n=qo)[0]=this._camera.frustum.near,n[1]=this._camera.frustum.far,a=1),this._camera.viewMatrix),l=(Cesium.defined(o.frustum.fovy)?(o=this._camera.frustum.projectionMatrix,o=Cesium.Matrix4.multiply(o,s,Uo),i=Cesium.Matrix4.inverse(o,Uo)):t=Cesium.Matrix4.inverseTransformation(s,Uo),new Float64Array(12*(a+1)+3)),c=0;c<a+1;++c)for(var u=0;u<4;++u){var h,m,d=Cesium.Cartesian4.clone(zo[u],Zo[u]);Cesium.defined(i)?(m=1/(d=Cesium.Matrix4.multiplyByVector(i,d,d)).w,Cesium.Cartesian3.multiplyByScalar(d,m,d),Cesium.Cartesian3.subtract(d,this._camera.positionWC,d),Cesium.Cartesian3.normalize(d,d),m=Cesium.Cartesian3.dot(this._camera.directionWC,d),Cesium.Cartesian3.multiplyByScalar(d,n[c]/m,d),Cesium.Cartesian3.add(d,this._camera.positionWC,d)):(Cesium.defined(r._offCenterFrustum)&&(r=r._offCenterFrustum),m=c===a?(h=n[c-1],n[c]):(h=n[c],n[c+1]),d.x=.5*(d.x*(r.right-r.left)+r.left+r.right),d.y=.5*(d.y*(r.top-r.bottom)+r.bottom+r.top),d.z=.5*(d.z*(h-m)-h-m),d.w=1,Cesium.Matrix4.multiplyByVector(t,d,d)),l[12*c+3*u]=d.x,l[12*c+3*u+1]=d.y,l[12*c+3*u+2]=d.z}l[12*a+12]=this._camera.positionWC.x,l[12*a+12+1]=this._camera.positionWC.y,l[12*a+12+2]=this._camera.positionWC.z;o=new Cesium.BoundingSphere.fromVertices(l),s=new Cesium.GeometryAttributes;s.position=new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l});var p,g,f=new Uint16Array(8*(2*a+1+1));for(c=0;c<a+1;++c)f[p=8*c]=g=4*c,f[p+1]=g+1,f[p+2]=g+1,f[p+3]=g+2,f[p+4]=g+2,f[p+5]=g+3,f[p+6]=g+3,f[p+7]=g;for(c=0;c<a;++c)f[p=8*(a+1+c)]=g=4*c,f[p+1]=g+4,f[p+2]=g+1,f[p+3]=g+5,f[p+4]=g+2,f[p+5]=g+6,f[p+6]=g+3,f[p+7]=g+7;f[p+=8]=g+8,f[p+1]=g+1,f[p+2]=g+8,f[p+3]=g+2,f[p+4]=g+8,f[p+5]=g+3,f[p+6]=g+8,f[p+7]=g+4,this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:{attributes:s,indices:f,primitiveType:Cesium.PrimitiveType.LINES,boundingSphere:o},attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}this._outlinePrimitive.isViewshedPart=!0,this._outlinePrimitive.update(e)}},Zo.prototype.getHorizonDistance=function(e){return Math.sqrt(Math.pow(Ho+e,2)-Math.pow(Ho,2))},Zo.prototype.onPreFrame=function(e){var t,i,o,r;null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap&&(t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position),i=this.getHorizonDistance(t.height),this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=i,i=D.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5),null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius&&this._prevRadius!=this._currentRadius?(this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap()):null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY&&(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical?(this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance)):(this.checkIfMouseOnPosition(),null!=this._newPosition&&(this._currentObject.viewshedObjOptions.altitudeMethod==Go.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,D.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedObjOptions.altitudeMethod==Go.ABOVE_MODEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedPrimitive._camera.position=this._newPosition,this.adjustDirections())))},Zo.prototype.onPreFrameMobile=function(e){var t,i,o,r;null!=this._currentObject&&null!=this._currentObject.viewshedPrimitive&&null!=this._currentObject.viewshedMap&&(t=new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position),i=this.getHorizonDistance(t.height),this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=i,i=D.scene.globe.getHeight(t),this._currentObject.viewshedMap.isBelowGround=t.height<i+.5),null!=this._currentObject&&this._currentObject.viewshedMap,null!=this._newPosition&&this.toPreviewMode(this._currentObject),this._canEnlarge&&null!=this._currentRadius?(this._prevRadius=this._currentRadius,(this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive())&&this.createViewshedMap()):null!=this._currentObject&&this._setNewPosition&&null!=this._mousePositionX&&null!=this._mousePositionY&&(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical?(this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance)):(this.checkIfMouseOnPosition(),null!=this._newPosition&&(this._currentObject.viewshedObjOptions.altitudeMethod==Go.ABOVE_GROUND_LEVEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,D.scene.globe.getHeight(o)+this._currentObject.startingAltitudeAboveGround),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedObjOptions.altitudeMethod==Go.ABOVE_MODEL&&null==this._zAxisNewPosition?(o=Cesium.Cartographic.fromCartesian(this._newPosition.clone()),r=Cesium.Cartesian3.fromRadians(o.longitude,o.latitude,o.height+this._currentObject.startingAltitudeAboveModel),this._currentObject.viewshedPrimitive._camera.position=r):this._currentObject.viewshedPrimitive._camera.position=this._newPosition,this.adjustDirections())))};var $o,er,tr,ir,or="vec4 toEye(in vec2 uv, in float depth){\nvec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\nvec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera =posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat getDepth(in vec4 depth){\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}\nmat4 inverse_mat4(mat4 m)\n{\nfloat Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\nfloat Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\nfloat Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\nfloat Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\nfloat Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\nfloat Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\nfloat Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\nfloat Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\nfloat Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\nfloat Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\nfloat Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\nfloat Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\nfloat Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\nfloat Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\nfloat Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\nfloat Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\nfloat Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\nfloat Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\nconst vec4 SignA = vec4( 1.0, -1.0,  1.0, -1.0);\nconst vec4 SignB = vec4(-1.0,  1.0, -1.0,  1.0);\nvec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);\nvec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);\nvec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);\nvec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);\nvec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);\nvec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);\nvec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);\nvec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);\nvec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);\nvec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);\nvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\nvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\nvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\nvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\nmat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);\nvec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\nfloat Determinant = dot(m[0], Row0);\nInverse /= Determinant;\nreturn Inverse;\n}\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec3 cen;\nuniform vec3 position;\nuniform vec3 eupp;\nuniform vec3 angle;\nuniform vec4 nearAndFar;\nuniform sampler2D video;\nuniform vec4 visible;\nuniform vec4 unvisible;\nuniform float type;\nuniform sampler2D stcshadow;\nuniform mat4 _shadowMap_matrix;\nuniform vec4 shadowMap_lightPositionEC;\nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\nmat4 computeMat(){\nvec3 dir = normalize( position - cen );\nvec3 up = normalize( eupp - cen);\nvec3 right = cross(dir , up);\nright = normalize(right);\nup = cross(right , dir);\nup = normalize(up);\nreturn mat4(\nright.x,right.y,right.z,0.,\nup.x,up.y,up.z,0.,\ndir.x,dir.y,dir.z,0.,\ncen.x,cen.y,cen.z,1.\n);\n}\nmat3 computeMat3(float an){\nfloat sa = sin(an);\nfloat ca = cos(an);\nreturn mat3(\nca , -sa ,0.,\nsa , ca , 0.,\n0.,0.,1.\n);\n}\nvoid main(){\nvec2 uv = v_textureCoordinates;\nfloat depth = getDepth(texture2D( depthTexture , uv));\nvec4 oc = texture2D(colorTexture , uv);\nvec4 ec = toEye( uv , depth);\nec /= ec.w;\nvec3 snor = normalize(position - cen);\nvec3 pd = ec.xyz - cen;\nfloat dd = length(pd);\nvec3 n = normalize(ec.xyz - cen);\nfloat d = dot(n ,  snor);\nmat4 localMat = computeMat();\nvec4 p = inverse_mat4(localMat) * ec;\np /= p.w;\nif( p.z < nearAndFar.x || p.z > nearAndFar.y){\ngl_FragColor = oc;\nreturn;\n}\nvec3 pp = p.xyz;\nmat3 rm = computeMat3( radians( angle.z ) );\npp = rm * pp;\nvec3 nn = pp.xyz;\nvec3 zn = vec3(0.,0.,1.);\nfloat dist = dot( nn , zn);\nfloat dx = pp.x ;\nfloat xangle = tan(radians( angle.x ));\nfloat yangle = tan(radians( angle.y ));\nfloat tanx = pp.x / dist;\nfloat tany = pp.y / dist;\nif( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){\nczm_shadowParameters shadowParameters;\nshadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\nshadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\nshadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\nshadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\nshadowParameters.depthBias *= max(depth * 0.01, 1.0);\nvec3 directionEC = normalize(ec.xyz - shadowMap_lightPositionEC.xyz);\nvec3 normalEC = vec3(1.0);\nfloat nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);\nvec4 shadowPosition = _shadowMap_matrix * ec;\nshadowPosition /= shadowPosition.w;\nshadowParameters.texCoords = shadowPosition.xy;\nshadowParameters.depth = shadowPosition.z;\nshadowParameters.nDotL = nDotL;\nfloat visibility = czm_shadowVisibility(stcshadow, shadowParameters);\nif(type == 0.0){\nif(visibility == 1.0){\ngl_FragColor = mix(oc , visible , nearAndFar.z);\n}else{\ngl_FragColor = mix(oc , unvisible , nearAndFar.z);\n}\n}else{\nif(visibility == 1.0){\nfloat r = (tanx + xangle) / (2. * xangle);\nfloat g = (tany + yangle) / (2. * yangle);\nvec4 col = texture2D( video , vec2( r , g));\nfloat f1 = 1.;\nfloat v1 = nearAndFar.w ;\nfloat v2 = 1. - v1;\nif(r < v1){\nf1 = r / v1;\n}\nif(r > v2){\nf1 = (1. - r) / v1;\n}\nfloat f2 = 1.;\nif(g < v1){\nf2 = g / v1;\n}\nif(g > v2){\nf2 = (1. - g) / v1;\n}\nfloat f12 = f1 * f2;\nfloat ff = smoothstep(  0. , 1. , f12 );\nff *= nearAndFar.z;\ngl_FragColor = mix(oc , col , ff);\n}else{\ngl_FragColor = oc;\n}\n}\n}else{\ngl_FragColor = oc;\n}\n}\n";let rr=new f;function nr(e,t){this._viewer=e,this.video=t.video,this.viewshed=t.viewshed||{},this.cameraPosition=t.cameraPosition.x&&t.cameraPosition.y&&t.cameraPosition.z?t.cameraPosition:Cesium.Cartesian3.fromDegrees(t.cameraPosition.lon,t.cameraPosition.lat,t.cameraPosition.height),this.position=t.position&&(t.position instanceof Cesium.Cartesian3?t.position:Cesium.Cartesian3.fromDegrees(t.position.lon,t.position.lat,t.position.height)),this.heading=t.heading||0,this.pitch=t.pitch||0,this.alpha=t.alpha||.9,this.horizonAngle=t.horizonAngle||60,this.verticalAngle=t.verticalAngle||40,this.angle=new Cesium.Cartesian3(this.horizonAngle/2,this.verticalAngle/2,0),this.near=rr.defaultValue(t.near,1),this.far=t.far||30,this.showFarScale=t.showFarScale||5,this.offset=0,this.show=!0,this.video&&(this.offset=rr.defaultValue(t.video.offset,.1)),this.viewshed.visible=Cesium.Color.fromCssColorString(this.viewshed.visible||"#00ff00"),this.viewshed.unvisible=Cesium.Color.fromCssColorString(this.viewshed.unvisible||"#ff0000"),this.nearAndFar=new Cesium.Cartesian4(this.near,this.far,this.alpha,this.offset),this.center=new Cesium.Cartesian3,this.eupp=new Cesium.Cartesian3,this.epp=new Cesium.Cartesian3,this.upp=this.setSpHeight(this.cameraPosition),this.useLine=Cesium.defaultValue(t.useLine,!0),this._viewer.scene.primitives.add(this),this.init()}function ar(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._getPosition=new y(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip()}function sr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this.isPause=!1,this.isLoad=!1}function lr(e,t){this._viewer=e,this._cesium=t}function cr(e,t,i,h,m,d){const{Pass:o,defined:r,PerspectiveFrustum:n,PerspectiveOffCenterFrustum:a,OrthographicFrustum:s,OrthographicOffCenterFrustum:l}=Cesium;$o=$o||new n,er=er||new a,tr=tr||new s,ir=ir||new l;let c=e._us,u=c._frameState,p=u.camera,g=p._scene,f=g._view,_=f.frustumCommandsList,C=_.length;var y,v,w,b=g._globeTranslucencyState,T=b.translucent;function S(e,t,i,o){if(!d||d(e,t))if(h&&m){var r=e;var n=h;var a=m;var s=i;var l=o;const u=Cesium.defined;var t=t._frameState,c=r.derivedCommands;u(c)&&(c=(r=t.useLogDepth&&u(c.logDepth)?c.logDepth.command:r).derivedCommands,u(c[n])&&(r=c[n][a]).execute(s,l))}else e.execute(i,o)}for(var E=r(p.frustum.fov)?p.frustum.clone($o):r(p.frustum.infiniteProjectionMatrix)?p.frustum.clone(er):r(p.frustum.width)?p.frustum.clone(tr):p.frustum.clone(ir),P=0;P<C;++P){var x=C-P-1,D=_[x],I=i.framebuffer;if(i.framebuffer=t,E.near=0!=x?D.near*g.opaqueFrustumNearOffset:D.near,E.far=D.far,c.updateFrustum(E),c.updatePass(o.GLOBE),w=D.commands[o.GLOBE],v=D.indices[o.GLOBE],T)b.executeGlobeCommands(D,S,globeTranslucencyFramebuffer,g,i);else for(y=0;y<v;++y)S(w[y],g,e,i);for(c.updatePass(o.CESIUM_3D_TILE),w=D.commands[o.CESIUM_3D_TILE],v=D.indices[o.CESIUM_3D_TILE],y=0;y<v;++y)S(w[y],g,e,i);for(c.updatePass(o.OPAQUE),w=D.commands[o.OPAQUE],v=D.indices[o.OPAQUE],y=0;y<v;++y)S(w[y],g,e,i);for(c.updatePass(o.TRANSLUCENT),w=D.commands[o.TRANSLUCENT],v=D.indices[o.TRANSLUCENT],y=0;y<v;++y)S(w[y],g,e,i);i.framebuffer=I}}nr.prototype.createViewCone=function(){var e;this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),this.useLine&&(e=this.viewShadowMap._lightCamera,this.line=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:e.positionWC,orientation:this.orientationData,frustum:e.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#fff"))}}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._viewer.scene.primitives.add(this.line))},nr.prototype.isShow=function(){return this.show&&rr.getPointToCameraDistance(this._viewer,this.cameraPosition)<this.far*this.showFarScale},nr.prototype.init=function(){if(!this.post||!this.texture){if(!(this.upp instanceof Cesium.Cartesian3))throw new Error("计算上方向错误");this._createShadowMap(),this.createViewCone();const o=this.video&&this.video.container,r=this;let e=this._viewer.scene.context.uniformState,t=this.viewShadowMap._isPointLight?this.viewShadowMap._pointBias:this.viewShadowMap._primitiveBias,i=0;o&&(this.texture=new Cesium.Texture({context:this._viewer.scene.context,source:o,width:1,height:1}),i=1),this.post=new Cesium.PostProcessStage({uniforms:{type:function(){return i},cen:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,r.cameraPosition,r.center)},position:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,r.videoCenter,r.epp)},eupp:function(){return Cesium.Matrix4.multiplyByPoint(e.view3D,r.upp,r.eupp)},video:function(){return o&&2<=o.readyState&&!r.isPause&&r.texture.copyFrom({source:o}),r.texture||r._viewer.scene.context.defaultTexture},visible:function(){return r.viewshed.visible},unvisible:function(){return r.viewshed.unvisible},angle:function(){return r.angle},nearAndFar:function(){return r.nearAndFar},_shadowMap_matrix:function(){return r.viewShadowMap._shadowMapMatrix},shadowMap_lightPositionEC:function(){return r.viewShadowMap._lightPositionEC},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let e=new Cesium.Cartesian2;return e.x=1/r.viewShadowMap._textureSize.x,e.y=1/r.viewShadowMap._textureSize.y,Cesium.Cartesian4.fromElements(e.x,e.y,t.depthBias,t.normalShadingSmooth)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cesium.Cartesian4.fromElements(t.normalOffsetScale,r.viewShadowMap._distance,r.viewShadowMap.maximumDistance,r.viewShadowMap._darkness)},stcshadow:function(){return r.viewShadowMap._shadowMapTexture}},fragmentShader:or}),this._viewer.scene.postProcessStages.add(this.post)}},nr.prototype._createShadowMap=function(){let e=new Cesium.Camera(this._viewer.scene);e.frustum.fov=Cesium.Math.toRadians(this.horizonAngle),e.frustum.aspectRatio=this.horizonAngle/this.verticalAngle,e.frustum.near=this.near,e.frustum.far=this.far,this.position?(e.position=this.cameraPosition,e.direction=Cesium.Cartesian3.subtract(this.position,this.cameraPosition,new Cesium.Cartesian3(0,0,0)),e.up=Cesium.Cartesian3.normalize(this.cameraPosition,new Cesium.Cartesian3(0,0,0)),t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.position,this.cameraPosition,new Cesium.Cartesian3),new Cesium.Cartesian3),e.direction=t,this.heading=Cesium.Math.toDegrees(e.heading),this.pitch=Cesium.Math.toDegrees(e.pitch)):e.setView({destination:this.cameraPosition,orientation:{heading:Cesium.Math.toRadians(this.heading),pitch:Cesium.Math.toRadians(this.pitch),roll:0}});var t=new Cesium.Cartesian3,i=new Cesium.Matrix3,o=new Cesium.Quaternion,r=e.upWC,n=e.rightWC,n=Cesium.Cartesian3.negate(n,t),t=i;if(Cesium.Matrix3.setColumn(t,0,n,t),Cesium.Matrix3.setColumn(t,1,r,t),Cesium.Matrix3.setColumn(t,2,e.direction,t),this.orientationData=Cesium.Quaternion.fromRotationMatrix(t,o),!this.position){var a=new Float64Array(24);Cesium.FrustumGeometry._computeNearFarPlanes(e.positionWC,this.orientationData,0,e.frustum,a);let t=new Cesium.Cartesian3;for(let e=12;e<a.length;e+=3)t.x+=a[e],t.y+=a[e+1],t.z+=a[e+2];Cesium.Cartesian3.multiplyByScalar(t,.25,t),this.position=t}this.videoCenter=this.position,this.position=null,this.viewShadowMap=new Cesium.ShadowMap({lightCamera:e,enabled:!1,isPointLight:!1,isSpotLight:!0,cascadesEnabled:!1,context:this._viewer.scene.context,pointLightRadius:this.far}),this.viewShadowMap.guid=Cesium.createGuid()},nr.prototype.flyTo=function(){var e;this.viewShadowMap&&this.viewShadowMap._lightCamera&&(e=this.viewShadowMap._lightCamera,this._viewer.camera.flyTo({destination:e.position,orientation:{heading:e.heading,pitch:e.pitch,roll:0}}))},nr.prototype.updatePost=function(e){e.cameraPosition&&(this.cameraPosition=e.cameraPosition instanceof Cesium.Cartesian3?e.cameraPosition:Cesium.Cartesian3.fromDegrees(e.cameraPosition.lon,e.cameraPosition.lat,e.cameraPosition.height)),e.position&&(this.position=e.position instanceof Cesium.Cartesian3?e.position:Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),isNaN(e.heading)||"number"!=typeof e.heading||(this.heading=e.heading),isNaN(e.pitch)||"number"!=typeof e.pitch||(this.pitch=e.pitch),isNaN(e.alpha)||"number"!=typeof e.alpha||(this.alpha=e.alpha),isNaN(e.horizonAngle)||"number"!=typeof e.horizonAngle||(this.horizonAngle=e.horizonAngle,this.angle.x=this.horizonAngle/2),isNaN(e.verticalAngle)||"number"!=typeof e.verticalAngle||(this.verticalAngle=e.verticalAngle,this.angle.y=this.verticalAngle/2),isNaN(e.near)||"number"!=typeof e.near||(this.near=e.near,this.nearAndFar.x=this.near),isNaN(e.far)||"number"!=typeof e.far||(this.far=e.far,this.nearAndFar.y=this.far),isNaN(e.offset)||"number"!=typeof e.offset||(this.nearAndFar.w=e.offset,this.offset=e.offset),isNaN(e.alpha)||"number"!=typeof e.alpha||(this.nearAndFar.z=e.alpha,this.alpha=e.alpha),isNaN(e.showFarScale)||"number"!=typeof e.showFarScale||(this.showFarScale=e.showFarScale),void 0!==e.useLine&&(this.useLine=e.useLine),this._createShadowMap(),this.createViewCone()},nr.prototype.update=function(e){var t;this.viewShadowMap&&this.show&&(t=this.isShow(),this.post&&(this.post.enabled=t),this.line&&(this.line.show=t),t&&this._viewer.scene.frameState.shadowMaps.push(this.viewShadowMap))},nr.prototype.setVisibility=function(e){this.show=e,this.post&&(this.post.enabled=e),this.line&&(this.line.show=e)},nr.prototype.destroy=function(){return this.post&&(this._viewer.scene.postProcessStages.remove(this.post),this.post.destroy(),this.post=void 0),this.texture&&(this.texture.destroy(),this.texture=void 0),this._viewer.scene.primitives.remove(this),this.shadowMaps&&this.shadowMaps.destroy(),this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),Cesium.destroyObject(this)},nr.prototype.setSpHeight=function(e,t=5e3){let i=Cesium.Cartographic.fromCartesian(e);return i.height+=t,Cesium.Cartographic.toCartesian(i)},nr.prototype.changeHorizonAngle=function(e){this.updatePost({horizonAngle:parseFloat(e)})},nr.prototype.changeVerticalAngle=function(e){this.updatePost({verticalAngle:parseFloat(e)})},nr.prototype.changeRotateAngle=function(e){this.updatePost({angleZ:parseFloat(e)})},ar.prototype.createViewCone=function(s,l){s=s||{},s=this._core.extend({roll:0,fov:60,near:1,height:1.6,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"},s,!0),this._option=s,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw);let c=this,u=this._viewer,h=(this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(u.scene.canvas),V.states=1,[]);return this.drawHandler.setInputAction(t=>{var e,i,o,r,n,a,t=c._getPosition.getMousePosition(t);if(t){if(0===h.length){if(s.height){let e=c._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 c.drawHandler.destroy(),c.drawHandler=void 0,c.tooltip.show(!1),setTimeout(function(){V.states=0},100),c._core.mouse(c._viewer.container,0,"0"),l&&"function"==typeof l&&l(c.item,h);c.item||(c.viewConeCamera=new Cesium.Camera(u.scene),t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1],h[0],new Cesium.Cartesian3),new Cesium.Cartesian3),c.viewConeCamera.position=h[0],c.viewConeCamera.direction=t,c.viewConeCamera.frustum.fov=Cesium.Math.toRadians(s.fov),c.viewConeCamera.frustum.near=s.near,c.viewConeCamera.frustum.far=1,n=new Cesium.Cartesian3,a=new Cesium.Matrix3,e=new Cesium.Quaternion,i=c.viewConeCamera.positionWC,o=c.viewConeCamera.upWC,r=c.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&&(c._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:i,orientation:a,frustum:c.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})),c._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:i,orientation:a,frustum:c.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}),c.item=new Cesium.PrimitiveCollection,c._viewer.scene.primitives.add(c.item),c._outlinePrimitive&&c.item.add(c._outlinePrimitive),c._planesPrimitive&&c.item.add(c._planesPrimitive))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{var t;0<h.length?(c.tooltip.showAt(e.endPosition,"再次点击结束绘制"),(t=c._getPosition.getMousePosition(e))&&(h[1]=t,c.viewConeCamera.direction=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1],h[0],new Cesium.Cartesian3),new Cesium.Cartesian3),c.updata({heading:Cesium.Math.toDegrees(c.viewConeCamera.heading),pitch:Cesium.Math.toDegrees(c.viewConeCamera.pitch),far:c._core.getSpaceDistancem(h,Cesium)}))):c.tooltip.showAt(e.endPosition,"点击开始绘制")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},ar.prototype.addViewCone=function(e){var t={position:this._viewer.camera.position.clone(),heading:0,pitch:0,roll:0,fov:60,near:1,far:60,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"},t=((e=e||{}).position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(t,e,!0),this.viewConeCamera=new Cesium.Camera(this._viewer.scene),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far,new Cesium.Cartesian3),i=new Cesium.Matrix3,o=new Cesium.Quaternion,r=this.viewConeCamera.positionWC,n=this.viewConeCamera.directionWC,a=this.viewConeCamera.upWC,s=this.viewConeCamera.rightWC,s=Cesium.Cartesian3.negate(s,t),t=i,i=(Cesium.Matrix3.setColumn(t,0,s,t),Cesium.Matrix3.setColumn(t,1,a,t),Cesium.Matrix3.setColumn(t,2,n,t),Cesium.Quaternion.fromRotationMatrix(t,o));return e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:r,orientation:i,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:r,orientation:i,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item=new Cesium.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),this._outlinePrimitive&&this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive),this},ar.prototype.updata=function(e){(e=e||{}).position&&e.position.lon&&(e.position=Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),e=this._core.extend(this._option,e,!0),this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item.removeAll(),this.viewConeCamera.setView({destination:e.position,orientation:{heading:Cesium.Math.toRadians(e.heading),pitch:Cesium.Math.toRadians(e.pitch),roll:Cesium.Math.toRadians(e.roll)}}),this.viewConeCamera.frustum.fov=Cesium.Math.toRadians(e.fov),this.viewConeCamera.frustum.near=e.near,this.viewConeCamera.frustum.far=e.far;var t=new Cesium.Cartesian3,i=new Cesium.Matrix3,o=new Cesium.Quaternion,r=this.viewConeCamera.positionWC,n=this.viewConeCamera.directionWC,a=this.viewConeCamera.upWC,s=this.viewConeCamera.rightWC,s=Cesium.Cartesian3.negate(s,t),t=i,i=(Cesium.Matrix3.setColumn(t,0,s,t),Cesium.Matrix3.setColumn(t,1,a,t),Cesium.Matrix3.setColumn(t,2,n,t),Cesium.Quaternion.fromRotationMatrix(t,o));e.fill&&(this._planesPrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumGeometry({origin:r,orientation:i,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry({origin:r,orientation:i,frustum:this.viewConeCamera.frustum}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor))},id:e.id}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=e,this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive)},ar.prototype.destroy=function(){return this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item&&this._viewer.scene.primitives.removeAndDestroy(this.item),Cesium.destroyObject(this)},sr.prototype.createViewshed=function(i={}){i.alpha=this._core.defaultValue(i.alpha,.5),i.horizonAngle=this._core.defaultValue(i.horizonAngle,60),i.verticalAngle=this._core.defaultValue(i.verticalAngle,60);let o=new ar(this._viewer,Cesium);return o.createViewCone({height:this._core.defaultValue(i.height,1.7)},(e,t)=>{this.ShadowPostProcess=new nr(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},sr.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 nr(this._viewer,{showFarScale:6,viewshed:{visible:e.visible,unvisible:e.unvisible},...e}),this},sr.prototype.updateViewshed=function(e){this.ShadowPostProcess.updatePost(e)},sr.prototype.destroy=function(){this.ShadowPostProcess&&this.ShadowPostProcess.destroy(),this.ShadowPostProcess=null},sr.prototype.changeHorizonAngle=function(e){this.ShadowPostProcess&&this.ShadowPostProcess.changeHorizonAngle(e)},sr.prototype.changeVerticalAngle=function(e){this.ShadowPostProcess&&this.ShadowPostProcess.changeVerticalAngle(e)},lr.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)},lr.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage)};const ur=`
        `, r) this.explainContainer.style[o] = r[o]; this.explainContainer.innerHTML = "W:前;S:后;A:左;D:右<br>Q:上;E:下<br>双击:碰撞检测;滚轮:移动速度<br>鼠标移动:方向控制;Esc:退出", this._viewer.container.append(this.explainContainer)
        } return this
    }, Eo.prototype.dblclick = function (e) { 0 === e.button && (this.collision = !this.collision, layuiLayer.msg(this.collision ? "开启碰撞检测" : "关闭碰撞检测")) }, Eo.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 && 0 < this.camera.pitch && 0 < e) && (e = 0), this.camera.rotate(this.camera.position, t * this.indoor_data.X_speedScale), this.camera.lookUp(e * this.indoor_data.Y_speedScale) } }, Eo.prototype.mousewheel = function (e) { 0 < e.wheelDelta ? this.indoor_data.moveRate += .02 : this.indoor_data.moveRate -= .02, 1 < this.indoor_data.moveRate && (this.indoor_data.moveRate = 1), this.indoor_data.moveRate < .1 && (this.indoor_data.moveRate = .1) }, Eo.prototype.pointerlockchange = function () { document.pointerLockElement ? this.indoor_data.enable_looking = !0 : this.indoor_data.enable_looking && this.close() }, Eo.prototype.keydown = function (e) { e = this.getFlagForKeyCode(e.keyCode); void 0 !== e && (this.flags[e] = !0) }, Eo.prototype.keyup = function (e) { e = this.getFlagForKeyCode(e.keyCode); void 0 !== e && (this.flags[e] = !1) }, Eo.prototype.getFlagForKeyCode = function (e) { switch (e) { case "W".charCodeAt(0): return "moveForward"; case "S".charCodeAt(0): return "moveBackward"; case "Q".charCodeAt(0): return "moveUp"; case "E".charCodeAt(0): return "moveDown"; case "D".charCodeAt(0): return "moveRight"; case "A".charCodeAt(0): return "moveLeft"; default: return } }, Eo.prototype.onTick = function () { let e = this.camera; var t = this._viewer.scene.globe.getHeight(e.positionCartographic), i = e.positionCartographic.height, i = (this.indoor_data.moveFactor = i - t, 100 < this.indoor_data.moveFactor ? this.indoor_data.moveFactor / 100 : this.indoor_data.moveRate); this.oldCameraPosition = { position: e.position.clone(), heading: e.heading, pitch: e.pitch, roll: e.roll }, this.flags.moveForward && e.moveForward(i), this.flags.moveBackward && e.moveBackward(i), this.flags.moveUp && e.moveUp(i), this.flags.moveDown && e.moveDown(i), this.flags.moveLeft && e.moveLeft(i), this.flags.moveRight && e.moveRight(i), this.collision && this.checkCollision() }, Eo.prototype.checkCollision = function () { let e = this._core.pickFromRay(this._viewer, this.oldCameraPosition.position, this.camera.position), t = (e && e.position && Cesium.Cartesian3.distance(this.oldCameraPosition.position, e.position) < 1 && this.camera.setView({ destination: this.oldCameraPosition.position, orientation: { heading: this.oldCameraPosition.heading, pitch: this.oldCameraPosition.pitch, roll: this.oldCameraPosition.roll } }), this.camera.positionCartographic.clone()); var i; --t.height, t = Cesium.Cartographic.toCartesian(t), (e = this._core.pickFromRay(this._viewer, this.camera.position, t)) && e.position && 1.65 !== Cesium.Cartesian3.distance(this.camera.position, e.position) && (i = 1.65 - Cesium.Cartesian3.distance(this.camera.position, e.position), (t = this.camera.positionCartographic.clone()).height += i, t = Cesium.Cartographic.toCartesian(t), this.camera.setView({ destination: t, orientation: { heading: this.oldCameraPosition.heading, pitch: this.oldCameraPosition.pitch, roll: this.oldCameraPosition.roll } })) }, Eo.prototype.close = function () { this._handler && this._handler.destroy(), this._handler = null, this.bindEvent && (document.removeEventListener("pointerlockchange", this.bindEvent.pointerlockchange, !1), document.removeEventListener("mousemove", this.bindEvent.mousemove, !1), document.removeEventListener("keydown", this.bindEvent.keydown, !1), document.removeEventListener("keyup", this.bindEvent.keyup, !1), document.removeEventListener("mousewheel", this.bindEvent.mousewheel, !1), document.removeEventListener("dblclick", this.bindEvent.dblclick, !1), this.bindEvent = null), this.collision = !1, this._viewer.clock.onTick.removeEventListener(this.onTick, this), this.explainContainer && this.explainContainer.remove(), this.explainContainer = null, document.exitPointerLock(), this.indoor_data.enable_looking = !1, document.body.style.cursor = "default", this._viewer.scene.screenSpaceCameraController.enableRotate = !0, this._viewer.scene.screenSpaceCameraController.enableTranslate = !0, this._viewer.scene.screenSpaceCameraController.enableZoom = !0, this._viewer.scene.screenSpaceCameraController.enableTilt = !0, this._viewer.scene.screenSpaceCameraController.enableLook = !0 }, Po.prototype.createWeather = function (e, t, i) { var o = this._viewer.scene.postProcessStages, r = null, n = null, a = null, s = null, l = { min: 10, max: 160 }, c = { min: .5, max: 3 }, u = { min: -1, max: 1 }, h = { min: 0, max: 1 }, m = { min: 10, max: 160 }, d = { min: 0, max: 1 }, p = { min: 0, max: .7 }, g = { min: .1, max: .9 }; if ("sun" === e) this.createWeather("rain", !1), this.createWeather("snow", !1), this.createWeather("fog", !1); else switch (e) { case "rain": if (r = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene.postProcessStages._stages.forEach(function (e) { e && "rain" === e.name && o.remove(e) }), t) { if (r ? n = { test1: i.test1, test2: i.test2, test3: i.test3, test4: i.test4 } : (n = { test1: 7, test2: .3, test3: -.4, test4: 1 }, r = { test1: 7, test2: .3, test3: -.4, test4: 1 }), n.test1 = 15 * (10 - parseFloat(n.test1)) + 10, n.test2 = 2.5 * parseFloat(n.test2) + .5, n.test1 > l.max || n.test1 < l.min) return; if (n.test2 > c.max || n.test2 < c.min) return; if (n.test3 > u.max || n.test3 < u.min) return; if (n.test4 > h.max || n.test4 < h.min) return; n.test1 = this.getValue(n.test1 + ""), n.test2 = this.getValue(n.test2 + ""), n.test3 = this.getValue(n.test3 + ""), n.test4 = this.getValue(n.test4 + ""); var f = new this._cesium.PostProcessStage({ name: "rain", fragmentShader: "uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates;\n\nfloat hash(float x){\nreturn fract(sin(x*133.3)*13.13);\n}\n\nvoid main(void){\nfloat time = czm_frameNumber / " + n.test1 + ";\nvec2 resolution = czm_viewport.zw; \nvec2 uv=(gl_FragCoord.xy*" + n.test2 + "-resolution.xy)/min(resolution.x,resolution.y); \nvec3 c=vec3(.6,.7,.8);\nfloat a=" + n.test3 + ";\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+" + n.test4 + ";\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b; //屏幕上雨的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); \n }" }); o.add(f) } break; case "snow": if (a = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene.postProcessStages._stages.forEach(function (e) { e && "snow" === e.name && o.remove(e) }), t) { if (a ? n = { test1: i.test1, test2: i.test2, test3: i.test3, test4: i.test4 } : (n = { test1: 7, test2: .1, test3: .5, test4: .5 }, a = { test1: 7, test2: .1, test3: .5, test4: .5 }), n.test1 = 15 * (10 - parseFloat(n.test1)) + 10, n.test2 = parseFloat(n.test2) / 10, n.test3 = .7 * parseFloat(n.test3), n.test4 = .8 * (1 - parseFloat(n.test4)) + .1, parseFloat(n.test1) > m.max || parseFloat(n.test1) < m.min) return; if (parseFloat(n.test2) > d.max || parseFloat(n.test2) < d.min) return; if (parseFloat(n.test3) > p.max || parseFloat(n.test3) < p.min) return; if (parseFloat(n.test4) > g.max || parseFloat(n.test4) < g.min) return; n.test1 = this.getValue(n.test1 + ""), n.test2 = this.getValue(n.test2 + ""), n.test3 = this.getValue(n.test3 + ""), n.test4 = this.getValue(n.test4 + ""); f = new this._cesium.PostProcessStage({ name: "snow", fragmentShader: "uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale){\nfloat time = czm_frameNumber / " + n.test1 + ";\nfloat w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<" + n.test2 + ")return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np=" + n.test3 + "+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c)); //屏幕上雪的颜色\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), " + n.test4 + ");  //将雪和三维场景融合\n}" }); o.add(f) } break; case "fog": if (s = i, this._viewer.scene.postProcessStages._stages.length && this._viewer.scene.postProcessStages._stages.forEach(function (e) { e && "fog" === e.name && o.remove(e) }), t) { if (s ? n = { distance: i.distance, color: i.color && Cesium.Color.fromCssColorString(i.color) } : (n = { distance: 200, color: "#ffffff" }, s = { distance: 200, color: "#ffffff" }), n.distance < 10) return; f = new Cesium.PostProcessStage({ name: "fog", fragmentShader: "float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n    float depth = czm_unpackDepth(texture2D(depthTexture, texCoords)); \n    if (depth == 0.0) { \n        return czm_infinity; \n    } \n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n    return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n    float startDistance = nearFarScalar.x; \n    float startValue = nearFarScalar.y; \n    float endDistance = nearFarScalar.z; \n    float endValue = nearFarScalar.w; \n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n    return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nvarying vec2 v_textureCoordinates; \nvoid main(void) \n{ \n    float distance = getDistance(depthTexture, v_textureCoordinates); \n    vec4 sceneColor = texture2D(colorTexture, v_textureCoordinates); \n    float blendAmount = interpolateByDistance(fogByDistance, distance); \n    vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n    gl_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n", uniforms: { fogByDistance: new Cesium.Cartesian4(10, 0, n.distance || 200, 1), fogColor: n.color || Cesium.Color.WHITE } }); o.add(f) } } }, Po.prototype.getValue = function (e) { return "" === e || "-" === e || "." === e || void 0 === e || 2 < (e = "-" === e[e.length - 1] ? e.substr(0, e.length - 1) : e).split(".").length ? "0.0" : e.split(".")[1] && e.split(".")[1].length ? e : parseFloat(e).toFixed(1) }, xo.prototype.createParticleEffect = function (e, t, i, o) { switch (this._viewer.clockViewModel.shouldAnimate || (this._viewer.clockViewModel.shouldAnimate = !0), e) { case "fireworks": this.createFireworks(t, i, o); break; case "smog": this.createSmog(t, i, o); break; case "fountain": this.createFountain(t, i, o); break; case "flame": this.createFlame(t, i, o); break; case "blast": this.createBlast(t, i, o) }return this }, xo.prototype.deleteObject = function () { var t = this._viewer.scene; 0 < this.Fireworks.length && (this.Fireworks.forEach(function (e) { t.primitives.remove(e) }), this.Fireworks = []), 0 < this.Smog.length && (this.Smog.forEach(function (e) { t.primitives.remove(e) }), this.Smog = []), 0 < this.Fountain.length && (this.Fountain.forEach(function (e) { t.primitives.remove(e) }), this.Fountain = []), 0 < this.Flame.length && (this.Flame.forEach(function (e) { t.primitives.remove(e) }), this.Flame = []), 0 < this.Blast.length && (this.Blast.forEach(function (e) { t.primitives.remove(e) }), this.Blast = []) }, xo.prototype.removeParticleEffect = function (e) { var t = this._viewer.scene; switch (e) { case "fireworks": 0 < this.Fireworks.length && (this.Fireworks.forEach(function (e) { t.primitives.remove(e) }), this.Fireworks = []); break; case "smog": 0 < this.Smog.length && (this.Smog.forEach(function (e) { t.primitives.remove(e) }), this.Smog = []); break; case "fountain": 0 < this.Fountain.length && (this.Fountain.forEach(function (e) { t.primitives.remove(e) }), this.Fountain = []); break; case "flame": 0 < this.Flame.length && (this.Flame.forEach(function (e) { t.primitives.remove(e) }), this.Flame = []); break; case "blast": 0 < this.Blast.length && (this.Blast.forEach(function (e) { t.primitives.remove(e) }), this.Blast = []) } }, xo.prototype.createFireworks = function (e, t, i) { var l, c = this._viewer.scene, o = this._viewer, u = this._cesium, h = (t = t || {}, u.Math.setRandomNumberSeed(315), this.computeModelMatrix(e)), m = new u.Cartesian3(0, 0, 100); var d = u.defaultValue(t.minSize, 30), p = u.defaultValue(t.maxSize, 100), e = u.defaultValue(t.size, 7), g = new u.Cartesian2(e, e), f = 10, r = u.defaultValue(t.num, 20), _ = new u.Matrix4; function n(e, t, i) { var o, e = u.Cartesian3.add(m, e, new u.Cartesian3), e = u.Matrix4.fromTranslation(e, _), r = u.Matrix4.multiply(h, e, new u.Matrix4), n = u.Matrix4.inverseTransformation(r, r), a = u.Math.randomBetween(d, p), s = new u.Cartesian3, r = .7 * ((a - d) / (p - d)) + .3; return c.primitives.add(new u.ParticleSystem({ image: (u.defined(l) || ((l = document.createElement("canvas")).width = 20, l.height = 20, (o = l.getContext("2d")).beginPath(), o.arc(8, 8, 8, 0, u.Math.TWO_PI, !0), o.closePath(), o.fillStyle = "rgb(255, 255, 255)", o.fill()), l), startColor: t, endColor: t.withAlpha(0), particleLife: r, speed: 100, imageSize: g, emissionRate: 0, emitter: new u.SphereEmitter(.1), bursts: i, lifetime: f, updateCallback: function (e) { var t = u.Matrix4.multiplyByPoint(n, e.position, s); u.Cartesian3.magnitudeSquared(t) >= a * a && u.Cartesian3.clone(u.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 < r; ++s) { for (var C = u.Math.randomBetween(-100, 100), y = u.Math.randomBetween(-80, 100), v = u.Math.randomBetween(-50, 50), C = new u.Cartesian3(C, y, v), y = u.Color.fromRandom(a[s % a.length]), w = [], b = 0; b < 3; ++b)w.push(new u.ParticleBurst({ time: u.Math.nextRandomNumber() * f, minimum: 400, maximum: 400 })); this.Fireworks.push(n(C, y, w)) } i && "function" == typeof i ? i(this.Fireworks) : (e = o.scene.camera, t = new u.Cartesian3(-300, 0, 0), e.lookAtTransform(h, t), e.lookAtTransform(u.Matrix4.IDENTITY), i = u.Cartesian3.subtract(m, t, new u.Cartesian3), u.Cartesian3.normalize(i, i), o = u.Math.PI_OVER_TWO - Math.acos(u.Cartesian3.dot(i, u.Cartesian3.UNIT_Z)), e.lookUp(o)) }, xo.prototype.createSmog = function (e, o, t) { this._viewer.scene; var r, n = this._viewer, a = this._cesium, s = this, l = (o && "" !== o || (o = {}), a.Math.setRandomNumberSeed(3), { image: window.SmartEarthRootUrl + I.smog, emissionRate: 50, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 1.2, minimumSpeed: 1, maximumSpeed: 4, startScale: 1, endScale: 5, particleSize: 1, lifetime: 6 }), c = (this._core.extend(l, o, !0), new a.Cartesian3), e = function (i) { var e = n.scene; r = e.primitives.add(new a.ParticleSystem({ image: l.image, startColor: a.Color.LIGHTSEAGREEN.withAlpha(.7), endColor: a.Color.WHITE.withAlpha(0), startScale: l.startScale, endScale: l.endScale, sizeInMeters: !0, minimumParticleLife: l.minimumParticleLife, maximumParticleLife: l.maximumParticleLife, minimumSpeed: l.minimumSpeed, maximumSpeed: l.maximumSpeed, imageSize: new a.Cartesian2(l.particleSize, l.particleSize), emissionRate: l.emissionRate, lifetime: l.lifetime, emitter: new a.CircleEmitter(2), emitterModelMatrix: s.computeEmitterModelMatrix(o.translation, o.rotation), updateCallback: u })), l.type && function (e) { "圆形放射" === e ? r.emitter = new a.CircleEmitter(2) : "球体放射" === e ? r.emitter = new a.SphereEmitter(2.5) : "圆锥体放射" === e ? r.emitter = new a.ConeEmitter(a.Math.toRadians(45)) : "盒状放射" === e && (r.emitter = new a.BoxEmitter(new a.Cartesian3(10, 10, 10))) }(l.type); return n.scene.preUpdate.addEventListener(function (e, t) { r && (r.modelMatrix = s.computeModelMatrix(i, t), r.emitterModelMatrix = s.computeEmitterModelMatrix(o.translation, o.rotation)) }), r }(e); function u(e, t) { var i = e.position; a.Cartesian3.normalize(i, c), a.Cartesian3.multiplyByScalar(c, l.gravity * t, c), e.velocity = a.Cartesian3.add(e.velocity, c, e.velocity) } this.Smog.push(e), t && "function" == typeof t && t(this.Smog) }, xo.prototype.createFountain = function (i, o, e) { this._viewer.scene; var r, t = this._viewer, n = this._cesium, a = this, s = (o && "" !== o || (o = {}), { image: window.SmartEarthRootUrl + I.penquan, emissionRate: 50, minimumParticleLife: 3, maximumParticleLife: 4, minimumSpeed: 9, maximumSpeed: 9.5, startScale: 1, endScale: 15, particleSize: 1, lifetime: 6, gravity: -3.5 }), l = (this._core.extend(s, o, !0), new n.Cartesian3), t = (r = t.scene.primitives.add(new n.ParticleSystem({ image: s.image, startColor: new n.Color(1, 1, 1, .3), endColor: new n.Color(.8, .86, 1, .4), startScale: s.startScale, endScale: s.endScale, minimumParticleLife: s.minimumParticleLife, maximumParticleLife: s.maximumParticleLife, minimumSpeed: s.minimumSpeed, maximumSpeed: s.maximumSpeed, imageSize: new n.Cartesian2(s.particleSize, 2 * s.particleSize), emissionRate: s.emissionRate, lifetime: s.lifetime, loop: !0, emitter: new n.ConeEmitter(n.Math.toRadians(n.defaultValue(s.angle, 7))), updateCallback: c, sizeInMeters: !0 })), t.scene.preUpdate.addEventListener(function (e, t) { r && (r.modelMatrix = a.computeModelMatrix(i, t), r.emitterModelMatrix = a.computeEmitterModelMatrix(o.translation, o.rotation)) }), r); function c(e, t) { var i = e.position; n.Cartesian3.normalize(i, l), n.Cartesian3.multiplyByScalar(l, s.gravity * t, l), e.velocity = n.Cartesian3.add(e.velocity, l, e.velocity) } this.Fountain.push(t), e && "function" == typeof e && e(this.Fountain) }, xo.prototype.createFlame = function (e, t, i) { this._viewer.scene; var o = this._viewer, r = this._cesium, n = this, a = (t && "" !== t || (t = {}), { image: window.SmartEarthRootUrl + I.fire, emissionRate: 50, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 3, minimumSpeed: 1, maximumSpeed: 4, startScale: 1, endScale: 6, particleSize: 1, lifetime: 16 }), e = (this._core.extend(a, t, !0), t = e, o.scene.primitives.add(new r.ParticleSystem({ image: a.image, startColor: r.Color.RED.withAlpha(.7), endColor: r.Color.YELLOW.withAlpha(.3), startScale: a.startScale, endScale: a.endScale, minimumParticleLife: a.minimumParticleLife, maximumParticleLife: a.maximumParticleLife, minimumSpeed: a.minimumSpeed, maximumSpeed: a.maximumSpeed, imageSize: new r.Cartesian2(a.particleSize, a.particleSize), emissionRate: a.emissionRate, sizeInMeters: !0, lifetime: a.lifetime, emitter: new r.ConeEmitter(r.Math.toRadians(30)), modelMatrix: n.computeModelMatrix(t), emitterModelMatrix: n.computeEmitterModelMatrix(a.translation, a.rotation) }))); this.Flame.push(e), i && "function" == typeof i && i(this.Flame) }, xo.prototype.createBlast = function (e, t, i) { this._viewer.scene; var o = this._viewer, r = this._cesium, n = this, a = (t && "" !== t || (t = {}), { image: window.SmartEarthRootUrl + I.fire2, emissionRate: 10, gravity: 0, minimumParticleLife: 1, maximumParticleLife: 3, minimumSpeed: 5, maximumSpeed: 20, startScale: 1, endScale: 10, particleSize: 5, lifetime: 3 }), t = (this._core.extend(a, t, !0), function (e) { let t = new r.ParticleSystem({ image: a.image, startColor: a.startColor, endColor: a.endColor, startScale: a.startScale, endScale: a.endScale, minimumParticleLife: a.minimumParticleLife, maximumParticleLife: a.maximumParticleLife, minimumSpeed: a.minimumSpeed, maximumSpeed: a.maximumSpeed, imageSize: new r.Cartesian2(a.particleSize, a.particleSize), emissionRate: a.emissionRate, sizeInMeters: !0, lifetime: a.lifetime, emitter: new r.ConeEmitter(r.Math.toRadians(30)), emitterModelMatrix: n.computeEmitterModelMatrix(a.translation, a.rotation), bursts: a.bursts, updateCallback: () => { 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) }, xo.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 }, xo.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) }, Do.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) }, Do.prototype.add = function (e) { if (this.show = !0, this._depth = e || 100, !this.item) return this._viewer.scene.primitives.add(this), this.refreshGridLines(), this }, Do.prototype.update = function (e) { this.item && this.show && (this.getRelativeHeight(), this.item.show && this.item.update(e)) }, Do.prototype.destroy = function () { this.item && (this._viewer.scene.primitives.remove(this), this.item = null) }, Do.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) } } }, Do.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), 0 < this._relativeHeight ? this.item && (this.item.show = !1) : (this.item && (this.item.show = !0), (Math.abs(this.oldCameraHeight - e.positionCartographic.height) > this._depth / 10 || 1e4 < Cesium.Cartesian3.distance(this.oldCameraPosition, e.position)) && (this.oldCameraPosition = e.position.clone(), this.oldCameraHeight = e.positionCartographic.height, this.refreshGridLines())) }, Io.prototype.StreetViewOpen = function (e, t, i) { var o, r = this, n = this._viewer; return this.isStreetView || (0 < this.StreetViewSphere.length && (this.StreetViewSphere.forEach(function (e) { e && n.entities.remove(e) }), this.StreetViewSphere = [null, null]), this.StreetViewType = t.type, this.StreetViewData.linkImagesData = [], this.URL = this.extend(this.URL, t, !1), this.CallBack = this.extend(this.CallBack, t, !1), this.defaultSkyAtmosphere = !!n.scene.skyAtmosphere.show, n.scene.skyAtmosphere.show || (n.scene.skyAtmosphere.show = !0), o = n.camera, this.getInitImageByPosition(e, function (e) { r.isStreetView = !0, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !0), o.flyTo({ destination: new r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon, r.StreetViewData.lat, r.StreetViewData.height), orientation: { heading: o.heading, pitch: o.pitch > r._cesium.Math.toRadians(45) || o.pitch < r._cesium.Math.toRadians(-45) ? 0 : o.pitch, roll: 0 }, duration: t.flyTime, complete: function () { i && "function" == typeof i && i() } }), r.attachMouseEvent(), r.createNavigation(), r.StreetViewSphereIndex = 0, r.StreetViewSphere_Canvas[r.StreetViewSphereIndex] = e, r.StreetViewSphere[r.StreetViewSphereIndex] = r.createScene(r.StreetViewData.lon, r.StreetViewData.lat, r.StreetViewData.height), r.StreetViewSphere[r.StreetViewSphereIndex].show = !0, r.StreetViewSphere[r.StreetViewSphereIndex].orientation = r._cesium.Transforms.headingPitchRollQuaternion(r._cesium.Cartesian3.fromDegrees(r.StreetViewData.lon, r.StreetViewData.lat, r.StreetViewData.height), new r._cesium.HeadingPitchRoll(r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.heading + ("lide" === r.StreetViewType ? 90 : 0)), r._cesium.Math.toRadians(-r.StreetViewData.HeadingPitchRoll.roll), r._cesium.Math.toRadians(r.StreetViewData.HeadingPitchRoll.pitch))), "lide" === r.StreetViewType ? r._core.xhr({ url: r.URL.getImageInfo + r.StreetViewData.getImageTileID, type: "get", dataType: "json", success: function (e) { r.CallBack && r.CallBack.setImageDataCallback && "function" == typeof r.CallBack.setImageDataCallback && r.CallBack.setImageDataCallback(r.StreetViewData, e), r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID, function (e) { e.index === r.StreetViewSphereIndex && !1 === r.StreetViewData.isTwoTextures && (r.StreetViewSphere_Canvas[r.StreetViewSphereIndex] = e.canvas), r.StreetViewData.isTwoTextures = !0, r.StreetViewData.isThreeTextures = !1 }) } }) : r.getSecondTexturesFromAtlasFile(r.StreetViewData.getImageTileID, function (e) { e.index === r.StreetViewSphereIndex && !1 === r.StreetViewData.isTwoTextures && (r.StreetViewSphere_Canvas[r.StreetViewSphereIndex] = e.canvas), r.StreetViewData.isTwoTextures = !0, r.StreetViewData.isThreeTextures = !1 }) })), this }, Io.prototype.exit = function () { var e, t, i; this.isStreetView && (t = (e = this)._viewer, 0 < this.StreetViewSphere.length && (this.StreetViewSphere.forEach(function (e) { e && t.entities.remove(e) }), this.StreetViewSphere = [null, null], this.StreetViewSphere_Canvas = [null, null]), 0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function (e) { t.entities.remove(e) }), this.StreetViewNavigation = []), this.setCesiumFov(this.StreetViewData.defaultFov), this.detachMouseEvent(), t.scene.skyAtmosphere.show = this.defaultSkyAtmosphere, this.isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1), i = t.camera.positionCartographic, t.camera.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, i.height + 3e3), orientation: { heading: t.camera.heading, pitch: this._cesium.Math.toRadians(-90), roll: 0 }, complete: function () { e.isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1) } })) }, Io.prototype.extend = function (e, t, i) { for (var o in t) t.hasOwnProperty(o) && (e.hasOwnProperty(o) || i) && (e[o] = t[o]); return e }, Io.prototype.getInitImageByPositionURL = function (e) { var t, i, o; return o = this.URL && this.URL.getInitImageByPosition ? 1 < (i = this.URL.getInitImageByPosition.split("{lon}"))[0].split("{lat}").length ? (t = i[0].split("{lat}"))[0] + e.lat + t[1] + e.lon + i[1] : (t = i[1].split("{lat}"), i[0] + e.lon + t[0] + e.lat + t[1]) : o }, Io.prototype.getImageByIdURL = function (e, t) { var i, o; switch (e) { case "one": i = this.URL.getInitImageById; break; case "two": i = this.URL.getSecondImageById; break; case "three": i = this.URL.getThirdImageById; break; case "init": i = this.URL.getInitImageInfoById }return "lide" === this.StreetViewType && (t = t.replace("-0-", "-X-"), "one" === e && (i += "&row=0&col=0")), o = i ? (e = i.split("{id}"))[0] + t + e[1] : o }, Io.prototype.getInitImageByPosition = function (e, n) { var a = this, e = this.getInitImageByPositionURL(e); this.StreetViewData.linkImagesData = [], this._core.xhr({ url: e, type: "get", dataType: "json", success: e => { 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) { } }) }, Io.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 }, Io.prototype.getSecondTexturesFromAtlasFile = function (e, o) { var r, n, a, s, l = this.StreetViewSphereIndex, t = this.getImageByIdURL("two", e), c = null, u = 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 == c && (c = document.createElement("canvas"), u = c.getContext("2d"), c.height = s > f ? f : s, c.width = a > g ? g : a, u.translate(c.width, 0), u.scale(-1, 1)); var e = r, t = n; "lide" === this.StreetViewType && (e = 512, t = 256), u.drawImage(this.FirstImage, 0, 0, e, t, 0, 0, c.width, c.height); for (var i = 0; i < m.length; i++)m[i].src && u.drawImage(m[i], 0, 0, r, n, r * (i % p), n * Math.floor(i / p), r, n); o({ index: l, canvas: c }) } }, C = 0; C < d; C++)for (var y = 0; y < p; y++) { var v = (v = t + i).replace("{row}", C).replace("{col}", y), w = new Image; w.onload = function () { r = this.width, n = this.height, a = r * p, s = n * d, _() }, w.onerror = function () { this.src = "", this.onerror = void 0, _() }, w.setAttribute("crossOrigin", "Anonymous"); try { w.src = v } catch (e) { w.src = "" } m.push(w) } }, Io.prototype.getThreeTexturesFromAtlasFile = function (e, r) { for (var n = this.StreetViewSphereIndex, t = this.getImageByIdURL("three", e), a = null, s = null, l = 0, c = [], i = 0; i < 8; i++)for (var o = 0; o < 16; o++) { var u = t + i + "-" + o, h = new Image; !function (o) { o.onload = function () { var e = o.width, t = o.height; if (128 == ++l) { null == a && (a = document.createElement("canvas"), s = a.getContext("2d"), a.height = 4096, a.width = 8192, s.translate(8192, 0), s.scale(-1, 1)); for (var i = 0; i < c.length; i++)s.drawImage(c[i], 0, 0, e, t, e * (i % 16), t * Math.floor(i / 16), e, t); r({ index: n, canvas: a }) } } }(h), h.setAttribute("crossOrigin", "Anonymous"); try { h.src = u } catch (e) { h.src = "" } c.push(h) } }, Io.prototype.InitSceneByID = function (t) { var i = this, o = this._viewer; this.updateStreetSphereIndex(), this.StreetViewSphere[this.StreetViewSphereIndex] = this.createScene(this.StreetViewData.lon, this.StreetViewData.lat, this.StreetViewData.height), this.getInitImage(this.StreetViewData.getImageTileID, function (e) { i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, setTimeout(function () { i.StreetViewSphere[i.StreetViewSphereIndex].show = !0 }, 300) }), this.StreetViewData.isTwoTextures = !1, "lide" !== this.StreetViewType ? this.getImageInfoById(this.StreetViewData.getImageTileID, function (e) { i.StreetViewData.linkImagesData = [], i.CallBack && i.CallBack.getImageInfoByIdCallBack ? ("function" == typeof i.CallBack.getImageInfoByIdCallBack && i.CallBack.getImageInfoByIdCallBack(i.StreetViewData, e), i.StreetViewSphere[i.StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), o.camera.cancelFlight(), o.camera.flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function () { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading), i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll), i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))), i.getInitImage(i.StreetViewData.getImageTileID, function (e) { i.StreetViewData.isTwoTextures || (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e) }), i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function (e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData.isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i.StreetViewData.isTwoTextures = !0, i.StreetViewData.isThreeTextures = !1 }), i.createNavigation()) : console.log("the getImageInfoByIdCallBack is undefined!") }) : this.getInitImageByPosition(i.StreetViewData, function (e) { i.StreetViewSphere[i.StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, o.camera.cancelFlight(), o.camera.flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function () { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading + 90), i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll), i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))), i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function (e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData.isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i.StreetViewData.isTwoTextures = !0, i.StreetViewData.isThreeTextures = !1 }) }) }, Io.prototype.getImageInfoById = function (e, t) { e = this.getImageByIdURL("init", e); this._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { "function" == typeof t && t(e) } }) }, Io.prototype.createScene = function (e, t, i) { var o = this, r = this._viewer, n = this.StreetViewSphereIndex, a = new this._cesium.ImageMaterialProperty({ image: new this._cesium.CallbackProperty(function () { return o.StreetViewSphere_Canvas[n] }, !1), transparent: !0, color: this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha) }), e = { show: !1, position: this._cesium.Cartesian3.fromDegrees(e, t, i), ellipsoid: { radii: new this._cesium.Cartesian3(this.StreetViewData.radius, this.StreetViewData.radius, this.StreetViewData.radius), material: a } }, t = r.entities.add(e); return t.geometryName = "街景", t }; var Ao, Lo, Mo = null, Ro = null, Oo = { looking: !(Io.prototype.detachMouseEvent = function () { var e = this._viewer.scene; this._viewer.canvas, this.StreetViewData._handler && (this.StreetViewData._handler.destroy(), this.StreetViewData._handler = void 0), this.StreetViewData.navigation_handler && (this.StreetViewData.navigation_handler.destroy(), this.StreetViewData.navigation_handler = void 0), "lide" !== this.StreetViewType && this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick, this), e.screenSpaceCameraController.enableRotate = !0, e.screenSpaceCameraController.enableTranslate = !0, e.screenSpaceCameraController.enableZoom = !0, e.screenSpaceCameraController.enableTilt = !0, e.screenSpaceCameraController.enableLook = !0 }) }; function Bo(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, 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: "", getImageById: "" }, 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, x: void 0, y: void 0, height: 0, HeadingPitchRoll: null, getImageTileID: "", linkImagesData: [], isTwoTextures: !1, isThreeTextures: !1, _handler: null, navigation_handler: null }, this.FirstImage = void 0 } Io.prototype.attachMouseEvent = function () { var t = this; Mo = this._viewer.scene, Ro = this._viewer.canvas, this.StreetViewData._handler = new this._cesium.ScreenSpaceEventHandler(Ro), Ro.setAttribute("tabindex", "0"), Ro.focus(), Ro.onclick = function () { Ro.focus() }, setTimeout(function () { t.setCesiumFov(t.StreetViewData.fov) }, 4e3), Mo.screenSpaceCameraController.enableRotate = !1, Mo.screenSpaceCameraController.enableTranslate = !1, Mo.screenSpaceCameraController.enableZoom = !1, Mo.screenSpaceCameraController.enableTilt = !1, Mo.screenSpaceCameraController.enableLook = !1, this.StreetViewData._handler.setInputAction(function (e) { Oo.looking = !0 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.StreetViewData._handler.setInputAction(function (e) { Oo.looking && (fo = e.startPosition, _o = e.endPosition, t.StreetView_mouseMove()) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.StreetViewData._handler.setInputAction(function (e) { Oo.looking = !1 }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.StreetViewData._handler.setInputAction(function (e) { e = t.StreetViewData.fov + e / -10; 30 < e && e < 120 && (t.StreetViewData.fov = e, t.setCesiumFov(t.StreetViewData.fov)) }, this._cesium.ScreenSpaceEventType.WHEEL), "lide" !== this.StreetViewType && this._viewer.clock.onTick.addEventListener(t.StreetView_onTick, this) }, Io.prototype.StreetView_onTick = function () { var t = this; !this.StreetViewData.isThreeTextures && this.StreetViewData.fov < 50 && (this.StreetViewData.isThreeTextures = !0, this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID, function (e) { e.index === t.StreetViewSphereIndex && (t.StreetViewSphere_Canvas[t.StreetViewSphereIndex] = e.canvas) })) }, Io.prototype.StreetView_mouseMove = function () { var e, t, i = this._viewer.camera; Oo.looking && (e = Ro.clientWidth, t = Ro.clientHeight, e = -(_o.x - fo.x) / e, t = (_o.y - fo.y) / t, (!i.roll && i.pitch < 0 && t < 0 || !i.roll && 0 < i.pitch && 0 < t) && (t = 0), i.rotate(i.position, e * this.StreetViewData.speedScale), i.lookUp(t * this.StreetViewData.speedScale)) }, Io.prototype.setOpacity = function (t) { var i = this; this.StreetViewSphere.forEach(function (e) { e && (e.ellipsoid.material.color._value = i._cesium.Color.WHITE.withAlpha(t)) }), this.StreetViewData.alpha = t }, Io.prototype.setCesiumFov = function (e) { this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e) }, Io.prototype.MoveToLinkImage = function (e) { e ? "lide" !== this.StreetViewType || e.ImageID ? (this.StreetViewData.name = e.name, this.StreetViewData.lon = e.Position[0], this.StreetViewData.lat = e.Position[1], this.StreetViewData.height = e.Position[2], this.StreetViewData.getImageTileID = e.ImageID, this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])) : this.CallBack && this.CallBack.selectJoinsCallBack && "function" == typeof this.CallBack.selectJoinsCallBack && this.CallBack.selectJoinsCallBack() : alert("暂无街景数据") }, Io.prototype.updateStreetSphereIndex = function () { this.StreetViewSphereIndex = 0 === this.StreetViewSphereIndex ? 1 : 0 }, Io.prototype.createNavigation = function () { var t, i = this, a = this._viewer, s = (0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function (e) { a.entities.remove(e) }), this.StreetViewNavigation = []), this.StreetViewData.navigation_handler && (this.StreetViewData.navigation_handler.destroy(), this.StreetViewData.navigation_handler = null), 6378137), n = 6356725, o = { lon: this.StreetViewData.lon, lat: this.StreetViewData.lat, height: this.StreetViewData.height - 1 }; function l(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = n + (s - n) * (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] } function c(e) { return e * Math.PI / 180 } this.StreetViewData.linkImagesData.forEach(function (t) { var e = a.entities.add({ polygon: { hierarchy: new i._cesium.CallbackProperty(function () { var e = function (e, t) { var i = [], e = l(e.lon, e.lat, 3.5, 180 * a.camera.heading / Math.PI), o = { lon: e[0], lat: e[1] }; e = l(e[0], e[1], 1.1, 0), i.push(e[0], e[1]), e = l(e[0], e[1], .5758, 135), i.push(e[0], e[1]), e = l(e[0], e[1], .2, 270), i.push(e[0], e[1]), e = l(e[0], e[1], .5, 180), i.push(e[0], e[1]), e = l(e[0], e[1], .4, 270), i.push(e[0], e[1]), e = l(e[0], e[1], .5, 0), i.push(e[0], e[1]), e = l(e[0], e[1], .2, 270), i.push(e[0], e[1]); for (var r, n = 0; n < i.length - 1; n += 2)r = function (e, t, i) { t = function (e, t, i, o) { var r = c(t), n = c(o), o = c(o) - c(t), t = c(i) - c(e); i = (i = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(o / 2), 2) + Math.cos(r) * Math.cos(n) * Math.pow(Math.sin(t / 2), 2)))) * s, i = Math.round(1e4 * i) / 1e4, e = 0 == o && 0 < t ? 90 : 0 == o && t < 0 ? 270 : o < 0 && 0 == t ? 180 : 0 <= o && 0 == t ? 0 : o < 0 && 0 < t ? 180 - 180 * Math.atan(t / -o) / Math.PI : o < 0 && t < 0 ? 180 + 180 * Math.atan(t / o) / Math.PI : 0 < o && t < 0 ? 360 - 180 * Math.atan(-t / o) / Math.PI : 180 * Math.atan(t / o) / Math.PI; return { angle: e, distance: i } }(e.lon, e.lat, t.lon, t.lat); return l(e.lon, e.lat, t.distance, i - t.angle) }(o, { lon: i[n], lat: i[n + 1] }, t), i[n] = r[0], i[n + 1] = r[1]; return i }(o, t.NavigationAngle); return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3.fromDegreesArray(e)) }, !1), fill: !0, outline: !0, outlineColor: i._cesium.Color.BLACK.withAlpha(.2), height: o.height } }); e.geometryName = "街景", e.isNavigation = !0, e.linkImageData = t, i.StreetViewNavigation.push(e) }), i.StreetViewData.navigation_handler = new i._cesium.ScreenSpaceEventHandler(Ro), i.StreetViewData.navigation_handler.setInputAction(function (e) { e = a.scene.pick(e.position); i._cesium.defined(e) && (e && e.id && e.id.isNavigation ? (t && (t.polygon.outlineColor = i._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i._cesium.Color.WHITE), (t = e.id).polygon.outlineColor = i._cesium.Color.BLUE, t.polygon.material = i._cesium.Color.WHITE.withAlpha(.9)) : t && (t.polygon.outlineColor = i._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i._cesium.Color.WHITE, t = void 0)), t && i.MoveToLinkImage(t.linkImageData) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK) }, Bo.prototype.StreetViewOpenYZ = function (e, i, o) { var r, t, n = this, a = this._viewer; return this.isStreetView || (0 < this.StreetViewSphere.length && (this.StreetViewSphere.forEach(function (e) { e && a.entities.remove(e) }), this.StreetViewSphere = [null, null]), this.StreetViewType = i.type, this.StreetViewData.linkImagesData = [], this.StreetViewData.x = e.x, this.StreetViewData.y = e.y, this.URL = this.extend(this.URL, i, !1), this.CallBack = this.extend(this.CallBack, i, !1), this.defaultSkyAtmosphere = !!a.scene.skyAtmosphere.show, a.scene.skyAtmosphere.show || (a.scene.skyAtmosphere.show = !0), r = a.camera, t = (1e5 * Math.random()).toFixed(0), this.URL.getInitImageByPosition += "&fn=" + (t = "SmartEarth_" + t), window[t] = function (e) { n.isStreetView = !0, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !0); try { n.StreetViewData.height = e.content[0].Z, n.StreetViewData.HeadingPitchRoll = n.StreetViewData.HeadingPitchRoll || {}, n.StreetViewData.HeadingPitchRoll.heading = e.content[0].Heading, n.StreetViewData.HeadingPitchRoll.roll = e.content[0].Roll, n.StreetViewData.HeadingPitchRoll.pitch = e.content[0].Pitch, n.imageJoin(e, function (t) { r.flyTo({ destination: new n._cesium.Cartesian3.fromDegrees(n.StreetViewData.x, n.StreetViewData.y, n.StreetViewData.height), orientation: { heading: r.heading, pitch: r.pitch > n._cesium.Math.toRadians(45) || r.pitch < n._cesium.Math.toRadians(-45) ? 0 : r.pitch, roll: 0 }, duration: i.flyTime || 1, complete: function () { n.attachMouseEvent(), n.createNavigation(), n.StreetViewSphereIndex = 0, n.StreetViewSphere_Canvas[n.StreetViewSphereIndex] = t; var e = n.StreetViewData.height + n.StreetViewData.radius / 2; n.StreetViewSphere[n.StreetViewSphereIndex] = n.createScene(n.StreetViewData.x, n.StreetViewData.y, e), n.StreetViewSphere[n.StreetViewSphereIndex].show = !0, n.StreetViewSphere[n.StreetViewSphereIndex].orientation = n._cesium.Transforms.headingPitchRollQuaternion(n._cesium.Cartesian3.fromDegrees(n.StreetViewData.x, n.StreetViewData.y, n.StreetViewData.height), new n._cesium.HeadingPitchRoll(n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.heading + ("lide" === n.StreetViewType ? 90 : 0)), n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.roll), n._cesium.Math.toRadians(n.StreetViewData.HeadingPitchRoll.pitch))), o && "function" == typeof o && o() } }) }) } catch (e) { alert("获取街景失败!") } delete window[t] }, this.getInfoByPosition(e)), this }, Bo.prototype.imageJoin = function (e, o) { let r = this, n = e.content[0].ID; var t = parseInt(e.content[0].LayerCount) - 2, e = e.content[0].ImgLayer[t]; let a = e.ImgLevel; var i = e.BlockY / 2, s = e.BlockX / 2; let l = i * s, c = null, u = (c = document.createElement("canvas")).getContext("2d"), h = (c.height = 512 * i, c.width = 512 * s, document.body.appendChild(c), 0); for (let t = 0; t < i; t++)for (let e = 0; e < s; e++)!function (e, t) { let i = new Image; i.onload = function () { u.drawImage(this, 0, 0, 512, 512, 512 * t, 512 * e, 512, 512), h++, l == h && o(c) }, i.setAttribute("crossOrigin", "Anonymous"), i.src = r.URL.getImageById + "&sid=" + n + "&pos=" + e + "_" + t + "&z=" + a }(t, e) }, Bo.prototype.getInfoByPosition = function (e) { var e = this.getInitImageByPositionURL(e), t = document.createElement("script"); t.type = "text/javascript", t.src = e, t.addEventListener ? t.addEventListener("load", function (e) { (e = e.target).parentNode.removeChild(e) }, !1) : t.attachEvent && t.attachEvent("onreadystatechange", function () { var e = window.event.srcElement; !e || "loaded" != e.readyState && "complete" != e.readyState || e.parentNode.removeChild(e) }), setTimeout(function () { document.getElementsByTagName("head")[0].appendChild(t), t = null }, 1) }, Bo.prototype.exit = function () { var e, t, i; this.isStreetView && (t = (e = this)._viewer, 0 < this.StreetViewSphere.length && (this.StreetViewSphere.forEach(function (e) { e && t.entities.remove(e) }), this.StreetViewSphere = [null, null], this.StreetViewSphere_Canvas = [null, null]), 0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function (e) { t.entities.remove(e) }), this.StreetViewNavigation = []), this.setCesiumFov(this.StreetViewData.defaultFov), this.detachMouseEvent(), t.scene.skyAtmosphere.show = this.defaultSkyAtmosphere, this.isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1), i = t.camera.positionCartographic, t.camera.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, i.height + 3e3), orientation: { heading: t.camera.heading, pitch: this._cesium.Math.toRadians(-90), roll: 0 }, complete: function () { e.isStreetView = !1, Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.isStreetView = !1) } })) }, Bo.prototype.extend = function (e, t, i) { for (var o in t) t.hasOwnProperty(o) && (e.hasOwnProperty(o) || i) && (e[o] = t[o]); return e }, Bo.prototype.getInitImageByPositionURL = function (e) { var t, i, o; return o = this.URL && this.URL.getInitImageByPosition ? 1 < (i = this.URL.getInitImageByPosition.split("{lon}"))[0].split("{lat}").length ? (t = i[0].split("{lat}"))[0] + e.lat + t[1] + e.lon + i[1] : (t = i[1].split("{lat}"), i[0] + e.lon + t[0] + e.lat + t[1]) : o }, Bo.prototype.getImageByIdURL = function (e, t) { var i, o; switch (e) { case "one": i = this.URL.getInitImageById; break; case "two": i = this.URL.getSecondImageById; break; case "three": i = this.URL.getThirdImageById; break; case "init": i = this.URL.getInitImageInfoById }return "lide" === this.StreetViewType && (t = t.replace("-0-", "-X-"), "one" === e && (i += "&row=0&col=0")), o = i ? (e = i.split("{id}"))[0] + t + e[1] : o }, Bo.prototype.getInitImageByPosition = function (e, n) { var a = this, e = this.getInitImageByPositionURL(e); this.StreetViewData.linkImagesData = [], this._core.xhr({ url: e, type: "get", dataType: "json", success: e => { 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) { } }) }, Bo.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 }, Bo.prototype.getSecondTexturesFromAtlasFile = function (e, o) { var r, n, a, s, l = this.StreetViewSphereIndex, t = this.getImageByIdURL("two", e), c = null, u = 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 == c && (c = document.createElement("canvas"), u = c.getContext("2d"), c.height = s > f ? f : s, c.width = a > g ? g : a, u.translate(c.width, 0), u.scale(-1, 1)); var e = r, t = n; "lide" === this.StreetViewType && (e = 512, t = 256), u.drawImage(this.FirstImage, 0, 0, e, t, 0, 0, c.width, c.height); for (var i = 0; i < m.length; i++)m[i].src && u.drawImage(m[i], 0, 0, r, n, r * (i % p), n * Math.floor(i / p), r, n); o({ index: l, canvas: c }) } }, C = 0; C < d; C++)for (var y = 0; y < p; y++) { var v = (v = t + i).replace("{row}", C).replace("{col}", y), w = new Image; w.onload = function () { r = this.width, n = this.height, a = r * p, s = n * d, _() }, w.onerror = function () { this.src = "", this.onerror = void 0, _() }, w.setAttribute("crossOrigin", "Anonymous"); try { w.src = v } catch (e) { w.src = "" } m.push(w) } }, Bo.prototype.getThreeTexturesFromAtlasFile = function (e, r) { for (var n = this.StreetViewSphereIndex, t = this.getImageByIdURL("three", e), a = null, s = null, l = 0, c = [], i = 0; i < 8; i++)for (var o = 0; o < 16; o++) { var u = t + i + "-" + o, h = new Image; !function (o) { o.onload = function () { var e = o.width, t = o.height; if (128 == ++l) { null == a && (a = document.createElement("canvas"), s = a.getContext("2d"), a.height = 4096, a.width = 8192, s.translate(8192, 0), s.scale(-1, 1)); for (var i = 0; i < c.length; i++)s.drawImage(c[i], 0, 0, e, t, e * (i % 16), t * Math.floor(i / 16), e, t); r({ index: n, canvas: a }) } } }(h), h.setAttribute("crossOrigin", "Anonymous"); try { h.src = u } catch (e) { h.src = "" } c.push(h) } }, Bo.prototype.InitSceneByID = function (t) { var i = this, o = this._viewer; this.updateStreetSphereIndex(), this.StreetViewSphere[this.StreetViewSphereIndex] = this.createScene(this.StreetViewData.lon, this.StreetViewData.lat, this.StreetViewData.height), this.getInitImage(this.StreetViewData.getImageTileID, function (e) { i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, setTimeout(function () { i.StreetViewSphere[i.StreetViewSphereIndex].show = !0 }, 300) }), this.StreetViewData.isTwoTextures = !1, "lide" !== this.StreetViewType ? this.getImageInfoById(this.StreetViewData.getImageTileID, function (e) { i.StreetViewData.linkImagesData = [], i.CallBack && i.CallBack.getImageInfoByIdCallBack ? ("function" == typeof i.CallBack.getImageInfoByIdCallBack && i.CallBack.getImageInfoByIdCallBack(i.StreetViewData, e), i.StreetViewSphere[i.StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), o.camera.cancelFlight(), o.camera.flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function () { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading), i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll), i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))), i.getInitImage(i.StreetViewData.getImageTileID, function (e) { i.StreetViewData.isTwoTextures || (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e) }), i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function (e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData.isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i.StreetViewData.isTwoTextures = !0, i.StreetViewData.isThreeTextures = !1 }), i.createNavigation()) : console.log("the getImageInfoByIdCallBack is undefined!") }) : this.getInitImageByPosition(i.StreetViewData, function (e) { i.StreetViewSphere[i.StreetViewSphereIndex].position = i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e, o.camera.cancelFlight(), o.camera.flyTo({ destination: i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), orientation: { heading: o.camera.heading, pitch: o.camera.pitch, roll: 0 }, duration: 1.5 }), setTimeout(function () { o.entities.remove(t), t = null }, 1300), i.StreetViewSphere[i.StreetViewSphereIndex].orientation = i._cesium.Transforms.headingPitchRollQuaternion(i._cesium.Cartesian3.fromDegrees(i.StreetViewData.lon, i.StreetViewData.lat, i.StreetViewData.height), new i._cesium.HeadingPitchRoll(i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.heading + 90), i._cesium.Math.toRadians(-i.StreetViewData.HeadingPitchRoll.roll), i._cesium.Math.toRadians(i.StreetViewData.HeadingPitchRoll.pitch))), i.getSecondTexturesFromAtlasFile(i.StreetViewData.getImageTileID, function (e) { e.index === i.StreetViewSphereIndex && !1 === i.StreetViewData.isTwoTextures && (i.StreetViewSphere_Canvas[i.StreetViewSphereIndex] = e.canvas), i.StreetViewData.isTwoTextures = !0, i.StreetViewData.isThreeTextures = !1 }) }) }, Bo.prototype.getImageInfoById = function (e, t) { e = this.getImageByIdURL("init", e); this._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { "function" == typeof t && t(e) } }) }, Bo.prototype.createScene = function (e, t, i) { var o = this, r = this._viewer, n = this.StreetViewSphereIndex, a = new this._cesium.ImageMaterialProperty({ image: new this._cesium.CallbackProperty(function () { return o.StreetViewSphere_Canvas[n] }, !1), transparent: !0, color: this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha) }), e = { show: !1, position: this._cesium.Cartesian3.fromDegrees(e, t, i), ellipsoid: { radii: new this._cesium.Cartesian3(this.StreetViewData.radius, this.StreetViewData.radius, this.StreetViewData.radius), material: a } }, t = r.entities.add(e); return t.geometryName = "街景", t }; var Vo, Fo, Ho, Go, ko, No, jo, Uo, zo, Wo = null, Yo = null, Jo = { looking: !(Bo.prototype.detachMouseEvent = function () { var e = this._viewer.scene; this._viewer.canvas, this.StreetViewData._handler && (this.StreetViewData._handler.destroy(), this.StreetViewData._handler = void 0), this.StreetViewData.navigation_handler && (this.StreetViewData.navigation_handler.destroy(), this.StreetViewData.navigation_handler = void 0), "lide" !== this.StreetViewType && this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick, this), e.screenSpaceCameraController.enableRotate = !0, e.screenSpaceCameraController.enableTranslate = !0, e.screenSpaceCameraController.enableZoom = !0, e.screenSpaceCameraController.enableTilt = !0, e.screenSpaceCameraController.enableLook = !0 }) }; function Ko(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Qo(e, t) { this._viewer = e, this._cesium = t } Bo.prototype.attachMouseEvent = function () { var t = this; Wo = this._viewer.scene, Yo = this._viewer.canvas, this.StreetViewData._handler = new this._cesium.ScreenSpaceEventHandler(Yo), Yo.setAttribute("tabindex", "0"), Yo.focus(), Yo.onclick = function () { Yo.focus() }, setTimeout(function () { t.setCesiumFov(t.StreetViewData.fov) }, 4e3), Wo.screenSpaceCameraController.enableRotate = !1, Wo.screenSpaceCameraController.enableTranslate = !1, Wo.screenSpaceCameraController.enableZoom = !1, Wo.screenSpaceCameraController.enableTilt = !1, Wo.screenSpaceCameraController.enableLook = !1, this.StreetViewData._handler.setInputAction(function (e) { Jo.looking = !0 }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.StreetViewData._handler.setInputAction(function (e) { Jo.looking && (Ao = e.startPosition, Lo = e.endPosition, t.StreetView_mouseMove()) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this.StreetViewData._handler.setInputAction(function (e) { Jo.looking = !1 }, this._cesium.ScreenSpaceEventType.LEFT_UP), this.StreetViewData._handler.setInputAction(function (e) { e = t.StreetViewData.fov + e / -10; 30 < e && e < 120 && (t.StreetViewData.fov = e, t.setCesiumFov(t.StreetViewData.fov)) }, this._cesium.ScreenSpaceEventType.WHEEL), "lide" !== this.StreetViewType && this._viewer.clock.onTick.addEventListener(t.StreetView_onTick, this) }, Bo.prototype.StreetView_onTick = function () { var t = this; !this.StreetViewData.isThreeTextures && this.StreetViewData.fov < 50 && (this.StreetViewData.isThreeTextures = !0, this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID, function (e) { e.index === t.StreetViewSphereIndex && (t.StreetViewSphere_Canvas[t.StreetViewSphereIndex] = e.canvas) })) }, Bo.prototype.StreetView_mouseMove = function () { var e, t, i = this._viewer.camera; Jo.looking && (e = Yo.clientWidth, t = Yo.clientHeight, e = -(Lo.x - Ao.x) / e, t = (Lo.y - Ao.y) / t, (!i.roll && i.pitch < 0 && t < 0 || !i.roll && 0 < i.pitch && 0 < t) && (t = 0), i.rotate(i.position, e * this.StreetViewData.speedScale), i.lookUp(t * this.StreetViewData.speedScale)) }, Bo.prototype.setOpacity = function (t) { var i = this; this.StreetViewSphere.forEach(function (e) { e && (e.ellipsoid.material.color._value = i._cesium.Color.WHITE.withAlpha(t)) }), this.StreetViewData.alpha = t }, Bo.prototype.setCesiumFov = function (e) { this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e) }, Bo.prototype.MoveToLinkImage = function (e) { e ? "lide" !== this.StreetViewType || e.ImageID ? (this.StreetViewData.name = e.name, this.StreetViewData.lon = e.Position[0], this.StreetViewData.lat = e.Position[1], this.StreetViewData.height = e.Position[2], this.StreetViewData.getImageTileID = e.ImageID, this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])) : this.CallBack && this.CallBack.selectJoinsCallBack && "function" == typeof this.CallBack.selectJoinsCallBack && this.CallBack.selectJoinsCallBack() : alert("暂无街景数据") }, Bo.prototype.updateStreetSphereIndex = function () { this.StreetViewSphereIndex = 0 === this.StreetViewSphereIndex ? 1 : 0 }, Bo.prototype.createNavigation = function () { var t, i = this, a = this._viewer, s = (0 < this.StreetViewNavigation.length && (this.StreetViewNavigation.forEach(function (e) { a.entities.remove(e) }), this.StreetViewNavigation = []), this.StreetViewData.navigation_handler && (this.StreetViewData.navigation_handler.destroy(), this.StreetViewData.navigation_handler = null), 6378137), n = 6356725, o = { lon: this.StreetViewData.lon, lat: this.StreetViewData.lat, height: this.StreetViewData.height - 1 }; function l(e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = n + (s - n) * (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] } function c(e) { return e * Math.PI / 180 } this.StreetViewData.linkImagesData.forEach(function (t) { var e = a.entities.add({ polygon: { hierarchy: new i._cesium.CallbackProperty(function () { var e = function (e, t) { var i = [], e = l(e.lon, e.lat, 3.5, 180 * a.camera.heading / Math.PI), o = { lon: e[0], lat: e[1] }; e = l(e[0], e[1], 1.1, 0), i.push(e[0], e[1]), e = l(e[0], e[1], .5758, 135), i.push(e[0], e[1]), e = l(e[0], e[1], .2, 270), i.push(e[0], e[1]), e = l(e[0], e[1], .5, 180), i.push(e[0], e[1]), e = l(e[0], e[1], .4, 270), i.push(e[0], e[1]), e = l(e[0], e[1], .5, 0), i.push(e[0], e[1]), e = l(e[0], e[1], .2, 270), i.push(e[0], e[1]); for (var r, n = 0; n < i.length - 1; n += 2)r = function (e, t, i) { t = function (e, t, i, o) { var r = c(t), n = c(o), o = c(o) - c(t), t = c(i) - c(e); i = (i = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(o / 2), 2) + Math.cos(r) * Math.cos(n) * Math.pow(Math.sin(t / 2), 2)))) * s, i = Math.round(1e4 * i) / 1e4, e = 0 == o && 0 < t ? 90 : 0 == o && t < 0 ? 270 : o < 0 && 0 == t ? 180 : 0 <= o && 0 == t ? 0 : o < 0 && 0 < t ? 180 - 180 * Math.atan(t / -o) / Math.PI : o < 0 && t < 0 ? 180 + 180 * Math.atan(t / o) / Math.PI : 0 < o && t < 0 ? 360 - 180 * Math.atan(-t / o) / Math.PI : 180 * Math.atan(t / o) / Math.PI; return { angle: e, distance: i } }(e.lon, e.lat, t.lon, t.lat); return l(e.lon, e.lat, t.distance, i - t.angle) }(o, { lon: i[n], lat: i[n + 1] }, t), i[n] = r[0], i[n + 1] = r[1]; return i }(o, t.NavigationAngle); return new i._cesium.PolygonHierarchy(i._cesium.Cartesian3.fromDegreesArray(e)) }, !1), fill: !0, outline: !0, outlineColor: i._cesium.Color.BLACK.withAlpha(.2), height: o.height } }); e.geometryName = "街景", e.isNavigation = !0, e.linkImageData = t, i.StreetViewNavigation.push(e) }), i.StreetViewData.navigation_handler = new i._cesium.ScreenSpaceEventHandler(Yo), i.StreetViewData.navigation_handler.setInputAction(function (e) { e = a.scene.pick(e.position); i._cesium.defined(e) && (e && e.id && e.id.isNavigation ? (t && (t.polygon.outlineColor = i._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i._cesium.Color.WHITE), (t = e.id).polygon.outlineColor = i._cesium.Color.BLUE, t.polygon.material = i._cesium.Color.WHITE.withAlpha(.9)) : t && (t.polygon.outlineColor = i._cesium.Color.BLACK.withAlpha(.5), t.polygon.material = i._cesium.Color.WHITE, t = void 0)), t && i.MoveToLinkImage(t.linkImageData) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK) }, Ko.prototype.createCircleScan = function (e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddCircleScanPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ko.prototype.createMultiCircleScan = function (e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddCircleScanMultiPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建扩散圆扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ko.prototype.createRadarScan = function (e, t = 1500, i = "#ff0000", o = 4e3, r = !0) { var n = new this._cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, this._cesium.Color.fromCssColorString(i)), i = (this.item = this.AddRadarScanPostStage(n, t, e, o, r), { id: this._core.getuid(), name: "新建雷达扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, Ko.prototype.createSectorScan = function (e, t = 1500, i = "#ff0000", o = 90, r = 0, n = 4e3, a = !0) { var s = this._cesium, l = new s.Cartesian3.fromDegrees(e.lon, e.lat, e.height), e = (this._position = e, s.Color.fromCssColorString(i)), s = (this.item = this.AddSectorScanPostStage(l, t, e, o, r, n, a), { id: this._core.getuid(), name: "新建扇形扩散扫描", pId: 0, type: "scan", item: this }); return this.setTreeobj(s), this._tree.insertGroupId(s, 0), this }, Ko.prototype.AddSectorScanPostStage = function (e, t, i, o, r, n, a) { var s = this._viewer, l = this._cesium, c = this._core.defaultValue(this._position.height, 0); function u(e, t, i) { this._definitionChanged = new l.Event, this._color = void 0, this._colorSubscription = void 0, this.color = e, this.duration = i, this._angle = t, this._time = (new Date).getTime() } return l.EllipsoidFadeMaterialProperty || (Object.defineProperties(u.prototype, { isConstant: { get: function () { return !1 } }, definitionChanged: { get: function () { return this._definitionChanged } }, color: l.createPropertyDescriptor("color"), angle: l.createPropertyDescriptor("angle") }), u.prototype.getType = function (e) { return "EllipsoidFade" }, u.prototype.getValue = function (e, t) { return (t = l.defined(t) ? t : {}).color = l.Property.getValueOrClonedDefault(this._color, e, l.ColorWHITE, t.color), t.angle = this._angle, t }, u.prototype.equals = function (e) { return this === e || e instanceof u && Property.equals(this._color, e._color) }, l.EllipsoidFadeMaterialProperty = u, l.Material.EllipsoidFadeType = "EllipsoidFade", l.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}", 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 : c, semiMinorAxis: t, semiMajorAxis: t, stRotation: r * Math.PI / 180, material: new l.EllipsoidFadeMaterialProperty(i, o, n) } }, s.entities.add(e) }, Ko.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<time){\n                        float f = dis / time;\n                        material.alpha = pow(f, 4.0);\n                    }else{\n                        material.alpha = 0.0;\n                    }\n                    return material;\n                }", a.Material._materialCache.addMaterial(a.Material.CircleScanType, { fabric: { type: a.Material.CircleScanType, uniforms: { color: new a.Color(1, 0, 0, 1), time: 0 }, source: a.Material.CircleScanSource }, translucent: function (e) { return !0 } })); e = { name: "CircleScan", position: e, ellipse: { height: r ? void 0 : s, semiMinorAxis: t, semiMajorAxis: t, material: new a.CircleScanMaterialProperty(i, o) } }; return n.entities.add(e) }, Ko.prototype.AddCircleScanMultiPostStage = 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.u_radius1 = 0, this.u_radius2 = 0, this.u_radius3 = 0, this.duration = t, this._time = (new Date).getTime() } a.CircleScanMultiMaterialProperty || (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 "CircleScanMulti" }, 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.time < 1 / 3 && 0 === this.u_radius2 && 0 === this.u_radius1 ? this.u_radius3 = t.time : t.time >= 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) }, Ko.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), .5 < this.old && t.time < .5 && (t.inverse = !t.inverse), this.old = t.time, t.gradient ? t.inverse ? (t.angle2 = this.range * (1 - t.time), t._angle = this.range - t.angle2, t._angle > this._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) }, Ko.prototype.setRadius = function (e) { this.item && (this.item.ellipse.semiMinorAxis = parseFloat(e), this.item.ellipse.semiMajorAxis = parseFloat(e)) }, Ko.prototype.setTime = function (e) { this.item && (this.item.ellipse.material.duration = parseFloat(e)) }, Ko.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 < e ? t : parseFloat(e)) }, Ko.prototype.setRadarRange = function (e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material.range = 360 < e ? 360 : parseFloat(e)) }, Ko.prototype.setRadarIsReturn = function (e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material.isReturn = e) }, Ko.prototype.setRadarIsGradient = function (e) { this.item && "RadarScan" === this.item.ellipse.material.getType() && (this.item.ellipse.material.isGradient = e) }, Ko.prototype.setPosition = function (e) { this.item && (this.item.position = new Cesium.Cartesian3.fromDegrees(e.lon, e.lat)) }, Ko.prototype.remove = function () { this._viewer.entities.remove(this.item) }, Ko.prototype.setTreeobj = function (e) { this.treeobj = e }, Ko.prototype.deleteObject = function () { this.item && this._viewer.entities.remove(this.item) }, Ko.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, Qo.prototype.depthTestAgainstTerrain = function (e) { this._viewer.scene.globe.depthTestAgainstTerrain = e }, Qo.prototype.show = function () { return this._viewer.scene.globe.depthTestAgainstTerrain }; var D, qo = [1, 1e5]; function Xo(e, t) { var i, o; if (!(D.canvas.width <= 0 || D.canvas.height <= 0)) return (o = D.camera.getPickRay(e)) && (i = D.scene.globe.pick(o, D.scene)), (o = (o = D.scene.pick(e)) && o.id instanceof Cesium.Entity ? void 0 : o) && (o = D.scene.pickPosition(e)) ? o : i } function Zo(e, t) { this._normalShadowMap = e.scene.shadowMap, D = e, Cesium.Scene.prototype.screenToWorld = Xo, this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new y(e), this._startPositionCartesian = null, this._startPositionCartographic = null, this._currentPosition = null, this._prevRadius = null, this._currentRadius = null, this._currentFovHorizontal = null, this._currentFovVertical = null, this._viewshedDirection = null, this._scratchCartesian3 = new Cesium.Cartesian3, this._texture = null, this._canEnlarge = !1, this._viewshedPrimitive = null, this._eventListener = null, this._viewshedMap = void 0, this._firstTime = !0, this._editingMode = !1, this._isSliderClicked = !1, this._currentObject = void 0, this._setNewPosition = !1, this._setNewPositionCanDrag = !1, this._setNewName = !1, this._listControl = void 0, this._addingViewshedMode = !1, this._initialCameraParams = {}, this._isCancelledTerrain = !1, this._isCancelledPrimitives = !1, this._isSpherical = !1, this._occluder = void 0, this._horizonCullingDistanceFromPoint = void 0, this._mousePositionX = void 0, this._mousePositionY = void 0, this._zAxisNewPosition = void 0, this._startingRepoZHeight = void 0, this._viewshedCartoPos = void 0, this._propertiesChanged = !1, this._calculations = [], this._exposures = [], this._calculating = !1, this._calculatingExposure = !1, this.viewshedCalculateNormals = !1, this._txtUnit = "meters_short", this.isLoadingScreenOn = !1, this._primitiveColor = Cesium.Color.WHITE, this._predefinedPrimitiveColors = { BEYOND_THE_HORIZON: Cesium.Color.WHITE, DEFAULT: Cesium.Color.WHITE }, this._layersStorage = null, this.getId = function () { return "Viewshed" }, this.maxNumViewshed = 8, Vo = 53 * Cesium.Math.RADIANS_PER_DEGREE, Fo = 53 * Cesium.Math.RADIANS_PER_DEGREE, Ho = 6371010, Go = { ABOVE_SEA_LEVEL: 0, ABOVE_GROUND_LEVEL: 1, ABOVE_MODEL: 2 }, ko = new Cesium.Cartesian3, Uo = new Cesium.Matrix4, No = new Cesium.Cartesian4, jo = new Cesium.Cartesian3, Uo = new Cesium.Matrix4, (zo = new Array(4))[0] = new Cesium.Cartesian4(-1, -1, 1, 1), zo[1] = new Cesium.Cartesian4(1, -1, 1, 1), zo[2] = new Cesium.Cartesian4(1, 1, 1, 1), zo[3] = new Cesium.Cartesian4(-1, 1, 1, 1) } Zo.prototype.setOptions = function (e) { this._currentObject = { viewshedPrimitive: this._viewshedPrimitive, viewshedMap: this._viewshedMap, viewshedObjOptions: e || {} } }, Zo.prototype.startDraw = function (e) { this._viewshedPrimitive && (D.scene.primitives.remove(this._viewshedPrimitive), this._viewshedPrimitive = null), this._core.setDepthTest("open", this._viewer), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._eventListener && this._eventListener.destroy(), this._eventListener = new Cesium.ScreenSpaceEventHandler(D.scene.canvas), void 0 === this._viewshedDefaultNamingArray && (this._viewshedDefaultNamingArray = new Array(this.maxNumViewshed)), this._addingViewshedMode = !0, this._editingMode = !1, this._currentObject = { viewshedPrimitive: this._viewshedPrimitive, viewshedMap: this._viewshedMap, viewshedObjOptions: e || {} }, this._isSpherical = e.isSpherical, this._setNewPosition = !1, "pc" != this._core.getBrowser().pc ? (this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile, this), Cesium.ScreenSpaceEventType.LEFT_CLICK), D.scene.preRender.addEventListener(this.onPreFrameMobile, this)) : (this._eventListener.setInputAction($.proxy(this.setViewshedPosition, this), Cesium.ScreenSpaceEventType.LEFT_CLICK), D.scene.preRender.addEventListener(this.onPreFrame, this)), this.end = e => { 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) } }, Zo.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) }, Zo.prototype.setVisibility = function (e) { this._viewshedPrimitive.show = e, D.shadowMap.enabled = e }, Zo.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 }, Zo.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) }, Zo.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 }, Zo.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 }, Zo.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 < i.length && (t = i[i.length - 2], o = D.scene.primitives._primitives[t], D.scene.primitives.remove(o))))) : Cesium.defined(e) && void 0 !== this._currentObject && void 0 !== (t = this._getPosition.getMousePosition(e)) && (o = 0, this._startPositionCartographic = D.scene.globe.ellipsoid.cartesianToCartographic(t), this._currentObject.viewshedObjOptions.pickHeight = this._startPositionCartographic.height, void 0 !== this._currentObject.viewshedObjOptions.height && (o = this._currentObject.viewshedObjOptions.height), e = new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude, this._startPositionCartographic.latitude, this._startPositionCartographic.height + 0 + o), this._startPositionCartesian = e, t = this._startPositionCartesian, o = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, 0), Ho), this._occluder = new Cesium.Occluder(o, t), this._canEnlarge = !0, this._eventListener.setInputAction($.proxy(this.onMouseMove, this), Cesium.ScreenSpaceEventType.MOUSE_MOVE))) }, Zo.prototype.update = function (t = {}) { if (this._currentObject && this._currentObject.viewshedMap) { var i, o = this._currentObject.direction; Object.assign(o, t); let e = this._currentObject.position; void 0 === t.lon && void 0 === t.lat && void 0 === t.height || (i = this._core.toDegrees(e), Object.assign(i, t), e = Cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height), this._currentObject.position = e), void 0 !== t.distance && (this._currentRadius = t.distance), this._currentRadius ? this._currentObject.viewshedMap._lightCamera.frustum.far = this._currentRadius : this._currentRadius = this._currentObject.viewshedMap._lightCamera.frustum.far, this._currentObject.viewshedMap._lightCamera.lookAt(e, o), this._isSpherical ? this.createViewshedSpherePrimitive(e) : this.createViewshedCameraPrimitive(e, this._currentObject.viewshedMap._lightCamera) } }, Zo.prototype.setViewshedPositionMobile = function (e) { var i, t, o; this._setNewPosition || (this.onMouseMove(e), this.createViewshedCameraPrimitive(), this._canEnlarge && null != this._viewshedPrimitive ? (this._currentObject.viewshedObjOptions.end && this._currentObject.viewshedObjOptions.end(), this._core.mouse(this._viewer.container, 0), this.createViewshedMap(), 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._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 < i.length && (t = i[i.length - 2], o = D.scene.primitives._primitives[t], D.scene.primitives.remove(o))))) : Cesium.defined(e) && void 0 !== this._currentObject && void 0 !== (t = this._getPosition.getMousePosition(e)) && (o = 0, this._startPositionCartographic = D.scene.globe.ellipsoid.cartesianToCartographic(t), this._currentObject.viewshedObjOptions.pickHeight = this._startPositionCartographic.height, void 0 !== this._currentObject.viewshedObjOptions.height && (o = this._currentObject.viewshedObjOptions.height), e = new Cesium.Cartesian3.fromRadians(this._startPositionCartographic.longitude, this._startPositionCartographic.latitude, this._startPositionCartographic.height + 0 + o), this._startPositionCartesian || (this._startPositionCartesian = e), t = this._startPositionCartesian, o = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, 0), Ho), this._occluder = new Cesium.Occluder(o, t), this._canEnlarge = !0, this._eventListener.setInputAction($.proxy(this.onMouseMove, this), Cesium.ScreenSpaceEventType.MOUSE_MOVE))) }, Zo.prototype.onMouseMove = function (e) { var t, i, o, r; Cesium.defined(e) && (i = {}, null != (t = this._getPosition.getMousePosition(e)) ? null != i.pickPrimitive && null != i.pickPrimitive._camera || (i = {}, this._setNewPosition ? this._setNewPositionCanDrag ? (o = void 0, r = D.scene.globe.ellipsoid.cartesianToCartographic(t), this._currentObject.viewshedObjOptions.pickHeight = r.height, this._currentObject.viewshedObjOptions.terrainHeight = D.scene.globe.getHeight(r), o = this._zAxisNewPosition ? (e = e.endPosition.y - this._startingRepoZ.y, e = -1 * Cesium.Cartesian3.magnitude(Cesium.Cartesian3.subtract(this._currentObject.position, D.camera.position, this._scratchCartesian3), this._scratchCartesian3) * (e / D.canvas.height), null == this._viewshedCartoPos && (this._viewshedCartoPos = new Cesium.Cartographic.fromCartesian(this._currentObject.position)), new Cesium.Cartesian3.fromRadians(this._viewshedCartoPos.longitude, this._viewshedCartoPos.latitude, this._viewshedCartoPos.height + e)) : this._currentObject.viewshedObjOptions.altitudeMethod == Go.ABOVE_SEA_LEVEL ? new Cesium.Cartesian3.fromRadians(r.longitude, r.latitude, this._startingRepoZHeight) : t, this._newPosition = o) : (e = Cesium.Matrix4.multiplyByVector(D.camera._viewMatrix, Cesium.Cartesian4.fromElements(t.x, t.y, t.z, 1, No), No), r = Cesium.Matrix4.multiplyByVector(D.camera.frustum.projectionMatrix, e, No), o = Cesium.Cartesian3.divideByScalar(r, r.w, jo), e = Math.floor((.5 * o.x + .5) * D.canvas.width), r = Math.floor((.5 * o.y + .5) * D.canvas.height), this._mousePositionX = e, this._mousePositionY = r) : null != this._startPositionCartesian && (Cesium.Cartesian3.subtract(t, this._startPositionCartesian, i), isNaN(i.x) || isNaN(i.y) || isNaN(i.z) || (this._viewshedDirection = Cesium.Cartesian3.normalize(i, this._scratchCartesian3), this._currentRadius = Cesium.Cartesian3.magnitude(i)))) : (this._mousePositionX = void 0, this._mousePositionY = void 0)) }, Zo.prototype.createViewshedSpherePrimitive = function (e, t) { try { var i = null != e ? e : this._startPositionCartesian, o = null != t ? t : this._currentRadius; if (o <= 1) return !1; null != this._viewshedPrimitive && D.scene.primitives.remove(this._viewshedPrimitive); var r = Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(i), new Cesium.Cartesian3(0, 0, 0), Uo), n = new Cesium.GeometryInstance({ geometry: new Cesium.SphereOutlineGeometry({ radius: o, stackPartitions: 12, slicePartitions: 12 }), modelMatrix: r, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1, 1, 1, .5)) } }), a = (this._viewshedPrimitive = D.scene.primitives.add(new Cesium.Primitive({ geometryInstances: n, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, renderState: { lineWidth: 1 } }), allowPicking: !1, asynchronous: !1 })), new Cesium.Camera(D.scene)); a.position = i, a.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, this._scratchCartesian3), this._viewshedPrimitive._camera = a } catch (e) { return !1 } return this._viewshedPrimitive }, Zo.prototype.createViewshedCameraPrimitive = function (e, t) { null != this._viewshedPrimitive && D.scene.primitives.remove(this._viewshedPrimitive); var i = new Cesium.Camera(D.scene); if (this._startPositionCartesian || e) return i.position = null != e ? e : this._startPositionCartesian, null == this._viewshedDirection || isNaN(this._viewshedDirection.x) || isNaN(this._viewshedDirection.y) || (i.direction = this._viewshedDirection.clone(), i.up = D.scene.globe.ellipsoid.geodeticSurfaceNormal(i.position, ko)), i.frustum.isViewshed = !0, i.frustum.fov = Cesium.defaultValue(this._currentObject.viewshedObjOptions.fov, Vo), i.frustum._fovy = Cesium.defaultValue(this._currentObject.viewshedObjOptions.fovy, Fo), i.frustum.aspectRatio = Math.tan(i.frustum.fov / 2) / Math.tan(i.frustum._fovy / 2), i.frustum.near = 1, !(this._currentRadius <= 1) && (i.frustum.far = Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance, this._currentRadius), this._viewshedPrimitive = D.scene.primitives.add(new Cesium.DebugCameraPrimitive({ camera: t || i, color: this._primitiveColor })), this._viewshedPrimitive._numFrustrums = 0, this._viewshedPrimitive._outlineOnlyFrustum = !0, this._viewshedPrimitive.update = this.updateViewshedPrimitive, this._viewshedPrimitive) }, Zo.prototype.createViewshedMap = function () { null == D.scene.viewsheds && D.scene.viewsheds, null != this._viewshedPrimitive._camera && this._canEnlarge && (null == this._viewshedMap ? (this._viewshedMap = new Cesium.ShadowMap({ context: D.scene.context, lightCamera: this._viewshedPrimitive._camera, enabled: 1, isSpotLight: !0, fromLightSource: !0, softShadows: !1, isPointLight: this._isSpherical, pointLightRadius: Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance, this._currentRadius) }), this._viewshedMap.show = !0, this._viewshedMap.isPreviewMode = !0, this._viewshedMap.guid = "SamplerViewshed", this._viewshedMap) : (this._viewshedMap._lightCamera.direction = this._viewshedPrimitive._camera.direction, this._viewshedMap._lightCamera.frustum.far = Cesium.defaultValue(this._currentObject.viewshedObjOptions.distance, this._currentRadius))) }, Zo.prototype.updateViewshedPrimitive = function (e) { if (this.show) { if (this._updateOnChange && (this._outlinePrimitive = this._outlinePrimitive && this._outlinePrimitive.destroy()), !Cesium.defined(this._outlinePrimitive)) { for (var t, i, o = this._camera, r = o.frustum, n = e.frustumSplits, a = n.length - 1, s = ((a = this._numFrustrums) <= 0 && ((n = qo)[0] = this._camera.frustum.near, n[1] = this._camera.frustum.far, a = 1), this._camera.viewMatrix), l = (Cesium.defined(o.frustum.fovy) ? (o = this._camera.frustum.projectionMatrix, o = Cesium.Matrix4.multiply(o, s, Uo), i = Cesium.Matrix4.inverse(o, Uo)) : t = Cesium.Matrix4.inverseTransformation(s, Uo), new Float64Array(12 * (a + 1) + 3)), c = 0; c < a + 1; ++c)for (var u = 0; u < 4; ++u) { var h, m, d = Cesium.Cartesian4.clone(zo[u], Zo[u]); Cesium.defined(i) ? (m = 1 / (d = Cesium.Matrix4.multiplyByVector(i, d, d)).w, Cesium.Cartesian3.multiplyByScalar(d, m, d), Cesium.Cartesian3.subtract(d, this._camera.positionWC, d), Cesium.Cartesian3.normalize(d, d), m = Cesium.Cartesian3.dot(this._camera.directionWC, d), Cesium.Cartesian3.multiplyByScalar(d, n[c] / m, d), Cesium.Cartesian3.add(d, this._camera.positionWC, d)) : (Cesium.defined(r._offCenterFrustum) && (r = r._offCenterFrustum), m = c === a ? (h = n[c - 1], n[c]) : (h = n[c], n[c + 1]), d.x = .5 * (d.x * (r.right - r.left) + r.left + r.right), d.y = .5 * (d.y * (r.top - r.bottom) + r.bottom + r.top), d.z = .5 * (d.z * (h - m) - h - m), d.w = 1, Cesium.Matrix4.multiplyByVector(t, d, d)), l[12 * c + 3 * u] = d.x, l[12 * c + 3 * u + 1] = d.y, l[12 * c + 3 * u + 2] = d.z } l[12 * a + 12] = this._camera.positionWC.x, l[12 * a + 12 + 1] = this._camera.positionWC.y, l[12 * a + 12 + 2] = this._camera.positionWC.z; o = new Cesium.BoundingSphere.fromVertices(l), s = new Cesium.GeometryAttributes; s.position = new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: l }); var p, g, f = new Uint16Array(8 * (2 * a + 1 + 1)); for (c = 0; c < a + 1; ++c)f[p = 8 * c] = g = 4 * c, f[p + 1] = g + 1, f[p + 2] = g + 1, f[p + 3] = g + 2, f[p + 4] = g + 2, f[p + 5] = g + 3, f[p + 6] = g + 3, f[p + 7] = g; for (c = 0; c < a; ++c)f[p = 8 * (a + 1 + c)] = g = 4 * c, f[p + 1] = g + 4, f[p + 2] = g + 1, f[p + 3] = g + 5, f[p + 4] = g + 2, f[p + 5] = g + 6, f[p + 6] = g + 3, f[p + 7] = g + 7; f[p += 8] = g + 8, f[p + 1] = g + 1, f[p + 2] = g + 8, f[p + 3] = g + 2, f[p + 4] = g + 8, f[p + 5] = g + 3, f[p + 6] = g + 8, f[p + 7] = g + 4, this._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: { attributes: s, indices: f, primitiveType: Cesium.PrimitiveType.LINES, boundingSphere: o }, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(this._color) }, id: this.id, pickPrimitive: this }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1 }) } this._outlinePrimitive.isViewshedPart = !0, this._outlinePrimitive.update(e) } }, Zo.prototype.getHorizonDistance = function (e) { return Math.sqrt(Math.pow(Ho + e, 2) - Math.pow(Ho, 2)) }, Zo.prototype.onPreFrame = function (e) { var t, i, o, r; null != this._currentObject && null != this._currentObject.viewshedPrimitive && null != this._currentObject.viewshedMap && (t = new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position), i = this.getHorizonDistance(t.height), this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed = i, i = D.scene.globe.getHeight(t), this._currentObject.viewshedMap.isBelowGround = t.height < i + .5), null != this._currentObject && this._currentObject.viewshedMap, null != this._newPosition && this.toPreviewMode(this._currentObject), this._canEnlarge && null != this._currentRadius && this._prevRadius != this._currentRadius ? (this._prevRadius = this._currentRadius, (this._isSpherical ? this.createViewshedSpherePrimitive() : this.createViewshedCameraPrimitive()) && this.createViewshedMap()) : null != this._currentObject && this._setNewPosition && null != this._mousePositionX && null != this._mousePositionY && (this.getPosXAndY(), this._currentObject.viewshedObjOptions.isSpherical ? (this._currentObject.viewshedMap._lightCamera.position = this._newPosition, this._currentObject.viewshedPrimitive = this.createViewshedSpherePrimitive(this._newPosition, this._currentObject.distance)) : (this.checkIfMouseOnPosition(), null != this._newPosition && (this._currentObject.viewshedObjOptions.altitudeMethod == Go.ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, D.scene.globe.getHeight(o) + this._currentObject.startingAltitudeAboveGround), this._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject.viewshedObjOptions.altitudeMethod == Go.ABOVE_MODEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, o.height + this._currentObject.startingAltitudeAboveModel), this._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject.viewshedPrimitive._camera.position = this._newPosition, this.adjustDirections()))) }, Zo.prototype.onPreFrameMobile = function (e) { var t, i, o, r; null != this._currentObject && null != this._currentObject.viewshedPrimitive && null != this._currentObject.viewshedMap && (t = new Cesium.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position), i = this.getHorizonDistance(t.height), this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed = i, i = D.scene.globe.getHeight(t), this._currentObject.viewshedMap.isBelowGround = t.height < i + .5), null != this._currentObject && this._currentObject.viewshedMap, null != this._newPosition && this.toPreviewMode(this._currentObject), this._canEnlarge && null != this._currentRadius ? (this._prevRadius = this._currentRadius, (this._isSpherical ? this.createViewshedSpherePrimitive() : this.createViewshedCameraPrimitive()) && this.createViewshedMap()) : null != this._currentObject && this._setNewPosition && null != this._mousePositionX && null != this._mousePositionY && (this.getPosXAndY(), this._currentObject.viewshedObjOptions.isSpherical ? (this._currentObject.viewshedMap._lightCamera.position = this._newPosition, this._currentObject.viewshedPrimitive = this.createViewshedSpherePrimitive(this._newPosition, this._currentObject.distance)) : (this.checkIfMouseOnPosition(), null != this._newPosition && (this._currentObject.viewshedObjOptions.altitudeMethod == Go.ABOVE_GROUND_LEVEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, D.scene.globe.getHeight(o) + this._currentObject.startingAltitudeAboveGround), this._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject.viewshedObjOptions.altitudeMethod == Go.ABOVE_MODEL && null == this._zAxisNewPosition ? (o = Cesium.Cartographic.fromCartesian(this._newPosition.clone()), r = Cesium.Cartesian3.fromRadians(o.longitude, o.latitude, o.height + this._currentObject.startingAltitudeAboveModel), this._currentObject.viewshedPrimitive._camera.position = r) : this._currentObject.viewshedPrimitive._camera.position = this._newPosition, this.adjustDirections()))) }; var $o, er, tr, ir, or = "vec4 toEye(in vec2 uv, in float depth){\nvec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\nvec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera =posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat getDepth(in vec4 depth){\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}\nmat4 inverse_mat4(mat4 m)\n{\nfloat Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\nfloat Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\nfloat Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\nfloat Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\nfloat Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\nfloat Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\nfloat Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\nfloat Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\nfloat Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\nfloat Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\nfloat Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\nfloat Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\nfloat Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\nfloat Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\nfloat Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\nfloat Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\nfloat Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\nfloat Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\nconst vec4 SignA = vec4( 1.0, -1.0,  1.0, -1.0);\nconst vec4 SignB = vec4(-1.0,  1.0, -1.0,  1.0);\nvec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);\nvec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);\nvec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);\nvec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);\nvec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);\nvec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);\nvec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);\nvec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);\nvec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);\nvec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);\nvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\nvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\nvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\nvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\nmat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);\nvec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\nfloat Determinant = dot(m[0], Row0);\nInverse /= Determinant;\nreturn Inverse;\n}\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform vec3 cen;\nuniform vec3 position;\nuniform vec3 eupp;\nuniform vec3 angle;\nuniform vec4 nearAndFar;\nuniform sampler2D video;\nuniform vec4 visible;\nuniform vec4 unvisible;\nuniform float type;\nuniform sampler2D stcshadow;\nuniform mat4 _shadowMap_matrix;\nuniform vec4 shadowMap_lightPositionEC;\nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;\nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;\nmat4 computeMat(){\nvec3 dir = normalize( position - cen );\nvec3 up = normalize( eupp - cen);\nvec3 right = cross(dir , up);\nright = normalize(right);\nup = cross(right , dir);\nup = normalize(up);\nreturn mat4(\nright.x,right.y,right.z,0.,\nup.x,up.y,up.z,0.,\ndir.x,dir.y,dir.z,0.,\ncen.x,cen.y,cen.z,1.\n);\n}\nmat3 computeMat3(float an){\nfloat sa = sin(an);\nfloat ca = cos(an);\nreturn mat3(\nca , -sa ,0.,\nsa , ca , 0.,\n0.,0.,1.\n);\n}\nvoid main(){\nvec2 uv = v_textureCoordinates;\nfloat depth = getDepth(texture2D( depthTexture , uv));\nvec4 oc = texture2D(colorTexture , uv);\nvec4 ec = toEye( uv , depth);\nec /= ec.w;\nvec3 snor = normalize(position - cen);\nvec3 pd = ec.xyz - cen;\nfloat dd = length(pd);\nvec3 n = normalize(ec.xyz - cen);\nfloat d = dot(n ,  snor);\nmat4 localMat = computeMat();\nvec4 p = inverse_mat4(localMat) * ec;\np /= p.w;\nif( p.z < nearAndFar.x || p.z > nearAndFar.y){\ngl_FragColor = oc;\nreturn;\n}\nvec3 pp = p.xyz;\nmat3 rm = computeMat3( radians( angle.z ) );\npp = rm * pp;\nvec3 nn = pp.xyz;\nvec3 zn = vec3(0.,0.,1.);\nfloat dist = dot( nn , zn);\nfloat dx = pp.x ;\nfloat xangle = tan(radians( angle.x ));\nfloat yangle = tan(radians( angle.y ));\nfloat tanx = pp.x / dist;\nfloat tany = pp.y / dist;\nif( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){\nczm_shadowParameters shadowParameters;\nshadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;\nshadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;\nshadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;\nshadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;\nshadowParameters.depthBias *= max(depth * 0.01, 1.0);\nvec3 directionEC = normalize(ec.xyz - shadowMap_lightPositionEC.xyz);\nvec3 normalEC = vec3(1.0);\nfloat nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);\nvec4 shadowPosition = _shadowMap_matrix * ec;\nshadowPosition /= shadowPosition.w;\nshadowParameters.texCoords = shadowPosition.xy;\nshadowParameters.depth = shadowPosition.z;\nshadowParameters.nDotL = nDotL;\nfloat visibility = czm_shadowVisibility(stcshadow, shadowParameters);\nif(type == 0.0){\nif(visibility == 1.0){\ngl_FragColor = mix(oc , visible , nearAndFar.z);\n}else{\ngl_FragColor = mix(oc , unvisible , nearAndFar.z);\n}\n}else{\nif(visibility == 1.0){\nfloat r = (tanx + xangle) / (2. * xangle);\nfloat g = (tany + yangle) / (2. * yangle);\nvec4 col = texture2D( video , vec2( r , g));\nfloat f1 = 1.;\nfloat v1 = nearAndFar.w ;\nfloat v2 = 1. - v1;\nif(r < v1){\nf1 = r / v1;\n}\nif(r > v2){\nf1 = (1. - r) / v1;\n}\nfloat f2 = 1.;\nif(g < v1){\nf2 = g / v1;\n}\nif(g > v2){\nf2 = (1. - g) / v1;\n}\nfloat f12 = f1 * f2;\nfloat ff = smoothstep(  0. , 1. , f12 );\nff *= nearAndFar.z;\ngl_FragColor = mix(oc , col , ff);\n}else{\ngl_FragColor = oc;\n}\n}\n}else{\ngl_FragColor = oc;\n}\n}\n"; let rr = new f; function nr(e, t) { this._viewer = e, this.video = t.video, this.viewshed = t.viewshed || {}, this.cameraPosition = t.cameraPosition.x && t.cameraPosition.y && t.cameraPosition.z ? t.cameraPosition : Cesium.Cartesian3.fromDegrees(t.cameraPosition.lon, t.cameraPosition.lat, t.cameraPosition.height), this.position = t.position && (t.position instanceof Cesium.Cartesian3 ? t.position : Cesium.Cartesian3.fromDegrees(t.position.lon, t.position.lat, t.position.height)), this.heading = t.heading || 0, this.pitch = t.pitch || 0, this.alpha = t.alpha || .9, this.horizonAngle = t.horizonAngle || 60, this.verticalAngle = t.verticalAngle || 40, this.angle = new Cesium.Cartesian3(this.horizonAngle / 2, this.verticalAngle / 2, 0), this.near = rr.defaultValue(t.near, 1), this.far = t.far || 30, this.showFarScale = t.showFarScale || 5, this.offset = 0, this.show = !0, this.video && (this.offset = rr.defaultValue(t.video.offset, .1)), this.viewshed.visible = Cesium.Color.fromCssColorString(this.viewshed.visible || "#00ff00"), this.viewshed.unvisible = Cesium.Color.fromCssColorString(this.viewshed.unvisible || "#ff0000"), this.nearAndFar = new Cesium.Cartesian4(this.near, this.far, this.alpha, this.offset), this.center = new Cesium.Cartesian3, this.eupp = new Cesium.Cartesian3, this.epp = new Cesium.Cartesian3, this.upp = this.setSpHeight(this.cameraPosition), this.useLine = Cesium.defaultValue(t.useLine, !0), this._viewer.scene.primitives.add(this), this.init() } function ar(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._getPosition = new y(this._viewer, this._cesium), this.tooltip = this._core.CreateTooltip() } function sr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.isPause = !1, this.isLoad = !1 } function lr(e, t) { this._viewer = e, this._cesium = t } function cr(e, t, i, h, m, d) { const { Pass: o, defined: r, PerspectiveFrustum: n, PerspectiveOffCenterFrustum: a, OrthographicFrustum: s, OrthographicOffCenterFrustum: l } = Cesium; $o = $o || new n, er = er || new a, tr = tr || new s, ir = ir || new l; let c = e._us, u = c._frameState, p = u.camera, g = p._scene, f = g._view, _ = f.frustumCommandsList, C = _.length; var y, v, w, b = g._globeTranslucencyState, T = b.translucent; function S(e, t, i, o) { if (!d || d(e, t)) if (h && m) { var r = e; var n = h; var a = m; var s = i; var l = o; const u = Cesium.defined; var t = t._frameState, c = r.derivedCommands; u(c) && (c = (r = t.useLogDepth && u(c.logDepth) ? c.logDepth.command : r).derivedCommands, u(c[n]) && (r = c[n][a]).execute(s, l)) } else e.execute(i, o) } for (var E = r(p.frustum.fov) ? p.frustum.clone($o) : r(p.frustum.infiniteProjectionMatrix) ? p.frustum.clone(er) : r(p.frustum.width) ? p.frustum.clone(tr) : p.frustum.clone(ir), P = 0; P < C; ++P) { var x = C - P - 1, D = _[x], I = i.framebuffer; if (i.framebuffer = t, E.near = 0 != x ? D.near * g.opaqueFrustumNearOffset : D.near, E.far = D.far, c.updateFrustum(E), c.updatePass(o.GLOBE), w = D.commands[o.GLOBE], v = D.indices[o.GLOBE], T) b.executeGlobeCommands(D, S, globeTranslucencyFramebuffer, g, i); else for (y = 0; y < v; ++y)S(w[y], g, e, i); for (c.updatePass(o.CESIUM_3D_TILE), w = D.commands[o.CESIUM_3D_TILE], v = D.indices[o.CESIUM_3D_TILE], y = 0; y < v; ++y)S(w[y], g, e, i); for (c.updatePass(o.OPAQUE), w = D.commands[o.OPAQUE], v = D.indices[o.OPAQUE], y = 0; y < v; ++y)S(w[y], g, e, i); for (c.updatePass(o.TRANSLUCENT), w = D.commands[o.TRANSLUCENT], v = D.indices[o.TRANSLUCENT], y = 0; y < v; ++y)S(w[y], g, e, i); i.framebuffer = I } } nr.prototype.createViewCone = function () { var e; this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), this.useLine && (e = this.viewShadowMap._lightCamera, this.line = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: e.positionWC, orientation: this.orientationData, frustum: e.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString("#fff")) } }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._viewer.scene.primitives.add(this.line)) }, nr.prototype.isShow = function () { return this.show && rr.getPointToCameraDistance(this._viewer, this.cameraPosition) < this.far * this.showFarScale }, nr.prototype.init = function () { if (!this.post || !this.texture) { if (!(this.upp instanceof Cesium.Cartesian3)) throw new Error("计算上方向错误"); this._createShadowMap(), this.createViewCone(); const o = this.video && this.video.container, r = this; let e = this._viewer.scene.context.uniformState, t = this.viewShadowMap._isPointLight ? this.viewShadowMap._pointBias : this.viewShadowMap._primitiveBias, i = 0; o && (this.texture = new Cesium.Texture({ context: this._viewer.scene.context, source: o, width: 1, height: 1 }), i = 1), this.post = new Cesium.PostProcessStage({ uniforms: { type: function () { return i }, cen: function () { return Cesium.Matrix4.multiplyByPoint(e.view3D, r.cameraPosition, r.center) }, position: function () { return Cesium.Matrix4.multiplyByPoint(e.view3D, r.videoCenter, r.epp) }, eupp: function () { return Cesium.Matrix4.multiplyByPoint(e.view3D, r.upp, r.eupp) }, video: function () { return o && 2 <= o.readyState && !r.isPause && r.texture.copyFrom({ source: o }), r.texture || r._viewer.scene.context.defaultTexture }, visible: function () { return r.viewshed.visible }, unvisible: function () { return r.viewshed.unvisible }, angle: function () { return r.angle }, nearAndFar: function () { return r.nearAndFar }, _shadowMap_matrix: function () { return r.viewShadowMap._shadowMapMatrix }, shadowMap_lightPositionEC: function () { return r.viewShadowMap._lightPositionEC }, shadowMap_texelSizeDepthBiasAndNormalShadingSmooth: function () { let e = new Cesium.Cartesian2; return e.x = 1 / r.viewShadowMap._textureSize.x, e.y = 1 / r.viewShadowMap._textureSize.y, Cesium.Cartesian4.fromElements(e.x, e.y, t.depthBias, t.normalShadingSmooth) }, shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness: function () { return Cesium.Cartesian4.fromElements(t.normalOffsetScale, r.viewShadowMap._distance, r.viewShadowMap.maximumDistance, r.viewShadowMap._darkness) }, stcshadow: function () { return r.viewShadowMap._shadowMapTexture } }, fragmentShader: or }), this._viewer.scene.postProcessStages.add(this.post) } }, nr.prototype._createShadowMap = function () { let e = new Cesium.Camera(this._viewer.scene); e.frustum.fov = Cesium.Math.toRadians(this.horizonAngle), e.frustum.aspectRatio = this.horizonAngle / this.verticalAngle, e.frustum.near = this.near, e.frustum.far = this.far, this.position ? (e.position = this.cameraPosition, e.direction = Cesium.Cartesian3.subtract(this.position, this.cameraPosition, new Cesium.Cartesian3(0, 0, 0)), e.up = Cesium.Cartesian3.normalize(this.cameraPosition, new Cesium.Cartesian3(0, 0, 0)), t = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.position, this.cameraPosition, new Cesium.Cartesian3), new Cesium.Cartesian3), e.direction = t, this.heading = Cesium.Math.toDegrees(e.heading), this.pitch = Cesium.Math.toDegrees(e.pitch)) : e.setView({ destination: this.cameraPosition, orientation: { heading: Cesium.Math.toRadians(this.heading), pitch: Cesium.Math.toRadians(this.pitch), roll: 0 } }); var t = new Cesium.Cartesian3, i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = e.upWC, n = e.rightWC, n = Cesium.Cartesian3.negate(n, t), t = i; if (Cesium.Matrix3.setColumn(t, 0, n, t), Cesium.Matrix3.setColumn(t, 1, r, t), Cesium.Matrix3.setColumn(t, 2, e.direction, t), this.orientationData = Cesium.Quaternion.fromRotationMatrix(t, o), !this.position) { var a = new Float64Array(24); Cesium.FrustumGeometry._computeNearFarPlanes(e.positionWC, this.orientationData, 0, e.frustum, a); let t = new Cesium.Cartesian3; for (let e = 12; e < a.length; e += 3)t.x += a[e], t.y += a[e + 1], t.z += a[e + 2]; Cesium.Cartesian3.multiplyByScalar(t, .25, t), this.position = t } this.videoCenter = this.position, this.position = null, this.viewShadowMap = new Cesium.ShadowMap({ lightCamera: e, enabled: !1, isPointLight: !1, isSpotLight: !0, cascadesEnabled: !1, context: this._viewer.scene.context, pointLightRadius: this.far }), this.viewShadowMap.guid = Cesium.createGuid() }, nr.prototype.flyTo = function () { var e; this.viewShadowMap && this.viewShadowMap._lightCamera && (e = this.viewShadowMap._lightCamera, this._viewer.camera.flyTo({ destination: e.position, orientation: { heading: e.heading, pitch: e.pitch, roll: 0 } })) }, nr.prototype.updatePost = function (e) { e.cameraPosition && (this.cameraPosition = e.cameraPosition instanceof Cesium.Cartesian3 ? e.cameraPosition : Cesium.Cartesian3.fromDegrees(e.cameraPosition.lon, e.cameraPosition.lat, e.cameraPosition.height)), e.position && (this.position = e.position instanceof Cesium.Cartesian3 ? e.position : Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), isNaN(e.heading) || "number" != typeof e.heading || (this.heading = e.heading), isNaN(e.pitch) || "number" != typeof e.pitch || (this.pitch = e.pitch), isNaN(e.alpha) || "number" != typeof e.alpha || (this.alpha = e.alpha), isNaN(e.horizonAngle) || "number" != typeof e.horizonAngle || (this.horizonAngle = e.horizonAngle, this.angle.x = this.horizonAngle / 2), isNaN(e.verticalAngle) || "number" != typeof e.verticalAngle || (this.verticalAngle = e.verticalAngle, this.angle.y = this.verticalAngle / 2), isNaN(e.near) || "number" != typeof e.near || (this.near = e.near, this.nearAndFar.x = this.near), isNaN(e.far) || "number" != typeof e.far || (this.far = e.far, this.nearAndFar.y = this.far), isNaN(e.offset) || "number" != typeof e.offset || (this.nearAndFar.w = e.offset, this.offset = e.offset), isNaN(e.alpha) || "number" != typeof e.alpha || (this.nearAndFar.z = e.alpha, this.alpha = e.alpha), isNaN(e.showFarScale) || "number" != typeof e.showFarScale || (this.showFarScale = e.showFarScale), void 0 !== e.useLine && (this.useLine = e.useLine), this._createShadowMap(), this.createViewCone() }, nr.prototype.update = function (e) { var t; this.viewShadowMap && this.show && (t = this.isShow(), this.post && (this.post.enabled = t), this.line && (this.line.show = t), t && this._viewer.scene.frameState.shadowMaps.push(this.viewShadowMap)) }, nr.prototype.setVisibility = function (e) { this.show = e, this.post && (this.post.enabled = e), this.line && (this.line.show = e) }, nr.prototype.destroy = function () { return this.post && (this._viewer.scene.postProcessStages.remove(this.post), this.post.destroy(), this.post = void 0), this.texture && (this.texture.destroy(), this.texture = void 0), this._viewer.scene.primitives.remove(this), this.shadowMaps && this.shadowMaps.destroy(), this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), Cesium.destroyObject(this) }, nr.prototype.setSpHeight = function (e, t = 5e3) { let i = Cesium.Cartographic.fromCartesian(e); return i.height += t, Cesium.Cartographic.toCartesian(i) }, nr.prototype.changeHorizonAngle = function (e) { this.updatePost({ horizonAngle: parseFloat(e) }) }, nr.prototype.changeVerticalAngle = function (e) { this.updatePost({ verticalAngle: parseFloat(e) }) }, nr.prototype.changeRotateAngle = function (e) { this.updatePost({ angleZ: parseFloat(e) }) }, ar.prototype.createViewCone = function (s, l) { s = s || {}, s = this._core.extend({ roll: 0, fov: 60, near: 1, height: 1.6, fillColor: "rgba(0,255,0,0.1)", outlineColor: "rgba(0,255,0,1)" }, s, !0), this._option = s, this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw); let c = this, u = this._viewer, h = (this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), this.drawHandler = new this._cesium.ScreenSpaceEventHandler(u.scene.canvas), V.states = 1, []); return this.drawHandler.setInputAction(t => { var e, i, o, r, n, a, t = c._getPosition.getMousePosition(t); if (t) { if (0 === h.length) { if (s.height) { let e = c._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 c.drawHandler.destroy(), c.drawHandler = void 0, c.tooltip.show(!1), setTimeout(function () { V.states = 0 }, 100), c._core.mouse(c._viewer.container, 0, "0"), l && "function" == typeof l && l(c.item, h); c.item || (c.viewConeCamera = new Cesium.Camera(u.scene), t = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1], h[0], new Cesium.Cartesian3), new Cesium.Cartesian3), c.viewConeCamera.position = h[0], c.viewConeCamera.direction = t, c.viewConeCamera.frustum.fov = Cesium.Math.toRadians(s.fov), c.viewConeCamera.frustum.near = s.near, c.viewConeCamera.frustum.far = 1, n = new Cesium.Cartesian3, a = new Cesium.Matrix3, e = new Cesium.Quaternion, i = c.viewConeCamera.positionWC, o = c.viewConeCamera.upWC, r = c.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 && (c._planesPrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: i, orientation: a, frustum: c.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 })), c._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: i, orientation: a, frustum: c.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 }), c.item = new Cesium.PrimitiveCollection, c._viewer.scene.primitives.add(c.item), c._outlinePrimitive && c.item.add(c._outlinePrimitive), c._planesPrimitive && c.item.add(c._planesPrimitive)) } }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { var t; 0 < h.length ? (c.tooltip.showAt(e.endPosition, "再次点击结束绘制"), (t = c._getPosition.getMousePosition(e)) && (h[1] = t, c.viewConeCamera.direction = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(h[1], h[0], new Cesium.Cartesian3), new Cesium.Cartesian3), c.updata({ heading: Cesium.Math.toDegrees(c.viewConeCamera.heading), pitch: Cesium.Math.toDegrees(c.viewConeCamera.pitch), far: c._core.getSpaceDistancem(h, Cesium) }))) : c.tooltip.showAt(e.endPosition, "点击开始绘制") }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, ar.prototype.addViewCone = function (e) { var t = { position: this._viewer.camera.position.clone(), heading: 0, pitch: 0, roll: 0, fov: 60, near: 1, far: 60, fillColor: "rgba(0,255,0,0.1)", outlineColor: "rgba(0,255,0,1)" }, t = ((e = e || {}).position && e.position.lon && (e.position = Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), e = this._core.extend(t, e, !0), this.viewConeCamera = new Cesium.Camera(this._viewer.scene), this.viewConeCamera.setView({ destination: e.position, orientation: { heading: Cesium.Math.toRadians(e.heading), pitch: Cesium.Math.toRadians(e.pitch), roll: Cesium.Math.toRadians(e.roll) } }), this.viewConeCamera.frustum.fov = Cesium.Math.toRadians(e.fov), this.viewConeCamera.frustum.near = e.near, this.viewConeCamera.frustum.far = e.far, new Cesium.Cartesian3), i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = this.viewConeCamera.positionWC, n = this.viewConeCamera.directionWC, a = this.viewConeCamera.upWC, s = this.viewConeCamera.rightWC, s = Cesium.Cartesian3.negate(s, t), t = i, i = (Cesium.Matrix3.setColumn(t, 0, s, t), Cesium.Matrix3.setColumn(t, 1, a, t), Cesium.Matrix3.setColumn(t, 2, n, t), Cesium.Quaternion.fromRotationMatrix(t, o)); return e.fill && (this._planesPrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, flat: !0 }), asynchronous: !1, allowPicking: !1 })), this._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._option = e, this.item = new Cesium.PrimitiveCollection, this._viewer.scene.primitives.add(this.item), this._outlinePrimitive && this.item.add(this._outlinePrimitive), this._planesPrimitive && this.item.add(this._planesPrimitive), this }, ar.prototype.updata = function (e) { (e = e || {}).position && e.position.lon && (e.position = Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), e = this._core.extend(this._option, e, !0), this._outlinePrimitive && this._outlinePrimitive.destroy(), this._planesPrimitive && this._planesPrimitive.destroy(), this.item.removeAll(), this.viewConeCamera.setView({ destination: e.position, orientation: { heading: Cesium.Math.toRadians(e.heading), pitch: Cesium.Math.toRadians(e.pitch), roll: Cesium.Math.toRadians(e.roll) } }), this.viewConeCamera.frustum.fov = Cesium.Math.toRadians(e.fov), this.viewConeCamera.frustum.near = e.near, this.viewConeCamera.frustum.far = e.far; var t = new Cesium.Cartesian3, i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = this.viewConeCamera.positionWC, n = this.viewConeCamera.directionWC, a = this.viewConeCamera.upWC, s = this.viewConeCamera.rightWC, s = Cesium.Cartesian3.negate(s, t), t = i, i = (Cesium.Matrix3.setColumn(t, 0, s, t), Cesium.Matrix3.setColumn(t, 1, a, t), Cesium.Matrix3.setColumn(t, 2, n, t), Cesium.Quaternion.fromRotationMatrix(t, o)); e.fill && (this._planesPrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.fillColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !0, flat: !0 }), asynchronous: !1, allowPicking: !1 })), this._outlinePrimitive = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry({ origin: r, orientation: i, frustum: this.viewConeCamera.frustum }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString(e.outlineColor)) }, id: e.id }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._option = e, this.item.add(this._outlinePrimitive), this._planesPrimitive && this.item.add(this._planesPrimitive) }, ar.prototype.destroy = function () { return this._outlinePrimitive && this._outlinePrimitive.destroy(), this._planesPrimitive && this._planesPrimitive.destroy(), this.item && this._viewer.scene.primitives.removeAndDestroy(this.item), Cesium.destroyObject(this) }, sr.prototype.createViewshed = function (i = {}) { i.alpha = this._core.defaultValue(i.alpha, .5), i.horizonAngle = this._core.defaultValue(i.horizonAngle, 60), i.verticalAngle = this._core.defaultValue(i.verticalAngle, 60); let o = new ar(this._viewer, Cesium); return o.createViewCone({ height: this._core.defaultValue(i.height, 1.7) }, (e, t) => { this.ShadowPostProcess = new nr(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 }, sr.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 nr(this._viewer, { showFarScale: 6, viewshed: { visible: e.visible, unvisible: e.unvisible }, ...e }), this }, sr.prototype.updateViewshed = function (e) { this.ShadowPostProcess.updatePost(e) }, sr.prototype.destroy = function () { this.ShadowPostProcess && this.ShadowPostProcess.destroy(), this.ShadowPostProcess = null }, sr.prototype.changeHorizonAngle = function (e) { this.ShadowPostProcess && this.ShadowPostProcess.changeHorizonAngle(e) }, sr.prototype.changeVerticalAngle = function (e) { this.ShadowPostProcess && this.ShadowPostProcess.changeVerticalAngle(e) }, lr.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) }, lr.prototype.clear = function () { this.postProccessStage && this._viewer.scene.postProcessStages.remove(this.postProccessStage) }; const ur = `
vec3 packNormalToRGB( const in vec3 normal ) {
   return normalize( normal ) * 0.5 + 0.5;
}
@@ -152,10 +187,13 @@
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
   return ( near * far ) / ( ( far - near ) * invClipZ - far );
}
`,hr="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 mr(e){const{defaultValue:r,BoundingRectangle:i,Pass:H,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:U,sampler:z,viewportScale:l,shaderRedefine:T,overrideViewport:c}=e,S="renderPass_"+N.replace(/[\.\\\/\-]/g,"_"),E=`czm_non_${S}_main`,P=`czm_${S}_main`,C="_cache_"+S,x=S+"Command",D=null,u=null,I=null,A=null,L,M=new t({color:h.TRANSPARENT,depth:1}),R=new i,O=this;if(c&&i.clone(c,R),T=T||"add",_=_||"all",(o=o||1)<0||8<o)throw new Cesium.DeveloperError("CesiumRenderPass:textureScale必须大于0小于等于8");function W(t,i,o,r){var n=t.shaderCache.getDerivedShaderProgram(i,S);if(!v(n)){var a=i._attributeLocations,s=i.fragmentShaderSource,l=i.vertexShaderSource,c=i._vertexShaderText,u=(C=s.sources).length;let e=!!A&&function(){if(A){var e=A.selected||A.parentSelected;if(e.length)return e}}();var h=hr,m=/texture2D\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(o),o=(h+="varying"!=r||m?`
`, hr = "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 mr(e) {
        const { defaultValue: r, BoundingRectangle: i, Pass: H, 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: U, sampler: z, viewportScale: l, shaderRedefine: T, overrideViewport: c } = e, S = "renderPass_" + N.replace(/[\.\\\/\-]/g, "_"), E = `czm_non_${S}_main`, P = `czm_${S}_main`, C = "_cache_" + S, x = S + "Command", D = null, u = null, I = null, A = null, L, M = new t({ color: h.TRANSPARENT, depth: 1 }), R = new i, O = this; if (c && i.clone(c, R), T = T || "add", _ = _ || "all", (o = o || 1) < 0 || 8 < o) throw new Cesium.DeveloperError("CesiumRenderPass:textureScale必须大于0小于等于8"); function W(t, i, o, r) {
            var n = t.shaderCache.getDerivedShaderProgram(i, S); if (!v(n)) {
                var a = i._attributeLocations, s = i.fragmentShaderSource, l = i.vertexShaderSource, c = i._vertexShaderText, u = (C = s.sources).length; let e = !!A && function () { if (A) { var e = A.selected || A.parentSelected; if (e.length) return e } }(); var h = hr, m = /texture2D\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(o), o = (h += "varying" != r || m ? `
bool czm_selected(){ 
    return czm_selected(${o}); 
}`:`
}`: `
varying float me_isSelected;
bool czm_selected(){
    bool isSelected= me_isSelected>0.0000001;
@@ -164,16 +202,25 @@
    }
    return isSelected;
}
    `,hr+`
    `, hr + `
varying float me_isSelected;
bool czm_selected(){
    return czm_selected(${o});
}
`),d=!1,p=!1;if(/attribute\s?vec3\s?normal\s?;/.test(c)||/\n\s?vec3\s?normal\s?;/.test(c)?d=!0:/varying\s?vec3\s?v_normal\s?;/.test(c)&&(p=!0),b){var g=!1;for(_=0;_<u;++_)if(/vec4\s?packDepthToRGBA\s?\(/.test(C[_])){g=!0;break}for(var c=(g?"":ur)+(e?h:"")+y.replaceMain(b,P)+"void main() \n{ \n"+("replace"!=T?`    ${E}();
`:"")+`    ${P}();
`+"} \n",f=new Array(u+1),_=0;_<u;++_)f[_]=y.replaceMain(C[_],E);f[u]=c,d?s.defines.push("HAS_NORMAL"):p&&s.defines.push("HAS_V_NORMAL"),s=new y({sources:f,defines:s.defines})}if(w||b){var C,u=(C=l.sources).length,g=!1;for(_=0;_<u;++_)if(/vec4\s?packDepthToRGBA\s?\(/.test(C[_])){g=!0;break}e=e&&"varying"==r&&!m,d?l.defines.push("HAS_NORMAL"):p&&l.defines.push("HAS_V_NORMAL");for(h=(g?"":ur)+(e?o:"")+y.replaceMain(w||"void main(){}",P)+"void main() \n{ \n"+("replace"!=T?`    ${E}();
`:"")+(e?"    me_isSelected=czm_selected()?1.:0.;\n":"")+`    ${P}();
`+"} \n",f=new Array(u+1),_=0;_<u;++_)f[_]=y.replaceMain(C[_],E);f[u]=h,l=new y({sources:f,defines:l.defines})}n=t.shaderCache.createDerivedShaderProgram(i,S,{vertexShaderSource:l,fragmentShaderSource:s,attributeLocations:a})}return n}function Y(t,i,o){let r=t;var n,a,s=i._frameState,l=t.derivedCommands;if(v(l)){let e=(l=(t=s.useLogDepth&&v(l.logDepth)?l.logDepth.command:t).derivedCommands).renderPass;v(l.renderPass)||(e=l.renderPass={}),v(e[x])&&(n=e[x].shaderProgram,a=e[x].renderState),e[x]=G.shallowClone(t,e[x]),v(n)&&e.shaderProgramId===t.shaderProgram.id?(e[x].shaderProgram=n,e[x].renderState=a):(s=t.shaderProgram,l=r._pickIdQualifier=new RegExp("uniform\\s?vec4\\s?"+t.pickId,"g").test(s._fragmentShaderText)?"uniform":"varying",e[x].shaderProgram=W(o,s,t.pickId,l),e[x].renderState=(n=i,a=t.renderState,n._renderPassCache=n._renderPassCache||{},n._renderPassCache[C]=n._renderPassCache[C]||{},o=(n=n._renderPassCache[C])[a.id],v(o)||(s=m.getState(a),"function"==typeof g&&g.call(O,s),o=m.fromCache(s),n[a.id]=o),o),e.shaderProgramId=t.shaderProgram.id);var c,u=e[x].uniformMap;if(!u.__created&&(u.czm_selectedIdTexture=function(){return A._selectedIdTexture},u.czm_selectedIdTextureWidth=function(){return A._selectedIdTexture?A._selectedIdTexture.width:0},u.czm_selectedIdTextureStep=function(){return A._selectedIdTexture?1/A._selectedIdTexture.width:-1},p))for(var h in u.__created=!0,p)p.hasOwnProperty(h)&&("function"!=typeof p[h]?u[h]=function(t){return function(){var e=p[t];return"function"==typeof e?e():e}}(h):u[h]=p[h],("string"==typeof(c=u[h]())||c instanceof d||c instanceof HTMLImageElement||c instanceof HTMLCanvasElement||c instanceof HTMLVideoElement)&&(u[h+"Dimensions"]=function(t,i){return function(){var e=t[i]();if(v(e))return e.dimensions}}(u,h)))}}function B(e,t,i){var o=t.width,t=t.height;u&&u.width===o&&u.height===t&&i===L||(L=i,u&&(u.destroy(),D.destroy(),D=void 0,u=void 0),I&&(I.destroy(),I=void 0),u=new d({context:e,width:o,height:t,pixelFormat:r(j,s.RGBA),pixelDatatype:r(U,a.FLOAT),sampler:r(z,n.NEAREST)}),I=new d({context:e,width:o,height:t,pixelFormat:s.DEPTH_COMPONENT,pixelDatatype:a.UNSIGNED_SHORT,sampler:n.NEAREST}),D=new k({colorTextures:[u],context:e,destroyAttachments:!1,depthTexture:I}))}function V(e){c||(R=i.clone(e.viewport,R),l?(R.x=R.width*l.x,R.y=R.height*l.y,R.width*=l.width,R.height*=l.height):(R.width*=o,R.height*=o));let t=Object.assign({},e.passState);return t.viewport=R,t}function F(e,t){var i=e._us._frameState.camera._scene,o=i._view;try{if(w||b){for(var r,n=V(o),a=("function"==typeof f&&f.call(O,i,t),B(e,R,i.hdr,o.sceneFramebuffer),i),s=a._view.frustumCommandsList,l=s.length,c=0;c<l;++c)for(var u=s[l-c-1],h=0;h<u.commands.length;h++){var m=u.commands[h],d=u.indices[h];if(!A||h!=H.GLOBE)for(r=0;r<d;++r)Y(m[r],a,a._context)}cr(e,D,n,"renderPass",x,"all"!=_&&A&&A._selectedIdTexture?J:null)}else{var p=V(o);"function"==typeof f&&f.call(O,i,t),B(e,R,i.hdr,o.sceneFramebuffer),cr(e,D,p)}}catch(e){console.error(e)}}function J(e,t){var i=A&&(A.selected||A.parentSelected);if(!A||!i||!i.length)return!1;if(!e.pickId||"uniform"!=e._pickIdQualifier)return!0;let o=!0,r=e.owner;var n="selected"==_;if(r&&r.isObject3D){for(let e=0;e<i.length;e++)if(i[e]==r)return n;return!n}let a=e.uniformMap;if(a[e.pickId]){var s=a[e.pickId]();o=!n;for(let e=0;e<i.length;e++){var l=i[e],c=l.pickId?[l.pickId]:l.pickIds||l._pickIds;for(let e=0;e<c.length;e++){var u=c[e];if(u.color==s||h.equals(u.color,s))return n}}}return o}function K(e){var t;D&&(t=e._us._frameState.camera._scene._view,M.framebuffer=D,M.execute(e,t.passState),M.framebuffer=void 0)}this.update=F,this.clear=K,Object.defineProperties(this,{texture:{get(){return u}},depthTexture:{get(){return I}},stage:{get(){return A},set(e){if(A!=e)if(A&&O.prevStageUpdate&&(A.update=O.prevStageUpdate,O.prevStageUpdate=null,O.prevStageExecute=null),A=e){let o=A.update;O.prevStageUpdate=o,A.update=function(e,t){var i;K(e),o.call(A,e,t),A.enabled&&(!w&&!b||(i=A.selected||A.parentSelected)&&i.length)&&F(e,t)}}}}})}function dr(e){this._viewer=e,this._core=new f}function pr(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new f,this.tooltip=this._core.CreateTooltip(),this._getPosition=new y(e),this.FlattenIsDraw=!1,this.wallArr=[],this.heightsort=[],this.FlattenPolygon=[],this.showWall=!0,this.deepth=100,this.bottomImg=window.SmartEarthRootUrl+I.bottomplane,this.wallImg=window.SmartEarthRootUrl+I.wall}function gr(e,t){this._viewer=e,this._cesium=t,this._scene=e.scene,this._core=new f,this.currentSpeed="1x",this.currentTime=null,this.currentPlayMode="1",this.timer=null}function fr(e,t){this._viewer=e,this._cesium=t}function _r(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._getPosition=new y(e)}function Cr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._getPosition=new y(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.sunshineOption={},this.loadingImg=window.SmartEarthRootUrl+I.loading}dr.prototype.createEdgeStage=function(e={}){this.clear();var t="OutlineEffect";const{PostProcessStage:i,PostProcessStageComposite:o,Sampler:r,TextureMagnificationFilter:n,TextureMinificationFilter:a}=Cesium;let s=this._core.defaultValue(e.width,2),l=this._core.defaultValue(e.thresholdAngle,10)*Math.PI/180,c=!1,u=!1,h=Cesium.Color.fromCssColorString(e.visibleColor||"#00a8e0"),m=Cesium.Color.fromCssColorString(e.hiddenColor||"#4d4d4d"),d=this._core.defaultValue(e.showGlow,!0),p=this._core.defaultValue(e.edgeGlow,1),g=3,f=!1,_=new mr({name:t+"Pass",vertexShader:`
`), d = !1, p = !1; if (/attribute\s?vec3\s?normal\s?;/.test(c) || /\n\s?vec3\s?normal\s?;/.test(c) ? d = !0 : /varying\s?vec3\s?v_normal\s?;/.test(c) && (p = !0), b) {
                    var g = !1; for (_ = 0; _ < u; ++_)if (/vec4\s?packDepthToRGBA\s?\(/.test(C[_])) { g = !0; break } for (var c = (g ? "" : ur) + (e ? h : "") + y.replaceMain(b, P) + "void main() \n{ \n" + ("replace" != T ? `    ${E}();
`: "") + `    ${P}();
`+ "} \n", f = new Array(u + 1), _ = 0; _ < u; ++_)f[_] = y.replaceMain(C[_], E); f[u] = c, d ? s.defines.push("HAS_NORMAL") : p && s.defines.push("HAS_V_NORMAL"), s = new y({ sources: f, defines: s.defines })
                } if (w || b) {
                    var C, u = (C = l.sources).length, g = !1; for (_ = 0; _ < u; ++_)if (/vec4\s?packDepthToRGBA\s?\(/.test(C[_])) { g = !0; break } e = e && "varying" == r && !m, d ? l.defines.push("HAS_NORMAL") : p && l.defines.push("HAS_V_NORMAL"); for (h = (g ? "" : ur) + (e ? o : "") + y.replaceMain(w || "void main(){}", P) + "void main() \n{ \n" + ("replace" != T ? `    ${E}();
`: "") + (e ? "    me_isSelected=czm_selected()?1.:0.;\n" : "") + `    ${P}();
`+ "} \n", f = new Array(u + 1), _ = 0; _ < u; ++_)f[_] = y.replaceMain(C[_], E); f[u] = h, l = new y({ sources: f, defines: l.defines })
                } n = t.shaderCache.createDerivedShaderProgram(i, S, { vertexShaderSource: l, fragmentShaderSource: s, attributeLocations: a })
            } return n
        } function Y(t, i, o) { let r = t; var n, a, s = i._frameState, l = t.derivedCommands; if (v(l)) { let e = (l = (t = s.useLogDepth && v(l.logDepth) ? l.logDepth.command : t).derivedCommands).renderPass; v(l.renderPass) || (e = l.renderPass = {}), v(e[x]) && (n = e[x].shaderProgram, a = e[x].renderState), e[x] = G.shallowClone(t, e[x]), v(n) && e.shaderProgramId === t.shaderProgram.id ? (e[x].shaderProgram = n, e[x].renderState = a) : (s = t.shaderProgram, l = r._pickIdQualifier = new RegExp("uniform\\s?vec4\\s?" + t.pickId, "g").test(s._fragmentShaderText) ? "uniform" : "varying", e[x].shaderProgram = W(o, s, t.pickId, l), e[x].renderState = (n = i, a = t.renderState, n._renderPassCache = n._renderPassCache || {}, n._renderPassCache[C] = n._renderPassCache[C] || {}, o = (n = n._renderPassCache[C])[a.id], v(o) || (s = m.getState(a), "function" == typeof g && g.call(O, s), o = m.fromCache(s), n[a.id] = o), o), e.shaderProgramId = t.shaderProgram.id); var c, u = e[x].uniformMap; if (!u.__created && (u.czm_selectedIdTexture = function () { return A._selectedIdTexture }, u.czm_selectedIdTextureWidth = function () { return A._selectedIdTexture ? A._selectedIdTexture.width : 0 }, u.czm_selectedIdTextureStep = function () { return A._selectedIdTexture ? 1 / A._selectedIdTexture.width : -1 }, p)) for (var h in u.__created = !0, p) p.hasOwnProperty(h) && ("function" != typeof p[h] ? u[h] = function (t) { return function () { var e = p[t]; return "function" == typeof e ? e() : e } }(h) : u[h] = p[h], ("string" == typeof (c = u[h]()) || c instanceof d || c instanceof HTMLImageElement || c instanceof HTMLCanvasElement || c instanceof HTMLVideoElement) && (u[h + "Dimensions"] = function (t, i) { return function () { var e = t[i](); if (v(e)) return e.dimensions } }(u, h))) } } function B(e, t, i) { var o = t.width, t = t.height; u && u.width === o && u.height === t && i === L || (L = i, u && (u.destroy(), D.destroy(), D = void 0, u = void 0), I && (I.destroy(), I = void 0), u = new d({ context: e, width: o, height: t, pixelFormat: r(j, s.RGBA), pixelDatatype: r(U, a.FLOAT), sampler: r(z, n.NEAREST) }), I = new d({ context: e, width: o, height: t, pixelFormat: s.DEPTH_COMPONENT, pixelDatatype: a.UNSIGNED_SHORT, sampler: n.NEAREST }), D = new k({ colorTextures: [u], context: e, destroyAttachments: !1, depthTexture: I })) } function V(e) { c || (R = i.clone(e.viewport, R), l ? (R.x = R.width * l.x, R.y = R.height * l.y, R.width *= l.width, R.height *= l.height) : (R.width *= o, R.height *= o)); let t = Object.assign({}, e.passState); return t.viewport = R, t } function F(e, t) { var i = e._us._frameState.camera._scene, o = i._view; try { if (w || b) { for (var r, n = V(o), a = ("function" == typeof f && f.call(O, i, t), B(e, R, i.hdr, o.sceneFramebuffer), i), s = a._view.frustumCommandsList, l = s.length, c = 0; c < l; ++c)for (var u = s[l - c - 1], h = 0; h < u.commands.length; h++) { var m = u.commands[h], d = u.indices[h]; if (!A || h != H.GLOBE) for (r = 0; r < d; ++r)Y(m[r], a, a._context) } cr(e, D, n, "renderPass", x, "all" != _ && A && A._selectedIdTexture ? J : null) } else { var p = V(o); "function" == typeof f && f.call(O, i, t), B(e, R, i.hdr, o.sceneFramebuffer), cr(e, D, p) } } catch (e) { console.error(e) } } function J(e, t) { var i = A && (A.selected || A.parentSelected); if (!A || !i || !i.length) return !1; if (!e.pickId || "uniform" != e._pickIdQualifier) return !0; let o = !0, r = e.owner; var n = "selected" == _; if (r && r.isObject3D) { for (let e = 0; e < i.length; e++)if (i[e] == r) return n; return !n } let a = e.uniformMap; if (a[e.pickId]) { var s = a[e.pickId](); o = !n; for (let e = 0; e < i.length; e++) { var l = i[e], c = l.pickId ? [l.pickId] : l.pickIds || l._pickIds; for (let e = 0; e < c.length; e++) { var u = c[e]; if (u.color == s || h.equals(u.color, s)) return n } } } return o } function K(e) { var t; D && (t = e._us._frameState.camera._scene._view, M.framebuffer = D, M.execute(e, t.passState), M.framebuffer = void 0) } this.update = F, this.clear = K, Object.defineProperties(this, { texture: { get() { return u } }, depthTexture: { get() { return I } }, stage: { get() { return A }, set(e) { if (A != e) if (A && O.prevStageUpdate && (A.update = O.prevStageUpdate, O.prevStageUpdate = null, O.prevStageExecute = null), A = e) { let o = A.update; O.prevStageUpdate = o, A.update = function (e, t) { var i; K(e), o.call(A, e, t), A.enabled && (!w && !b || (i = A.selected || A.parentSelected) && i.length) && F(e, t) } } } } })
    } function dr(e) { this._viewer = e, this._core = new f } function pr(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this.tooltip = this._core.CreateTooltip(), this._getPosition = new y(e), this.FlattenIsDraw = !1, this.wallArr = [], this.heightsort = [], this.FlattenPolygon = [], this.showWall = !0, this.deepth = 100, this.bottomImg = window.SmartEarthRootUrl + I.bottomplane, this.wallImg = window.SmartEarthRootUrl + I.wall } function gr(e, t) { this._viewer = e, this._cesium = t, this._scene = e.scene, this._core = new f, this.currentSpeed = "1x", this.currentTime = null, this.currentPlayMode = "1", this.timer = null } function fr(e, t) { this._viewer = e, this._cesium = t } function _r(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new y(e) } function Cr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._getPosition = new y(this._viewer, this._cesium), this.tooltip = this._core.CreateTooltip(), this.sunshineOption = {}, this.loadingImg = window.SmartEarthRootUrl + I.loading } dr.prototype.createEdgeStage = function (e = {}) {
        this.clear(); var t = "OutlineEffect"; const { PostProcessStage: i, PostProcessStageComposite: o, Sampler: r, TextureMagnificationFilter: n, TextureMinificationFilter: a } = Cesium; let s = this._core.defaultValue(e.width, 2), l = this._core.defaultValue(e.thresholdAngle, 10) * Math.PI / 180, c = !1, u = !1, h = Cesium.Color.fromCssColorString(e.visibleColor || "#00a8e0"), m = Cesium.Color.fromCssColorString(e.hiddenColor || "#4d4d4d"), d = this._core.defaultValue(e.showGlow, !0), p = this._core.defaultValue(e.edgeGlow, 1), g = 3, f = !1, _ = new mr({
            name: t + "Pass", vertexShader: `
        varying vec3 vOutlineNormal;
        void main(){
            #ifdef HAS_NORMAL
@@ -186,13 +233,15 @@
                #endif
            #endif
        }
        `,fragmentShader:`
        `, fragmentShader: `
        varying vec3 vOutlineNormal;
        void main(){
        //    if(!czm_selected())discard; 
            if(length(vOutlineNormal)>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 c},showOutlineOnly:function(){return u},visibleEdgeColor:function(){return h},hiddenEdgeColor:function(){return m},maskTexture(){return _.texture},maskDepthTexture(){return _.depthTexture}},fragmentShader:`
        `, 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 c }, showOutlineOnly: function () { return u }, visibleEdgeColor: function () { return h }, hiddenEdgeColor: function () { return m }, maskTexture() { return _.texture }, maskDepthTexture() { return _.depthTexture } }, fragmentShader: `
        uniform sampler2D colorTexture;
        uniform vec2 colorTextureDimensions;
        uniform sampler2D depthTexture;
@@ -288,7 +337,8 @@
                 //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:`
        `}), 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;
@@ -324,7 +374,10 @@
                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 u},set(e){u=e}},edgeOnly:{get(){return f},set(e){f=e}},useSingleColor:{get(){return c},set(e){c=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},dr.prototype.createBlurStage=function(e,t,i,o){const{Cartesian2:r,PostProcessStage:n,PostProcessStageComposite:a,PostProcessStageSampleMode:s}=Cesium;var l=new r(1,0),c=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:c},sampleMode:s.LINEAR});return new a({name:e,stages:[l,t],inputPreviousStageTexture:!0})},dr.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},dr.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage),this.postProccessStage=void 0},pr.prototype.draw=function(e=100,t={},i){if(!this.FlattenIsDraw){if(this.deepth=e||this.deepth,this.showWall=this._core.defaultValue(t.showWall,!0),this.showBottom=this._core.defaultValue(t.showBottom,!0),t.positions)this.create(t.positions),"function"==typeof i&&i();else{this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.FlattenIsDraw=!0;var o,r,n=this._viewer,a=this._cesium,s=(this.clear(),[]),l=[],c=0,u=(this.drawHandler=new a.ScreenSpaceEventHandler(n.scene.canvas),this.tooltip);let t;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this.drawHandler.setInputAction(e=>{r=this._getPosition.getMousePosition(e.position);e=this._core.toDegrees(r);s.push(r),l.push(e.lon,e.lat,e.height),0===c?(s.push(r),l.push(e.lon,e.lat,e.height),t=n.entities.add({name:"临时线",polyline:{positions:new a.CallbackProperty(()=>s,!1),clampToGround:!0,material:new a.ColorMaterialProperty(a.Color.YELLOW.withAlpha(.3)),width:3}})):1===c&&(t&&n.entities.remove(t),o=n.entities.add({name:null,polygon:{hierarchy:new a.CallbackProperty(function(){return new a.PolygonHierarchy(a.Cartesian3.fromDegreesArrayHeights(l))},!1),material:a.Color.YELLOW.withAlpha(.3)}})),c++},a.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(e=>{0===c?u.showAt(e.endPosition,"左键点击开始绘制点"):(1===c?u.showAt(e.endPosition,"点击添加第二个点"):u.showAt(e.endPosition,"右键结束绘制"),r=this._getPosition.getMousePosition(e.endPosition),e=this._core.toDegrees(r),l.splice(l.length-3,3),s.splice(s.length-1,1),s.push(r),l.push(e.lon,e.lat,e.height))},a.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(e){this.end&&this.end()}.bind(this),a.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{u.show(!1),this._core.mouse(this._viewer.container,0),this.drawHandler.destroy(),this.drawHandler=null,t&&n.entities.remove(t),o&&n.entities.remove(o),this.FlattenIsDraw=!1,this.end=void 0,"cancel"===e||s.length<3||(c<2?c=0:(c=0,this.create(l),"function"==typeof i&&i(l)))}}return this}},pr.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;e<t.length;e+=3)this.originHeight>t[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<i.length-1;e++)o=this._core.toDegrees(i[e]),r=this._core.toDegrees(i[e+1]),this.calculateWall(o.lon,o.lat,r.lon,r.lat)}this.groundClipping(i)},pr.prototype.groundClipping=function(e){var t=this._viewer.scene.globe,i=e.concat();i.splice(i.length-1,1);for(var o=0;o<i.length-1;o++)i[o].x===i[o+1].x&&i[o].y===i[o+1].y&&(i.splice(o,1),o--);for(var r=i.length,n=(this.PolygonIsClockwise(i)&&i.reverse(),[]),o=0;o<r;++o){var a=(o+1)%r,s=Cesium.Cartesian3.add(i[o],i[a],new Cesium.Cartesian3),s=Cesium.Cartesian3.multiplyByScalar(s,.5,s),l=Cesium.Cartesian3.normalize(s,new Cesium.Cartesian3),a=Cesium.Cartesian3.subtract(i[a],s,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(a,a),a=Cesium.Cartesian3.cross(a,l,new Cesium.Cartesian3),a=Cesium.Cartesian3.normalize(a,a),l=new Cesium.Plane(a,0),l=Cesium.Plane.getPointDistance(l,s);n.push(new Cesium.ClippingPlane(a,l))}this.clippingPlane=new Cesium.ClippingPlaneCollection({planes:n}),t.multiClippingPlanes?t.multiClippingPlanes.add(this.clippingPlane):t.multiClippingPlanes=new Cesium.MultiClippingPlaneCollection({collections:[this.clippingPlane],edgeWidth:1,edgeColor:Cesium.Color.WHITE})},pr.prototype.PolygonIsClockwise=function(e){if(3<=e.length)return!(0<(e[1].x-e[0].x)*(e[2].y-e[1].y)-(e[1].y-e[0].y)*(e[2].x-e[1].x))},pr.prototype.calculateWall=function(e,t,i,o){var r,n,a=Cesium.Math.lerp(e,i,.01)-e,s=Cesium.Math.lerp(t,o,.01)-t,l=[],c=[];l.push(e,t),n=Cesium.Cartesian3.fromDegrees(e,t),c.push(Cesium.Cartographic.fromCartesian(n));for(var u=0;u<100;u++){var h=e+(u+1)*a,m=t+(u+1)*s;l.push(h,m),n=Cesium.Cartesian3.fromDegrees(h,m),c.push(Cesium.Cartographic.fromCartesian(n))}l.push(i,o),n=Cesium.Cartesian3.fromDegrees(i,o),c.push(Cesium.Cartographic.fromCartesian(n));var d=[];this._core.getHeightsFromLonLat(this._viewer,c).then(e=>{if(e){for(r=e,u=0;u<r.length;u++)d.push(this.originHeight-this.deepth);this.createWall(l,r,d)}})},pr.prototype.createWall=function(e,t,i){e=this._viewer.entities.add({name:"地形开挖岩墙",wall:{positions:Cesium.Cartesian3.fromDegreesArray(e),maximumHeights:t,minimumHeights:i,material:new Cesium.ImageMaterialProperty({image:this.wallImg,repeat:new Cesium.Cartesian2(1,1)})}});this.wallArr.push(e)},pr.prototype.setDeepth=function(i){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-i),this.wallArr.forEach(e=>{let t=e.wall.minimumHeights.getValue();(t=Array(t.length)).fill(this.originHeight-i),e.wall.minimumHeights.setValue(t)})},pr.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})},pr.prototype.deleteObject=pr.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},gr.prototype.createAnalysis=function(){return this.shadows=!0,this.currentSpeed=1,this.currentPlayMode="1",this.Forword(),this},gr.prototype.setCurrentTime=function(e){e=new Date(e),e=this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=e.clone()},gr.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=28800+(i=(i=i.getTime())/1e3),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)},gr.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)},gr.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)},gr.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)},gr.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)},gr.prototype.Pause=function(){this._viewer.animation.viewModel.pauseViewModel.command()},Object.defineProperties(gr.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)}}}),fr.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()},fr.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:'<img src="'+o+'" style="height:100%;width:100%;">'})},_r.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,c;var e=i.limitTime?i.limitAngel:360;let u=i.time||30,h=(e||360)/u,m=function(){var e=Cesium.JulianDate.secondsDifference(o.clock.currentTime,o.clock.startTime);i.limitTime&&e>u?r.end&&r.end():(e=Cesium.Math.toRadians(e*h)+l,o.scene.camera.setView({destination:c,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=>{c=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:c,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},Cr.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)},Cr.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),V.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(){V.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},Cr.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),V.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(){V.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},Cr.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,c=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 u=this._viewer.clock.currentTime.clone();function h(){var t,e=n.getTime()+6e4*o*s,e=new Date(e);a<e?(l.createPoint(c),l._viewer.clock.currentTime=u,l.isLoading(!1),r&&"function"==typeof r&&r(c)):(t=function(e){var t=e;for(let e=0;e<c.length;e++)l.Sunshine(c[e],t)?c[e].through++:c[e].out++;s++,h()},l.SetTimeNow(e),setTimeout(()=>{var e=l._viewer.scene.context.uniformState.sunPositionWC;t(e)},100))}1500<(a-n)/(6e4*o)*c.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(c)}}):(l.isLoading(!0),h())},Cr.prototype.createPoint=function(e){this.ResultPoint=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);for(var t=0;t<e.length;t++){var i=e[t],o=e[t].through+e[t].out,o=e[t].out/o,r="",o=(.7<=o?r=this._cesium.Color.BLUE:o<.7&&.3<=o?r=this._cesium.Color.YELLOW:o<.3&&(r=this._cesium.Color.RED),{id:{isshowderData:!0,data:"阴影率:"+100*(1-o)+"%"},position:this._cesium.Cartesian3.fromDegrees(i.lon,i.lat,i.height),color:r});this.ResultPoint.add(o)}this.showResultTooltip(!0)},Cr.prototype.showResultTooltip=function(e){if(this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),e){let i=this;this.ResultTooltipHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let e;this.ResultTooltipHandler.setInputAction(function(t){clearTimeout(e),e=setTimeout(()=>{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)}},Cr.prototype.getPoint=function(e,t,i,o){for(var r=[],n=e.polygon.hierarchy.getValue().positions,a=0;a<n.length;a++){var s=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).longitude),l=this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).latitude);r.push(s),r.push(l)}for(var e=this.getTheBottomPoint(r),c=this.scanningPolygon(e,t,t,r),u=[],h=(o-i)/t,m=0;m<h;m++)for(var d=0;d<c.length;d++){var p=c[d],p={lon:p.lon,lat:p.lat,height:i+t*m,through:0,out:0,color:""};u.push(p)}return u},Cr.prototype.getTheBottomPoint=function(e){for(var t=90,i=0,o=1;o<e.length;o+=2)t=t<e[o]?t:(i=o)&&e[o];return{lon:e[i-1],lat:e[i]}},Cr.prototype.scanningPolygon=function(e,t,i,o){for(var r,n,a,s=[],l=180,c=-180,u=-90,h=0;h<o.length;h+=2)u=u>o[h+1]?u:o[h+1],l=l<o[h]?l:o[h],c=c>o[h]?c: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<=u;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<=c;n.lon+=m)this.IsInPolygon(n.lon,n.lat,o)&&s.push({lon:n.lon,lat:n.lat})}return s},Cr.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]},Cr.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<i.length-2;l+=2)o=i[l],n=i[l+1],r=i[l+2],a=i[l+3],(n<=t&&t<a||a<=t&&t<n)&&0<Math.abs(n-a)&&o-(o-r)*(n-t)/(n-a)<=e&&s++;return s%2!=0},Cr.prototype.SetTimeNow=function(e){e=new this._cesium.JulianDate.fromDate(e);this._viewer.clock.currentTime=e},Cr.prototype.Sunshine=function(e,t){e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height);return this.pickFromRay(e,t)},Cr.prototype.jiance=function(e,t){var i=!1,e=this._cesium.Cartographic.fromCartesian(e),t=this._cesium.Cartographic.fromCartesian(t),o={},r=(o.longitude=e.longitude/Math.PI*180,o.latitude=e.latitude/Math.PI*180,o.czheight=e.height,{});r.longitude=t.longitude/Math.PI*180,r.latitude=t.latitude/Math.PI*180,r.czheight=t.height;for(var n=0;n<20;n++){var a={},s=(a.longitude=this._cesium.Math.lerp(o.longitude,r.longitude,.01*(n+1)),a.latitude=this._cesium.Math.lerp(o.latitude,r.latitude,.01*(n+1)),a.czheight=o.czheight-.01*(o.czheight-r.czheight)*(n+1),new this._cesium.Cartographic(this._cesium.Math.toRadians(a.longitude),this._cesium.Math.toRadians(a.latitude),0)),s=this._viewer.scene.sampleHeight(s);this._cesium.Cartesian3.fromDegrees(a.longitude,a.latitude,s),a.zsheight=s,a.zsheight>a.czheight&&(i=!0)}return i},Cr.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},Cr.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)},Cr.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)},Cr.prototype.isLoading=function(e){this.loading.style.display=e?"block":"none"},Cr.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var yr,vr="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",wr="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 f,this._tree=V,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 br(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 f(e),this._getPosition=new y(this._viewer,this._cesium),this._tree=V,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 f(e),this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a",this._lang={draw_tip_left:"左键开始绘制!",draw_tip_right:"右键结束绘制!",draw_tip_click:"点击继续绘制!",draw_tip_cancel:"再次点击结束绘制,右键取消!",unit_m:"米",unit_km:"千米"}}function Tr(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 f(e),this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._points=[],this._polylines=[],this._lang={draw_tip_left:"左键开始绘制!",draw_tip_right:"右键结束绘制!",draw_tip_click:"点击继续绘制!",draw_tip_cancel:"再次点击结束绘制,右键取消!",unit_m:"米",unit_km:"千米"}}function Sr(e){this._viewer=e,this._scene=e.scene,this._core=new f(e),this._tooltip=this._core.CreateTooltip(),this._getPosition=new y(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 Er(e){this._viewer=e,this._core=new f,this.measureData=new Map}function Pr(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 xr(e,t,i){e=Pr(t,e)-Pr(t,i);return e<0&&(e+=360),e}function Dr(e){if(!e||e.length<3)return 0;for(var t=Math.PI/180,i=0,o=0;o<e.length;o++){var r=(o+1)%e.length,n=(o+2)%e.length;i+=xr(e[o],e[r],e[n])}var a=180*(e.length-2),s=i-a;return 420<s?s=(i=360*e.length-i)-a:300<s&&s<420&&(s=Math.abs(360-s)),s*t*6371e3*6371e3}function Ir(e,t){this._viewer=e,this._cesium=t}A.prototype.create3DTilesets=function(e,t,i,o,r,n,a){var t={url:t,preferLeaves:!0,skipLevelOfDetail:!0},s=("string"==typeof i.lightColor&&(u=i.lightColor.split(","),i.lightColor=new this._cesium.Cartesian3(u[0],u[1],u[2])),o.groundHeight=this._core.defaultValue(i.height,o.groundHeight),this._core.extend(t,i,!0)),l=(s.time&&(s.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),this.availability=s.availability),s.customShader=this.getCustomShader(o),new this._cesium.Cesium3DTileset(s)),c=((o.effects||o.snow)&&(l.enableModelExperimental=!0),this),u=s.id||c._core.getuid(),t=(l.id=u,l.Level=s.Level,c.item=l,o.flattenPositions&&(this.setFlatten(!0,{positions:o.flattenPositions}),void 0!==o.flattenHeight&&(this.flattenHeight=o.flattenHeight)),setTimeout(function(){i.flyTo&&c._viewer.flyTo(l);var e=c._viewer.scene.primitives.add(l);null!=o.maximumscreenspaceerror&&(l.maximumScreenSpaceError=o.maximumscreenspaceerror),null!=o.pointcloudshading&&(l.pointCloudShading.maximumAttenuation=c.checkZero(o.pointcloudshading.maximumattenuation),l.pointCloudShading.baseResolution=o.pointcloudshading.baseresolution,l.pointCloudShading.geometricErrorScale=o.pointcloudshading.geometricerrorscale,l.pointCloudShading.attenuation=o.pointcloudshading.attenuation,l.pointCloudShading.eyeDomeLighting=o.pointcloudshading.eyedomelighting,l.pointCloudShading.eyeDomeLightingStrength=o.eyeDomeLightingStrength,l.pointCloudShading.eyeDomeLightingRadius=o.eyeDomeLightingRadius);let t=l.readyPromise.then(function(e){null!=s.geometricError&&(e._geometricError=s.geometricError),null!=o.groundheight&&c.setHeight(o.groundheight),null!=o.groundHeight&&c.setHeight(o.groundHeight),o.groundCenter&&c.setPosition(o.groundCenter),c.boundingSphereCenter||(c.getCenter(),e=c._cesium.Cartographic.fromCartesian(c.boundingSphereCenter),c.modelEditData.lon=c._cesium.Math.toDegrees(e.longitude),c.modelEditData.lat=c._cesium.Math.toDegrees(e.latitude),c.modelEditData.height=e.height),(o.heading||o.pitch||o.roll)&&c.setEditData({roll:o.roll,pitch:o.pitch,heading:o.heading}),o.edit&&c.setEditData(o.edit),"function"==typeof a&&a(c)});t.catch&&t.catch(function(e){console.log(e)}),t.otherwise&&t.otherwise(function(e){console.log(e)}),l.Level&&(c.Level=0,c._viewer.scene.preRender.addEventListener(function(){c.isShow&&(c.Level=c._core.getLevel(c._viewer),c.Level>l.Level&&!l.show?l.show=!0:c.Level<l.Level&&l.show&&(l.show=!1))})),c.sd=e,n?c.isShow=!0:c.setVisibility(!1);e=c.setStyle(o);l.style=new c._cesium.Cesium3DTileStyle(e)}),{id:u,name:e=c._core.isnull(e)?"新建模型":e,checked:n,pId:c._core.isnull(r)?0:r,type:"3DTilesets",item:c});return c.setTreeobj(t),c._tree.insertGroupId(t,c._core.isnull(r)?0:r),this},A.prototype.setVisibility=function(e){this.isShow=e,this.item.show=e,this.item._availability&&!e?this.item._availability=void 0:this.availability&&e&&(this.item._availability=this.availability)},A.prototype.checkZero=function(e){e=parseFloat(e);return 0===e?void 0:e},A.prototype.getVisibility=function(){return this.item.show},A.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e.message)}},A.prototype.restore=function(){this.modelEditData={lon:0,lat:0,height:0,scale:1,heading:0,pitch:0,roll:0,rotate:!1,modelMatrix:this.modelEditData.modelMatrix,rootTransform:this.modelEditData.rootTransform,originalMatrix:this.modelEditData.originalMatrix};var e=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.modelEditData.lon=this._cesium.Math.toDegrees(e.longitude),this.modelEditData.lat=this._cesium.Math.toDegrees(e.latitude),this.modelEditData.height=e.height,this.item.modelMatrix=this.modelEditData.modelMatrix.clone(),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.item.modelMatrix=this.modelEditData.originalMatrix.clone():(this.item._root.transform=this.modelEditData.originalMatrix.clone(),this.modelEditData.rotate=!0),this.moveModelEnd&&(this.moveModelEnd(),this.moveModelEnd=void 0),this.rotatePointPosition=void 0,this.moveEndCenter=void 0},A.prototype.setHeight=function(e){var t,i;e=Number(e),isNaN(e)||null!=this.item&&null!=this.item.boundingSphere&&(this.boundingSphereCenter||this.getCenter(),i=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter),this.restore(),this.modelEditData.height=e,t=this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,0),i=this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,e),e=this._cesium.Cartesian3.subtract(i,t,new this._cesium.Cartesian3),this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(e))},A.prototype.setPosition=function(e,t){null!=this.item&&null!=this.item.boundingSphere&&e&&(this.boundingSphereCenter||this.getCenter(),this.setEditData({lon:e[0],lat:e[1],height:t?this.boundingSphereCenterHeight:e[2]}))},A.prototype.setEditData=function(e){var t,i;null!=this.item&&null!=this.item.boundingSphere&&(this.boundingSphereCenter||this.getCenter(),e&&(this.modelEditData=this._core.extend(this.modelEditData,e,!0)),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?(e=Cesium.Cartesian3.multiplyByScalar(this.boundingSphereCenter,-1,new Cesium.Cartesian3),e=Cesium.Matrix4.fromTranslation(e),t=this._cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),t=Cesium.Matrix4.fromTranslation(t),i=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.modelEditData.heading||0),Cesium.Math.toRadians(this.modelEditData.pitch||0),Cesium.Math.toRadians(this.modelEditData.roll||0)),i=Cesium.Matrix3.fromHeadingPitchRoll(i),i=Cesium.Matrix4.fromRotation(i,new Cesium.Matrix4),Cesium.Matrix4.multiply(i,e,e),Cesium.Matrix4.multiply(t,e,e),this.item.modelMatrix=e):(i=Cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),t=Cesium.Transforms.eastNorthUpToFixedFrame(i),e=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.modelEditData.heading||0),Cesium.Math.toRadians(this.modelEditData.pitch||0),Cesium.Math.toRadians(this.modelEditData.roll||0)),i=Cesium.Matrix3.fromHeadingPitchRoll(e),Cesium.Matrix4.multiplyByMatrix3(t,i,t),e=Cesium.Matrix4.fromUniformScale(this.modelEditData.scale),Cesium.Matrix4.multiply(t,e,t),this.item._root.transform=t))},A.prototype.getCenter=function(){var e;this.boundingSphereCenter||(e=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center),this.boundingSphereCenter=this.item.boundingSphere.center.clone(),this.boundingSphereCenterHeight=e.height,this.boundingSphereRadius=this.item.boundingSphere.radius,this.modelEditData.rootTransform=this.item._root.transform.clone(),this.modelEditData.modelMatrix=this.item.modelMatrix.clone(),this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY)?this.modelEditData.originalMatrix=this.item.modelMatrix.clone():(this.modelEditData.originalMatrix=this.item._root.transform.clone(),this.modelEditData.rotate=!0))},A.prototype.arge=function(e,t,i){var o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),e=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),t=Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2)),i=(Math.pow(o,2)+Math.pow(e,2)-Math.pow(t,2))/(2*o*e);return Math.round(180*Math.acos(i)/Math.PI)},A.prototype.editModel=function(e={}){this._ModelEdit.start(this,e)},A.prototype.endEdit=function(){this._ModelEdit.end()},A.prototype.clippingModel=function(t={}){var i,o=this,r=this._viewer,e=(this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint)),this.clippingHandler&&(this.clippingHandler.destroy(),this.clippingHandler=void 0,o.planeEntities&&o.planeEntities.forEach(e=>{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<this.clippingPlanes.length;++s){var l=this.clippingPlanes.get(s),l=r.entities.add({name:"modelClippingPlane",position:n.center,plane:{dimensions:new Cesium.Cartesian2(1.2*a,1.2*a),material:Cesium.Color.WHITE.withAlpha(.1),plane:new Cesium.CallbackProperty(function(e){return function(){return e.distance=o.targetY,e}}(l),!1),outline:!0,outlineColor:Cesium.Color.WHITE}});o.planeEntities.push(l)}this.enableModelExperimental=this.item.enableModelExperimental,this.item.enableModelExperimental=!1,this.clippingHandler=new this._cesium.ScreenSpaceEventHandler(r.scene.canvas);var c=o._core.CreateTooltip();this.clippingHandler.setInputAction(function(e){e=r.scene.pick(e.position);o._cesium.defined(e)&&e.id&&"modelClippingPlane"===e.id.name&&((i=e.id.plane).material=o._cesium.Color.WHITE.withAlpha(.05),i.outlineColor=o._cesium.Color.WHITE,r.scene.screenSpaceCameraController.enableInputs=!1)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.clippingHandler.setInputAction(e=>{var t;Cesium.defined(i)?(t=e.startPosition.y-e.endPosition.y,this.targetY+=t*a*.001,c.showAt(e.endPosition,"移动鼠标平移裁切面")):c.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(),c.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,u={}){if(this.flatten=e,this.updateModelExperimental(),e){let t=u.positions||[];if(t[0]&&t[0].lon&&t[0].lat)for(let e=0;e<t.length;e++)t[e]=Cesium.Cartesian3.fromDegrees(t[e].lon,t[e].lat);let i,o;t.length&&(i=u.fid||this._core.getuid(),this.flattenData.set(i,{id:i,modelId:this.item.id,name:u.name||"新建压平",show:this._core.defaultValue(u.show,!0),boundingSphere:Cesium.BoundingSphere.fromPoints(t),positions:t,setVisibility: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"),c=(e.width=1024,e.height=1024,e.getContext("2d"));c.fillStyle="#000",c.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])}),c.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)c.lineTo(t[e][0],t[e][1]);c.fillStyle="#f00",c.fill()}return this.flattenTexture=new Cesium.TextureUniform({url:e.toDataURL("image/png")}),i&&this.flattenData.get(i)}},A.prototype.setFlattenByGeojson=function(n,t){if(t){let e=Cesium.GeoJsonDataSource.load(t);return e.then(e=>{var o=e.entities.values;let r=[];for(let i=0;i<o.length;i++){let e=o[i],t;e.polyline?t=e.polyline.positions.getValue():e.polygon&&(t=e.polygon.hierarchy.getValue().positions),t&&r.push(this.setFlatten(n,{fid:e.id,name:e.name,positions:t}))}return r})}this.flatten=!!n,this.updateModelExperimental()},A.prototype.removeFlattenById=function(e){this.flattenData.delete(e),this.flatten=!!this.flattenData.size,this.setFlatten(this.flatten)},A.prototype.showFlattenById=function(e,t){let i=this.flattenData.get(e);i&&(i.show=t),this.setFlatten(this.flatten)},A.prototype.removeFlattenAll=function(){this.flattenData.clear(),this.flattenRectangle=new Cesium.Rectangle,this._flattenRectangle=void 0,this.flatten=!1,this.flattenTexture=new Cesium.TextureUniform({url:""}),this.updateModelExperimental()},A.prototype.updateModelExperimental=function(){this.effects||this.flatten||this.snow?this.item&&(this.item.enableModelExperimental=!0):this.item&&(this.item.enableModelExperimental=!1)},A.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(A.prototype,{style:{get:function(){return this.item.style}}}),A.prototype.export=function(){var e=this.item.url,t=this.item.show,i=this.item.shadows;return{type:"3DTilesets",treeobj:{name:this.treeobj.name},style:{url:e,show:t,shadows:i}}},A.prototype.setTreeobj=function(e){this.treeobj=e},A.prototype.setItem=function(e){this.item=e},A.prototype.setShowStyle=function(e){this.item.style,this.item.style=new this._cesium.Cesium3DTileStyle({show:!0})},A.prototype.setStyle=function(e){var t=[],i={color:void 0,show:!0},o=!0;if(e.colors instanceof Array){for(var r=0;r<e.colors.length;r++){var n=[],a=e.colors[r].color,s=e.colors[r].condition;/^\[/.test(s)&&(s=s.replace(/^\[/,"${").replace(/\]/,"}")),a=this._core.isHtmlColor(a)?this._color.colorFromHtmlColor(a):(1<(a=/^rgb/.test(a)?this._color.rgbaStringToRgbaObj(a):a).r&&(a.r=a.r/255),1<a.g&&(a.g=a.g/255),1<a.b&&(a.b=a.b/255),1<a.a&&(a.a=a.a/255),this._color.createColor(a.r,a.g,a.b,a.a)),n.push(s),n.push(a),t.push(n)}i.color={},i.color.conditions=t}else e.colors&&(i.color=`color("${e.colors}")`);return e.show&&/\[/.test(e.show)?o=e.show.replace(/^\[/,"${").replace(/\]/,"}"):e.show&&(o=e.show),i.show=o,i},Object.defineProperties(A.prototype,{luminanceAtZenith:{get:function(){return this.item.luminanceAtZenith},set:function(e){this.item.luminanceAtZenith=e}},groundHeight:{get:function(){return null!=this.item&&null!=this.item.boundingSphere?this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).altitude:0},set:function(e){this.setHeight(e)}},lon:{get:function(){return this.modelEditData.lon},set:function(e){this.modelEditData.lon=e,this.setEditData()}},lat:{get:function(){return this.modelEditData.lat},set:function(e){this.modelEditData.lat=e,this.setEditData()}},height:{get:function(){return this.modelEditData.height},set:function(e){this.modelEditData.height=e,this.setEditData()}},scale:{get:function(){return this.modelEditData.scale},set:function(e){this.modelEditData.scale=e,this.setEditData()}},material:{set:function(e){this._core.isHtmlColor(e)||(e="rgba("+(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r+","+e.g+","+e.b+","+e.a+")"),this.item.style=new this._cesium.Cesium3DTileStyle({color:"color('"+e+"')"})}},dynamicScreenSpaceErrorDensity:{get:function(){return this.item.dynamicScreenSpaceErrorDensity},set:function(e){this.item.dynamicScreenSpaceErrorDensity=e}},shadows:{get:function(){return this.item.shadows},set:function(e){this.item.shadows=e}},classificationType:{get:function(){return this.item.classificationType},set:function(e){this.item.classificationType=e}},dynamicScreenSpaceErrorHeightFalloff:{get:function(){return this.item.dynamicScreenSpaceErrorHeightFalloff},set:function(e){this.item.dynamicScreenSpaceErrorHeightFalloff=e}},dynamicScreenSpaceErrorFactor:{get:function(){return this.item.dynamicScreenSpaceErrorFactor},set:function(e){this.item.dynamicScreenSpaceErrorFactor=e}},imageBasedLightingFactor_x:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.x},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}},imageBasedLightingFactor_y:{get:function(){return null==this.item.imageBasedLightingFactor?0:this.item.imageBasedLightingFactor.y},set:function(e){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(e,this.item.imageBasedLightingFactor_y)}},effects:{get:function(){return this.item.customShader.uniforms.u_effects.value},set:function(e){this.item.customShader.setUniform("u_effects",e),this.item.customShader.lightingModel=e?0:void 0,this.updateModelExperimental()}},effectsMaxHeight:{get:function(){return this.item.customShader.uniforms.u_effectsMaxHeight.value},set:function(e){this.item.customShader.setUniform("u_effectsMaxHeight",e)}},snow:{get:function(){return this.item.customShader.uniforms.u_snow.value},set:function(e){this.item.customShader.setUniform("u_snow",e),this.updateModelExperimental()}},snowAlpha:{get:function(){return this.item.customShader.uniforms.u_snowAlpha.value},set:function(e){this.item.customShader.setUniform("u_snowAlpha",e)}},snowDirection:{get:function(){return this.item.customShader.uniforms.u_snowDirection.value},set:function(e){this.item.customShader.setUniform("u_snowDirection",e)}},flatten:{get:function(){return this.item.customShader.uniforms.u_flatten.value},set:function(e){this.item.customShader.setUniform("u_flatten",e),this.updateModelExperimental()}},flattenHeight:{get:function(){return this.item.customShader.uniforms.u_flattenHeight.value},set:function(e){this.item.customShader.setUniform("u_flattenHeight",e)}},flattenRectangle:{get:function(){return this._flattenRectangle},set:function(e){this._flattenRectangle=e,this.item.customShader.setUniform("u_flattenSouthWest",Cesium.Cartesian3.fromRadians(e.west,e.south)),this.item.customShader.setUniform("u_flattenNorthEast",Cesium.Cartesian3.fromRadians(e.east,e.north))}},flattenTexture:{get:function(){return this.item.customShader.uniforms.u_flattenTexture.value},set:function(e){this.item.customShader.setUniform("u_flattenTexture",e)}}}),A.prototype.getCustomShader=function(e){return Cesium.CustomShader&&new Cesium.CustomShader({mode:Cesium.CustomShaderMode.MODIFY_MATERIAL,lightingModel:e.effects||e.removeLighting?Cesium.LightingModel.UNLIT:void 0,uniforms:{u_flatten:{type:Cesium.UniformType.BOOL,value:!1},u_flattenHeight:{type:Cesium.UniformType.FLOAT,value:0},u_flattenNorthEast:{type:Cesium.UniformType.VEC3,value:new Cesium.Cartesian3},u_flattenSouthWest:{type:Cesium.UniformType.VEC3,value:new Cesium.Cartesian3},u_flattenTexture:{type:Cesium.UniformType.SAMPLER_2D,value:new Cesium.TextureUniform({url:""})},u_effects:{type:Cesium.UniformType.BOOL,value:e.effects||!1},u_effectsMaxHeight:{type:Cesium.UniformType.FLOAT,value:e.effectsMaxHeight||150},u_snow:{type:Cesium.UniformType.BOOL,value:e.snow||!1},u_snowAlpha:{type:Cesium.UniformType.FLOAT,value:e.snowAlpha||.8},u_snowDirection:{type:Cesium.UniformType.VEC3,value:e.snowDirection||new Cesium.Cartesian3(1,1,0)}},vertexShaderText:this.getFlattenShader(),fragmentShaderText:this.getEffectsShader()})},A.prototype.getFlattenShader=function(){return wr},A.prototype.getEffectsShader=function(){return vr},A.prototype.getType=function(){return{label:"模型",value:"3DTileset"}},br.prototype.play=function(t,i={}){this.start=i.start,this.end=i.end,this.attr=i.attr,this.attrType=i.attrType,this.palyType=i.type||"progress",this.startPosition=i.startPosition,this.endPosition=i.endPosition,this.colors=i.colors||["rgb(255,0,0)","rgb(255,152,0)","rgb(0,255,0)","rgb(0,0,255)"];let o;if(this._useColor=i.useColor,this.getCurrentProgressStyle(0),"string"==typeof t){o=new A(this._viewer),this.tiltModel.start=o.create3DTilesets("拆迁模型",t,{},{groundCenter:this.startPosition},"0",!0,e=>{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},br.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},br.prototype.useColor=function(e=!1){this._useColor=e,this.currentProgress(this.progress)},br.prototype.getCurrentProgressStyle=function(e){this.progress=e,"time"===this.palyType&&(e=parseInt(e*this.time+this.start),this.setTime(e))},br.prototype.setModelProgressStyle=function(e,t){let i,o;i=.5<this.progress?"start"===e?this._useColor?[["true",this.colors[3]]]:[["true","rgba(255, 255, 255, 0)"]]:(o=parseInt(2*(this.progress-.5)*t.allTime+t.startTime),this._useColor?[["${"+this.attr[0]+"} > "+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}})},br.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}})},br.prototype.currentProgress=function(e){this.getCurrentProgressStyle(e),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(e=>{this.setModelStyle("end",e)})},br.prototype.currentTime=function(e){this.setTime(e),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(e=>{this.setModelStyle("end",e)})},br.prototype.setModelStyle=function(e,t){t&&("time"===this.palyType?t.item.style="start"===e?this.startStyle:this.endStyle:this.setModelProgressStyle(e,t))},br.prototype.setVisibility=function(t){this.tiltModel.start&&this.tiltModel.start.setVisibility(t),this.tiltModel.end.forEach(e=>{e.setVisibility(t)})},br.prototype.deleteObject=function(){this.tiltModel.start&&this.tiltModel.start.deleteObject(),this.tiltModel.end.forEach(e=>{e.deleteObject()})},Object.defineProperties(br.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<i.g&&(i.g=i.g/255),1<i.b&&(i.b=i.b/255),1<i.a&&(i.a=i.a/255),i.r&&(i=this._color.createColor(i.r,i.g,i.b,i.a))),a.color=i),this._position=t,this.item=this._viewer.entities.add({name:e,position:this._cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]||0),point:a}),{id:this.item.id,name:e,pId:this._core.isnull(r)?0:r,type:"Point",item:this});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(r)?0:r),this},L.prototype.getstyles=function(){var e={};return e.show=!this.item.point.show||this.item.point.show._value,e.pixelSize=this.item.point.pixelSize?this.item.point.pixelSize.toString():null,e.heightReference=this.item.point.heightReference&&this.item.point.heightReference._value?this.item.point.heightReference.toString():null,e.color=this.item.point.color&&this.item.point.color._value?"rgba"+this.item.point.color.toString():null,e.outlineColor=this.item.point.outlineColor&&this.item.point.outlineColor._value?"rgba"+this.item.point.outlineColor.toString():null,e.outlineWidth=this.item.point.outlineWidth&&this.item.point.outlineWidth._value?this.item.point.outlineWidth.toString():null,e.near=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.near:null,e.far=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},L.prototype.createLonlat=function(o){var r=this,t=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);t.setInputAction(function(e){var e=r._viewer.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid),e=r._cesium.Cartographic.fromCartesian(e,r._viewer.scene.globe.ellipsoid,new r._cesium.Cartographic),t=r._cesium.Math.toDegrees(e.latitude),i=r._cesium.Math.toDegrees(e.longitude),e=e.height;"function"==typeof o&&o({lng:i,lat:t,height:e})},this._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK)},L.prototype.createRichTextPoint=function(t,i,o={}){var m,d,p,g,f,r=this,n=this._core.getuid(),e=o.GroupID,a=(void 0!==i.length?2===i.length?a=this._cesium.Cartesian3.fromDegrees(i[0],i[1]):3===i.length&&(a=this._cesium.Cartesian3.fromDegrees(i[0],i[1],i[2])):a=i.z?this._cesium.Cartesian3.fromDegrees(i.x,i.y,i.z):this._cesium.Cartesian3.fromDegrees(i.x,i.y),this._position=a,{horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(r._core.defaultValue(o.near,0),r._core.defaultValue(o.far,Number.MAX_VALUE))}),s=this._core.extend(a,o,!0),a="",l=15,l=(o&&o.fontColor&&(a=o.fontColor),o&&o.fontSize&&(l=o.fontSize),m=t,d=l,p=a,g=function(e){s.image=e,r.item=r._viewer.entities.add({id:n,name:t,position:r._position,billboard:s}),r.item.degrees=i,r.item.type="RichPoint",r.item.data=o.data},(f=document.createElement("img")).src=r._core.defaultValue(s.url,window.SmartEarthRootUrl+I.richtextpoint),d=parseFloat(d),f.crossOrigin="Anonymous",f.onload=function(){var e,t,i,o,r,n,a,s,l=document.createElement("canvas"),c=l.getContext("2d"),u=f.width,h=f.height;l.width=u,l.height=h,c.drawImage(f,0,0,u,h),c.shadowOffsetX=1,c.shadowOffsetY=0,c.shadowColor="#fff",c.shadowBlur=1,/^\</.test(m)&&/\>$/.test(m)?(a='<svg xmlns="http://www.w3.org/2000/svg" width="'+u+'" height="60"><foreignObject width="100%" height="100%">'+m+"</foreignObject></svg>",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(){c.drawImage(t,0,0,t.width,t.height),e.revokeObjectURL(i)}):(c.fillStyle=p||"#fff",c.font=d+"px Calibri,sans-serif",m.length*d>u?(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=(u-a.length*d)/2,c.fillText(a,n,s),c.fillText(o,n,r)):(a=(h-100-d)/2,s=(u-m.length*d)/2,c.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<i.length){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&this._cesium.defined(a))o=t.scene.pickPosition(e);else{r=t.camera.getPickRay(e);if(!r)return;o=t.scene.globe.pick(r,t.scene)}return o},L.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},L.prototype.altitude=L.prototype.executePoint=function(o,e){let t;"object"!=typeof o&&"function"!=typeof e||(t=e,e=o,o=t),t=null,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw);var r=this,n=(this._tree.starttemporaryItem(this._viewer),{point:r._cesium.Color.RED});0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(n.point=e.point),this._tree.removeHandler();let a=this._core.CreateTooltip();return this._tree.handler=new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){var e=r._getPosition.getMousePosition(e),t=r._core.toDegrees(e),t=1e3<=t.height?(t.height/1e3).toFixed(2)+"千米":t.height.toFixed(2)+"米",i=r._core.getPointToCameraDistance(r._viewer,e),e=r._viewer.entities.add({name:"高度",position:e,point:{color:n.point.withAlpha(.5),pixelSize:5,outlineColor:r._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:r._cesium.HeightReference.none,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*i),disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:"海拔高度:"+t,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*i),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),i=(r._tree.temporaryItem.obj.push(e),{point:e,height:t});r._tree.endtemporaryItem(),r._core.mouse(r._viewer.container,0,"0"),r._tree.handler.destroy(),a.show(!1),"function"==typeof o&&o(i),r.item=e},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){a.showAt(e.endPosition,"点击拾取高度!")},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},L.prototype.executePointp=function(t,e){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw);var i=this,o=(this._tree.starttemporaryItem(this._viewer),{point:i._cesium.Color.RED});return 0<Object.keys(e).length&&""!=e.point&&null!=e.point&&(o.point=e.point),this._tree.removeHandler(),this._tree.handler=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas),this._tree.handler.setInputAction(function(e){var e=i._getPosition.getMousePosition(e);e&&(e=i._viewer.entities.add({name:"高度",position:e,point:{color:o.point.withAlpha(.5),pixelSize:5,outlineColor:i._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:i._cesium.HeightReference.none}}),i._tree.temporaryItem.obj.push(e),i._tree.endtemporaryItem(),i._core.mouse(i._viewer.container,0,"0"),i._tree.handler.destroy(),"function"==typeof t&&t(e),i.item=e)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),this},L.prototype.deleteObject=function(){try{if(this._viewer.entities.remove(this.item),0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}catch(e){}},L.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;this.item.show=e},L.prototype.getVisibility=function(){return this.item.show},L.prototype.setPointAlpha=function(e){try{this.item._point.material._value.alpha=e}catch(e){console.log(e)}return this},L.prototype.export=function(){var e=null==this.item.point.show?void 0:this.item.point.show._value,t=null==this.item.point.pixelSize?void 0:this.item.point.pixelSize._value,i=null==this.item.point.color?void 0:"rgba("+this.item.point.color._value.red+","+this.item.point.color._value.green+","+this.item.point.color._value.blue+","+this.item.point.color._value.alpha+")",o=null==this.item.point.outlineColor?void 0:"rgba("+this.item.point.outlineColor._value.red+","+this.item.point.outlineColor._value.green+","+this.item.point.outlineColor._value.blue+","+this.item.point.outlineColor._value.alpha+")",r=null==this.item.point.outlineWidth?void 0:this.item.point.outlineWidth._value,n=this.item.point.distanceDisplayCondition,a=null==n?void 0:n._value.near,n=null==n?void 0:n._value.far,s=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"point",position:{x:this._cesium.Math.toDegrees(s.longitude),y:this._cesium.Math.toDegrees(s.latitude),z:this._cesium.Math.toDegrees(s.height)},treeobj:{name:this.treeobj.name},style:{show:e,pixelSize:t,color:i,outlineColor:o,outlineWidth:r,near:a,far:n}}},L.prototype.setTreeobj=function(e){this.treeobj=e},L.prototype.setPointColor=function(e){try{this.item._point.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){console.log(e)}return this},L.prototype.setRadius=function(e){try{this.item.ellipse=new this._cesium.EllipseGraphics({semiMinorAxis:e,semiMajorAxis:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},L.prototype.setOutlineColor=function(e){try{this.item._point.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},Object.defineProperties(L.prototype,{HighLight:{set:function(e){e&&(this.item.fillColor=this.item.point._color),e?this.item._point.color=new m(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.point._color=this.item.fillColor}}}),Object.defineProperties(L.prototype,{pointColor:{get:function(){if(this.item.point._color._value)return this._color.toHtmlColor("rgb("+255*this.item.point._color._value.red+","+255*this.item.point._color._value.green+","+255*this.item.point._color._value.blue+","+255*this.item.point._color._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.color=e):this.item._point.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.fillColor=this.item._point.color}catch(e){}}},pointOutlineColor:{get:function(){if(null!=this.item._point._outlineColor)return this._color.toHtmlColor("rgb("+255*this.item._point.outlineColor._value.red+","+255*this.item._point.outlineColor._value.green+","+255*this.item._point.outlineColor._value.blue+","+255*this.item._point.outlineColor._value.alpha+")")},set:function(e){try{/^rgb/.test(e)?(1<(e=this._color.rgbaStringToRgbaObj(e)).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),e=this._color.createColor(e.r,e.g,e.b,e.a),this.item._point.outlineColor=e):this.item._point.outlineColor=this._color.colorFromHtmlColor(e)}catch(e){console.log(e)}}},pointOutlineWidth:{get:function(){if(null!=this.item.point.outlineWidth)return this.item.point.outlineWidth._value},set:function(e){this.item.point.outlineWidth=e}},pointAlpha:{get:function(){if(null!=this.item._point._color)return this.item._point._color._value.alpha},set:function(e){this.item._point._color._value.alpha=e}},pointOutlineAlpha:{get:function(){if(null!=this.item._point.outlineColor)return this.item._point.outlineColor._value.alpha},set:function(e){try{this.item._point.outlineColor._value.alpha=e}catch(e){}}},pointHeight:{set:function(e){e=parseFloat(e);var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),t=this._cesium.Math.toDegrees(t.latitude),i=this._cesium.Cartesian3.fromDegrees(i,t,e);this.item.position._value=i},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.height)}},pointX:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),t=this._cesium.Math.toDegrees(t.height),e=this._cesium.Cartesian3.fromDegrees(e,i,t);this.item.position.position=e},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.longitude)}},pointY:{set:function(e){var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),t=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),i=this._cesium.Cartesian3.fromDegrees(i,e,t);this.item.position.position=i},get:function(){var e=this._cesium.Cartographic.fromCartesian(this.item.position._value);return this._cesium.Math.toDegrees(e.latitude)}}}),Object.defineProperties(L.prototype,{pixelSize:{get:function(){return this.item.point.pixelSize._value},set:function(e){this.item.point.pixelSize=e}}}),Object.defineProperties(L.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),L.prototype.setItem=function(e){this.item=e},Object.defineProperties(L.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(L.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(L.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(L.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(L.prototype,{position:{get:function(){return this._position||this.item.position}}}),Object.defineProperties(L.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(L.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(L.prototype,{pointTempOptions:{get:function(){return{color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:m.BLACK,outlineWidth:0,show:!0,scaleByDistance:null,translucencyByDistance:null,heightReference:null,distanceDisplayCondition:null,disableDepthTestDistance:null}}}}),M.prototype.createPolygon=function(e,t,i,o,r){var n,a=[];if(Array.isArray(e)){if(e[0]instanceof Array){if(2===e[0].length){for(var s=0;s<e.length;s++)a.push(e[s][0],e[s][1]);n=this._cesium.Cartesian3.fromDegreesArray(a)}else if(3===e[0].length){for(s=0;s<e.length;s++)a.push(e[s][0],e[s][1],e[s][2]);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}}else if(e[0].z){for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y,e[s].z);n=this._cesium.Cartesian3.fromDegreesArrayHeights(a)}else{for(s=0;s<e.length;s++)a.push(e[s].x,e[s].y);n=this._cesium.Cartesian3.fromDegreesArray(a)}"string"==typeof t&&(t={fillColor:t}),this.item=this._viewer.entities.add({name:r,polygon:{hierarchy:new this._cesium.PolygonHierarchy(n),material:new m(this._viewer,this._cesium).colorFromHtmlColor(t.fillColor),heightReference:this._core.defaultValue(i,1),perPositionHeight:1!==i,outline:!0,outlineWidth:this._core.defaultValue(t.outlineWidth,1),outlineColor:new m(this._viewer,this._cesium).colorFromHtmlColor(this._core.defaultValue(t.outlineColor,t.fillColor))}})}else"object"==typeof e&&(e.points.forEach(e=>{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,u,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,c=i,i=r(t),t=Math.sin(i),i=Math.cos(i),e=(1-o)*Math.tan(r(e)),u=1/Math.sqrt(1+e*e),h=e*u,m=Math.atan2(e,i),e=u*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=c/(s*p),_=2*Math.PI;for(;1e-12<Math.abs(f-_);){var C=Math.cos(2*m+f),y=Math.sin(f),v=Math.cos(f);_=f,f=c/(s*p)+g*y*(C+g/4*(v*(2*C*C-1)-g/6*C*(4*y*y-3)*(4*C*C-3)))}a=h*y-u*v*i,a=Math.atan2(h*v+u*y*i,(1-o)*Math.sqrt(e*e+a*a)),t=Math.atan2(y*t,u*v-h*y*i),u=o/16*d*(4+o*(4-3*d));return{lon:l+n(t-(1-u)*o*e*(f+u*y*(C+u*v*(2*C*C-1)))),lat:n(a)}}(e,i,Math.cos(o)*t),o={lon:e.lon,lat:e.lat,height:e.height},t={lon:i.lon,lat:i.lat,height:e.height+n},l=6378137,c=6356725,h=this,i=function(e,t){var i=[],o=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))))*l,a=Math.round(1e4*a)/1e4,{anglew:h._core.TwoPointAzimuth(t,e,o,i),distance:a}}(e.lat,e.lon,t.lat,t.lon),r=o.anglew,n=o.distance;i.push(e.lon,e.lat,e.height);for(var a=r-u/2,s=null;a<r+u/2;a++)s=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=c+(l-c)*(90-e)/90,n=o*Math.cos(e*Math.PI/180),r=180*(r/n+t*Math.PI/180)/Math.PI,n=180*(i/o+e*Math.PI/180)/Math.PI;return[r,n]}(e.lat,e.lon,n,a),i.push(s[0],s[1],t.height+10*a);return i}(o,t),e=document.createElement("canvas"),n=(e.id="0-a",e.width=800,e.height=800,document.body.appendChild(e),document.createElement("canvas")),m=(n.id="0-b",n.width=800,n.height=800,"a"),d=(document.body.appendChild(n),1),o=new Cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+m),o=i.getContext("2d");function r(e,t,i){o.beginPath(),o.arc(400,800,i,n(e),n(t),!1),o.stroke()}function n(e){return(e-=90)*Math.PI/180}o.strokeStyle="red",o.lineWidth=15,o.clearRect(0,0,800,800);var a,s,l,c=o.createLinearGradient(0,800,0,0);return c.addColorStop(0,"rgba(255,0,0,0.6)"),c.addColorStop(1,"rgba(255,0,0,0)"),a=-u/2,s=u/2,l=d+600,o.beginPath(),o.arc(400,800,l,n(a),n(s),!1),o.stroke(),o.lineTo(400,800),o.closePath(),o.fillStyle=c,o.fill(),r(-u/2,u/2,d+100),r(-u/2,u/2,d+200),r(-u/2,u/2,d+300),r(-u/2,u/2,d+400),r(-u/2,u/2,d+500),r(-u/2,u/2,d+600),d<100?d+=1:d=1,m="a"===m?"b":"a",i},!1);function p(e){return e*Math.PI/180}return this.item=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.PolygonHierarchy(this._cesium.Cartesian3.fromDegreesArrayHeights(i)),material:new this._cesium.ImageMaterialProperty({image:o,transparent:!0}),perPositionHeight:!0,outlineColor:r.outlineColor}}),this},M.prototype.setImageMaterialProperty=function(){var r=this,e=document.createElement("canvas"),t=(e.id="0-a",e.width=700,e.height=100,document.createElement("canvas")),e=(t.id="0-b",t.width=700,t.height=100,document.body.appendChild(e),document.body.appendChild(t),new r._cesium.CallbackProperty(function(e,t){var i=document.getElementById("0-"+r.curCanvas),o=i.getContext("2d");return i.strokeStyle="1px solid red",o.strokeStyle="red",o.fillStyle="red",o.save(),o.translate(100,100),o.arc(0,0,100,0,180*Math.PI/180),o.restore(),o.stroke(),r.curCanvas="a"===r.curCanvas?"b":"a",i},!1));return new r._cesium.ImageMaterialProperty({image:e,transparent:!0})},M.prototype.executeSector=function(t,e){var i,o,n,a,l=this,r=(this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._viewer),s=0,c={fillColor:l._cesium.Color.YELLOW.withAlpha(.5),outlineColor:l._cesium.Color.YELLOW},u=(e&&e.fillColor&&(c.fillColor=e.fillColor),e&&e.outlineColor&&(c.outlineColor=e.outlineColor),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),[]),h=this._core.CreateTooltip(),m=(this.item=void 0,this.end=e=>{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(u))),"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),u=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+30;o++)r=function(e,t,i,o){var r=i*Math.sin(o*Math.PI/180),i=i*Math.cos(o*Math.PI/180),o=d+(m-d)*(90-e)/90,n=o*Math.cos(e*Math.PI/180),r=180*(r/n+t*Math.PI/180)/Math.PI,n=180*(i/o+e*Math.PI/180)/Math.PI;return[r,n]}(e.lat,e.lon,a,o),i.push(r[0],r[1]);return i}(i,o),l.item||(l.item=r.entities.add({polygon:{hierarchy:new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(u)),material:new l._cesium.ColorMaterialProperty(c.fillColor),outlineColor:c.outlineColor,fill:!0}}),l.item.polygon.hierarchy=new l._cesium.CallbackProperty(function(){return new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(u))},!1)))},l._cesium.ScreenSpaceEventType.MOUSE_MOVE),6378137),d=6356725;function p(e){return e*Math.PI/180}return this},M.prototype.executePolygon=function(t,s){this._lang=this._core.extend(this._lang,language._lang);var l=this,i=(this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new l._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=l._viewer.entities.add(this.options),l.item=this.polygon,l._tree.temporaryItem.obj.push(this.polygon)},e);function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:l._core.defaultValue(t.heightReference,1),perPositionHeight:0===t.heightReference,material:l._core.defaultValue(t.material,l._cesium.Color.YELLOW.withAlpha(.5))}},this.hierarchy=e,this._init()}this._tree.handler=new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas);var c=[],o={},u=void 0,h=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._core.CreateTooltip());return this._tree.handler.setInputAction(function(e){e=l._getPosition.getMousePosition(e);0==c.length&&c.push(e.clone()),c.push(e),o=new l._cesium.PolygonHierarchy(c)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===c.length?h.showAt(e.endPosition,l._lang.draw_tip_left):c.length<=2?h.showAt(e.endPosition,l._lang.draw_tip_click):h.showAt(e.endPosition,l._lang.draw_tip_right);e=l._getPosition.getMousePosition(e);2<=c.length&&(l._cesium.defined(u)?null!=e&&(c.pop(),e.y+=1+Math.random(),c.push(e),o=new l._cesium.PolygonHierarchy(c)):(o=new l._cesium.PolygonHierarchy(c),u=new i(o)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){l._tree.endtemporaryItem(),l._tree.handler.destroy(),h.show(!1);for(var t={polygon:{},positions:[],area:[]},i=(t.polygon=u,[]),o=0;o<c.length;o++){var r=l._cesium.Cartographic.fromCartesian(c[o]),n=l._cesium.Math.toDegrees(r.longitude),a=l._cesium.Math.toDegrees(r.latitude),r=r.height;i.push({lon:n,lat:a,hei:r})}t.positions=i,l._core.mouse(l._viewer.container,0,"0"),"function"==typeof s&&s(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},M.prototype.executePolygonvideo=function(a,t){this._lang=this._core.extend(this._lang,language._lang);var s=this,i=(this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),e.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new s._cesium.CallbackProperty(function(){return e.hierarchy},!1),this.polygon=s._viewer.entities.add(this.options),m.style.transform="rotate("+t.angle+"deg)",this.polygon.polygon.stRotation=s._cesium.Math.toRadians(t.angle),s.item=this.polygon,s._tree.temporaryItem.obj.push(this.polygon)},e);function e(e){this.options={name:"",polygon:{hierarchy:[],heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND,classificationType:s._cesium.ClassificationType.BOTH,material:s._cesium.Color.YELLOW.withAlpha(.5)}},this.hierarchy=e,this._init()}this._tree.handler=new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas);var l=[],o={},r=void 0,c=this._core.CreateTooltip(),u=s._core.getuid(),n=document.getElementById("videoToolbar"),h=(n||($(".cesium-viewer").append('<div id="videoToolbar"></div>'),n=document.getElementById("videoToolbar")),'<video id="video'+u+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>'),m=($(n).append(h),document.getElementById("video"+u));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);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?(d&&s._viewer.entities.remove(d),o=new s._cesium.PolygonHierarchy(l),r=new i(o)):o=new s._cesium.PolygonHierarchy(l)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){0===l.length?c.showAt(e.endPosition,s._lang.draw_tip_left):l.length<=2?c.showAt(e.endPosition,s._lang.draw_tip_click):c.showAt(e.endPosition,s._lang.draw_tip_right),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(),c.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<l.length;i++){var o=s._cesium.Cartographic.fromCartesian(l[i]),r=s._cesium.Math.toDegrees(o.longitude),n=s._cesium.Math.toDegrees(o.latitude),o=o.height;t.push({lon:r,lat:n,hei:o})}e.positions=t,e.id=u,"function"==typeof a&&a(e)}},this},M.prototype.addVideoPolygon=function(e,t){var i,o=[];if(e[0]instanceof Array){if(2===e[0].length){for(var r=0;r<e.length;r++)o.push(e[r][0],e[r][1]);i=this._cesium.Cartesian3.fromDegreesArray(o)}else if(3===e[0].length){for(r=0;r<e.length;r++)o.push(e[r][0],e[r][1],e[r][2]);i=this._cesium.Cartesian3.fromDegreesArrayHeights(o)}}else if(e[0].z)if(e[0].x<180&&-180<e[0].x&&e[0].y<90&&-90<e[0].y){for(r=0;r<e.length;r++)o.push(e[r].x,e[r].y,e[r].z);i=this._cesium.Cartesian3.fromDegreesArrayHeights(o)}else i=e;else{for(r=0;r<e.length;r++)o.push(e[r].x,e[r].y);i=this._cesium.Cartesian3.fromDegreesArray(o)}var n=document.getElementById("videoToolbar"),a=(n||($(".cesium-viewer").append('<div id="videoToolbar"></div>'),n=document.getElementById("videoToolbar")),this._core.getuid()),s='<video id="video'+a+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>',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('<div id="videoToolbar"></div>'),e=document.getElementById("videoToolbar")),this._core.getuid()),r='<video id="video'+o+'"  style="display: none;" muted autoplay loop crossorigin controls><source src="'+t.url+'" type="video/mp4"></video>',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<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}this.item=void 0},M.prototype.planeArea=M.prototype.executePolygoncl=function(t,e){this._lang=this._core.extend(this._lang,language._lang);let i;"object"!=typeof t&&"function"!=typeof e||(i=e,e=t,t=i),i=null,this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var o,r,n=this,a=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._core.CreateTooltip()),s=[],l={},c=[],u=null,h=null,m={point:n._cesium.Color.RED,polyline:n._cesium.Color.YELLOW,polygon:n._cesium.Color.YELLOW.withAlpha(.5)},d=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(m.polygon=e.polygon)),{mj:0,label:[],polygon:[]});let p,g;this._tree.handler.setInputAction(function(e){var t,i;0===s.length?a.showAt(e.endPosition,n._lang.draw_tip_left):s.length<=3?a.showAt(e.endPosition,n._lang.draw_tip_click):a.showAt(e.endPosition,n._lang.draw_tip_right),(h=n._getPosition.getMousePosition(e))&&(e=n._cesium.Cartographic.fromCartesian(h),t=n._cesium.Math.toDegrees(e.longitude),i=n._cesium.Math.toDegrees(e.latitude),e.height,2<=s.length&&(n._cesium.defined(u)?(s.pop(),s.push(h),l=new n._cesium.PolygonHierarchy(s),c.pop(),c.push([t,i])):(l=new n._cesium.PolygonHierarchy(s),u=new f(l)),e=n._core.getArea(c,s),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,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(c,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()),c.push([t,i])),s.push(h),c.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(u)||(l=new n._cesium.PolygonHierarchy(s),u=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(c,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),c.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(V.selectedItem)||"group"!=V.selectedItem.type||(e=V.selectedItem.id),t={id:t=o._core.getuid(),name:"新建面"+t,pId:o._core.isnull(e)?0:e,type:"polygon",item:o},o.setTreeobj(t),V.insertGroupId(t,o._core.isnull(e)?0:e),c);function c(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,S=!1,E=[];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<T&&(b+=t,_.item._polygon.extrudedHeight.setValue(b),T<=b&&(clearInterval(_.waterTimer),_.waterTimer=void 0,b=T,_._viewer.entities.remove(_.item),_.polygon1=new _._cesium.PolygonGeometry({polygonHierarchy:new _._cesium.PolygonHierarchy(v),extrudedHeight:T,height:0,vertexFormat:_._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT}),e=new _._cesium.Primitive({geometryInstances:new _._cesium.GeometryInstance({geometry:_.polygon1}),appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:f.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),blendColor:f.watherColor||Cesium.Color.SKYBLUE.withAlpha(.6),normalMap:f.url,frequency:f.frequency||1e3,animationSpeed:f.watherSpeed||.01,amplitude:f.amplitude||10}}})}),show:!0}),_._viewer.scene.primitives.add(e),_.item=e,""!=i&&null!=i&&"function"==typeof i&&i(b),_._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||(o=V.selectedItem.id),e={id:e=_._core.getuid(),name:"新建淹没分析"+e,pId:_._core.isnull(o)?0:o,type:"polygon",item:_},_.setTreeobj(e),V.insertGroupId(e,_._core.isnull(o)?0:o)))},50)}this._tree.handler.setInputAction(function(e){if(S)void 0===b?C.showAt(e.endPosition,"点击拾取初始水面高度"):void 0===T&&C.showAt(e.endPosition,"点击拾取最大淹没高度");else{4<=v.length?C.showAt(e.endPosition,"右键结束绘制"):C.showAt(e.endPosition,"点击左键绘制淹没区域");e=_._viewer.camera.getPickRay(e.endPosition);if(h=_._viewer.scene.globe.pick(e,_._viewer.scene),2<=v.length){if(_._cesium.defined(w))if(f.rectangle)x=_._core.toDegrees(h),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;else{for(var e=v[0],e=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Cesium.Math.toDegrees(e.latitude),e=Cesium.Math.toDegrees(e.longitude),i=v[v.length-2],i=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),o=Cesium.Math.toDegrees(i.latitude),i=Cesium.Math.toDegrees(i.longitude),r=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(h),n=Cesium.Math.toDegrees(r.latitude),r=Cesium.Math.toDegrees(r.longitude),a=Cesium_turf.lineString([[e,t],[r,n]]),s=Cesium_turf.lineString([[i,o],[r,n]]),l=!0,c=0;c<E.length&&2<=E.length;c++){var u=E[c];if(0==c){if(Cesium_turf.lineIntersect(s,u).features.length){l=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(c==E.length-1){if(Cesium_turf.lineIntersect(a,u).features.length){l=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else{if(Cesium_turf.lineIntersect(a,u).features.length)return l=!1,void(C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium_turf.lineIntersect(s,u).features.length){l=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';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(S){var t=_._cesium.Cartographic.fromCartesian(e);if(void 0===b)b=t.height;else if(void 0===T){if((T=t.height)<b)return window.layuiLayer&&window.layuiLayer.msg("最大淹没高度小于初始水面高度,请重新拾取"),void(b=T=void 0);D()}}else{if(0==v.length&&(v.push(e.clone()),y=new _._cesium.PolygonHierarchy(v)),2<=v.length){if(0==E.length)var i=v[0],o=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),a=v[1],s=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(a),l=Cesium.Math.toDegrees(s.latitude),c=Cesium.Math.toDegrees(s.longitude),u=Cesium_turf.lineString([[n,r],[c,l]]);else{if(2<=E.length){for(var i=v[0],o=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(i),r=Cesium.Math.toDegrees(o.latitude),n=Cesium.Math.toDegrees(o.longitude),a=v[v.length-2],s=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(a),l=Cesium.Math.toDegrees(s.latitude),c=Cesium.Math.toDegrees(s.longitude),t=_._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),a=Cesium.Math.toDegrees(t.latitude),t=Cesium.Math.toDegrees(t.longitude),h=Cesium_turf.lineString([[n,r],[t,a]]),m=Cesium_turf.lineString([[c,l],[t,a]]),d=!0,p=0;p<E.length&&2<=E.length;p++){var g=E[p];if(0==p){if(Cesium_turf.lineIntersect(m,g).features.length){d=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else if(p==E.length-1){if(Cesium_turf.lineIntersect(h,g).features.length){d=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';break}}else{if(Cesium_turf.lineIntersect(h,g).features.length)return d=!1,void(C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>');if(Cesium_turf.lineIntersect(m,g).features.length){d=!1,C.innerHTML='<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>';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),c=Cesium.Math.toDegrees(s.longitude),u=Cesium_turf.lineString([[n,r],[c,l]])}E.push(u)}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?S=!(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){S||v.length<=3||(C.show(!1),v.pop(),y=new _._cesium.PolygonHierarchy(v),f.pointSelect?S=!(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<this._points.length)){for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);this._points=[]}};e.prototype._init=function(){var e=this,t=(this.options.polygon.hierarchy=new _._cesium.CallbackProperty(function(){return e.hierarchy},!1),_._viewer.entities.add(this.options));_.item=t,_._tree.temporaryItem.obj.push(t);try{null!=f&&""!=f&&(0<f.waterHeight&&(b=f.waterHeight),0<f.targetHeight&&(T=f.targetHeight),0<f.spood&&(r=f.spood),""!=f.GroupID&&null!=f.GroupID&&(o=f.GroupID))}catch(e){console.log(e)}};var d=e;function e(e){this.options={name:"多边形",polygon:{hierarchy:[],material:_._cesium.Color.SKYBLUE.withAlpha(.5),heightReference:_._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return this},M.prototype.endWater=function(){this.end&&this.end(),this.waterTimer&&clearInterval(this.waterTimer),this._tree.endtemporaryItem(),this.deleteObject()},M.prototype.executePolygonymsdtt=function(o,e){this._tree.removeHandler();var r=this,n=(this._tree.starttemporaryItem(this._viewer),this._tree.handler=new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas),[]),t=null,i=null,a=(this._tree.handler.setInputAction(function(e){e=r._viewer.camera.getPickRay(e.endPosition);i=r._viewer.scene.globe.pick(e,r._viewer.scene),2<=n.length&&(r._cesium.defined(t)?(n.pop(),n.push(i)):t=new a(n),new r._cesium.PolygonHierarchy(n))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){e=r._viewer.camera.getPickRay(e.position),i=r._viewer.scene.globe.pick(e,r._viewer.scene),0==n.length&&(n.push(i.clone()),new r._cesium.PolygonHierarchy(n)),n.push(i),new r._cesium.PolygonHierarchy(n),e=r._cesium.Cartographic.fromCartesian(n[n.length-1]),r._cesium.Math.toDegrees(e.longitude),r._cesium.Math.toDegrees(e.latitude),e.height,e=r._viewer.entities.add({name:"多边形面积",position:n[n.length-1],point:{pixelSize:5,color:r._cesium.Color.RED.withAlpha(.5),outlineColor:r._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:r._cesium.HeightReference.CLAMP_TO_GROUND}});r._tree.temporaryItem.obj.push(e),r._points.push(e)},r._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r._tree.handler.destroy(),r._viewer.entities.remove(r.item),r.polygon1=new r._cesium.PolygonGeometry({polygonHierarchy:new r._cesium.PolygonHierarchy(n),extrudedHeight:0,height:0,vertexFormat:r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var t=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:r.polygon1}),appearance:new r._cesium.EllipsoidSurfaceAppearance({aboveGround:!0}),show:!0}),i=new r._cesium.Material({fabric:{type:"Water",uniforms:{normalMap:o.url,frequency:100,animationSpeed:.01,amplitude:10}}}),i=(t.appearance.material=i,r._viewer.scene);r.polygon1=i.primitives.add(t),r._tree.endtemporaryItem(),n.pop(),new r._cesium.PolygonHierarchy(n)},r._cesium.ScreenSpaceEventType.RIGHT_CLICK),s.prototype._init=function(){var e=this,t=(this.options.polygon.hierarchy=new r._cesium.CallbackProperty(function(){return e.hierarchy},!1),r._viewer.entities.add(this.options)),t=(r.item=t,r._tree.temporaryItem.obj.push(t),0),i=(r._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.selectedItem.id),r._core.getuid()),i={id:i,name:"新建水面"+i,pId:r._core.isnull(t)?0:t,type:"polyline",item:r};r.setTreeobj(i),V.insertGroupId(i,r._core.isnull(t)?0:t)},s);function s(e){this.options={name:"多边形",polygon:{hierarchy:[],material:r._cesium.Color.SKYBLUE.withAlpha(.4),heightReference:r._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=e,this._init()}return this},M.prototype.executePolygontdmj=function(t,e){this._lang=this._core.extend(this._lang,language._lang);var i,o,r=this,n=(this._tree.starttemporaryItem(this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.removeHandler(),{mj:0,label:[],polygon:[]}),a=!0,s=[],l=void 0,c=this._viewer.scene,u=c.globe.ellipsoid,h={point:r._cesium.Color.RED,polyline:r._cesium.Color.YELLOW,polygon:r._cesium.Color.YELLOW.withAlpha(.5)},m=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(h.point=e.point),""!=e.polyline&&null!=e.polyline&&(h.polyline=e.polyline),""!=e.polygon&&null!=e.polygon&&(h.polygon=e.polygon)),this._core.CreateTooltip()),d=(this._tree.handler=new r._cesium.ScreenSpaceEventHandler(c.canvas),0);let p;this._tree.handler.setInputAction(function(e){0===s.length?m.showAt(e.endPosition,r._lang.draw_tip_left):s.length<=2?m.showAt(e.endPosition,r._lang.draw_tip_click):m.showAt(e.endPosition,r._lang.draw_tip_right),o&&(r._viewer.entities.remove(o),o=void 0);var e=r._getPosition.getMousePosition(e,[n.polygon,n.label]);e&&r._cesium.Ellipsoid.WGS84.cartesianToCartographic(e)&&a&&(s.pop(),s.push(e),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.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<e.length;i++)t[i]=_(u.cartesianToCartographic(e[i]));for(var o=0,i=0;i<t.length;i++)o+=t[i].longitude;o/=t.length;for(i=0;i<t.length;i++)t[i]=r._core.Gauss_to_XY(t[i].longitude,t[i].latitude,o,r._cesium);return Math.abs(C(t))},_=function(e){return e.longitude=e.longitude/Math.PI*180,e.latitude=e.latitude/Math.PI*180,e},C=function(e){for(var t=0,i=0;i<e.length;i++){var o=e[i],r=i<e.length-1?e[i+1]:e[0];t+=o.x*r.y-r.x*o.y}return t/2},y=(v.prototype._init=function(e){var t=this;this.options.polygon.hierarchy=new r._cesium.CallbackProperty(function(){return t.path},!1),this.polygonEntity=r._viewer.entities.add(this.options),r.item=this.polygonEntity,r._tree.temporaryItem.obj.push(this.polygonEntity),n.polygon=this.polygonEntity,r._entity=this.polygonEntity},v);function v(e,t){if(!r._cesium.defined(e))throw new r._cesium.DeveloperError("positions is required!");if(e.length<3)throw new r._cesium.DeveloperError("positions 的长度必须大于等于3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:r._cesium.ClassificationType.BOTH,material:h.polygon}},this.path=e,this._init(t)}return this},M.prototype.surfaceArea=function(r={},n){this._lang=this._core.extend(this._lang,language._lang);var i,o=this,a=(this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),{mj:0,label:void 0,polygon:void 0}),s=[],l=[],c=void 0,e=this._viewer.scene,u={point:r.point||Cesium.Color.RED,polyline:r.polyline||Cesium.Color.YELLOW,polygon:r.polygon||Cesium.Color.YELLOW.withAlpha(.5)},t=this._core.CreateTooltip();this._tree.handler=new o._cesium.ScreenSpaceEventHandler(e.canvas);let h=!1,m;this._tree.handler.setInputAction(e=>{0===s.length?t.showAt(e.endPosition,o._lang.draw_tip_left):s.length<=2?t.showAt(e.endPosition,o._lang.draw_tip_click):t.showAt(e.endPosition,o._lang.draw_tip_right),!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:u.polygon,width:3}})),3<=s.length&&!Cesium.defined(c)&&(d&&this._viewer.entities.remove(d),c=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<l.length){i=Cesium.BoundingSphere.fromPoints(s);let e=this._core.getSpaceArea(this._viewer,l,{onlyTerrain:r.onlyTerrain,distance:r.distance||i.radius/20}),t=e=>{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:u.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:u.polygon}},this.path=e,this._init()}return this},M.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;this._lable&&(this._lable.show=e),this.item&&(this.item.show=e)},M.prototype.getVisibility=function(){return this.item.show},M.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polygon.hierarchy.getValue(),o=this._viewer.scene.globe.ellipsoid,r=0;r<i.length;r++){var n=new this._cesium.Cartesian3(i[r].x,i[r].y,i[r].z),a=o.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}var c=new this._cesium.Cartesian3(i[0].x,i[0].y,i[0].z),u=o.cartesianToCartographic(c),s=this._cesium.Math.toDegrees(u.latitude),l=this._cesium.Math.toDegrees(u.longitude);t.push(l),t.push(s),t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,material:this._cesium.Color.RED.withAlpha(.4)})}catch(e){console.log(e)}return this},M.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polygon.hierarchy.getValue(),i=null==this.item.polygon.height?void 0:this.item.polygon.height._value,o=null==this.item.polygon.extrudedHeight?void 0:this.item.polygon.extrudedHeight._value,r=null==this.item.polygon.stRotation?void 0:this.item.polygon.stRotation._value,n=null==this.item.polygon.fill?void 0:this.item.polygon.fill._value,a=this.item.polygon.material,s=(null!=a&&(a={color:null==a.color?void 0:"rgba("+a.color._value.red+","+a.color._value.green+","+a.color._value.blue+","+a.color._value.alpha+")",image:null==a.image?void 0:a.image._value,diffusemap:null==a.diffusemap?void 0:a.diffusemap._value,alphamap:null==a.alphamap?void 0:a.alphamap._value}),null==this.item.polygon.outline?void 0:this.item.polygon.outline._value),l=null==this.item.polygon.outlineColor?void 0:"rgba("+this.item.polygon.outlineColor._value.red+","+this.item.polygon.outlineColor._value.green+","+this.item.polygon.outlineColor._value.blue+","+this.item.polygon.outlineColor._value.alpha+")",c=null==this.item.polygon.outlineWidth?void 0:this.item.polygon.outlineWidth._value,u=null==this.item.polygon.perPositionHeight?void 0:this.item.polygon.perPositionHeight._value,h=null==this.item.polygon.closeTop?void 0:this.item.polygon.closeTop._value,m=null==this.item.polygon.closeBottom?void 0:this.item.polygon.closeBottom._value,d=this.item.polygon.distanceDisplayCondition,p=null==d?void 0:d._value.near,d=null==d?void 0:d._value.far;return{type:"polygon",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,hierarchy:t,height:i,extrudedHeight:o,stRotation:r,fill:n,material:a,outline:s,outlineColor:l,outlineWidth:c,perPositionHeight:u,closeTop:h,closeBottom:m,near:p,far:d}}},M.prototype.setTreeobj=function(e){this.treeobj=e},M.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=e}catch(e){console.log(e)}return this},M.prototype.setPolygonAlpha=function(e){try{this.item._polygon.material.color._value.alpha=e}catch(e){console.log(e)}return this},M.prototype.setPolygonColor=function(e){try{this.item._polygon.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},M.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polygon.distanceDisplayCondition=e}catch(e){console.log(e)}return this},M.prototype.setPolygonImage=function(e){try{this.item._polygon.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},M.prototype.setPolygonRepeat=function(e,t){try{this.item._polygon.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},M.prototype.setOutlineColor=function(e){try{this.item._polygon.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},M.prototype.setOutline=function(e){try{this.item._polygon.outline=e}catch(e){console.log(e)}return this},M.prototype.setExtrudedHeight=function(e){try{this.item._polygon.extrudedHeight=e}catch(e){console.log(e)}return this},M.prototype.setHeight=function(e){try{this.item._polygon.height=e}catch(e){console.log(e)}return this},M.prototype.setHeightType=function(e){try{1==e?this.item._polygon.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polygon.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polygon.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},Object.defineProperties(M.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(M.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polygon.material),this.item.polygon.material=e?new m(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.material}},polygonShow:{set:C.debounce(function(e){this.item.polygon.show=e},500),get:function(){return this.item.polygon.b}},polygonHeight:{set:C.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.height=e)},500),get:function(){var e=this.item.polygon.height;if(e)return e._value}},polygonHeightReference:{set:C.debounce(function(e){this._core.isnull(e)||(this.item.polygon.heightReference=e)},500),get:function(){var e=this.item.polygon.heightReference;if(e)return e._value}},polygonExtrudedHeight:{set:C.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.extrudedHeight=e)},500),get:function(){var e=this.item.polygon.extrudedHeight;if(e)return e._value}},polygonExtrudedHeightReference:{set:C.debounce(function(e){this._core.isnull(e)||(this.item.polygon.extrudedHeightReference=e)},500),get:function(){var e=this.item.polygon.extrudedHeightReference;if(e)return e._value}},polygonFill:{set:C.debounce(function(e){this.item.polygon.fill=e},500),get:function(){var e=this.item.polygon.fill;if(e)return e._value}},polygonMaterial:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.material=e,this.item.material=this.item.polygon.material)},500),get:function(){var e=this.item.polygon.material;try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polygonMaterialAlpha:{set:C.debounce(function(e){this._core.isnull(e)||(this.item.polygon.material.color.alpha=e)},500),get:function(){this.item.polygon.material;try{return this.item.polygon.material.color.alpha}catch(e){}}},polygonOutline:{set:C.debounce(function(e){this._core.isnull(e)||(this.item.polygon.outline=e)},500),get:function(){var e=this.item.polygon.outline;if(e)return e._value}},polygonOutlineColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polygon.outlineColor=e)},500),get:function(){var e=this.item.polygon.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},polygonOutlineWidth:{set:C.debounce(function(e){this._core.isnull(e)||(/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.outlineWidth=e)},500),get:function(){var e=this.item.polygon.outlineWidth;if(e)return e._value}}}),M.prototype.setItem=function(e){this.item=e},Object.defineProperties(M.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(M.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(M.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(M.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(M.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(M.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(M.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}}}}),Object.defineProperties(M.prototype,{Visibility:{get:function(){return this.item.show}},PolygonColor:{get:function(){var e=this.item._polygon.material.color._value;if(e)return new m(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},PolygonAlpha:{get:function(){if(this.item._polygon.material.color)return this.item._polygon.material.color._value.alpha||1}},Outline:{get:function(){if(this.item._polygon.outline)return this.item._polygon.outline._value}},OutlineColor:{get:function(){var e=this.item._polygon.outlineColor;if(this.item._polygon.outlineColor)return e=e._value,new m(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")}},ExtrudedHeight:{get:function(){if(this.item._polygon.extrudedHeight)return this.item._polygon.extrudedHeight._value}},Height:{get:function(){return this.item._polygon.height}},PolygonImage:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.uniforms.image}},PolygonRepeat:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.repeat}}}),M.prototype.forceEndHanlder=function(){this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},R.prototype.createPolyline=function(e,t,i,o,r){var n=[];if(Array.isArray(e)){if(e[0].x||e[0].y)if(void 0!==e[0].z)for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y,e[a].z));else for(a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));else if(2===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1]));else if(3===e[0].length)for(var a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1],e[a][2]));i=2===i?!1:!0;this.item=this._viewer.entities.add({polyline:{positions:n,width:10,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:this._cesium.Color.BLACK,color:new m(this._viewer,this._cesium).colorFromHtmlColor(t)}),clampToGround:i}})}else"object"==typeof e&&(t=this._core.defaultValue(e.alpha,.6),e.points.forEach(e=>{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=[],c=(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].y<l[1].y?t=0<=e?-t:t:l[0].x<l[1].x&&l[0].y<=l[1].y?(o=0!=e?-o:o,t=0<e?-t:t):l[0].x<l[1].x&&l[0].y>l[1].y&&(t=e<0?-t:t,o=-o),a=new Cesium.HeadingPitchRoll(0,o,t)),s[0]),u=(this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return c},!1),orientation:i.cylinder?new this._cesium.CallbackProperty(function(){return Cesium.Transforms.headingPitchRollQuaternion(c,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/u)-l[0].x,m=this._cesium.Math.lerp(l[0].y,l[1].y,1/u)-l[0].y,d=this._cesium.Math.lerp(l[0].z,l[1].z,1/u)-l[0].z,p=[];p.push(s[0]);for(let e=0;e<u;e++){var g=l[0].x+(e+1)*h,f=l[0].y+(e+1)*m,_=l[0].z+(e+1)*d;p.push(this._cesium.Cartesian3.fromDegrees(g,f,_))}p.push(s[1]);var C=this._core.defaultValue(i.speed,1),y=0,v=(this._viewer.clock.onTick.addEventListener(function(){y+=C,((y=parseInt(y))>=p.length-1&&0<C||y<=0&&C<0)&&(C=-C),c=p[y]}),{id:this.item.id,name:"新建链路",pId:0,type:"polyline",item:this});return this.setTreeobj(v),this._tree.insertGroupId(v,0),this},R.prototype.createLinkPros=function(o){this._lang=this._core.extend(this._lang,language._lang);this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var r=[],n=null,t="0米",i=null,a=this,s="",l=this._core.CreateTooltip(),c={point:a._cesium.Color.RED,polyline:a._cesium.Color.BLUE},u=(this._tree.handler.setInputAction(function(e){(i=a._getPosition.getMousePosition(e))&&(0===r.length?l.showAt(e.endPosition,a._lang.draw_tip_left):l.showAt(e.endPosition,a._lang.draw_tip_right),2<=r.length&&(a._cesium.defined(n)?(r.length>a._points.length&&r.pop(),r.push(i)):n=new u(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 u(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:c.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){this._lang=this._core.extend(this._lang,language._lang);var c=this,i=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1),this.polyline=c._viewer.entities.add(this.options),c.item=this.polyline},e);function e(e){this.options={polyline:{show:!0,positions:[],material:new c._cesium.PolylineOutlineMaterialProperty({color:c._core.defaultValue(t.color,c._cesium.Color.YELLOW)}),clampToGround:c._core.defaultValue(t.clampToGround,!0),width:c._core.defaultValue(t.width,3)}},this.positions=e,this._init()}var u=new c._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas),h=[],m=void 0,d=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),u.setInputAction(function(e){e=c._getPosition.getMousePosition(e);0==h.length&&h.push(e.clone()),h.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),u.setInputAction(function(e){0===h.length?d.showAt(e.endPosition,c._lang.draw_tip_left):d.showAt(e.endPosition,c._lang.draw_tip_right);e=c._getPosition.getMousePosition(e);2<=h.length&&(c._cesium.defined(m)?null!=e&&(h.pop(),e.y+=1+Math.random(),h.push(e)):m=new i(h))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),u.setInputAction(function(e){d.show(!1);var t={polyline:{},positions:[],positionsp:[],distance:[],setDistance:function(){alert("qq")}};u.destroy(),t.polyline=m;for(var i=[],o=0;o<h.length;o++){var r=c._cesium.Cartographic.fromCartesian(h[o]),n=c._cesium.Math.toDegrees(r.longitude),a=c._cesium.Math.toDegrees(r.latitude),r=r.height;i.push({lon:n,lat:a,hei:r})}t.positions=i;for(var s=1;s<h.length;s++)t.distance[s-1]=Tr(h[s-1].y,h[s-1].x,h[s].y,h[s].x);t.positionsp=h,c._core.mouse(c._viewer.container,0,"0"),"function"==typeof l&&l(t)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},R.prototype.spaceDistance=R.prototype.executePolyline1=function(t,e){this._lang=this._core.extend(this._lang,language._lang);let i;"object"!=typeof t&&"function"!=typeof e||(i=e,e=t,t=i),i=null;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var o,r,n=[],a=null,s="0米",l=null,c=this,u="",h=this._core.CreateTooltip(),m={name:"",spot:[],distance:[],label:[],ployline:[]},d={point:c._cesium.Color.RED,polyline:c._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(d.point=e.point),""!=e.polyline&&null!=e.polyline&&(d.polyline=e.polyline));let p;this._tree.handler.setInputAction(function(e){(l=c._getPosition.getMousePosition(e))&&(0===n.length?h.showAt(e.endPosition,c._lang.draw_tip_left):h.showAt(e.endPosition,c._lang.draw_tip_right),2<=n.length&&(c._cesium.defined(a)?(n.length>c._points.length&&n.pop(),n.push(l)):a=new g(n),s=c._core.getSpaceDistance(n,c._cesium)),r&&(c._viewer.entities.remove(r),r=void 0),r=c._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}}),c._tree.temporaryItem.obj.push(r))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){c._viewer.camera.getPickRay(e.position),(l=c._getPosition.getMousePosition(e))&&(p=p||c._core.getPointToCameraDistance(c._viewer,l),0!=n.length&&n.length>c._points.length?(n.pop(),n.push(l)):n.push(l,l),2<=n.length&&(c._cesium.defined(a)||(a=new g(n)),s=c._core.getSpaceDistance(n,c._cesium)),r&&(c._viewer.entities.remove(r),r=void 0),u="总长:"+(e=s),o=c._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],point:{pixelSize:5,color:d.point.withAlpha(.5),outlineColor:c._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}}),c._tree.temporaryItem.obj.push(o),c._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){c.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){h.show(!1),c._tree&&c._tree.endtemporaryItem(),c.end=void 0,r&&(c._viewer.entities.remove(r),r=void 0,n.pop()),c._points[c._points.length-1]&&(c._points[c._points.length-1].label.text=u),c._tree&&c._tree.handler.destroy(),c._core.mouse(c._viewer.container,0,"0"),"cancel"===e?c.deleteObject():(n.length<2&&c.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(m))};f.prototype._init=function(){var e=this,t=(this.options.polyline.positions=new c._cesium.CallbackProperty(function(){return e.positions},!1),c._viewer.entities.add(this.options)),t=(c.item=t,c._tree.temporaryItem.obj.push(t),m.ployline.push(t),c._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){this._lang=this._core.extend(this._lang,language._lang);var i,o,u=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,u=this,l="",c=this._core.CreateTooltip(),h={spot:[],distance:[],label:[],ployline:[]},m={point:u._cesium.Color.RED,polyline:u._cesium.Color.YELLOW};0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(m.point=e.point),""!=e.polyline&&null!=e.polyline&&(m.polyline=e.polyline));let d;this._tree.handler.setInputAction(function(e){(s=u._getPosition.getMousePosition(e))&&(0===r.length?c.showAt(e.endPosition,u._lang.draw_tip_left):c.showAt(e.endPosition,u._lang.draw_tip_right),2<=r.length&&(u._cesium.defined(n)?(r.pop(),r.push(s)):n=new g(r),a=u._core.getSpaceDistance(r,u._cesium)),u._viewer.entities.remove(o),o=u._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],label:{text:"总长:"+a,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*d),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),u._tree.temporaryItem.obj.push(o))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){u._viewer.camera.getPickRay(e.position),(s=u._getPosition.getMousePosition(e))&&(d=d||u._core.getPointToCameraDistance(u._viewer,s),p(s),0==r.length&&r.push(s.clone()),r.push(s),l="总长:"+(e=a),i=u._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],point:{pixelSize:5,color:m.point.withAlpha(.5),outlineColor:u._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*d),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*d),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),u._tree.temporaryItem.obj.push(i),u._points.push(i),h.spot.push(s),h.distance.push(a),h.label.push(i))},this._cesium.ScreenSpaceEventType.LEFT_CLICK);var p=function(e){polylineCartographic.push(e);var t=[];if(1<polylineCartographic.length){var i=polylineCartographic[polylineCartographic.length-2],o=polylineCartographic[polylineCartographic.length-1],r=1e7*Math.abs(i.longitude-o.longitude),n=1e7*Math.abs(i.latitude-o.latitude),a=(n<r&&(n=r),parseInt(n/10));(a=1e3<a?1e3:a)<2&&(a=2);for(var s=0;s<a;++s)t.push(new u._cesium.Cartographic(u._cesium.Math.lerp(i.longitude,o.longitude,s/(a-1)),u._cesium.Math.lerp(i.latitude,o.latitude,s/(a-1))))}else t=polylineCartographic;if(0<t.length)for(var l=0;l<t.length;l++){var e=t[l],c=u._viewer.scene.globe.getHeight(e);u._cesium.Cartesian3.fromDegrees(e.longitude/Math.PI*180,e.latitude/Math.PI*180,c)}},g=(this._tree.handler.setInputAction(function(e){c.show(!1),u._tree.endtemporaryItem(),u._viewer.entities.remove(o),u._points[u._points.length-1].label.text=l,u._tree.handler.destroy(),r.pop(),""!=t&&null!=t&&"function"==typeof t&&t(h)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),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));u.item=t,u._tree.temporaryItem.obj.push(t),h.ployline.push(t)},f);function f(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:m.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*d),width:3,clampToGround:!1}},this.positions=e,this._init()}return this},R.prototype.horizontalDistance=R.prototype.executeHorizontals=function(t,e){this._lang=this._core.extend(this._lang,language._lang);let i;"object"!=typeof t&&"function"!=typeof e||(i=e,e=t,t=i),i=null,this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.starttemporaryItem(this._viewer);var h,m=this,d=[],p="",g=[],f=void 0,o=m._viewer.scene,l=o.globe.ellipsoid,_={name:"",spot:[],distance:[],label:[],polyline:[]},C={point:m._cesium.Color.RED,polyline:m._cesium.Color.YELLOW},e=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(C.point=e.point),""!=e.polyline&&null!=e.polyline&&(C.polyline=e.polyline)),new m._cesium.BillboardCollection),c=(o.primitives.add(e),new m._cesium.WebMercatorProjection),r=(this._tree.handler=new m._cesium.ScreenSpaceEventHandler(o.canvas),this._core.CreateTooltip()),y=[];let v;this._tree.handler.setInputAction(function(e){0===d.length?r.showAt(e.endPosition,m._lang.draw_tip_left):r.showAt(e.endPosition,m._lang.draw_tip_right),(e=m._getPosition.getMousePosition(e,_.polyline.concat(_.label)))&&m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e)&&(e=e,d.length<1||(m._cesium.defined(f)?(f.path.pop(),f.path.push(e),y.pop(),y.push(e)):f=new b(d,m._cesium),e=w(y),h&&(m._viewer.entities.remove(h),h=void 0),h=m._viewer.entities.add({name:"空间直线距离",position:f.path[f.path.length-1],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*v),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})))},m._cesium.ScreenSpaceEventType.MOUSE_MOVE);this._tree.handler.setInputAction(function(e){e=m._getPosition.getMousePosition(e,_.polyline.concat(_.label));if(n=e?m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e):n){v=v||m._core.getPointToCameraDistance(m._viewer,e);0<y.length&&y.pop();var t=n,i=(g.push(t),[]);if(1<g.length){var o=g[g.length-2],r=g[g.length-1],n=1e7*Math.abs(o.longitude-r.longitude),a=1e7*Math.abs(o.latitude-r.latitude),s=(a<n&&(a=n),parseInt(a/10));(s=1e3<s?1e3:s)<2&&(s=2);for(var l=0;l<s;++l)i.push(new m._cesium.Cartographic(m._cesium.Math.lerp(o.longitude,r.longitude,l/(s-1)),m._cesium.Math.lerp(o.latitude,r.latitude,l/(s-1))));i.push(r.clone())}else i=g;if(0<i.length)for(var c=0;c<i.length;c++){var t=i[c],u=m._viewer.scene.globe.getHeight(t),u=m._cesium.Cartesian3.fromRadians(t.longitude,t.latitude,u);y.push(u)}0===d.length?d.push(e,e):d.push(e),m._cesium.defined(f)||(f=new b(d,m._cesium)),h&&(m._viewer.entities.remove(h),h=void 0);n="0米",a=(f&&(n=w(y)),y.push(e),p="总长:"+n,_.spot.push(e),_.distance.push(n),m._viewer.entities.add({position:e,point:{pixelSize:5,color:C.point.withAlpha(.5),outlineColor:m._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*v),outlineWidth:1,clampToGround:!0},label:{text:n,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*v),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}));_.label.push(a),m._points.push(a)}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){m.end()},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){m._tre&&m._tree.endtemporaryItem(),h&&m._viewer.entities.remove(h),m._points[m._points.length-1]&&(m._points[m._points.length-1].label.text=p),m._tree&&m._tree.handler.destroy(),m.end=void 0,m._core.mouse(m._viewer.container,0,"0"),d.pop(),r.show(!1),"cancel"===e?m.deleteObject():(d.length<2&&m.deleteObject(),""!=t&&null!=t&&"function"==typeof t&&t(_))};var w=function(e){for(var t,i,o,r,n=0,a=0+m._lang.unit_m,s=0;s<e.length-1;s++)o=l.cartesianToCartographic(e[s]),t=(r=c.project(o)).x,i=r.y,o=l.cartesianToCartographic(e[s+1]),o=(r=c.project(o)).x,r=r.y,n+=Math.sqrt((t-o)*(t-o)+(i-r)*(i-r));return 0<n&&(a=n.toFixed(2)+m._lang.unit_m),a=1<=n/1e3?(n/1e3).toFixed(2)+m._lang.unit_km:a},b=(n.prototype._init=function(e){var t=this,i=(this.options.polyline.positions=new m._cesium.CallbackProperty(function(){return t.path},!1),this.lineEntity=m._viewer.entities.add(this.options),m.item=this.lineEntity,_.polyline.push(this.lineEntity),m._core.getuid());_.name="新建水平距离"+i},n);function n(e,t){if(!m._cesium.defined(e))throw new m._cesium.DeveloperError("positions is required!");if(e.length<2)throw new m._cesium.DeveloperError("positions 的长度必须大于等于2");m._cesium.Material.fromType(m._cesium.Material.ColorType).uniforms.color=new m._cesium.Color(1,1,0,.5),this.options={name:"直线",polyline:{show:!0,positions:[],material:C.polyline,width:3,clampToGround:!0}},this.path=e,this._init(m._cesium)}return this},R.prototype.getHeight=function(e){var t=this._cesium.Cartographic.fromCartesian(e[0]),e=this._cesium.Cartographic.fromCartesian(e[1]).height-t.height;return e=e<1e3?e.toFixed(2)+this._lang.unit_m:(e/=1e3).toFixed(2)+this._lang.unit_km},R.prototype.executeHeight=function(t){this._lang=this._core.extend(this._lang,language._lang);var r=this,n=(this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),i=null,a=0,o=this._core.CreateTooltip(),s=null;let l;this._tree.handler.setInputAction(function(e){(s=r._getPosition.getMousePosition(e))&&(0===n.length?o.showAt(e.endPosition,r._lang.draw_tip_left):o.showAt(e.endPosition,r._lang.draw_tip_right),2<=n.length&&(r._cesium.defined(i)?(n.pop(),n.push(s)):i=new c(n),1<n.lenght&&(a=r._core.getHeight(n,r._cesium))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){(s=r._getPosition.getMousePosition(e))&&(l=l||r._core.getPointToCameraDistance(r._viewer,s),e=a+"米",0==n.length?(n.push(s.clone()),n.push(s),e=r._viewer.entities.add({name:"高度",position:n[0],point:{pixelSize:5,color:r._cesium.Color.RED.withAlpha(.5),outlineColor:r._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*l),outlineWidth:2,clampToGround:!0,heightReference:r._cesium.HeightReference.none},label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*l),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(e),r._points.push(e)):1<=n.length&&(r._tree.endtemporaryItem(),""!=t&&null!=t&&"function"==typeof t&&t(n)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){r._tree.handler.destroy();var t=a+"米",i=r._cesium.Cartographic.fromCartesian(n[0]),o=r._cesium.Cartographic.fromCartesian(n[1]),i=r._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(i.longitude),r._cesium.Math.toDegrees(i.latitude),o.height),o=r._viewer.entities.add({name:"直线距离",position:i,point:{pixelSize:5,color:r._cesium.Color.RED.withAlpha(.5),outlineColor:r._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,clampToGround:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*l),heightReference:r._cesium.HeightReference.none},label:{text:t,font:"16px 宋体",distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*l),fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});r._tree.temporaryItem.obj.push(o),r._points.push(o)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);e.prototype._init3=function(){var o=this,e=(this.options.polyline.positions=new r._cesium.CallbackProperty(function(){var e=[],t=(e.push(o.positions[0]),r._cesium.Cartographic.fromCartesian(o.positions[0]));try{var i=r._cesium.Cartographic.fromCartesian(o.positions[1])}catch(e){return}t=r._cesium.Cartesian3.fromDegrees(r._cesium.Math.toDegrees(t.longitude),r._cesium.Math.toDegrees(t.latitude),i.height);return e.push(t),e},!1),r._viewer.entities.add(this.options));r.item=e,r._tree.temporaryItem.obj.push(e)};var c=e;function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:r._cesium.Color.YELLOW,clampToGround:!0,width:3},ellipse:{show:!1,material:r._cesium.Color.GREEN.withAlpha(.5),clampToGround:!0,outline:!0}},this.positions=e,this._init3()}return this},R.prototype.verticalHeight=R.prototype.executeHeightTe=function(t,e){this._lang=this._core.extend(this._lang,language._lang);let i;"object"!=typeof t&&"function"!=typeof e||(i=e,e=t,t=i),i=null;var r,o={point:Cesium.Color.RED,polyline:Cesium.Color.YELLOW},n=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(o.point=e.point),""!=e.polyline&&null!=e.polyline&&(o.polyline=e.polyline)),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),a=null,s=null,l=this,c={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},u=this._core.CreateTooltip();let h;function m(e){var t,i,o=l._cesium.Cartographic.fromCartesian(e[0]),r=l._cesium.Cartographic.fromCartesian(e[1]);return r.height,r.height,o.height,r=0<r.height-o.height?(t=l._cesium.Cartesian3.fromDegrees(l._cesium.Math.toDegrees(o.longitude),l._cesium.Math.toDegrees(o.latitude),r.height),i=[e[1],t],[e[0],t]):(t=l._cesium.Cartesian3.fromDegrees(l._cesium.Math.toDegrees(r.longitude),l._cesium.Math.toDegrees(r.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:r}}this._tree.handler.setInputAction(function(e){0===n.length?u.showAt(e.endPosition,l._lang.draw_tip_left):u.showAt(e.endPosition,"右键结束!"),(s=l._getPosition.getMousePosition(e,c.polyline.concat(c.point)))&&2<=n.length&&(l._cesium.defined(a)?(n.pop(),n.push(s.clone()),r=m(n)):(a=new d(n),e=l._viewer.entities.add({name:"高度测量",position:new l._cesium.CallbackProperty(function(){return n[1]},!1),point:{pixelSize:5,color:o.point.withAlpha(.5),outlineColor:l._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),heightReference:l._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l._tree.temporaryItem.obj.push(e),c.point.push(e),l._points.push(e),r=m(n),e=l._viewer.entities.add({position:new l._cesium.CallbackProperty(function(){return l._cesium.Cartesian3.midpoint(r.eq_lon_lat[0],r.eq_lon_lat[1],new l._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new l._cesium.CallbackProperty(function(){return r.eq_lon_lat},!1),material:o.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),width:2},label:{text:new l._cesium.CallbackProperty(function(){var e=l.getHeight(r.eq_lon_lat),t=l._lang.unit_m,i=e;i=-1!==e.indexOf("千米")?(t=l._lang.unit_km,e.replace("千米","")):e.replace("米","");e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t;return c.gddistance=e="高度:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c.polyline.push(e),l._polylines.push(e),e=l._viewer.entities.add({position:new l._cesium.CallbackProperty(function(){return l._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new l._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new l._cesium.CallbackProperty(function(){return r.eq_height},!1),material:o.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),width:2},label:{text:new l._cesium.CallbackProperty(function(){var e=l._core.getHorizontalDistance(r.eq_height,l._cesium);return c.spdistance="水平距离:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c.polyline.push(e),l._polylines.push(e)))},l._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){(s=l._getPosition.getMousePosition(e,c.polyline.concat(c.point)))&&(h=h||l._core.getPointToCameraDistance(l._viewer,s),0==n.length?(n.push(s.clone()),n.push(s.clone()),r=m(n),e=l._viewer.entities.add({name:"高度测量",position:n[0],point:{pixelSize:5,color:o.point.withAlpha(.5),outlineColor:l._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),heightReference:l._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l._tree.temporaryItem.obj.push(e),c.point.push(e),l._points.push(e)):2<=n.length&&(l._cesium.defined(a)?(n.pop(),n.push(s.clone()),r=m(n)):(a=new d(n),e=l._viewer.entities.add({name:"高度测量",position:new l._cesium.CallbackProperty(function(){return n[1]},!1),point:{pixelSize:5,color:o.point.withAlpha(.5),outlineColor:l._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),heightReference:l._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l._tree.temporaryItem.obj.push(e),c.point.push(e),l._points.push(e),r=m(n),e=l._viewer.entities.add({position:new l._cesium.CallbackProperty(function(){return l._cesium.Cartesian3.midpoint(r.eq_lon_lat[0],r.eq_lon_lat[1],new l._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new l._cesium.CallbackProperty(function(){return r.eq_lon_lat},!1),material:o.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),width:2},label:{text:new l._cesium.CallbackProperty(function(){var e=l.getHeight(r.eq_lon_lat),t=l._lang.unit_m,i=e;i=-1!==e.indexOf("千米")?(t=l._lang.unit_km,e.replace("千米","")):e.replace("米","");e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t;return c.gddistance=e="高度:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c.polyline.push(e),l._polylines.push(e),e=l._viewer.entities.add({position:new l._cesium.CallbackProperty(function(){return l._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new l._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new l._cesium.CallbackProperty(function(){return r.eq_height},!1),material:o.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),width:2},label:{text:new l._cesium.CallbackProperty(function(){var e=l._core.getHorizontalDistance(r.eq_height,l._cesium);return c.spdistance="水平距离:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),c.polyline.push(e),l._polylines.push(e))))},l._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){l.end()},l._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){l.end()},l._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){l._tree.handler.destroy(),u.show(!1),l.end=void 0,l._tree.endtemporaryItem(),l._core.mouse(l._viewer.container,0,"0"),"cancel"===e?l.deleteObject():""!=t&&null!=t&&"function"==typeof t&&t(c)};p.prototype._init=function(){var o=this,e=(this.options.polyline.positions=new l._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new l._cesium.CallbackProperty(function(){return l._cesium.Cartesian3.midpoint(r.eq_height[0],r.eq_height[1],new l._cesium.Cartesian3)},!1),this.options.label.text=new l._cesium.CallbackProperty(function(){i=o.positions,e=l._cesium.Cartographic.fromCartesian(i[0]),i=l._cesium.Cartographic.fromCartesian(i[1]),(t=new l._cesium.EllipsoidGeodesic).setEndPoints(e,i),t=t.surfaceDistance;var e,t,i=t=1e3<=(t=Math.sqrt(Math.pow(t,2)+Math.pow(i.height-e.height,2)))?(t/1e3).toFixed(2)+l._lang.unit_km:t.toFixed(2)+l._lang.unit_m;return c.kjdistance="空间距离:"+i},!1),l._viewer.entities.add(this.options)),e=(l.item=e,l._tree.temporaryItem.obj.push(e),c.polyline.push(e),l._core.getuid());c.name="新建垂直高度"+e};var d=p;function p(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:o.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*h),pixelOffset:new Cesium.Cartesian2(20,20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},R.prototype.executeHeightTe1=function(t){this._lang=this._core.extend(this._lang,language._lang),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var i=[],o=null,r=null,n=null,a=null,s=this,l={spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},c=this._core.CreateTooltip();function u(e){var t=s._cesium.Cartographic.fromCartesian(e[0]),e=s._cesium.Cartographic.fromCartesian(e[1]);e.height,e.height,t.height,s._cesium.Cartesian3.fromDegrees(s._cesium.Math.toDegrees(t.longitude),s._cesium.Math.toDegrees(t.latitude),e.height)}this._tree.handler.setInputAction(function(e){0===i.length?c.showAt(e.endPosition,s._lang.draw_tip_left):c.showAt(e.endPosition,s._lang.draw_tip_right),(a=s._getPosition.getMousePosition(e))&&2<=i.length&&(s._cesium.defined(o)?(i.pop(),i.push(a.clone()),u(i)):o=new h(i),s._cesium.define(r)||(r=new m(i)),s._cesium.define(n)||(n=new p(i)))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){0==i.length&&(a=s._getPosition.getMousePosition(e))&&(i.push(a.clone()),i.push(a.clone()),u(i),e=s._viewer.entities.add({name:"高度测量",position:i[0],point:{pixelSize:5,color:s._cesium.Color.RED.withAlpha(.5),outlineColor:s._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:s._cesium.HeightReference.none}}),s._tree.temporaryItem.obj.push(e),l.point.push(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){s._tree.handler.destroy(),c.show(!1),s._tree.endtemporaryItem(),""!=t&&null!=t&&"function"==typeof t&&t(l)},s._cesium.ScreenSpaceEventType.RIGHT_CLICK);e.prototype._init=function(){var o=this,e=(this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),i=s._cesium.Cartographic.fromCartesian(i[1]),(t=new s._cesium.EllipsoidGeodesic).setEndPoints(e,i),t=t.surfaceDistance;var e,t,i=t=1e3<=(t=Math.sqrt(Math.pow(t,2)+Math.pow(i.height-e.height,2)))?(t/1e3).toFixed(2)+s._lang.unit_km:t.toFixed(2)+s._lang.unit_m;return l.kjdistance="空间距离:"+i},!1),s._viewer.entities.add(this.options));s._tree.temporaryItem.obj.push(e),l.polyline.push(e)};var h=e;function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}d.prototype._init=function(){var o=this,e=(this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),i=s._cesium.Cartographic.fromCartesian(i[1]),(t=new s._cesium.EllipsoidGeodesic).setEndPoints(e,i),t=t.surfaceDistance;var e,t,i=t=1e3<=(t=Math.sqrt(Math.pow(t,2)+Math.pow(i.height-e.height,2)))?(t/1e3).toFixed(2)+s._lang.unit_km:t.toFixed(2)+s._lang.unit_m;return l.kjdistance="空间距离:"+i},!1),s._viewer.entities.add(this.options));s._tree.temporaryItem.obj.push(e),l.polyline.push(e)};var m=d;function d(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}g.prototype._init=function(){var o=this,e=(this.options.polyline.positions=new s._cesium.CallbackProperty(function(){return o.positions},!1),this.options.position=new s._cesium.CallbackProperty(function(){return o.positions[1].clone()},!1),this.options.label.text=new s._cesium.CallbackProperty(function(){i=o.positions,e=s._cesium.Cartographic.fromCartesian(i[0]),i=s._cesium.Cartographic.fromCartesian(i[1]),(t=new s._cesium.EllipsoidGeodesic).setEndPoints(e,i),t=t.surfaceDistance;var e,t,i=t=1e3<=(t=Math.sqrt(Math.pow(t,2)+Math.pow(i.height-e.height,2)))?(t/1e3).toFixed(2)+s._lang.unit_km:t.toFixed(2)+s._lang.unit_m;return l.kjdistance="空间距离:"+i},!1),s._viewer.entities.add(this.options));s._tree.temporaryItem.obj.push(e),l.polyline.push(e)};var p=g;function g(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},R.prototype.measureAngle=R.prototype.executeAngle=function(t,e){this._lang=this._core.extend(this._lang,language._lang);let i;"object"!=typeof t&&"function"!=typeof e||(i=e,e=t,t=i),i=null;var o,r,n,a,s={point:Cesium.Color.RED,polyline:Cesium.Color.YELLOW},l=(0<Object.keys(e).length&&(""!=e.point&&null!=e.point&&(s.point=e.point),""!=e.polyline&&null!=e.polyline&&(s.polyline=e.polyline)),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),c=null,u=null,h=this,m={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[],labels:[]},d=this._core.CreateTooltip();let p;function g(e){var t,i,o=h._cesium.Cartographic.fromCartesian(e[0]),r=h._cesium.Cartographic.fromCartesian(e[1]);return r.height,r.height,o.height,r=0<r.height-o.height?(t=h._cesium.Cartesian3.fromDegrees(h._cesium.Math.toDegrees(o.longitude),h._cesium.Math.toDegrees(o.latitude),r.height),i=[e[1],t],[e[0],t]):(t=h._cesium.Cartesian3.fromDegrees(h._cesium.Math.toDegrees(r.longitude),h._cesium.Math.toDegrees(r.latitude),o.height),i=[e[0],t],[e[1],t]),{new:t,eq_height:i,eq_lon_lat:r}}this._tree.handler.setInputAction(function(e){var t,i;0===l.length?d.showAt(e.endPosition,h._lang.draw_tip_left):d.showAt(e.endPosition,"右键结束!"),(u=h._getPosition.getMousePosition(e,m.polyline.concat(m.point)))&&2<=l.length&&(e=h._core.ElevationAngle(n,u,h._cesium),i=t="",i=n.z<=u.z?(t="角度:"+(90-Math.abs(e)).toFixed(2),"角度:"+Math.abs(e).toFixed(2)):(t="角度:"+Math.abs(e).toFixed(2),"角度:"+(90-Math.abs(e)).toFixed(2)),r.label.text=t,h._cesium.defined(c)?(a.position.setValue(u),a.label.text=i):(a=h._viewer.entities.add({position:u,name:"等经纬度",label:{text:i,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),m.labels.push(a),h._points.push(a)),h._cesium.defined(c)?(l.pop(),l.push(u.clone()),o=g(l)):(c=new f(l),e=h._viewer.entities.add({name:"角度测量",position:new h._cesium.CallbackProperty(function(){return l[1]},!1),point:{pixelSize:5,color:s.point.withAlpha(.5),outlineColor:h._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),outlineWidth:2,heightReference:h._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h._tree.temporaryItem.obj.push(e),m.point.push(e),h._points.push(e),o=g(l),t=h._viewer.entities.add({position:new h._cesium.CallbackProperty(function(){return l[0]},!1),name:"等经纬度",polyline:{show:!0,positions:new h._cesium.CallbackProperty(function(){return o.eq_lon_lat},!1),material:s.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:2}}),m.polyline.push(t),h._polylines.push(t),i=h._viewer.entities.add({position:new h._cesium.CallbackProperty(function(){return l[1]},!1),name:"等高度直线",polyline:{show:!0,positions:new h._cesium.CallbackProperty(function(){return o.eq_height},!1),material:s.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:2}}),m.polyline.push(i),h._polylines.push(i)))},h._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){var t;(u=h._getPosition.getMousePosition(e,m.polyline.concat(m.point)))&&(p=p||h._core.getPointToCameraDistance(h._viewer,u),0==l.length?(n=u,r=h._viewer.entities.add({position:u,name:"等经纬度",label:{text:"0",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}}),m.labels.push(r),t=h._viewer.entities.add({position:new h._cesium.CallbackProperty(function(){return h._cesium.Cartesian3.midpoint(o.eq_lon_lat[0],o.eq_lon_lat[1],new h._cesium.Cartesian3)},!1),label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),l.push(u.clone()),l.push(u.clone()),o=g(l),e=h._viewer.entities.add({name:"高度测量",position:l[0],point:{pixelSize:5,color:s.point.withAlpha(.5),outlineColor:h._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:h._cesium.HeightReference.none,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h._tree.temporaryItem.obj.push(e),m.point.push(e),h._points.push(r,e)):2<=l.length&&(h._cesium.defined(c)?(l.pop(),l.push(u.clone()),o=g(l)):(c=new f(l),e=h._viewer.entities.add({name:"高度测量",position:new h._cesium.CallbackProperty(function(){return l[1]},!1),point:{pixelSize:5,color:s.point.withAlpha(.5),outlineColor:h._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),outlineWidth:2,heightReference:h._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),h._tree.temporaryItem.obj.push(e),m.point.push(e),h._points.push(e),o=g(l),t=h._viewer.entities.add({position:new h._cesium.CallbackProperty(function(){return h._cesium.Cartesian3.midpoint(o.eq_lon_lat[0],o.eq_lon_lat[1],new h._cesium.Cartesian3)},!1),name:"等经纬度",polyline:{show:!0,positions:new h._cesium.CallbackProperty(function(){return o.eq_lon_lat},!1),material:s.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:2},label:{text:new h._cesium.CallbackProperty(function(){var e=h.getHeight(o.eq_lon_lat),t=h._lang.unit_m,i=e;i=-1!==e.indexOf("千米")?(t=h._lang.unit_km,e.replace("千米","")):e.replace("米","");e=(i=parseFloat(i))<0?(i=Math.abs(i))+t:i+t;return m.gddistance=e="高度:"+e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),m.polyline.push(t),h._polylines.push(t),e=h._viewer.entities.add({position:new h._cesium.CallbackProperty(function(){return h._cesium.Cartesian3.midpoint(o.eq_height[0],o.eq_height[1],new h._cesium.Cartesian3)},!1),name:"等高度直线",polyline:{show:!0,positions:new h._cesium.CallbackProperty(function(){return o.eq_height},!1),material:s.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:2},label:{text:new h._cesium.CallbackProperty(function(){var e="角度:"+(e=h._core.ElevationAngle(firtP,u,h._cesium)).toFixed(2);return m.spdistance=e},!1),font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),m.polyline.push(e),h._polylines.push(e))))},h._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){h.end()},h._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(e){h.end()},h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(e){h._tree.handler.destroy(),d.show(!1),h._tree.endtemporaryItem(),h.end=void 0,h._core.mouse(h._viewer.container,0,"0"),"cancel"===e?h.deleteObject():""!=t&&null!=t&&"function"==typeof t&&(this.labels=m.labels,t(m))};_.prototype._init=function(){var e=this,t=(this.options.polyline.positions=new h._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new h._cesium.CallbackProperty(function(){return h._cesium.Cartesian3.midpoint(e.positions[0],e.positions[1],new h._cesium.Cartesian3)},!1),h._viewer.entities.add(this.options)),t=(h.item=t,h._tree.temporaryItem.obj.push(t),m.polyline.push(t),h._core.getuid());m.name="新建垂直高度"+t};var f=_;function _(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:s.polyline,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*p),pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}return this},R.prototype.executeHeightDg=function(e){this._tree.removeHandler();var r,n=this,a=(this._tree.handler=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas),[]),t=null,i=null,o=(this._tree.handler.setInputAction(function(e){(i=n._getPosition.getMousePosition(e))&&2<=a.length&&(n._cesium.defined(t)?(a.pop(),a.push(i.clone()),r=point_conf(a)):t=new o(a))},n._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){0==a.length&&(i=n._getPosition.getMousePosition(e))&&(a.push(i.clone()),a.push(i.clone()),n._viewer.entities.add({parent:measure_entities,name:"多边形面积",position:a[0],point:{pixelSize:5,color:n._cesium.Color.RED.withAlpha(.5),outlineColor:n._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:n._cesium.HeightReference.none}}))},n._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){n._tree.handler.destroy();var t=[],i=[],o=(t.push(a[0].clone()),t.push(r.clone()),n.getHeight(t));n._viewer.entities.add({parent:measure_entities,name:"等经纬度",position:t[0].clone(),polyline:{show:!0,clampToGround:!0,positions:t,material:new n._cesium.PolylineDashMaterialProperty({color:n._cesium.Color.RED}),width:2},label:{text:o,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),i.push(r.clone()),i.push(a[1].clone()),o=getDistance(i)+n._lang.unit_km,n._viewer.entities.add({parent:measure_entities,name:"等高度直线",position:i[0].clone(),polyline:{show:!0,positions:i,clampToGround:!0,material:new n._cesium.PolylineDashMaterialProperty({color:n._cesium.Color.RED}),width:2},label:{text:o,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})},n._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),s.prototype._init=function(){var e=this;this.options.polyline.positions=new n._cesium.CallbackProperty(function(){return e.positions},!1),this.options.position=new n._cesium.CallbackProperty(function(){return e.positions[1].clone()},!1),this.options.label.text=new n._cesium.CallbackProperty(function(){return getSpaceDistance(e.positions)},!1),n._viewer.entities.add(this.options)},s);function s(e){this.options={parent:measure_entities,name:"直线",polyline:{show:!0,positions:[],clampToGround:!0,material:n._cesium.Color.GOLD,width:2},label:{font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=e,this._init()}},R.prototype.executeAnge=function(t){var i,o=this,r=(this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),n=null,a="",s=null,l=0,c={spot:[],distance:0,label:{},angle:0},u=(this._tree.handler.setInputAction(function(e){o._viewer.camera.getPickRay(e.endPosition),(s=o._getPosition.getMousePosition(e))&&(2<=r.length&&(o._cesium.defined(n)?(r.pop(),r.push(s)):n=new h(r),a=o._core.getSpaceDistance(r,o._cesium)),e=a,o._viewer.entities.remove(i),1<r.length&&(l=(180*Math.atan2(r[1].y-r[0].y,r[1].x-r[0].x)/Math.PI).toFixed(0),i=o._viewer.entities.add({name:"空间直线距离",position:r[r.length-1],label:{text:e+";"+l+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})))},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),0),h=(this._tree.handler.setInputAction(function(e){0<u&&(o._tree.handler.destroy(),r.pop()),o._viewer.camera.getPickRay(e.position),(s=o._getPosition.getMousePosition(e))&&(0==r.length&&r.push(s.clone()),r.push(s),c.spot.push(s),c.distance=a,c.label=i,o._points.push(i),c.angle=l,1==u&&""!=t&&null!=t&&"function"==typeof t&&t(c),u+=1)},o._cesium.ScreenSpaceEventType.LEFT_CLICK),e.prototype._init6=function(){var e=this,t=(this.options.polyline.positions=new o._cesium.CallbackProperty(function(){return e.positions},!1),o._viewer.entities.add(this.options));o.item=t},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:o._cesium.Color.YELLOW,width:3,clampToGround:!0}},this.positions=e,this._init6()}return this},R.prototype.executeProfile=function(e,i){this._lang=this._core.extend(this._lang,language._lang);var o,r=this,n=(this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),a=[],s=null,l=e.parameterd,c=e.objid,u=e.cyjj,a=[],h=0,m=this._core.CreateTooltip(),d=null,p={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]},g=(this._tree.handler.setInputAction(function(e){0===n.length?m.showAt(e.endPosition,r._lang.draw_tip_left):m.showAt(e.endPosition,"再次点击结束绘制!");var t=r._viewer.camera.getPickRay(e.endPosition);d=r._viewer.scene.globe.pick(t,r._viewer.scene),r._viewer.scene.pick(e.endPosition)&&(t=r._viewer.scene.pickPosition(e.endPosition))&&(d=t),d&&(2<=n.length&&(r._cesium.defined(s)?(n.pop(),n.push(d)):s=new f(n),h=r._core.getSpaceDistance(n,r._cesium)),e=h,r._viewer.entities.remove(o),1<n.length&&((180*Math.atan2(n[1].y-n[0].y,n[1].x-n[0].x)/Math.PI).toFixed(0),o=r._viewer.entities.add({name:"空间直线距离",position:n[n.length-1],label:{text:e,font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),r._tree.temporaryItem.obj.push(o),r._points.push(o)))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),0),f=(this._tree.handler.setInputAction(function(e){0<g&&(r._tree.handler.destroy(),n.pop(),m.show(!1));var t=r._viewer.camera.getPickRay(e.position);d=r._viewer.scene.globe.pick(t,r._viewer.scene),r._viewer.scene.pick(e.position)&&(t=r._viewer.scene.pickPosition(e.position))&&(d=t),d&&(0==n.length&&n.push(d.clone()),a.push(d),n.push(d),p.spot.push(d),p.label=o,1==g?(r._tree.endtemporaryItem(),r._core.getPmfx(a,l,u,r._cesium,r._viewer,function(e){p.distance=e.juli,p.gcs=e.gcs,p.gcs=e.gcs,p.cys=e.cys,p.max=e.max,p.min=e.min,p.obj=r,m.show(!1),""!=i&&null!=i&&"function"==typeof i&&i(p)})):(e.position.x,e.position.y),g+=1)},r._cesium.ScreenSpaceEventType.LEFT_CLICK),t.prototype._init10=function(){var e=this,t=(this.options.polyline.positions=new r._cesium.CallbackProperty(function(){return e.positions},!1),r._viewer.entities.add(this.options)),t=(r.item=t,r._tree.temporaryItem.obj.push(t),r._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||V.selectedItem.id,r._core.getuid()),t={id:t,name:"新建剖面分析"+t,pId:r._core.isnull(c)?0:c,type:"polyline",item:r};r.setTreeobj(t),V.insertGroupId(t,r._core.isnull(c)?0:c)},t);function t(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:r._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return this},R.prototype.executeProfilePro=function(e,t){var i=this,o=(this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),r=null,n=e.parameterd,a=e.objid,s=e.cyjj,l=this._core.CreateTooltip(),c=null,u={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]},h=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this._tree.handler.setInputAction(function(e){3<=o.length?l.showAt(e.endPosition,"右键结束绘制"):l.showAt(e.endPosition,"点击绘制剖面点");var t=i._viewer.camera.getPickRay(e.endPosition);c=i._viewer.scene.globe.pick(t,i._viewer.scene),i._viewer.scene.pick(e.endPosition)&&(t=i._viewer.scene.pickPosition(e.endPosition))&&(c=t),c&&2<=o.length&&(i._cesium.defined(r)?(o.pop(),o.push(c)):r=new h(o))},i._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(e){i.end()},i._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){i._tree.handler.destroy(),i._core.mouse(i._viewer.container,0),i._tree.endtemporaryItem(),"pc"==i._core.getBrowser().pc&&o.pop(),l.show(!1),i.end=void 0,"cancel"===e?i.item&&i._viewer.entities.remove(i.item):o.length<=1?window.layuiLayer&&window.layuiLayer.msg("剖面点小于两点,请重新绘制"):(u.spot=o,i._core.getPmfxPro(o,n,s,i._cesium,i._viewer,function(e){u.distance=e.juli,u.gcs=e.gcs,u.cys=e.cys,u.max=e.max,u.min=e.min,u.allPoint=e.allPoint,""!=t&&null!=t&&"function"==typeof t&&t(u)}))},this._tree.handler.setInputAction(function(e){var t=i._viewer.camera.getPickRay(e.position);c=i._viewer.scene.globe.pick(t,i._viewer.scene),i._viewer.scene.pick(e.position)&&(t=i._viewer.scene.pickPosition(e.position))&&(c=t),c&&(0===o.length&&o.push(c.clone()),o.push(c),2<o.length&&(i._cesium.defined(r)||(r=new h(o))))},i._cesium.ScreenSpaceEventType.LEFT_CLICK),m.prototype._init10=function(){var e=this,t=(this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1),i._viewer.entities.add(this.options)),t=(i.item=t,i._tree.temporaryItem.obj.push(t),i._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||V.selectedItem.id,i._core.getuid()),t={id:t,name:"新建剖面分析"+t,pId:i._core.isnull(a)?0:a,type:"polyline",item:i};i.setTreeobj(t),V.insertGroupId(t,i._core.isnull(a)?0:a)},m);function m(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:i._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=e,this._init10()}return this},R.prototype.executeAngeSdcs=function(o){this._lang=this._core.extend(this._lang,language._lang);var r,n=this,a=(this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),[]),s=null,l=[],c=this._core.CreateTooltip(),u="",h=null,m=0,d={spot:[],distance:0,label:{},angle:0},p=(this._tree.handler.setInputAction(function(e){var t,i;0===a.length?c.showAt(e.endPosition,n._lang.draw_tip_left):c.showAt(e.endPosition,"再次点击结束绘制!"),n._viewer.camera.getPickRay(e.endPosition),(h=n._getPosition.getMousePosition(e))&&2<=a.length&&(n._cesium.defined(s)?(a.pop(),a.push(h)):s=new g(a),u=n._core.getSpaceDistance(a,n._cesium),2<=p&&(n._viewer.entities.remove(r),e=n._cesium.Cartographic.fromCartesian(a[a.length-1]),t=n._cesium.Math.toDegrees(e.longitude),i=n._cesium.Math.toDegrees(e.latitude),e=e.height,l[2]={lon:t,lat:i,hei:e},m=n._core.Angle(l[0],l[1],l[2]).toFixed(1),r=n._viewer.entities.add({name:"三点角度测量",position:a[a.length-1],label:{text:m+"度",font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._points.push(r)))},n._cesium.ScreenSpaceEventType.MOUSE_MOVE),0),g=(this._tree.handler.setInputAction(function(e){var t,i;1<p&&(n._tree.handler.destroy(),a.pop()),n._viewer.camera.getPickRay(e.position),(h=n._getPosition.getMousePosition(e))&&(0==a.length&&a.push(h.clone()),a.push(h),e=n._cesium.Cartographic.fromCartesian(a[a.length-1]),t=n._cesium.Math.toDegrees(e.longitude),i=n._cesium.Math.toDegrees(e.latitude),e=e.height,l.push({lon:t,lat:i,hei:e}),d.spot.push(h),d.distance=u,2==p&&(c.show(!1),d.label=r,d.angle=m,""!=o&&null!=o&&"function"==typeof o&&o(d)),p+=1)},n._cesium.ScreenSpaceEventType.LEFT_CLICK),e.prototype._init6=function(){var e=this,t=(this.options.polyline.positions=new n._cesium.CallbackProperty(function(){return e.positions},!1),n._viewer.entities.add(this.options));n.item=t},e);function e(e){this.options={name:"直线",polyline:{show:!0,positions:[],material:n._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positions=e,this._init6()}return this},R.prototype.executeAngeSd=function(o){this._lang=this._core.extend(this._lang,language._lang),this._tree.removeHandler();var r=[],n=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),this),a=[],s=void 0,l=[],c=[],u=(this._tree.starttemporaryItem(this._viewer),this._core.CreateTooltip()),h=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new n._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=n._viewer.entities.add(this.options),n._tree.temporaryItem.obj.push(this.polyline),n.item=this.polyline},e);function e(e){this.options={polyline:{show:!0,positions:[],material:n._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}this._tree.handler=new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas);var m=[],d=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);return this._tree.handler.setInputAction(function(e){var t,i,e=n._getPosition.getMousePosition(e);e&&(l.push(e),n._cesium.Cartographic.fromCartesian(e),0==m.length?(m.push(e.clone()),m.push(e.clone()),s=e.clone()):(e=n._core.ElevationAngle(s,e,n._cesium),1==r.length?c.push("俯仰角1 "+e.toFixed(2)):c.push("俯仰角2 "+e.toFixed(2)),d=void 0,(m=[]).push(s.clone()),m.push(s.clone()),d=new h(m),r.push(d.polyline)),2<=c.length&&(u.show(!1),e=n._core.ThreePointAzimuth(l[0],l[1],l[2],n._cesium),c.push("水平角 "+e.toFixed(2)),e=n._viewer.entities.add({name:"三点角度测量",position:l[1],label:{text:c[0],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(e),t=n._viewer.entities.add({name:"三点角度测量",position:l[2],label:{text:c[1],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(t),i=n._viewer.entities.add({name:"三点角度测量",position:l[0],label:{text:c[2],font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,pixelOffset:new Cesium.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),n._tree.temporaryItem.obj.push(i),a.push(e),a.push(t),a.push(i),m.pop(),n._tree.handler.destroy(),n._core.mouse(n._viewer.container,0,"0"),n._tree.endtemporaryItem(),n._points=a,n._polylines=r,n._polylines1=r,""!=o&&null!=o&&"function"==typeof o&&o({polylines:r,labels:a,angles:c})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t=n._getPosition.getMousePosition(e);t&&(0===m.length?u.showAt(e.endPosition,n._lang.draw_tip_left):m.length<=3?u.showAt(e.endPosition,"点击绘制目标点!"):u.showAt(e.endPosition,"再次点击结束绘制!"),2<=m.length&&(n._cesium.defined(d)?null!=t&&(m.pop(),t.y+=1+Math.random(),m.push(t)):(d=new h(m),r.push(d.polyline))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},R.prototype.deleteObject=function(){if(this.item&&this.item.item?this._viewer.entities.remove(this.item.item):this._viewer.entities.remove(this.item),this._points&&0<this._points.length){for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);this._points=[]}if(this._polylines&&0<this._polylines.length){for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._polylines=[]}if(this.labels&&0<this.labels.length){for(e=0;e<this.labels.length;e++)this._viewer.entities.remove(this.labels[e]);this.labels=[]}if(this.item&&this.item._points&&0<this.item._points.length){for(e=0;e<this.item._points.length;e++)this._viewer.entities.remove(this.item._points[e]);this.item._points=[]}if(this.item&&this.item._polylines&&0<this.item._polylines.length){for(e=0;e<this.item._polylines.length;e++)this._viewer.entities.remove(this.item._polylines[e]);this.item._polylines=[]}},R.prototype.setHeightType=function(e){try{1==e?this.item._polyline.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._polyline.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._polyline.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},R.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=this.item.polyline.positions.getValue(),i=null==this.item.polyline.width?void 0:this.item.polyline.width._value,o=this.item.polyline.material,r=(null!=o&&(o={color:null==o.color?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.polyline.clampToGround?void 0:this.item.polyline.clampToGround._value),n=this.item.polyline.distanceDisplayCondition,a=null==n?void 0:n._value.near,n=null==n?void 0:n._value.far;return{type:"polyline",treeobj:{name:this.treeobj.name},style:{show:e,positions:t,width:i,material:o,clampToGround:r,near:a,far:n}}},R.prototype.setVisibility=function(e){if(this.item&&this.item.item?this.item.item.show=e:this.item.show=e,this.item&&this.item._points&&0<this.item._points.length)for(var t=0;t<this.item._points.length;t++)this.item._points[t].show=e;if(this._polylines&&0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;if(this._points&&0<this._points.length)for(t=0;t<this._points.length;t++)this._points[t].show=e;if(this.item&&this.item._polylines&&0<this.item._polylines.length)for(t=0;t<this.item._polylines.length;t++)this.item._polylines[t].show=e},R.prototype.getVisibility=function(){return this.item.show},R.prototype.setOutlinewidth=function(e){this.item._polyline.material.outlineWidth=e},R.prototype.setMaterial=function(e){try{this._core.extend({outlineWidth:3},e,!0);this.item._polyline.material=new this._cesium.PolylineGlowMaterialProperty(e),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},R.prototype.setPolylineWall=function(e){try{for(var t=[],i=[],o=this.item._polyline.positions.getValue(),r=this._viewer.scene.globe.ellipsoid,n=0;n<o.length;n++){var a=new this._cesium.Cartesian3(o[n].x,o[n].y,o[n].z),s=r.cartesianToCartographic(a),l=this._cesium.Math.toDegrees(s.latitude),c=this._cesium.Math.toDegrees(s.longitude);t.push(c),t.push(l),i.push(e)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.wall=new this._cesium.WallGraphics({positions:t,minimumHeights:i,material:this.item._polyline.material.color._value})}catch(e){console.log(e)}return this},R.prototype.setRadius=function(e){try{for(var t=[],i=this.item._polyline.positions.getValue(),o=this._viewer.scene.globe.ellipsoid,r=0;r<i.length;r++){var n=new this._cesium.Cartesian3(i[r].x,i[r].y,i[r].z),a=o.cartesianToCartographic(n),s=this._cesium.Math.toDegrees(a.latitude),l=this._cesium.Math.toDegrees(a.longitude);t.push(l),t.push(s)}t=this._cesium.Cartesian3.fromDegreesArray(t),this.item.corridor=new this._cesium.CorridorGraphics({positions:t,width:e,show:!0,outline:!0,material:this._cesium.Color.RED.withAlpha(.4),heightReference:this._cesium.HeightReference.none})}catch(e){console.log(e)}return this},R.prototype.setGlow=function(e){try{this.item._polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.2,taperPower:.5,color:this.item._polyline.material.color}):new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color,outlineWidth:this.item._polyline.material.outlineWidth,outlineColor:this.item._polyline.material.outlineColor}),this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},R.prototype.setMaterialAlpha=function(e){try{this.item._polyline.material.color._value.alpha=e,this.item.material=this.item._polyline.material}catch(e){console.log(e)}return this},R.prototype.setType=function(e){try{"PolylineDashMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineDashMaterialProperty({color:this.item._polyline.material.color}):"PolylineArrowMaterialProperty"==e?this.item._polyline.material=new this._cesium.PolylineArrowMaterialProperty({color:this.item._polyline.material.color}):"PolylineOutlineMaterialProperty"==e&&(this.item._polyline.material=new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color}))}catch(e){console.log(e)}return this},R.prototype.setMaterialColor=function(e){try{this.item._polyline.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},R.prototype.setOutlineColor=function(e){try{this.item._polyline.material.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},R.prototype.setClampToGround=function(e){try{this.item._polyline.clampToGround=e}catch(e){console.log(e)}return this},R.prototype.setWidth=function(e){try{this.item._polyline.width=e}catch(e){console.log(e)}return this},R.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._polyline.distanceDisplayCondition=e}catch(e){console.log(e)}return this},Object.defineProperties(R.prototype,{HighLight:{set:function(e){e&&(this.item.material=this.item.polyline.material),this.item.polyline.material=e?new this._cesium.PolylineGlowMaterialProperty({glowPower:.8,color:this._cesium.Color.ORANGERED.withAlpha(.9)}):this.item.material}},polylinemMterial:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.polyline.material=e,this.item.material=this.item.polyline.material)},500),get:function(){var e=this.item.polyline.material;if(e)try{return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}},polylinemArcType:{set:C.debounce(function(e){this._core.isnull(e)||(this.item.polyline.arcType=e)},500),get:function(){var e=this.item.polyline.arcType;if(e)return e._value}},polylineWidth:{set:C.debounce(function(e){this._core.isnull(e)||(e=parseFloat(e),this.item.polyline.width=e)},500),get:function(){var e=this.item.polyline.width;if(e)return e._value}}}),Object.defineProperties(R.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(R.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(R.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(R.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(R.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(R.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),R.prototype.setItem=function(e){this.item=e},R.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(R.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(R.prototype,{polylineTempOptions:{get:function(){return{positions:[],arcType:ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE}}}}),Object.defineProperties(R.prototype,{MaterialColor:{get:function(){return new m(this._viewer,this._cesium).toHtmlColor("rgb("+255*this.item._polyline.material.color._value.red+","+255*this.item._polyline.material.color._value.green+","+255*this.item._polyline.material.color._value.blue+")")}},Height:{get:function(){return this.item._polyline.height}},Visibility:{get:function(){return this.item.show}},Outlinewidth:{get:function(){return this.item._polyline.material.outlineWidth._value}},OutlineColor:{get:function(){var e=this.item._polyline.material.outlineColor;return e?(e=e._value,new m(this._viewer,this._cesium).toHtmlColor("rgb("+255*e.red+","+255*e.green+","+255*e.blue+")")):"#ff0000"}},ClampToGround:{get:function(){return this.item._polyline.clampToGround}},Width:{get:function(){return this.item._polyline.width._value}},Type:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineDashMaterialProperty?"PolylineDashMaterialProperty":this.item._polyline.material instanceof this._cesium.PolylineArrowMaterialProperty?"PolylineArrowMaterialProperty":"PolylineOutlineMaterialProperty"}},Glow:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty}},MaterialAlpha:{get:function(){return 100*this.item._polyline.material.color._value.alpha}}}),R.prototype.CreatePolyline=function(e,t,i,o,r){this._Geometry=e;for(var i={color:this._cesium.Color.YELLOW,outlineColor:this._cesium.Color.BLACK,width:10,show:!0,AltitudeType:this._cesium.defaultValue(i,999)},n=(t&&""!==t&&(i.color=new m(this._viewer,this._cesium).colorFromHtmlColor(t)),[]),a=0;a<e.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));this.item=this._viewer.entities.add({name:r,polyline:{positions:n,width:i.width,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:i.outlineColor,color:i.color})}});t={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"polyline",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},R.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)},Sr.prototype.deleteObject=Sr.prototype.cleanUp=function(){void 0!==this._prevEntity&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),void 0!==this._prevEntity1&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=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.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)},Sr.prototype.startDrawing=function(e={},t="auto",a){var s,i=this._scene,r=this._tooltip,l=[],c=[],u=[],h=(this._positions=c,this._degreesArr=u,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),u.push([o,i]),c.push(t),s=t),4<=c.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),c.pop(),void this.stopDrawing(a)}}l.push(o,i),u.push([o,i]),c.push(t),2!==c.length||m||(m=this._viewer.entities.add({name:"临时线",polyline:{positions:new Cesium.CallbackProperty(function(){return c},!1),clampToGround:!0,material:h._drawColor.polygon,width:3}})),3===c.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===c.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),u.pop(),c.pop(),l.push(t,i),u.push([t,i]),c.push(e),r.showAt(o,"右键结束绘制"),3<=c.length&&4<=c.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,c.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},Sr.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)},Sr.prototype.computeCentroidOfPolygon=function(e){for(var t=[],i=[],o=0,r=0,n=0;n<e.length;n++){var a=Cesium.Cartographic.fromCartesian(e[n]);o+=a.longitude,r+=a.latitude,t.push(a.longitude),i.push(a.latitude)}var s=o/e.length,l=r/e.length;return new Cesium.Cartographic(s,l)},Sr.prototype.computeCutVolume=function(c,e){var u=15e3,h=-15e3,t=Cesium.BoundingSphere.fromPoints(this._positions);this.viewDistance=1.5*this._core.getPointToCameraDistance(this._viewer,t.center),"auto"===c&&(c=t.radius/20);let m=this._core.getPointsInPolygon(this._degreesArr,c,!0),d=Cesium_turf.polygon([this._degreesArr]),i=()=>{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-u+r-u+n-u)/3)?i.dig=i.dig+s*a*l.dig:i.fill=i.fill-s*a*l.fill,1e10<i.dig&&"立方米"===o.dig&&(i.dig=i.dig/1e9,o.dig="立方千米",l.dig=1e-9),1e10<i.fill&&"立方米"===o.fill&&(i.fill=i.fill/1e9,o.fill="立方千米",l.fill=1e-9))}),this.computeCentroidOfPolygon(this._positions));return this._volumeLabel=this._viewer.entities.add({position:Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,h),label:{text:"挖方体积:"+i.dig.toFixed(4)+o.dig,pixelOffset:{x:0,y:-30},font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*this.viewDistance),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,h),label:{text:"填方体积:"+i.fill.toFixed(4)+o.fill,pixelOffset:{x:0,y:-70},font:"16px 宋体",fillColor:Cesium.Color.GOLD,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,showBackground:!0,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,1.5*this.viewDistance),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:h,minHeight:u,volume:i,unit:o,spacing:c}};if(e){let t=[];return m.features.forEach(e=>{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,h<i[2]&&(h=i[2]),u>i[2]&&(u=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,h<t[2]&&(h=t[2]),u>t[2]&&(u=t[2])}),i()},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},Sr.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)}},Sr.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))})},Sr.prototype.setDatum=function(t,e){var i,o,r,n,a;this.Triangulation&&0<this.Triangulation.length&&(r={fill:0,dig:0},n={fill:"立方米",dig:"立方米"},a={fill:1,dig:1},this.Triangulation.forEach(function(e){i=e.bottomArea,o=e.height,0<(o=(o[0]-t+o[1]-t+o[2]-t)/3)?r.dig=r.dig+i*o*a.dig:r.fill=r.fill-i*o*a.fill,1e10<r.dig&&"立方米"===n.dig&&(r.dig=r.dig/1e9,n.dig="立方千米",a.dig=1e-9),1e10<r.fill&&"立方米"===n.fill&&(r.fill=r.fill/1e9,n.fill="立方千米",a.fill=1e-9)}),this._volumeLabel.label.text="挖方体积:"+r.dig.toFixed(4)+n.dig,this._volumeLabel1.label.text="填方体积:"+r.fill.toFixed(4)+n.fill,this._prevEntity.polygon.height=t,e&&"function"==typeof e&&e({volume:r,unit:n}))},Er.prototype.clearMeasure=function(t){if(t){let e=this.measureData.get(t);e&&e.deleteObject&&e.deleteObject(),e&&e.cleanUp&&e.cleanUp(),this.measureData.delete(t)}else this.measureData.forEach(e=>{e.deleteObject&&e.deleteObject(),e.cleanUp&&e.cleanUp()}),this.measureData.clear()},Er.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)})},Er.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)})},Er.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)})},Er.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)})},Er.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)})},Er.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)})},Er.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)})},Er.prototype.analysisVolume=function(e={},t){let i=new Sr(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}<br>挖方:`+(e.volume.dig.toFixed(4)+e.unit.dig),t&&"function"==typeof t&&t(e)})},Object.defineProperties(Er.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)}}}),Ir.prototype.createTerrainProfile=function(e){for(var t=[],i=0;i<e.length;i++){var o=this._cesium.Ellipsoid.WGS84.cartesianToCartographic(e[i]);t.push(o.height)}return t},Ir.prototype.measureTerrainArea=function(e){return Dr(e).toFixed(1)},Ir.prototype.measureTerrainHeight=function(e){var t=e[e.length-2],e=e[e.length-1];return Math.abs(t.x-e.x),Math.abs(t.y-e.y),t.hit,e.hit,Math.abs(t.z-e.z)},Ir.prototype.measureTerrainkPerimeter=function(e){var t=e[e.length-2],e=e[e.length-1],i=(Math.abs(t.x-e.x),Math.abs(t.y-e.y),Math.abs(t.z-e.z)),t=Tr(t.y,t.z,e.y,e.z);return Math.sqrt(i*i+t*t)},Ir.prototype.measureTerrainPerimeter=function(e){var t=e[e.length-2],e=e[e.length-1];return Math.abs(t.x-e.x),Math.abs(t.y-e.y),Tr(t.y,t.x,e.y,e.x)};var Ar,Lr=1e-5*Math.PI/180;function Mr(e,t){yr=t,this._cesium=t,this._viewer=e,this._core=new f,this._polylines=[],this._points=[],this._tree=V,this._interval=20}function Rr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._indoormode=new Eo(e),this._model=null,this._relativeHeight=-100,this._groundHeightAtCameraPosition=0,this._startMousePosition,this._mousePosition,this._cameraHeight,this._originalOption,this._alpha=.5,this._brightness=.3,this._depth=300,this._canvas=null,this.isIndoor=!1,this.isUndergroundMode=!1,this._flags={move:!1,vertical:!1,horizontally:!1,rotate:!1},this.moveSpeed=1}function Or(e){var t=e._viewer.scene;e._viewer.canvas,e._tree&&e._tree.handler&&(e._tree.handler.destroy(),e._tree.handler=null),t.screenSpaceCameraController.enableRotate=!0,t.screenSpaceCameraController.enableTranslate=!0,t.screenSpaceCameraController.enableZoom=!0,t.screenSpaceCameraController.enableTilt=!0,t.screenSpaceCameraController.enableLook=!0}function O(e,t){this._viewer=e,this._cesium=t,this._elevationContour=new Yt(this._viewer,this._cesium),this._createcurtaincontrast=new wo(this._viewer,this._cesium),this._createindoormode=new Eo(this._viewer,this._cesium),this._createWeather=new Po(this._viewer,this._cesium),this._UndergroundGrid=new Do(this._viewer),this._StreetView=new Io(this._viewer,this._cesium),this._StreetViewYZ=new Bo(this._viewer,this._cesium),this._depthTestAgainstTerrain=new Qo(this._viewer,this._cesium),this._create3DViewshed=new Zo(this._viewer,this._cesium),this._skylineAnalysis=new lr(this._viewer,this._cesium),this._EdgeStage=new dr(this._viewer,this._cesium),this._bufferAnalysis=new Ai(this._viewer,this._cesium),this._shadowsAnalysis=new gr(this._viewer,this._cesium),this._screenshot=new fr(this._viewer,this._cesium),this._PointFly=new _r(this._viewer,this._cesium),this._SunshineAnalysis=new Cr(this._viewer,this._cesium),this._measure=new Er(this._viewer),this._Deprecated=new Ir(this._viewer,this._cesium),this._UndergroundMode=new Rr(this._viewer,this._cesium)}function Br(e,t){this._viewer=e,this._cesium=t}function Vr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function B(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function Fr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function F(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._viewEvent=null,this.positions=[],this._getPosition=new y(this._viewer,this._cesium),this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonRectangleArr=[]}function H(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0},this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.radius=0}function G(e,t){this._viewer=e,this._cesium=t,this._tree=V,this._core=new f,this._Color=new m(this._viewer,this._cesium),this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0}}function k(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._entityFly=null}Mr.prototype.createlineOfSight=function(n,r){var a=this,s=(this._tree.starttemporaryItem(this._viewer),[]),l=[],c={polyline:[]},u=(this._tree.removeHandler(),this._core.CreateTooltip()),h=(a.objectsToExclude=null,void 0),m=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),e.prototype._init=function(){var e=this;this.options.polyline.positions=new a._cesium.CallbackProperty(function(){return e.positionsp},!1),this.polyline=a._viewer.entities.add(this.options),a.item=this.polyline,a._tree.temporaryItem.obj.push(this.polyline),l.push(this.polyline)},e);function e(e){this.options={polyline:{show:!0,positions:[],material:a._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=e,this._init()}this._tree.handler=new a._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas);var d=[],p=void 0;if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._viewer.entities.remove(this._points[t]);var g=[],f=(this._tree.handler.setInputAction(function(e){var t,i,o,r=a._viewer.camera.getPickRay(e.position),r=a._viewer.scene.globe.pick(r,a._viewer.scene);a._viewer.scene.pick(e.position)&&(i=a._viewer.scene.pickPosition(e.position))&&(r=i),r&&(0===d.length?(d.push(r.clone(),r.clone()),t={leftX:e.position.x,leftY:e.position.y},g.push(t),h=r.clone()):(t={rightX:e.position.x,rightY:e.position.y},g.push(t),i={postion:d,entity:l,cartesian:g},s.push(i),g=[],p=void 0,d=[],r=h.clone(),null!=n.height&&(e=ellipsoid.cartesianToCartographic(h.clone()),t=yr.Math.toDegrees(cartograhphic.latitude),i=yr.Math.toDegrees(cartograhpinc.longitude),o=n.height,e=yr.Cartographic.fromDegrees(i,t,o),r=ellipsoid.cartographicToCartesian(e)),d.push(r),d.push(r),p=new m(d)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(e){var t,i=a._viewer.camera.getPickRay(e.endPosition),i=a._viewer.scene.globe.pick(i,a._viewer.scene);a._viewer.scene.pick(e.endPosition)&&(t=a._viewer.scene.pickPosition(e.endPosition))&&(i=t),i&&(0===d.length?u.showAt(e.endPosition,"点击添加视点"):u.showAt(e.endPosition,"点击添加目标视点,右键结束"),2<=d.length&&(a._cesium.defined(p)?null!=i&&(d.pop(),d.push(i)):p=new m(d)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),0),_=0;return this._tree.handler.setInputAction(function(e){a.end&&a.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=e=>{if(u.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;t<l.length;t++)a._viewer.entities.remove(l[t]);else{for(var i,o=0;o<s.length;o++)i=(0==o?(f=s[o].cartesian[0].leftX,_=s[o].cartesian[0].leftY,a.tsjx(s[o].postion,f,_,s[o].cartesian[1].rightX,s[o].cartesian[1].rightY,50,l,a._cesium,a._viewer)):a.tsjx(s[o].postion,f,_,s[o].cartesian[0].rightX,s[o].cartesian[0].rightY,50,l,a._cesium,a._viewer))?a._viewer.entities.add({name:"polyline1",polyline:{positions:s[o].postion,width:3,material:a._cesium.Color.GREEN}}):a._viewer.entities.add({name:"polyline1",polyline:{positions:s[o].postion,width:3,material:a._cesium.Color.RED}}),c.polyline.push(i);d.pop(),a._polylines=c.polyline,a._tree.handler.destroy();for(t=0;t<l.length;t++)a._viewer.entities.remove(l[t]);""!=r&&null!=r&&"function"==typeof r&&r(c)}},this},Mr.prototype.tsjx=function(e,t,i,o,r,n,a,s,l){for(var c=this._core.getSpaceDistancem(e,s),c=(c<=100&&10<=c?n=parseInt(c/2):c<10&&0<c?n=parseInt(+c):100<c&&(n=parseInt(c/10)),e[0]),e=e[e.length-1],c=s.Cartographic.fromCartesian(c),u=s.Math.toDegrees(c.longitude),h=s.Math.toDegrees(c.latitude),m=(c.height,c.height),c=s.Cartographic.fromCartesian(e),e=s.Math.toDegrees(c.longitude),d=s.Math.toDegrees(c.latitude),c=(c.height,c.height),p=n,g=s.Math.lerp(u,e,1/p)-u,f=s.Math.lerp(h,d,1/p)-h,_=s.Math.lerp(m,c,1/p)-m,C=(s.Math.lerp(t,o,1/p),s.Math.lerp(i,r,1/p),!0),y=0;y<p-2;y++){var v=m+(y+1)*_,w=s.Cartesian3.fromDegrees(u+(y+1)*g,h+(y+1)*f,v),w=s.Cartographic.fromCartesian(w),b=l.scene.globe.getHeight(w),w=l.scene.sampleHeight(w,a);if(w&&(b=w),b=parseFloat(b.toFixed(1)),(v=parseFloat(v.toFixed(1)))<b)return C=!1}return C},Mr.prototype.deleteObject=function(){if(0<this._points.length){this.objectsToExclude=null;for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e])}},Mr.prototype.InterpolateLineCartographic=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[],r=(o.push(new yr.Cartographic(e.longitude,e.latitude)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2))),i=i&&"number"==typeof i?i:Lr;if(r<=i)o.push(new yr.Cartographic(t.longitude,t.latitude));else{for(var n=r/i,a=(t.longitude-e.longitude)/n,s=(t.latitude-e.latitude)/n,l=0;l<n;l++){var c=e.longitude+(l+1)*a,u=e.latitude+(l+1)*s;o.push(new yr.Cartographic(c,u))}o.push(new yr.Cartographic(t.longitude,t.latitude,t.height))}return o},Mr.prototype.InterpolateLineCartographicxp=function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[],r=(o.push(new yr.Cartographic(e.longitude,e.latitude)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2))),i=i&&"number"==typeof i?i:Lr;if(r<=i)o.push(new yr.Cartographic(t.longitude,t.latitude));else{for(var n=r/i,a=(t.longitude-e.longitude)/n,s=(t.latitude-e.latitude)/n,l=(t.height-e.height)/n,c=0;c<n;c++){var u=e.longitude+(c+1)*a,h=e.latitude+(c+1)*s,m=e.height+l*(c+1);o.push(new yr.Cartographic(u,h,m))}o.push(new yr.Cartographic(t.longitude,t.latitude,t.height))}return o},Mr.prototype.InterpolateLineHeightCartographic=function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[],o=(i.push(new yr.Cartographic(e.longitude,e.latitude,e.height)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)));if(!(o<=Lr))for(var r=o/Lr,n=(t.longitude-e.longitude)/r,a=(t.latitude-e.latitude)/r,s=(t.height-e.height)/r,l=0;l<r;l++){var c=e.longitude+(l+1)*n,u=e.latitude+(l+1)*a,h=e.height+(l+1)*s;i.push(new yr.Cartographic(c,u,h))}return i.push(new yr.Cartographic(t.longitude,t.latitude,t.height)),i},Mr.prototype.InterpolateIndexLineHeightCartographic=function(e,t,i,o){var r,n;return e&&t&&e.longitude&&e.latitude&&t.longitude&&t.latitude?(r=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,t=(t.height-e.height)/i,i=e.longitude+o*r,r=e.latitude+o*n,n=e.height+o*t,new yr.Cartographic(i,r,n)):null},Mr.prototype.InterpolateIndexLineHeightCartographicxp=function(e,t,i,o){var r,n;return e&&t&&e.longitude&&e.latitude&&t.longitude&&t.latitude?(r=(t.longitude-e.longitude)/i,n=(t.latitude-e.latitude)/i,t=(t.height-e.height)/i,i=e.longitude+o*r,r=e.latitude+o*n,n=e.height+o*t,new yr.Cartographic(i,r,n)):null},Mr.prototype.Interpolate2IndexLineHeightCartographic=function(e,t,i,o){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;for(var r=[],n=(r.push(new yr.Cartographic(e.longitude,e.latitude,e.height)),(t.longitude-e.longitude)/i),a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<o;l++){var c=e.longitude+(l+1)*n,u=e.latitude+(l+1)*a,h=e.height+(l+1)*s;r.push(new yr.Cartographic(c,u,h))}return r},Mr.prototype.CartographicPointsTerrainData=function(e,t){e.length&&0<e.length&&(e=yr.sampleTerrain(this._viewer.terrainProvider,11,e),yr.when(e,function(e){t(e)}))},Mr.prototype.setVisibility=function(e){if(0<this._polylines.length)for(var t=0;t<this._polylines.length;t++)this._polylines[t].show=e},Mr.prototype.deleteObject=function(){if(0<this._polylines.length)for(var e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e])},Object.defineProperties(Mr.prototype,{sight:{get:function(){return this.item.sight},set:function(e){this.item.sight=sight}}}),Rr.prototype.refreshGridLines=function(){var e,t=this._relativeHeight<0,i=this._viewer.camera,i=new this._cesium.Cartographic(i.positionCartographic.longitude,i.positionCartographic.latitude,-this._depth);this._model?(e=this.UndergroundGridLines(i,t),this._viewer.scene.primitives.remove(this._model),this._model=e):this._model=this.UndergroundGridLines(i,t)},Rr.prototype.UndergroundModelOpen=function(e,t){var i,o,r;if(!this._model)return this._getOriginalOption(),o=this._viewer.camera,r=new this._cesium.Cartographic(o.positionCartographic.longitude,o.positionCartographic.latitude,-this._depth),i=new this._cesium.Cartographic(o.positionCartographic.longitude,o.positionCartographic.latitude,o.positionCartographic.height),this.destination=i,this.orientation={heading:o.heading,pitch:o.pitch,roll:0},this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=!1,this._cesium.ExpandBySmartEarth.underEarth.enable=!0,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=this._depth,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!0),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(0),i=e?(this._depth=this._cesium.defaultValue(e.depth,300),this._alpha=this._cesium.defaultValue(e.alpha,.5),this._brightness=this._cesium.defaultValue(e.brightness,.3),this.isEnterUnderground=this._cesium.defaultValue(e.isEnterUnderground,!0),this.isFlyToSky=this._cesium.defaultValue(e.isFlyToSky,!0),this._cesium.defaultValue(e.height,-100)):(this._depth=300,this._alpha=.5,this._brightness=.3,this.isEnterUnderground=!0,this.isFlyToSky=!0,-100),this.setLayerAlpha(this._alpha,this._brightness),this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.container.style.backgroundImage="unset",this.isUndergroundMode=!0,t?(this.isIndoor=!0,this._indoormode.createIndoormode({undergroundMode:this})):this.isIndoor=!1,o=this._viewer.camera,r=new this._cesium.Cartographic(o.positionCartographic.longitude,o.positionCartographic.latitude,-this._depth),this._model=this.UndergroundGridLines(r,!0),this._viewer.scene.preRender.addEventListener(this.getRelativeHeight,this),this.getRelativeHeight(),0<this._relativeHeight&&this.isEnterUnderground&&this.enterUnderground(i),this},Rr.prototype.close=function(){this._model&&(this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight,this),this.setLayerAlpha(this._originalOption.alpha,this._originalOption.brightness),this._viewer.scene.primitives.remove(this._model),this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=void 0,this._cesium.ExpandBySmartEarth.underEarth.enable=!1,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=0,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!1),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(1),this._viewer.scene.globe.depthTestAgainstTerrain=this._originalOption.depthTest,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=this._originalOption.skyBoxShow),this._viewer.scene.highDynamicRange=this._originalOption.highDynamicRange,this._viewer.scene.skyAtmosphere.show=this._originalOption.skyShow,this._viewer.scene.backgroundColor=this._originalOption.backgroundColor,this._viewer.container.style.backgroundImage=this._originalOption.backgroundImage,this._viewer.scene.fog.enabled=this._originalOption.fog,this.isUndergroundMode=!1,this._model=null,Ar=void 0,this._viewer.camera.positionCartographic,Or(this),!this.isFlyToSky||500<this._relativeHeight||this.flyToSky())},Rr.prototype._getOriginalOption=function(){var e={alpha:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].alpha),brightness:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].brightness),highDynamicRange:this._cesium.clone(this._viewer.scene.highDynamicRange),skyShow:this._cesium.clone(this._viewer.scene.skyAtmosphere.show),skyBoxShow:this._cesium.clone(this._viewer.scene.skyBox&&this._viewer.scene.skyBox.show),depthTest:this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain),backgroundColor:this._viewer.scene.backgroundColor.clone(),backgroundImage:this._viewer.container.style.backgroundImage,fog:this._viewer.scene.fog.enabled};this._viewer.scene.globe._surface&&this._viewer.scene.globe._surface._tileProvider&&this._viewer.scene.globe._surface._tileProvider._renderState&&(e.blending=this._cesium.clone(this._viewer.scene.globe._surface._tileProvider._renderState.blending)),this._originalOption=e},Rr.prototype.enterUnderground=function(e){var t=this._viewer.camera,i=new this._cesium.Cartographic(t.positionCartographic.longitude,t.positionCartographic.latitude,-this._depth);t.positionCartographic.height<=10||t.flyTo({destination:new this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude,e||-this._depth/3),orientation:{heading:this._cesium.Math.toRadians(0),pitch:this._cesium.Math.toRadians(0),roll:0},complete:function(){}})},Rr.prototype.flyToSky=function(){var e=this._viewer.camera;this._viewer.camera.positionCartographic,10<=e.positionCartographic.height||this._viewer.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(this.destination.longitude,this.destination.latitude,this.destination.height),orientation:{heading:this.orientation.heading,pitch:this.orientation.pitch,roll:0}})},Rr.prototype.setLayerAlpha=function(e,t){for(var i=this._viewer.imageryLayers.length,o=0;o<i;o++)this._viewer.imageryLayers.get(o).alpha=e,void 0!==t&&(this._viewer.imageryLayers.get(o).brightness=t);this._alpha=e,void 0!==t&&(this._brightness=t)},Rr.prototype.UndergroundGridLines=function(e,t){var i=e,e=(e instanceof this._cesium.Cartesian3&&(i=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e)),new this._cesium.GeometryInstance({geometry:new this._cesium.EllipseGeometry({center:this._cesium.Cartesian3.fromRadians(i.longitude,i.latitude),height:i.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:this._cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"})),i=this._cesium.Material.fromType("Grid"),e=(i.uniforms.color=this._cesium.Color.WHITE.withAlpha(.3),i.uniforms.cellAlpha=.01,i.uniforms.lineCount=new this._cesium.Cartesian2(200,200),i.uniforms.lineThickness=new this._cesium.Cartesian2(1,1),this._viewer.scene.primitives.add(new this._cesium.Primitive({geometryInstances:e,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:i})})));return e.appearance.renderState.depthTest.enabled=!0,e.show=t,e},Rr.prototype.attachMouseEvent=function(){var o=this,e=this._viewer.scene;this._canvas=this._viewer.canvas,this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.onclick=function(){o._canvas.focus()},e.screenSpaceCameraController.enableRotate=!1,e.screenSpaceCameraController.enableTranslate=!1,e.screenSpaceCameraController.enableZoom=!1,e.screenSpaceCameraController.enableTilt=!1,e.screenSpaceCameraController.enableLook=!1,this._tree.handler.setInputAction(function(e){o._flags.move=!0,o._viewer.camera.pitch>o._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<t.positionCartographic.height?t.positionCartographic.height/1e3:.1;t.pitch<0&&t.positionCartographic.height<-200&&0<e||0<t.pitch&&t.positionCartographic.height<-200&&e<0||t.zoomIn(e*i)},this._cesium.ScreenSpaceEventType.WHEEL)},Rr.prototype.mouseMoveEvent=function(){var e,t,i,o=200*this.moveSpeed,r=this._viewer.camera;this._flags.move&&(this._canvas.clientWidth,e=this._canvas.clientHeight,t=this._mousePosition.x-this._startMousePosition.x,i=-(this._mousePosition.y-this._startMousePosition.y),this._flags.horizontally&&(r.moveLeft(2*t),r.moveBackward(2*i),r.setView({destination:this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude,r.positionCartographic.latitude,this._cameraHeight),orientation:{heading:r.heading,pitch:r.pitch,roll:r.roll}})),this._flags.vertical&&r.setView({destination:this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude,r.positionCartographic.latitude,this._cameraHeight-(i/=e)*o),orientation:{heading:r.heading,pitch:r.pitch,roll:r.roll}}),this._flags.rotate&&((!r.roll&&r.pitch<0&&i<0||!r.roll&&0<r.pitch&&0<i)&&(i=0),r.rotate(r.position,.001*t),r.lookUp(.001*i)))},Rr.prototype.getRelativeHeight=function(){var e=this._viewer.camera,t=this._viewer.scene.globe.getHeight(e.positionCartographic);this._groundHeightAtCameraPosition=t||this._groundHeightAtCameraPosition,this._relativeHeight=e.positionCartographic.height-this._groundHeightAtCameraPosition,this._relativeHeight<1?(this._tree.handler||this.isIndoor||this.attachMouseEvent(),t=Math.abs(this._relativeHeight),this.moveSpeed=t<50?.25:t<100?.5:t<150?.75:1):this._tree.handler&&!this.isIndoor&&Or(this),Ar=Ar||e.position.clone(),1e4<this._core.getSpaceDistancem([Ar,e.position],this._cesium)&&(Ar=e.position.clone(),this.refreshGridLines()),this._relativeHeight<0?this._model&&(this._model.show=!0):this._model&&(this._model.show=!1)},Rr.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)},Rr.prototype.setCesiumFov=function(e){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(e)},O.prototype.clearMeasure=function(e){this._measure.clearMeasure(e)},O.prototype.horizontalDistance=function(e,t){this._measure.horizontalDistance(e,t)},O.prototype.spaceDistance=function(e,t){this._measure.spaceDistance(e,t)},O.prototype.altitude=function(e,t){this._measure.altitude(e,t)},O.prototype.verticalHeight=function(e,t){this._measure.verticalHeight(e,t)},O.prototype.surfaceArea=function(e,t){this._measure.surfaceArea(e,t)},O.prototype.planeArea=function(e,t){this._measure.planeArea(e,t)},O.prototype.measureAngle=function(e,t){this._measure.measureAngle(e,t)},O.prototype.analysisVolume=function(e,t){this._measure.analysisVolume(e,t)},O.prototype.measureTerrainPerimeter=function(e){return this._Deprecated.measureTerrainPerimeter(e)},O.prototype.depthTestAgainstTerrain=function(e){return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e)},O.prototype.DrawPointBuffer=function(e,t,i){return this._bufferAnalysis.DrawPoint(e,t,i)},O.prototype.DrawPolylineBuffer=function(e,t,i){return this._bufferAnalysis.DrawPolyline(e,t,i)},O.prototype.DrawPolygonBuffer=function(e,t,i){return this._bufferAnalysis.DrawPolygon(e,t,i)},O.prototype.TerrainExcavation=function(e=100,t,i){let o=new pr(this._viewer,this._cesium);return o.draw(e,t,i)},O.prototype.ShadowsAnalysis=function(){return this._shadowsAnalysis.createAnalysis()},O.prototype.createSkylineAnalysis=function(e){return this._skylineAnalysis.createSkylineAnalysis(e)},O.prototype.createEdgeStage=function(e){return this._EdgeStage.createEdgeStage(e)},O.prototype.clearSkylineAnalysis=function(){return this._skylineAnalysis.clear()},O.prototype.createScreenshot=function(e){return this._screenshot.createScreenshot(e)},O.prototype.ScreenshotCompared=function(e){return this._screenshot.createScreenshotCompared(e)},O.prototype.setPointFly=function(e){return this._PointFly.setPointFly(e)},O.prototype.createCircleScan=function(e,t,i,o,r){return new Ko(this._viewer,this._cesium).createCircleScan(e,t,i,o,r)},O.prototype.createMultiCircleScan=function(e,t,i,o,r){return new Ko(this._viewer,this._cesium).createMultiCircleScan(e,t,i,o,r)},O.prototype.createSectorScan=function(e,t,i,o,r,n,a){return new Ko(this._viewer,this._cesium).createSectorScan(e,t,i,o,r,n,a)},O.prototype.createRadarScan=function(e,t,i,o,r){return new Ko(this._viewer,this._cesium).createRadarScan(e,t,i,o,r)},O.prototype.UndergroundModelOpen=function(e,t){return this._UndergroundMode.UndergroundModelOpen(e,t)},O.prototype.UndergroundModelClose=function(){return this._UndergroundMode.close()},O.prototype.UndergroundMode=function(e,o){if(e){this._viewer.scene.globe.translucency.enabled||(this._viewer.scene.globe.translucency.enabled=!0,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1,this._viewer.scene.globe.translucency.backFaceAlpha=0,this.undergroundValue("set")),this._viewer.scene.globe.translucency.frontFaceAlpha=void 0!==o?o:.5;let t=this._viewer,i=this._UndergroundGrid;return i.show&&i.add(),{get alpha(){return t.scene.globe.translucency.frontFaceAlpha},set alpha(e){t.scene.globe.translucency.frontFaceAlpha=e},get grid(){return i.show},set grid(e){(i.show=e)?i.add():i.destroy()},get depth(){return i._depth},set depth(e){i._depth=e,i.show&&i.refreshGridLines()}}}this._viewer.scene.globe.translucency.enabled&&(this._viewer.scene.globe.translucency.enabled=!1,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0,this._viewer.scene.globe.translucency.backFaceAlpha=1,this._UndergroundGrid.destroy(),this.undergroundValue("get"))},O.prototype.undergroundValue=function(e){"set"===e?(this.defaultUnderground={highDynamicRange:this._viewer.scene.highDynamicRange,skyBox:this._viewer.scene.skyBox.show,fog:this._viewer.scene.fog.enabled,undergroundColor:this._viewer.scene.globe.undergroundColor},this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.globe.undergroundColor=void 0):(this._viewer.scene.highDynamicRange=this.defaultUnderground.highDynamicRange,this._viewer.scene.skyBox.show=this.defaultUnderground.skyBox,this._viewer.scene.fog.enabled=this.defaultUnderground.fog,this._viewer.scene.globe.undergroundColor=this.defaultUnderground.undergroundColor)},O.prototype.StreetViewOpen=function(e,t,i){return this._StreetView.StreetViewOpen(e,t,i)},O.prototype.ExitStreetView=function(){return this._StreetView.exit()},O.prototype.StreetViewOpenYZ=function(e,t,i){return this._StreetViewYZ.StreetViewOpenYZ(e,t,i)},O.prototype.ExitStreetViewYZ=function(){return this._StreetViewYZ.exit()},O.prototype.createWeather=function(e,t,i){return this._createWeather.createWeather(e,t,i)},O.prototype.createParticleEffect=function(e,t,i,o){let r=new xo(this._viewer,this._cesium);return this._Particle||(this._Particle={}),this._Particle[e]||(this._Particle[e]=[]),this._Particle[e].push(r),r.createParticleEffect(e,t,i,o)},O.prototype.removeParticleEffect=function(e){this._Particle&&(this._Particle[e]&&this._Particle[e].forEach(e=>{e.deleteObject()}),this._Particle[e]=[])},O.prototype.demolition=function(e,t){let i=new br(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 sr(this._viewer,this._cesium);return t.createViewshed(e)},O.prototype.add3DViewshedPoss=function(e){let t=new sr(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 Mr(this._viewer,this._cesium).createlineOfSight(e,t)},O.prototype.createSightLine=function(e){let t=new yo(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)},Br.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]))},Vr.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},Vr.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},Vr.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},Vr.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},Vr.prototype.AddSectorScanPostStage=function(e,t,i,o,r,n){var a=this._viewer,s=this._cesium,l=s.Cartographic.toCartesian(e),c=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),u=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,c,h)},u_scanPlaneNormalEC:function(){var e=s.Matrix4.multiplyByVector(a.camera._viewMatrix,c,h),t=s.Matrix4.multiplyByVector(a.camera._viewMatrix,u,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)},Vr.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),c=(new Date).getTime(),u=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,u)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,u),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()-c)%o)/o},u_scanColor:i}});return r.scene.postProcessStages.add(a)},Vr.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),c=(new Date).getTime(),u=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,u)},u_scanPlaneNormalEC:function(){var e=n.Matrix4.multiplyByVector(r.camera._viewMatrix,s,u),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()-c)%o)/o;return e<t/3&&0===p&&0===d?g=e:t/3<=e&&e<2*t/3&&0===d?p=(g=e)-t/3:2*t/3<=e?(p=(g=e)-t/3,d=g-2*t/3):e<t/3&&0!==p&&0!==d?(p=(d=e)+t/3,g=e+2*t/3):t/3<=e&&e<2*t/3&&0!==d&&(d=e-t/3,g=(p=e)+t/3),g},u_maxRadius:t,u_scanColor:i}});return r.scene.postProcessStages.add(a)},Vr.prototype.AddRadarScanPostStage=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),a=n.Cartographic.toCartesian(a),l=new n.Cartesian4(a.x,a.y,a.z,1),a=new n.Cartographic(e.longitude+n.Math.toRadians(.001),e.latitude,e.height),e=n.Cartographic.toCartesian(a),c=new n.Cartesian4(e.x,e.y,e.z,1),u=new n.Quaternion,h=new n.Matrix3,m=(new Date).getTime(),d=new n.Cartesian4,p=new n.Cartesian4,g=new n.Cartesian4,f=new n.Cartesian3,_=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 vec3 u_scanLineNormalEC;\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 }\nbool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 v01 = testPt - ptOnLine;\nnormalize(v01);\nvec3 temp = cross(v01, lineNormal);\nfloat d = dot(temp, u_scanPlaneNormalEC);\nreturn d > 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,c,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,u),n.Matrix3.fromQuaternion(u,h),n.Matrix3.multiplyByVector(h,_,_),n.Cartesian3.normalize(_,_),_},u_scanColor:i}});return r.scene.postProcessStages.add(a)},Vr.prototype.remove=function(){this._viewer.scene.postProcessStages.remove(this.item)},Vr.prototype.setTreeobj=function(e){this.treeobj=e},Vr.prototype.deleteObject=function(){this.item&&this._viewer.scene.postProcessStages.remove(this.item)},Vr.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(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.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(V.selectedItem)||"group"!=V.selectedItem.type||(e=V.selectedItem.id),n._core.getuid()),i={id:t,name:"新建立方体"+t,pId:n._core.isnull(e)?0:e,type:"box",item:n};n.setTreeobj(i),V.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,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.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)}}}}}),Fr.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},Fr.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},Fr.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=Tr(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(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.selectedItem.id),r._core.getuid()),i={id:e,name:"新建球"+e,pId:r._core.isnull(t)?0:t,type:"ellipsoid",item:r};r.setTreeobj(i),V.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=Tr(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},Fr.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},Fr.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,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"ellipsoid",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.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}}},Fr.prototype.setTreeobj=function(e){this.treeobj=e},Fr.prototype.setVisibility=function(e){this.item.show=e},Fr.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Fr.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},Fr.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},Fr.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},Fr.prototype.setEllipsoidImage=function(e){try{this.item._ellipsoid.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},Fr.prototype.setEllipsoidRepeat=function(e,t){try{this.item._ellipsoid.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},Fr.prototype.setMaterial=function(e){try{this.item._ellipsoid.show=e}catch(e){console.log(e)}return this},Fr.prototype.setRadii=function(e){try{this.item._ellipsoid.radii=new this._cesium.Cartesian3(e,e,e)}catch(e){console.log(e)}return this},Fr.prototype.setItem=function(e){this.item=e},Fr.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(Fr.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)}}}}}),F.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}),c=(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:c,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)):c=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(V.selectedItem)||"group"!=V.selectedItem.type||(e=V.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),V.insertGroupId(t,s._core.isnull(e)?0:e),this},F.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},F.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(V.selectedItem)||"group"!=V.selectedItem.type||(e=V.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),V.insertGroupId(t,a._core.isnull(e)?0:e),this},F.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;e<r.gonRectangleArr.length;e++){var t=r.gonRectangleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){e=r._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(r.modifyPoint=e.id,o="释放后完成修改"),r.forbidDrawWorld(!0);else{for(var t=0;t<r.gonRectangleArr.length;t++){var i=r.gonRectangleArr[t];i&&(i.show=!1)}r.modifyHandler&&(r.modifyHandler.destroy(),r.modifyHandler=null)}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i=r._viewer.scene.pick(e.endPosition);r._core.CreateTooltip(o,e.endPosition,!1),r.modifyPoint?r.positions.length<1||!r.modifyPoint||((t=r.getCatesian3FromPX(e.endPosition,r._viewer,[r.shape.entity,r.modifyPoint]))&&(r.modifyPoint.position.setValue(t),r.shape.points[r.modifyPoint.wz]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),r.shape.rect=r._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.east+=1e-6,r.shape.rect.north+=1e-6),r._core.CreateTooltip(o,e.endPosition,!0)):r._cesium.defined(i)&&i.id&&i.id.objId&&r._core.CreateTooltip("拖动修改位置",e.endPosition,!0)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){r.forbidDrawWorld(!1),r.modifyPoint&&(e=r.getCatesian3FromPX(e.position,r._viewer,[r.shape.entity,r.modifyPoint]),r.modifyPoint.position.setValue(e),r.shape.points[r.modifyPoint.wz]=r._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),r.shape.rect=r._cesium.Rectangle.fromCartographicArray(r.shape.points),r.shape.rect.east+=1e-6,r.shape.rect.north+=1e-6,r.modifyPoint=null,r.forbidDrawWorld(!1),o="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},F.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},F.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&this._cesium.defined(a))o=t.scene.pickPosition(e);else{r=t.camera.getPickRay(e);if(!r)return;o=t.scene.globe.pick(r,t.scene)}return o},F.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},F.prototype.CreateRectangle=function(e,t,i,o,r){var n=this._core.getuid(),a={outlineColor:this._cesium.Color.RED,material:this._cesium.Color.YELLOW.withAlpha(.5)},i=(i&&i.fillColor&&(a.material=new m(this._viewer,this._cesium).colorFromHtmlColor(i.fillColor)),i&&i.outlineColor&&(a.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(i.outlineColor)),(a=this._core.extend(a,i,!1)).coordinates=this.getCoordinates(t),this.item=this._viewer.entities.add({id:n,name:e||"新建矩形",rectangle:a}),"function"==typeof r&&r(this.item),this._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||(o=V.selectedItem.id),{id:n,name:"新建矩形"+n,pId:this._core.isnull(o)?0:o,type:"rectangle",item:this.item});return this.setTreeobj(i),V.insertGroupId(i,this._core.isnull(o)?0:o),this},F.prototype.getCoordinates=function(e){var t,i,o=(e[0].lon>e[1].lon?(t=e[1].lon,e[0]):(t=e[0].lon,e[1])).lon,e=(e[0].lat>e[1].lat?(i=e[0].lat,e[1]):(i=e[1].lat,e[0])).lat;return new this._cesium.Rectangle.fromDegrees(t,e,o,i)},F.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(V.selectedItem)||"group"!=V.selectedItem.type||V.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),V.insertGroupId(e,a._core.isnull(t)?0:t),this},F.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),c=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+")",u=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:c,outlineWidth:u,near:m,far:h}}},F.prototype.setTreeobj=function(e){this.treeobj=e},F.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;s<n.length;s++)o=this._cesium.Cartographic.fromCartesian(n[s]),i=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),0===s?(a.west=i,a.north=o,a.east=i,a.south=o):(i>a.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,c=this._viewer.camera.pitch,u=this._viewer.camera.roll,h=this._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:c,roll:u},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,c=d._viewer.camera.pitch,u=d._viewer.camera.roll,h=d._viewer.camera.position.clone(),m={orientation:{heading:l,pitch:c,roll:u},position:h})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(d.flyListener)},F.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")},F.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},F.prototype.isInArea=function(e,t){var i=!1;return i=e.south>t.south&&e.east<t.east&&e.north<t.north&&e.west>t.west?!0:i},F.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 c(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=c(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=c(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},F.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(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.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),V.insertGroupId(s,r._core.isnull(t)?0:t),"function"==typeof e&&e(ploylinejl),this},F.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),null!=this._viewEvent&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))},F.prototype.setVisibility=function(e){this.item.show=e},F.prototype.getVisibility=function(){return this.item.show},F.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},F.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},F.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},F.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},F.prototype.setPolygonImage=function(e){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:e})}catch(e){console.log(e)}return this},F.prototype.setRectangleRepeat=function(e,t){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(e,t)}catch(e){console.log(e)}return this},F.prototype.setOutlineColor=function(e){try{this.item._rectangle.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},F.prototype.setOutline=function(e){try{this.item._rectangle.outline=e}catch(e){console.log(e)}return this},F.prototype.setExtrudedHeight=function(e){try{this.item._rectangle.extrudedHeight=e}catch(e){console.log(e)}return this},F.prototype.setHeight=function(e){try{this.item._rectangle.height=e}catch(e){console.log(e)}return this},Object.defineProperties(F.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),F.prototype.setItem=function(e){this.item=e},Object.defineProperties(F.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),Object.defineProperties(F.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(F.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(F.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(F.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(F.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(F.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}}}}),H.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},H.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},H.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<s.gonCircleArr.length&&(s.positions.pop(),s.state=1,s.handler.destroy()),e.wz=s.gonCircleArr.length,s.gonCircleArr.push(e)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t,i,o,r,n,a;s.positions.length<1||(e=s.getCatesian3FromPX(e.endPosition,s._viewer,[s.circle]),2!=s.positions.length||s._cesium.defined(s.circle)||(t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.radius=Tr(o,i,a,n),s.circle=s.createCircle(s.style),s.circle.objId=s.objId),s.circle&&(s.positions.pop(),s.positions.push(e),t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.radius=Tr(o,i,a,n)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},H.prototype.startModify=function(){var n="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var a=this,e=0;e<a.gonCircleArr.length;e++){var t=a.gonCircleArr[e];t&&(t.show=!0)}this.modifyHandler.setInputAction(function(e){e=a._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(a.modifyPoint=e.id,n="释放后完成修改"),a.forbidDrawWorld(!0);else{for(var t=0;t<a.gonCircleArr.length;t++){var i=a.gonCircleArr[t];i&&(i.show=!1)}a.modifyHandler&&(a.modifyHandler.destroy(),a.modifyHandler=null)}a.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i,o,r=a._viewer.scene.pick(e.endPosition);a._core.CreateTooltip(n,e.endPosition,!1),Cesium.defined(r)&&r.id&&(r.id.objId||a._core.CreateTooltip(n,e.endPosition,!0)),a.positions.length<1||!a.modifyPoint||((r=a.getCatesian3FromPX(e.endPosition,a._viewer,[a.circle,a.modifyPoint]))&&(a.modifyPoint.position.setValue(r),a.positions[a.modifyPoint.wz]=r,0==a.modifyPoint.wz?a.gonCircleArr[1].position={x:a.positions[0].x+a.radius,y:a.positions[0].y,z:a.positions[0].z}:(r=a._cesium.Cartographic.fromCartesian(a.positions[0]),t=a._cesium.Math.toDegrees(r.longitude),r=a._cesium.Math.toDegrees(r.latitude),o=a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]),i=a._cesium.Math.toDegrees(o.longitude),o=a._cesium.Math.toDegrees(o.latitude),a.radius=Tr(r,t,o,i))),a._core.CreateTooltip(n,e.endPosition,!0))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){var t,i,o;a.modifyPoint&&(e=a.getCatesian3FromPX(e.position,a._viewer,[a.circle,a.modifyPoint]),a.modifyPoint.position.setValue(e),a.positions[a.modifyPoint.wz]=e,0==a.modifyPoint.wz?a.gonCircleArr[1].position={x:a.positions[0].x+a.radius,y:a.positions[0].y,z:a.positions[0].z}:(e=a._cesium.Cartographic.fromCartesian(a.positions[0]),t=a._cesium.Math.toDegrees(e.longitude),e=a._cesium.Math.toDegrees(e.latitude),o=a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]),i=a._cesium.Math.toDegrees(o.longitude),o=a._cesium.Math.toDegrees(o.latitude),a.radius=Tr(e,t,o,i)),a.modifyPoint=null,a.forbidDrawWorld(!1),n="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},H.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},H.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{r=t.camera.getPickRay(e);if(!r)return;o=t.scene.globe.pick(r,t.scene)}return o},H.prototype.createCircle=function(e){var t=this;return this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),ellipse:{semiMinorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),semiMajorAxis:new t._cesium.CallbackProperty(function(){return t.radius},!1),material:t._cesium.Color.BLUE.withAlpha(.5),outline:e.outline||!0}})},H.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},H.prototype.executeClircle=function(e){var i=[],o=this,r=(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas));function n(){return Tr(i[0].lat,i[0].lon,i[1].lat,i[1].lon)}return r.setInputAction(function(e){var t,e=o._getPosition.getMousePosition(e,[o.item]);e&&(e=o._cesium.Cartographic.fromCartesian(e),t=o._cesium.Math.toDegrees(e.longitude),e=o._cesium.Math.toDegrees(e.latitude),i.push({lon:t,lat:e}),1==i.length?(i.push({lon:t,lat:e}),(t=o._viewer.entities.add({position:o._cesium.Cartesian3.fromDegrees(i[0].lon,i[0].lat),ellipse:{semiMinorAxis:0,semiMajorAxis:0,material:o._cesium.Color.fromRandom({alpha:.8})}})).ellipse.semiMinorAxis=new o._cesium.CallbackProperty(n,!1),t.ellipse.semiMajorAxis=new o._cesium.CallbackProperty(n,!1),o.item=t):(e=n(),o._core.mouse(o._viewer.container,0,"0"),o.item.ellipse.semiMinorAxis=e,o.item.ellipse.semiMajorAxis=e,r.destroy(),r=void 0,i=[]))},o._cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){var t;!i.length||(e=o._getPosition.getMousePosition(e,[o.item]))&&(e=o._cesium.Cartographic.fromCartesian(e),t=o._cesium.Math.toDegrees(e.longitude),e=o._cesium.Math.toDegrees(e.latitude),i[1]={lon:t,lat:e})},o._cesium.ScreenSpaceEventType.MOUSE_MOVE),this},H.prototype.executeClirclews=function(e){var r=this,t=(this._cesium.Material.fromType(this._cesium.Material.ColorType).uniforms.color=new this._cesium.Color(1,1,0,.5),this._cesium.Ellipsoid.WGS84),i=this,o=this._viewer.scene,n=this._viewer.scene.primitives,a=null,s=new this._cesium.ScreenSpaceEventHandler(o.canvas),l=(s.setInputAction(function(e){null!=e.position&&(e=o.camera.pickEllipsoid(e.position,t))&&(null==a?(a=new l({center:e,radius:0,asynchronous:!1,material:r._cesium.Color.RED}),n.add(a)):i.stopDrawing())},r._cesium.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(function(e){var e=e.endPosition;null!=e&&null!=a&&(e=o.camera.pickEllipsoid(e,t))&&a.setRadius(r._cesium.Cartesian3.distance(a.getCenter(),e))},r._cesium.ScreenSpaceEventType.MOUSE_MOVE),function(){function e(e){if(!r._cesium.defined(e.center)||!r._cesium.defined(e.radius))throw new r._cesium.DeveloperError("Center and radius are required");e=copyOptions(e,defaultSurfaceOptions),this.initialiseOptions(e),this.setRadius(e.radius)}return(e.prototype=new c).setCenter=function(e){this.setAttribute("center",e)},e.prototype.setRadius=function(e){this.setAttribute("radius",Math.max(.1,e))},e.prototype.getCenter=function(){return this.getAttribute("center")},e.prototype.getRadius=function(){return this.getAttribute("radius")},e.prototype.getGeometry=function(){if(r._cesium.defined(this.center)&&r._cesium.defined(this.radius))return new r._cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},e.prototype.getOutlineGeometry=function(){return new r._cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},e}),c=(u.prototype.initialiseOptions=function(e){fillOptions(this,e),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},u.prototype.setAttribute=function(e,t){this[e]=t,this._createPrimitive=!0},u.prototype.getAttribute=function(e){return this[e]},u.prototype.update=function(e,t,i){if(!r._cesium.defined(this.ellipsoid))throw new r._cesium.DeveloperError("this.ellipsoid must be defined.");if(!r._cesium.defined(this.appearance))throw new r._cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new r._cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&(this._createPrimitive||r._cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var o=this.getGeometry();if(!o)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:o,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new r._cesium.Primitive({geometryInstances:new r._cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:r._cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new r._cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i),this._outlinePolygon&&this._outlinePolygon.update(e,t,i)}},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),r._cesium.destroyObject(this)},u.prototype.setStrokeStyle=function(e,t){this.strokeColor&&this.strokeColor.equals(e)&&this.strokeWidth==t||(this._createPrimitive=!0,this.strokeColor=e,this.strokeWidth=t)},u);function u(){}},H.prototype.setSemiMajorAxis=function(e){try{this.item._ellipse.semiMajorAxis=e}catch(e){console.log(e)}return this},H.prototype.setSemiMinorAxis=function(e){try{this.item._ellipse.semiMinorAxis=e}catch(e){console.log(e)}return this},H.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show._value,t=null==this.item.ellipse.semiMajorAxis?void 0:this.item.ellipse.semiMajorAxis._value,i=null==this.item.ellipse.semiMinorAxis?void 0:this.item.ellipse.semiMinorAxis._value,o=(null==this.item.ellipse.height||this.item.ellipse.height._value,null==this.item.ellipse.extrudedHeight?void 0:this.item.ellipse.extrudedHeight._value),r=null==this.item.ellipse.rotation?void 0:this.item.ellipse.rotation._value,n=null==this.item.ellipse.stRotation?void 0:this.item.ellipse.stRotation._value,a=null==this.item.ellipse.fill?void 0:this.item.ellipse.fill._value,s=this.item.ellipse.material,l=(null!=s&&(s={color:null==s.color?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.ellipse.outline?void 0:this.item.ellipse.outline._value),c=null==this.item.ellipse.outlineColor?void 0:"rgba("+this.item.ellipse.outlineColor._value.red+","+this.item.ellipse.outlineColor._value.green+","+this.item.ellipse.outlineColor._value.blue+","+this.item.ellipse.outlineColor._value.alpha+")",u=null==this.item.ellipse.outlineWidth?void 0:this.item.ellipse.outlineWidth._value,h=null==this.item.ellipse.numberOfVerticalLines?void 0:this.item.ellipse.numberOfVerticalLines._value,m=this.item.ellipse.distanceDisplayCondition,d=null==m?void 0:m._value.near,m=null==m?void 0:m._value.far,p=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"circle",position:{x:this._cesium.Math.toDegrees(p.longitude),y:this._cesium.Math.toDegrees(p.latitude),z:p=this._cesium.Math.toDegrees(p.height)},treeobj:{name:this.treeobj.name},style:{show:e,semiMajorAxis:t,semiMinorAxis:i,height:p,extrudedHeight:o,rotation:r,stRotation:n,fill:a,material:s,outline:l,outlineColor:c,outlineWidth:u,numberOfVerticalLines:h,near:d,far:m}}},H.prototype.setTreeobj=function(e){this.treeobj=e},H.prototype.setHeight=function(e){try{this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND,this.item._ellipse.height=e}catch(e){console.log(e)}return this},H.prototype.setHeightType=function(e){try{1==e?this.item._ellipse.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._ellipse.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},H.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._ellipse.distanceDisplayCondition=e}catch(e){console.log(e)}return this},H.prototype.setEllipseImage=function(e){try{this.item._ellipse.material.uniforms.image=e}catch(e){console.log(e)}return this},H.prototype.setOutlineColor=function(e){try{this.item._ellipse.outlineWidth=5,this.item._ellipse.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},H.prototype.setMaterial=function(e){try{this.item._ellipse.material.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e)}catch(e){console.log(e)}return this},H.prototype.setMaterialAlpha=function(e){try{this.item._ellipse.material.color._value.alpha=e,this.item._ellipse.show=!0}catch(e){console.log(e)}return this},H.prototype.setItem=function(e){this.item=e},H.prototype.setExtrudedHeight=function(e){try{this.item._ellipse.extrudedHeight=e}catch(e){console.log(e)}return this},H.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},H.prototype.CreateCircle=function(e,t,i,o,r,n){this._postion=e;var a,t={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(t,3e5),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE},i=(i&&""!==i&&(t.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(i)),o&&""!==o&&(t.material=new m(this._viewer,this._cesium).colorFromHtmlColor(o)),(e.Yaw||e.Pitch||e.Roll)&&(a=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:n,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),ellipse:t,orientation:a}),{id:this.item.id,name:n,pId:this._core.isnull(r)?0:r,type:"circle",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(r)?0:r),this},H.prototype.CreateEllipse=function(e,t,i,o,r,n,a,s){this._postion=e;var l,t={semiMinorAxis:this._cesium.defaultValue(t,3e5),semiMajorAxis:this._cesium.defaultValue(i,1e5),numberOfVerticalLines:this._cesium.defaultValue(n,16),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE},i=(o&&""!==o&&(t.outlineColor=new m(this._viewer,this._cesium).colorFromHtmlColor(o)),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),ellipse:t,orientation:l}),{id:this.item.id,name:s,pId:this._core.isnull(a)?0:a,type:"ellipse",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(a)?0:a),this},Object.defineProperties(H.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)}}}}}),G.prototype.createLabel=function(e,t,i,o,r){var n={id:this._core.getuid(),text:"default text",backgroundColor:new m(this._viewer,this._cesium).createColor(.165,.165,.165,1),fillColor:new m(this._viewer,this._cesium).createColor(.9411764705882353,.9725490196078431,1,1),font:"30px sans-serif",horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(0,Number.MAX_VALUE)},n=this._core.extend(n,i,!0),i=(this._core.isnull(t)||(n.text=t),!n.fillColor||this._core.isnull(n)||this._core.isnull(n.fillColor)||"["==n.fillColor.toString().charAt(0)&&"]"==n.fillColor.toString().charAt(n.fillColor.length-1)||(this._core.isHtmlColor(n.fillColor)&&/^#/.test(n.fillColor.toString())?n.fillColor=this._Color.colorFromHtmlColor(n.fillColor):(/^rgb/.test(n.fillColor)&&(n.fillColor=this._Color.rgbaStringToRgbaObj(n.fillColor)),1<n.fillColor.r&&(n.fillColor.r=n.fillColor.r/255),1<n.fillColor.g&&(n.fillColor.g=n.fillColor.g/255),1<n.fillColor.b&&(n.fillColor.b=n.fillColor.b/255),1<n.fillColor.a&&(n.fillColor.a=n.fillColor.a/255),n.fillColor.r&&(n.fillColor=this._Color.createColor(n.fillColor.r,n.fillColor.g,n.fillColor.b,n.fillColor.a)))),!n.backgroundColor||this._core.isnull(n)||this._core.isnull(n.backgroundColor)||"["==n.backgroundColor.toString().charAt(0)&&"]"==n.backgroundColor.toString().charAt(n.backgroundColor.length-1)||(this._core.isHtmlColor(n.backgroundColor)&&/^#/.test(n.backgroundColor.toString())?n.backgroundColor=this._Color.colorFromHtmlColor(n.backgroundColor):(/^rgb/.test(n.backgroundColor)&&(n.backgroundColor=this._Color.rgbaStringToRgbaObj(n.backgroundColor)),1<n.backgroundColor.r&&(n.backgroundColor.r=n.backgroundColor.r/255),1<n.backgroundColor.g&&(n.backgroundColor.g=n.backgroundColor.g/255),1<n.backgroundColor.b&&(n.backgroundColor.b=n.backgroundColor.b/255),1<n.backgroundColor.a&&(n.backgroundColor.a=n.backgroundColor.a/255),n.backgroundColor.r&&(n.backgroundColor=this._Color.createColor(n.backgroundColor.r,n.backgroundColor.g,n.backgroundColor.b,n.backgroundColor.a)))),!n.outlineColor||this._core.isnull(n)||this._core.isnull(n.outlineColor)||"["==n.outlineColor.toString().charAt(0)&&"]"==n.outlineColor.toString().charAt(n.outlineColor.length-1)||(this._core.isHtmlColor(n.outlineColor)&&/^#/.test(n.outlineColor.toString())?n.outlineColor=this._Color.colorFromHtmlColor(n.outlineColor):(/^rgb/.test(n.outlineColor)&&(n.outlineColor=this._Color.rgbaStringToRgbaObj(n.outlineColor)),1<n.outlineColor.r&&(n.outlineColor.r=n.outlineColor.r/255),1<n.outlineColor.g&&(n.outlineColor.g=n.outlineColor.g/255),1<n.outlineColor.b&&(n.outlineColor.b=n.outlineColor.b/255),1<n.outlineColor.a&&(n.outlineColor.a=n.outlineColor.a/255),n.outlineColor.r&&(n.outlineColor=this._Color.createColor(n.outlineColor.r,n.outlineColor.g,n.outlineColor.b,n.outlineColor.a)))),n.near&&n.far&&(n.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(n.near,n.far)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),label:n}),{id:this.item.id,name:n.text,pId:this._core.isnull(o)?0:o,type:"label",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},G.prototype.getstyles=function(){var e={};return e.backgroundColor="rgba"+this.item.label._backgroundColor.toString(),e.fillColor="rgba"+this.item.label._fillColor.toString(),e.text=this.item.label.text.toString(),e.show=!this.item.label.show||this.item.label.show._value,e.font=this.item.label.font?this.item.label.font.toString():null,e.style=!this.item.label.style||"null"==this.item.label.style.toString()?null:this.item.label.style.toString(),e.scale=this.item.label.scale?this.item.label.scale.toString():null,e.showBackground=this.item.label.showBackground?this.item.label.showBackground._value:null,e.horizontalOrigin=this.item.label.horizontalOrigin?this.item.label.horizontalOrigin.toString():null,e.verticalOrigin=this.item.label.verticalOrigin?this.item.label.verticalOrigin.toString():null,e.heightReference=this.item.label.heightReference?this.item.label.heightReference.toString():null,e.outlineColor=this.item.label.outlineColor?"rgba"+this.item.label.outlineColor.toString():null,e.outlineWidth=this.item.label.outlineWidth?this.item.label.outlineWidth._value:null,e.near=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.near:null,e.far=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.far:null,e.position=this.item.position.getValue().toString(),e},G.prototype.executeLabel=function(e){var i=this,t=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas);return t.setInputAction(function(e){e=i._viewer.scene.camera.pickEllipsoid(e.position,i._viewer.scene.globe.ellipsoid),e=i._viewer.entities.add({position:e,label:{id:i._core.getuid(),text:"",font:"30px sans-serif",horizontalOrigin:i._cesium.HorizontalOrigin.CENTER,verticalOrigin:i._cesium.VerticalOrigin.CENTER,show:!0,showBackground:!0}}),i.item=e,e=0;i._core.isnull(V.selectedItem)||"group"!=V.selectedItem.type||(e=V.selectedItem.id);var t={id:i._core.getuid(),name:"",pId:i._core.isnull(e)?0:e,type:"Point",item:i};i.setTreeobj(t),i._tree.insertGroupId(t,i._core.isnull(e)?0:e)},i._cesium.ScreenSpaceEventType.LEFT_CLICK),t.setInputAction(function(e){t.destroy()},i._cesium.ScreenSpaceEventType.RIGHT_CLICK),this},G.prototype.deleteObject=function(){try{var e;"DivPoint"===this.item.type?(this.pointPrimitive.remove(this.item),(e=document.getElementById(this.item.id))&&e.remove()):this._viewer.entities.remove(this.item)}catch(e){}},G.prototype.setVisibility=function(e){this.item.show=e},G.prototype.setRichtext=function(e){var o,r,n,t=this._core.getuid(),i=(null!=this.item.position._value?this._position=this.item.position._value:this._position=this.item.position,this.treeobj.pId),t=(this.deleteObject(),this.pointPrimitive||(this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection),(n=this).pointPrimitive.update=function(){for(var e,t,i=0;i<n.pointPrimitive.length;i++){if(e=n.pointPrimitive.get(i),r=e.position,!(r=n._viewer.scene.cartesianToCanvasCoordinates(r)))return;o=document.getElementById(e.id),e.name||(e.name="泰瑞"),o=o||(t=e.description?'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n                   <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">'+e.description+"</div> \n           </div>":'<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+e.name+"</div>\n           </div>",$(".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<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=this._Color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),this._core.isnull(o)||this._core.isnull(o.LineColor)||"["==o.LineColor.toString().charAt(0)&&"]"==o.LineColor.toString().charAt(o.LineColor.length-1)||(this._core.isHtmlColor(o.LineColor)?a.outlineColor=this._Color.colorFromHtmlColor(o.LineColor):(/^rgb/.test(o.LineColor)&&(a.outlineColor=this._Color.rgbaStringToRgbaObj(o.LineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=this._Color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),a=this._core.extend(a,o,!0),{position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),label:a}),i=(i&&""!==i&&(e.label.pixelOffset=this._cesium.defaultValue(o.pixelOffset,{x:30*(t.length/2+1),y:-30}),t={image:i,horizontalOrigin:this._cesium.defaultValue(o.ImageHorizontal,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._cesium.defaultValue(o.ImageVertical,this._cesium.VerticalOrigin.BOTTOM),show:!0,scale:o.ImageScale||1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(o.ImageMinViewingHeight||0,o.ImageMaxViewingHeight||99999999999999)},o.pixelOffset={x:0,y:0},t=this._core.extend(t,o,!1),e.billboard=t),this.item=this._viewer.entities.add(e),{id:this.item.id,name:a.text,pId:this._core.isnull(r)?0:r,type:"label",item:this});return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(r)?0:r),this},G.prototype.export=function(){var e=null==this.item.label.show?void 0:this.item.label.show._value,t=null==this.item.label.text?void 0:this.item.label.text._value,i=null==this.item.label.font?void 0:this.item.label.font._value,o=null==this.item.label.style?void 0:this.item.label.style._value,r=null==this.item.label.scale?void 0:this.item.label.scale._value,n=null==this.item.label.showBackground?void 0:this.item.label.showBackground._value,a=null==this.item.label.backgroundColor?void 0:"rgba("+this.item.label.backgroundColor._value.red+","+this.item.label.backgroundColor._value.green+","+this.item.label.backgroundColor._value.blue+","+this.item.label.backgroundColor._value.alpha+")",s=null==this.item.label.horizontalOrigin?void 0:this.item.label.horizontalOrigin._value,l=null==this.item.label.verticalOrigin?void 0:this.item.label.verticalOrigin._value,c=null==this.item.label.heightReference?void 0:this.item.label.heightReference._value,u=null==this.item.label.fillColor?void 0:"rgba("+this.item.label.fillColor._value.red+","+this.item.label.fillColor._value.green+","+this.item.label.fillColor._value.blue+","+this.item.label.fillColor._value.alpha+")",h=null==this.item.label.outlineColor?void 0:"rgba("+this.item.label.outlineColor._value.red+","+this.item.label.outlineColor._value.green+","+this.item.label.outlineColor._value.blue+","+this.item.label.outlineColor._value.alpha+")",m=null==this.item.label.outlineWidth?void 0:this.item.label.outlineWidth._value,d=this.item.label.distanceDisplayCondition,p=null==d?void 0:d._value.near,d=null==d?void 0:d._value.far,g=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"label",position:{x:this._cesium.Math.toDegrees(g.longitude),y:this._cesium.Math.toDegrees(g.latitude),z:this._cesium.Math.toDegrees(g.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,text:t,font:i,style:o,scale:r,showBackground:n,backgroundColor:a,horizontalOrigin:s,verticalOrigin:l,heightReference:c,fillColor:u,outlineColor:h,outlineWidth:m,near:p,far:d}}},G.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(G.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=this._cesium.Math.toDegrees(t.latitude),r=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,o,e));this.item.position.position=r,this._postion.Altitude=e}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}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),o=this._cesium.Math.toDegrees(t.height),r=this._cesium.Cartesian3.fromDegrees(e,i,o);this.item.position.position=r}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),r=this._cesium.Cartesian3.fromDegrees(i,e,o);this.item.position.position=r}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)"bold"!=t[o]&&-1==t[o].indexOf("px")&&-1==t[o].indexOf("PX")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1!=t[o].indexOf("px")&&(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1!=t[o].indexOf("italic")&&(i=i+" "+t[o]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),k.prototype.executeFlycesium=function(t){var i=this,o=(e.prototype._init=function(){var e=this;this.options.polyline.positions=new i._cesium.CallbackProperty(function(){return e.positions},!1),this.flycesium=i._viewer.entities.add(this.options),i.item=this.flycesium},e);function e(e){this.options={polyline:{show:!0,positions:[],material:new i._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:i._cesium.Color.YELLOW}),width:10,clampToGround:!0}},this.positions=e,this._init()}var r=this.handler=new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas),n=[],a=0,s=void 0,l={polyline:{},cameraRoll:null,cameraPitch:null,cameraPosition:null,cameraHeading:null,positions:[],distance:[],Totaltime:""},c=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+I.draw),r.setInputAction(function(e){e=i._getPosition.getMousePosition(e);"pc"===i._core.getBrowser().pc&&0==n.length&&n.push(e.clone()),n.push(e),2<=n.length&&(i._cesium.defined(s)||(s=new o(n)),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){c.showAt(e.endPosition,"左键开始,右键结束!");e=i._getPosition.getMousePosition(e);2<=n.length&&(i._cesium.defined(s)?e&&(n.pop(),n.push(e)):s=new o(n),a=i._core.getSpaceDistancem(n,i._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(e){i.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(e){r.destroy(),c.show(!1),i._core.mouse(i._viewer.container,0),i.end=void 0,i._viewer.entities.remove(i.item),"cancel"===e||n.length<2||(a=i._core.getSpaceDistancem(n,i._cesium),l.polyline=s,l.positions=n,l.distance=parseFloat(a),i.setFlycesium(l,function(e){i.flyceium=e,i.ploylinejl=l,"function"==typeof t&&t(e)}))},this},k.prototype.getFlyData=function(e,t){let i=[];"object"==typeof e[0]?e.forEach(e=>{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<e.positions.length;o++){var r=this._cesium.Cartographic.fromCartesian(e.positions[o]),r=[r.longitude/Math.PI*180,r.latitude/Math.PI*180,r.height];i.push(r)}var n=(e.distance/50.5).toFixed(1),n={id:this._core.getuid(),name:"新建路线",distance:e.distance,showPoint:!1,showLine:!0,showModel:!0,isLoop:!1,Totaltime:Math.round(n),speed:50.5,height:10,perPositionHeight:!1,pitch:-20,range:100,mode:0,url:window.SmartEarthRootUrl+I.testModel,geojson:{geometry:{type:"LineString",coordinates:i}}};return t&&t(n),n},k.prototype.Start=function(e,t,i){var o=this;return e.geojson,e.Totaltime||(e.Totaltime=3e3),o._entityFly&&o.exit(),Jr=i,setTimeout(function(){o.executeFly3D(e,t)},200),this};var Hr,Gr,kr,Nr,jr,Ur,zr,Wr=null,Yr=null,Jr=null,N={start:null,time:null,longitude:0,latitude:0,cameraHeight:10,speed:50.5,multiplier:1,position:0},Kr=0,Qr=(k.prototype.executeFly3D=function(e,t){var l=this,i=e.geojson;if(Hr=new l._cesium.Cartesian3,Nr=new l._cesium.SampledProperty(Number),jr=new l._cesium.SampledPositionProperty,i&&i.geometry){var o=i.geometry.coordinates,r=[],n=[];if(0<o.length){for(var a=0;a<o.length;a++){var s=o[a][0],c=o[a][1],u=o[a][2];void 0===e.lineHeight||e.perPositionHeight||(u=e.lineHeight),n.push(s,c,u),r.push({x:s,y:c,z:u})}l._viewer.clock.clockRange=e.isLoop?l._cesium.ClockRange.LOOP_STOP:l._cesium.ClockRange.CLAMPED,l._viewer.clock.multiplier=e.multiplier||1,l._viewer.clock.canAnimate=!1,l._viewer.clock.shouldAnimate=!0,N.distance=e.distance,N.cameraHeight=this._core.defaultValue(e.height,10),N.lineHeight=e.lineHeight,N.perPositionHeight=e.perPositionHeight,N.pitch=e.pitch,N.range=e.range,N.speed=e.speed||50.5,N.Totaltime=e.distance/N.speed,N.start=l._cesium.JulianDate.fromDate(new Date),N.stop=l._cesium.JulianDate.addSeconds(N.start,N.Totaltime,new l._cesium.JulianDate),l._viewer.clock.startTime=N.start.clone(),l._viewer.clock.stopTime=N.stop.clone(),l._viewer.clock.currentTime=N.start.clone();var i=l.computeCirclularFlight(r),h=(N.position=i,N.degrees=r,kr=new l._cesium.VelocityOrientationProperty(i),{}),h=""!==t?{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1),uri:t}:{show:l._cesium.defaultValue(e.showModel,!0),scale:l._cesium.defaultValue(e.modelScale,1)};e.modelData&&(h=l._core.extend(h,e.modelData)),zr=function(){},Wr=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:N.start,stop:N.stop})]),position:i,polyline:{clampToGround:void 0===N.lineHeight&&!N.perPositionHeight,positions:Cesium.Cartesian3.fromDegreesArrayHeights(n),show:l._cesium.defaultValue(e.showLine,!0),material:new l._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:l._cesium.Color.YELLOW}),width:10},label:{text:new l._cesium.CallbackProperty(function(e,t){if(l._viewer.camera,2===l._viewer.clock.clockRange||!Cesium.JulianDate.equals(l._viewer.clock.currentTime,l._viewer.clock.stopTime)){try{var i,o,r=Qr.position.getValue(l._viewer.clock.currentTime),n=l._cesium.Cartographic.fromCartesian(r);N.longitude=l._cesium.Math.toDegrees(n.longitude),N.latitude=l._cesium.Math.toDegrees(n.latitude),void 0!==N.lineHeight||N.perPositionHeight||(i=l._viewer.scene.sampleHeight(n,[Yr,Qr]),o=l._viewer.scene.globe.getHeight(n),Yr.position=l._cesium.Cartesian3.fromRadians(n.longitude,n.latitude,i<o?o:i))}catch(e){}try{Gr.getValue(e,Hr),zr(e);var a=l._cesium.Cartesian3.magnitude(Hr),s=Math.round(3.6*a);s+=" km/h",N.time=l._cesium.JulianDate.secondsDifference(e,N.start),N.ratio=N.time/N.Totaltime,N.distanceTraveled=N.ratio*N.distance,N.speed=s,N.height=n.height,N.globeHeight=l._viewer.scene.globe.getHeight(n),null!=Jr&&"function"==typeof Jr&&Jr(N)}catch(e){}return""}Wr.label.text="",N.time=N.Totaltime,N.ratio=1,N.distanceTraveled=N.distance,l.exit(),null!=Jr&&"function"==typeof Jr&&Jr(N,"end"),zr=function(){}},!1),font:"20px sans-serif",showBackground:!1,distanceDisplayCondition:new l._cesium.DistanceDisplayCondition(0,100),eyeOffset:new l._cesium.Cartesian3(0,3.5,0)}}),Yr=l._viewer.entities.add({availability:new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({start:N.start,stop:N.stop})]),position:i,orientation:kr,point:{show:l._cesium.defaultValue(e.showPoint,!1),color:l._cesium.Color.RED,outlineColor:l._cesium.Color.WHITE,outlineWidth:2,pixelSize:10},model:h,billboard:e.image,viewFrom:e.viewFrom||new l._cesium.Cartesian3(500,500,500)}),Qr=Wr,l._viewer.trackedEntity=Yr,l._entityFly=Wr,e.mode&&l.changeFlyMode(e.mode)}}},null);function qr(e){Kr=Nr.getValue(e),N.heading=Kr}function Xr(e){var e=Cesium.Cartographic.fromCartesian(e),t=Cesium.Math.toDegrees(e.longitude),i=Cesium.Math.toDegrees(e.latitude);return Cesium.Cartesian3.fromDegrees(t,i,e.height+N.cameraHeight)}function j(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this.positions=[],this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.gonPointStretchingArr=[],this.topRadius=0,this.bottomRadius=0,this.length=50}function Zr(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._polyline=void 0,this._polygon=void 0,this._box=new B(e,t),this._ellipsoid=new Fr(e,t),this._rectangle=new F(e,t),this._circle=new H(e,t),this._point=void 0,this._label=new G(e,t),this._dynamicObject=new k(e,t),this._elevationContour=new Yt(e,t),this._cone=new j(e,t)}function $r(e,t){this._viewer=e,this._cesium=t,this._execute=new Zr(this._viewer,this._cesium)}k.prototype.showPoint=function(e){Yr&&Yr.point&&(Yr.point.show=e)},k.prototype.showLine=function(e){Wr&&Wr.polyline&&(Wr.polyline.show=e)},k.prototype.showModel=function(e){Yr&&Yr.model&&(Yr.model.show=e)},k.prototype.setFlyHeight=function(e){N.cameraHeight=e},k.prototype.setFlyDistance=function(e){N.range=e},k.prototype.setFlyPitch=function(e){N.pitch=e},k.prototype.changeFlyMode=function(e){var t=this;switch(e){case 0:zr=function(){},t.BindingModel(!0);break;case 1:this.BindingModel(!1),zr=function(e){qr(e),t.exeuteVisualAngle(t._cesium.Math.toRadians(N.heading),t._cesium.Math.toRadians(N.pitch),N.range)};break;case 2:this.BindingModel(!1),zr=function(e){qr(e),(Ur=t._entityFly.position.getValue(t._viewer.clock.currentTime))&&(Ur=Xr(Ur),t._viewer.camera.setView({destination:Ur,orientation:{heading:t._cesium.Math.toRadians(N.heading),pitch:t._cesium.Math.toRadians(-90),roll:0}}))}}},k.prototype.faster=function(){this._viewer.animation.viewModel.faster()},k.prototype.slower=function(){this._viewer.animation.viewModel.slower()},k.prototype.setMultiplier=function(e){this._viewer.clock.multiplier=parseFloat(e)},k.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},k.prototype.exit=function(){this.isPause(!0),this._viewer.clock.multiplier=1,this.executeSignout(),this.BindingModel(!1),this._viewer.entities.remove(Wr),this._viewer.entities.remove(Yr),Yr=Wr=null,this._entityFly=null},k.prototype.updateSpeedLabel=function(e,t){},k.prototype.computeCirclularFlight=function(e){var t=this;Gr=new t._cesium.VelocityVectorProperty(jr,!1);for(var i,o,r,n,a,s=0;s<e.length;s++){0===s&&(n=t._cesium.JulianDate.addSeconds(N.start,0,new t._cesium.JulianDate),i=t._cesium.Cartesian3.fromDegrees(e[0].x,e[0].y,t._cesium.defaultValue(N.lineHeight,e[s].z)),jr.addSample(n,i),Kr=t._core.TwoPointAzimuth(e[0].x,e[0].y,e[1].x,e[1].y),Nr.addSample(n,Kr));try{0<s&&(i=new t._cesium.Cartesian3(jr._property._values[3*s-3],jr._property._values[3*s-2],jr._property._values[3*s-1]),o=t._cesium.Cartesian3.fromDegrees(e[s].x,e[s].y,t._cesium.defaultValue(N.lineHeight,e[s].z)),r=Cesium.Cartesian3.distance(i,o),n=t._cesium.JulianDate.addSeconds(jr._property._times[s-1],.5,new t._cesium.JulianDate),a=t._cesium.JulianDate.addSeconds(jr._property._times[s-1],r/N.speed,new t._cesium.JulianDate),jr.addSample(a,o),Kr=t._core.TwoPointAzimuth(e[s-1].x,e[s-1].y,e[s].x,e[s].y),Nr.addSample(n,Kr),Nr.addSample(a,Kr))}catch(e){console.log(e)}}return jr},k.prototype.executePauseFly3DPaths=function(){var e=this._viewer.clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:this._viewer.clockViewModel.canAnimate&&(e.shouldAnimate=!0)},k.prototype.changeModel=function(e){Yr.model.uri=e},k.prototype.PointView=function(){return{position:Viewer.camera.position.clone(),orientation:{heading:Viewer.camera.heading,pitch:Viewer.camera.pitch,roll:Viewer.camera.roll}}},k.prototype.PlayPaths=function(e){var t=this;setInterval(function(){viewer.camera.setView({destination:t._cesium.Cartesian3.fromDegrees(117.48,30.67,15e3),orientation:{heading:t._cesium.Math.toRadians(90,0),pitch:t._cesium.Math.toRadians(-90),roll:0}})},2e3)},k.prototype.BindingModel=function(e){e?this._viewer.trackedEntity=Yr:(this._viewer.trackedEntity=void 0,this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY))},k.prototype.exeuteVisualAngle=function(e,t,i){var o={heading:null,pitch:null,range:null},e=(o.heading=e||this._cesium.Math.toRadians(90),o.pitch=t||this._cesium.Math.toRadians(0),o.range=i||1e3,this._entityFly.position.getValue(this._viewer.clock.currentTime));e&&(e=Xr(e),t=new this._cesium.HeadingPitchRange(o.heading,o.pitch,o.range),this._viewer.camera.lookAt(e,t))},k.prototype.Pathshow=function(e){this._entityFly.polyline.show=e},k.prototype.Pointshow=function(e){Yr._point.show=e},k.prototype.Modelshow=function(e){Yr._model.show=e},k.prototype.executePlayForwardFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0},k.prototype.executePlayReverseFly3DPaths=function(){var e=this._viewer.clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0},k.prototype.executeSignout=function(){var e=this._cesium.JulianDate.fromDate(new Date),e=(this._viewer.clock.startTime=e.clone(),this._cesium.JulianDate.addSeconds(e,86400,new this._cesium.JulianDate));this._viewer.clock.stopTime=e.clone()},k.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0)},j.prototype.createCone=function(e,t,i,o){var r={length:4e5,topRadius:0,bottomRadius:2e5,material:this._cesium.Color.GREEN},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]),cylinder:r}),{id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"cylinder",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},j.prototype.getstyles=function(){var e={};return e.show=!this.item.cylinder.show||this.item.cylinder.show._value,e.length=this.item.cylinder.length?this.item.cylinder.length.getValue():void 0,e.topRadius=this.item.cylinder.topRadius?this.item.cylinder.topRadius.getValue():void 0,e.bottomRadius=this.item.cylinder.bottomRadius?this.item.cylinder.bottomRadius.getValue():void 0,e.heightReference=this.item.cylinder.heightReference&&this.item.cylinder.heightReference._value?this.item.cylinder.heightReference._value:void 0,e.fill=this.item.cylinder.fill&&this.item.cylinder.fill._value?this.item.cylinder.fill._value:void 0,e.material={},e.material.color=this.item.cylinder.material&&this.item.cylinder.material.color&&this.item.cylinder.material.color._value?"rgba"+this.item.cylinder.material.color.toString():void 0,e.material.image=this.item.cylinder.material&&this.item.cylinder.material.image&&this.item.cylinder.material.image._value?this.item.cylinder.material.image._value:void 0,e.material.repeat=this.item.cylinder.material&&this.item.cylinder.material.repeat&&this.item.cylinder.material.repeat._value?this.item.cylinder.material.repeat._value:void 0,e.outline=this.item.cylinder.outline?this.item.cylinder.outline._value:void 0,e.outlineWidth=this.item.cylinder.outlineWidth&&this.item.cylinder.outlineWidth._value?this.item.cylinder.outlineWidth._value:void 0,e.outlineColor=this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor._value?"rgba"+this.item.cylinder.outlineColor.toString():void 0,e.near=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.near:void 0,e.far=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},j.prototype.createRectangularSensor=function(e,t,i,o){var r,n=this,a=this._core.defaultValue((t=t||{}).radius,100),s={radii:new this._cesium.Cartesian3(a,a,a),maximumCone:this._cesium.Math.toRadians(90),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!0,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},l=this._core.extend(s,t,!0),c=("string"==typeof t.color&&(l.material=this._cesium.Color.fromCssColorString(t.color)),"string"==typeof t.outlineColor&&(l.outlineColor=this._cesium.Color.fromCssColorString(t.outlineColor)),0),u=this.calcPoints(e[0],e[1],e[2],a,c),s=(this.wall=[],this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3.fromDegreesArrayHeights(u))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}})),h=(this.wall.push(s),l.angle&&(r=this.calcPoints(e[0],e[1],e[2],a,c+l.angle),s=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3.fromDegreesArrayHeights(r))},!1),perPositionHeight:!0,material:this._core.defaultValue(t.wallColor&&this._cesium.Color.fromCssColorString(t.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(t.wallOutlineColor&&this._cesium.Color.fromCssColorString(t.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}}),this.wall.push(s),s=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:{radii:l.radii,minimumClock:this._cesium.Math.toRadians(0),maximumClock:this._cesium.Math.toRadians(l.angle),maximumCone:this._cesium.Math.toRadians(90),material:this._core.defaultValue(t.surfaceColor&&this._cesium.Color.fromCssColorString(t.surfaceColor),this._cesium.Color.RED.withAlpha(.5))},orientation:new n._cesium.CallbackProperty(function(){return n._cesium.Transforms.headingPitchRollQuaternion(n._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),new n._cesium.HeadingPitchRoll(n._cesium.Math.toRadians(-c),0,0))},!1)}),this.wall.push(s)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),ellipsoid:l}),this._core.defaultValue(l.speed,1)),t=(this._viewer.clock.onTick.addEventListener(function(){c+=.1*h,u=n.calcPoints(e[0],e[1],e[2],a,c),r=r&&n.calcPoints(e[0],e[1],e[2],a,c+l.angle)}),{id:this.item.id,name:i,pId:this._core.isnull(o)?0:o,type:"cylinder",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},j.prototype.computeCirclularFlight=function(e,t,i,o,r,n,a){for(var s=[],l=(s.push(e),s.push(t),s.push(r),this._cesium.Cartesian3.distance(this._cesium.Cartesian3.fromDegrees(e,t,r),this._cesium.Cartesian3.fromDegrees(i,o,r))),c=n;c<=n+a;c++){var u=l*Math.sin(c*Math.PI/180),h=Math.cos(c*Math.PI/180),m=(o-t)*h+t;s.push((i-e)*h+e),s.push(m),s.push(u+r)}return s},j.prototype.calcPoints=function(e,t,i,o,r){var n=this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(e,t,i)),a=o*Math.cos(r*Math.PI/180),o=o*Math.sin(r*Math.PI/180),r=this._cesium.Cartesian3.fromElements(a,o,0),a=this._cesium.Matrix4.multiplyByPoint(n,r,new this._cesium.Cartesian3),o=this._cesium.Cartographic.fromCartesian(a),n=this._cesium.Math.toDegrees(o.longitude),r=this._cesium.Math.toDegrees(o.latitude);return this.computeCirclularFlight(e,t,n,r,i,0,90)},j.prototype.createRadarMaskScan=function(e,t,a,i){var o=this,s=(a=a||{},this._core.defaultValue(a.radius,100)),r=this._core.defaultValue(a.yaw,0),n=this._core.defaultValue(a.angle,60),l=a.innerOutline,c={subdivisions:6,stackPartitions:30,slicePartitions:30,innerRadii:new this._cesium.Cartesian3(.5,.5,.5),radii:new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(s,s,s)},!1),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(a.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(a.minLat,75)),minimumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(r)},!1),maximumClock:new Cesium.CallbackProperty(function(){return Cesium.Math.toRadians(r+n)},!1),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!l,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},c=this._core.extend(c,a,!0);"string"==typeof a.color&&(c.material=this._cesium.Color.fromCssColorString(a.color)),"string"==typeof a.outlineColor&&(c.outlineColor=this._cesium.Color.fromCssColorString(a.outlineColor));let u,h,m=t instanceof Cesium.Entity?t:void 0;if(m?(u=new Cesium.CallbackProperty(()=>{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)):u=Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]),a.trackedEntity){let e,t,i,o,r,n=(c.maximumCone-c.minimumCone)/2;h=new Cesium.CallbackProperty(()=>(t=a.trackedEntity.position.getValue(this._viewer.clock.currentTime.clone()),e=u.getValue?u.getValue():u,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:u,orientation:h,ellipsoid:{...c,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:u,orientation:h,ellipsoid:c}),this._core.defaultValue(c.speed,1));function f(){(d+=.1*g)<=0&&g<0?(d=0,g=-g):n-p<=d&&0<g&&(d=n-p,g=-g)}this._viewer.clock.onTick.addEventListener(f),this.setRadarMaskValue=(e,t)=>{"yaw"===e?r=t:"angle"===e?n=360<t?360:t:"radius"===e?s=t:"scanAngle"===e?p=n<t?n:t:"speed"===e&&(g=t)},this.deleteObject=()=>{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,c,u=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,c=Math.acos((s.height-a.height)/o),c=Cesium.Math.toDegrees(c),this.item.orientation=Cesium.Transforms.headingPitchRollQuaternion(t,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(l,0)),Cesium.Math.toRadians(this._core.defaultValue(c,0)),Cesium.Math.toRadians(this._core.defaultValue(u,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.lat<o[1]+.005?r.lat+=1e-5:r.lat>o[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<s.gonCircleArr.length&&(s.positions.pop(),s.state=1,s.handler.destroy()),s.createPointStretching(e,!1));e.wq=s.gonCircleArr.length,s.gonPointStretchingArr.push(e),t.wz=s.gonCircleArr.length,s.gonCircleArr.push(t)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){var t,i,o,r,n,a;s.positions.length<1||(e=s.getCatesian3FromPX(e.endPosition,s._viewer,[s.circle]),2!=s.positions.length||s._cesium.defined(s.circle)||(t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.topRadius=Tr(o,i,a,n),s.bottomRadius=Tr(o,i,a,n),s.circle=s.createCylinder(s.style),s.circle.objId=s.objId),s.circle&&(s.positions.pop(),s.positions.push(e),t=s._cesium.Cartographic.fromCartesian(s.positions[0]),i=s._cesium.Math.toDegrees(t.longitude),o=s._cesium.Math.toDegrees(t.latitude),r=s._cesium.Cartographic.fromCartesian(s.positions[1]),n=s._cesium.Math.toDegrees(r.longitude),a=s._cesium.Math.toDegrees(r.latitude),s.topRadius=Tr(o,i,a,n),s.bottomRadius=Tr(o,i,a,n)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)},j.prototype.startModify=function(){var m="拖动修改位置";if(2==this.state||1==this.state){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var d=this,e=0;e<d.gonCircleArr.length;e++)(t=d.gonCircleArr[e])&&(t.show=!0);if(0<d.gonPointStretchingArr.length)for(var t,e=0;e<d.gonPointStretchingArr.length;e++)(t=d.gonPointStretchingArr[e])&&(t.show=!0);this.modifyHandler.setInputAction(function(e){e=d._viewer.scene.pick(e.position);if(Cesium.defined(e)&&e.id)e.id.objId||(d.modifyPoint=e.id,m="释放后完成修改"),d.forbidDrawWorld(!0);else{for(var t=0;t<d.gonCircleArr.length;t++)(i=d.gonCircleArr[t])&&(i.show=!1);if(0<d.gonPointStretchingArr.length)for(var i,t=0;t<d.gonPointStretchingArr.length;t++)(i=d.gonPointStretchingArr[t])&&(i.show=!1);d.modifyHandler&&(d.modifyHandler.destroy(),d.modifyHandler=null)}d.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(e){var t,i,o,r,n,a,s,l,c,u,h=d._viewer.scene.pick(e.endPosition);d._core.CreateTooltip(m,e.endPosition,!1),Cesium.defined(h)&&h.id&&(h.id.objId||d._core.CreateTooltip(m,e.endPosition,!0)),d.positions.length<1||!d.modifyPoint||((h=d.getCatesian3FromPX(e.endPosition,d._viewer,[d.circle,d.modifyPoint]))&&(null!=d.modifyPoint.wq?(r={x:h.x,y:h.y,z:h.z+ +d.length},d.positions[d.modifyPoint.wq]=h,0==d.modifyPoint.wq?(d.modifyPoint.position.setValue(r),d.gonCircleArr[d.modifyPoint.wq].position=h):(r=d._viewer.scene.pickPosition(e.endPosition),n=d._cesium.Cartographic.fromCartesian(r),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),l=d._cesium.Cartographic.fromCartesian(d.positions[1]),c=d._cesium.Math.toDegrees(l.longitude),u=d._cesium.Math.toDegrees(l.latitude),d.length=Tr(s,a,u,c),r=d._cesium.Cartographic.fromCartesian(d.gonCircleArr[0].position.getValue()),t=d._cesium.Math.toDegrees(r.longitude),o=d._cesium.Math.toDegrees(r.latitude),r=r.height+d.length,t=d._cesium.Cartesian3.fromDegrees(t,o,r),o=d._cesium.Cartographic.fromCartesian(d.gonCircleArr[1].position.getValue()),r=d._cesium.Math.toDegrees(o.longitude),i=d._cesium.Math.toDegrees(o.latitude),o=o.height+d.length,r=d._cesium.Cartesian3.fromDegrees(r,i,o),d.gonPointStretchingArr[0].position.setValue(t),d.gonPointStretchingArr[1].position.setValue(r))):(d.modifyPoint.position.setValue(h),d.positions[d.modifyPoint.wz]=h,d.gonPointStretchingArr[d.modifyPoint.wz].position={x:h.x,y:h.y,z:h.z+d.length},d.modifyPoint.wz&&0==d.modifyPoint.wz?(d.gonCircleArr[1].position={x:d.positions[0].x+d.topRadius,y:d.positions[0].y,z:d.positions[0].z},d.gonPointStretchingArr[1].position={x:d.positions[0].x+d.topRadius,y:d.positions[0].y,z:d.positions[0].z+d.length}):(n=d._cesium.Cartographic.fromCartesian(d.positions[0]),a=d._cesium.Math.toDegrees(n.longitude),s=d._cesium.Math.toDegrees(n.latitude),l=d._cesium.Cartographic.fromCartesian(d.positions[d.modifyPoint.wz]),c=d._cesium.Math.toDegrees(l.longitude),u=d._cesium.Math.toDegrees(l.latitude),d.topRadius=Tr(s,a,u,c),d.bottomRadius=Tr(s,a,u,c)))),d._core.CreateTooltip(m,e.endPosition,!0))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(e){d.modifyPoint&&(d.modifyPoint=null,d.forbidDrawWorld(!1),m="拖动修改位置")},Cesium.ScreenSpaceEventType.LEFT_UP)}},j.prototype.forbidDrawWorld=function(e){this._viewer.scene.screenSpaceCameraController.enableRotate=!e,this._viewer.scene.screenSpaceCameraController.enableTilt=!e,this._viewer.scene.screenSpaceCameraController.enableTranslate=!e,this._viewer.scene.screenSpaceCameraController.enableInputs=!e},j.prototype.getCatesian3FromPX=function(e,t,i){var o,r=t.scene.pick(e),n=t.scene.drillPick(e),a=null;if(i){for(var s=0;s<n.length;s++)if(n[s].id._id!=i[0].id&&n[s].id._id!=i[1].id){a=n[s].id;break}}else a=r;if(t.scene.pickPositionSupported&&Cesium.defined(a))o=t.scene.pickPosition(e);else{r=t.camera.getPickRay(e);if(!r)return;o=t.scene.globe.pick(r,t.scene)}return o},j.prototype.createCylinder=function(e){var t=this;return e.length&&(t.length=e.length),this._viewer.entities.add({position:new t._cesium.CallbackProperty(function(){return t.positions[0]},!1),cylinder:{topRadius:new t._cesium.CallbackProperty(function(){return t.topRadius},!1),bottomRadius:new t._cesium.CallbackProperty(function(){return t.bottomRadius},!1),length:new t._cesium.CallbackProperty(function(){return t.length},!1),material:e.material||Cesium.Color.WHITE}})},j.prototype.createPoint=function(e,t){if(e)return this._viewer.entities.add({position:e,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},j.prototype.createPointStretching=function(e,t){var i,o,r;if(e)return r=Cesium.Cartographic.fromCartesian(e),i=Cesium.Math.toDegrees(r.longitude),o=Cesium.Math.toDegrees(r.latitude),r=r.height+this.length,e=Cesium.Cartesian3.fromDegrees(i,o,r),this._viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA,.5),outlineWidth:2,outlineColor:Cesium.Color.fromAlpha(Cesium.Color.WHITE,.5),heightReference:Cesium.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:t})},j.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=null==this.item.cylinder.length?void 0:this.item.cylinder.length.getValue(),i=null==this.item.cylinder.topRadius?void 0:this.item.cylinder.topRadius.getValue(),o=null==this.item.cylinder.bottomRadius?void 0:this.item.cylinder.bottomRadius.getValue(),r=null==this.item.cylinder.fill?void 0:this.item.cylinder.fill.getValue(),n=this.item.cylinder.material,a=(null!=n&&(n={color:null==n.color?void 0:"rgba("+n.color._value.red+","+n.color._value.green+","+n.color._value.blue+","+n.color._value.alpha+")",image:null==n.image?void 0:n.image._value,diffusemap:null==n.diffusemap?void 0:n.diffusemap._value,alphamap:null==n.alphamap?void 0:n.alphamap._value}),null==this.item.cylinder.outline?void 0:this.item.cylinder.outline._value),s=null==this.item.cylinder.outlineColor?void 0:"rgba("+this.item.cylinder.outlineColor._value.red+","+this.item.cylinder.outlineColor._value.green+","+this.item.cylinder.outlineColor._value.blue+","+this.item.cylinder.outlineColor._value.alpha+")",l=null==this.item.cylinder.outlineWidth?void 0:this.item.cylinder.outlineWidth._value,c=null==this.item.cylinder.numberOfVerticalLines?void 0:this.item.cylinder.numberOfVerticalLines._value,u=null==this.item.cylinder.slices?void 0:this.item.cylinder.slices._value,h=this.item.cylinder.distanceDisplayCondition,m=null==h?void 0:h._value.near,h=null==h?void 0:h._value.far,d=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"cylinder",position:{x:this._cesium.Math.toDegrees(d.longitude),y:this._cesium.Math.toDegrees(d.latitude),z:this._cesium.Math.toDegrees(d.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,length:t,topRadius:i,bottomRadius:o,fill:r,material:n,outline:a,outlineColor:s,outlineWidth:l,numberOfVerticalLines:c,slices:u,near:m,far:h}}},j.prototype.setTreeobj=function(e){this.treeobj=e},j.prototype.setVisibility=function(t){this.item.show=t,this._scan&&(this._scan.show=t),this.wall&&this.wall.forEach(e=>{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=Tr(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(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.selectedItem.id),i={id:e=r._core.getuid(),name:"新建圆锥"+e,pId:r._core.isnull(t)?0:t,type:"cylinder",item:r},this.setTreeobj(i),V.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=Tr(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(V.selectedItem)||"group"!=V.selectedItem.type||(t=V.selectedItem.id),i={id:e=r._core.getuid(),name:"新建圆柱"+e,pId:r._core.isnull(t)?0:t,type:"cylinder",item:r},r.setTreeobj(i),V.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)}}}}}),Zr.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}}}},$r.prototype.execute=function(e,t,i,o){return this._execute.execute(e,t,i,o)};var en=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 tn(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&&-1<t.type.indexOf("3D"),this.is3D&&(this._3DOption={width:t.TIN_X||200,height:t.TIN_Y||200,grid:this.defaultValue(t.showTIN,!1),scale:this.defaultValue(t.colorScale,1),z:this.defaultValue(t.minHeight,100)}),this.minOpacity=this.defaultValue(t.minOpacity,.1),this.maxOpacity=this.defaultValue(t.maxOpacity,.8),this.gradient=this.defaultValue(t.gradient,{".3":"blue",".5":"green",".7":"yellow",".95":"red"}),this.flyTo=this.defaultValue(t.flyTo,!0),t.dynamic&&!this.is3D&&this.dynamicAdjust(!0),this._core=new f,this.tooltip=this._core.CreateTooltip(),t.tooltip&&this.showTooltip(!0)}function on(e,t={}){this._viewer=e,this.radius=this.defaultValue(t.radius,50),this.alpha=this.defaultValue(t.alpha,1),this.rectangleHeight=t.height,this.minRadius=this.defaultValue(t.minRadius,1),this.maxRadius=this.defaultValue(t.maxRadius,50),this.flyTo=this.defaultValue(t.flyTo,!0),this.datas=[],t.dynamic&&this.dynamicAdjust(!0)}tn.prototype.defaultValue=function(e,t){return Cesium.defaultValue(e,t)},tn.prototype.create=function(e){this.setData(e),this.flyTo&&this.flyToBounding()},tn.prototype.setData=function(e){let o=1e3,r=-1e3,n=1e3,a=-1e3,s=-1/0,l=1/0;e.forEach(function(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 c={xMin:o-t/10,yMin:n-i/10,xMax:r+t/10,yMax:a+i/10},u=parseInt(1e3/(c.xMax-c.xMin)*(c.yMax-c.yMin));if(this.heatmapInstance)this.heatmapInstance._renderer.canvas.setAttribute("style","width:1000px;height:"+u+"px;");else{let e=document.createElement("div");e.setAttribute("style","width:1000px;height:"+u+"px;display:none;"),document.body.appendChild(e),this.heatmapInstance=h337.create({container:e,maxOpacity:this.maxOpacity,minOpacity:this.minOpacity,blur:this.blur,radius:this.radius,gradient:this.gradient})}let h=[];e.forEach(function(e){var t=(e.x-c.xMin)/(c.xMax-c.xMin)*1e3,i=(-(e.y-c.yMin)/(c.yMax-c.yMin)+1)*u,t={x:Math.round(t),y:Math.round(i),value:e.value};h.push(t)}),this.datas={max:s,min:l,data:h},this.heatmapInstance.setData(this.datas),this.heatmapcanvas=this.heatmapInstance._renderer.canvas,this.drawHeatmapRect(this.heatmapcanvas,c),this.rectangle=Cesium.Rectangle.fromDegrees(c.xMin,c.yMin,c.xMax,c.yMax);t=Cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=t.radius,this.extent=c},tn.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})},tn.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this.heatmapcanvas.remove(),this.showTooltip(!1)},tn.prototype.dynamicAdjust=function(e){e?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)},tn.prototype.dynamicAdjustEvent=function(){if(this.heatmapInstance&&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.minRadius:e)!==this.radius&&e<=this.maxRadius&&e>=this.minRadius&&this.changeRadius(e)}},tn.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()},tn.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)}},tn.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)}},tn.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)})},tn.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 c=[],u=[],h=[];for(let t=0;t<l;t++)for(let e=0;e<s;e++){var m=i.xMin+n*e,d=i.yMin+a*t,m=Cesium.Cartesian3.fromDegrees(m,d,(this.getValueFromDegrees({lon:m,lat:d})||0)*i.scale+i.z);c.push(m.x,m.y,m.z),u.push(n*e/o,a*t/r),0!=t&&0!=e&&(h.push((t-1)*s+(e-1),(t-1)*s+e,t*s+e-1),h.push((t-1)*s+e,t*s+e,t*s+e-1))}return{positions:c,st:u,indexs:h}},tn.prototype.get3DShader=function(){return"uniform sampler2D image;\n            czm_material czm_getMaterial(czm_materialInput materialInput)\n            {\n                vec2 repeat = vec2(1.0,1.0);\n                czm_material material = czm_getDefaultMaterial(materialInput);\n                vec4 j_color = texture2D(image, fract(repeat * materialInput.st)).rgba; \n                material.diffuse = j_color.rgb; \n                material.alpha = j_color.a;\n                return material;\n            }\n        "},tn.prototype.getValueFromDegrees=function(e){if(this.heatmapInstance&&this.extent&&e){var t=(e.lon-this.extent.xMin)/(this.extent.xMax-this.extent.xMin)*this.heatmapcanvas.width,e=(-(e.lat-this.extent.yMin)/(this.extent.yMax-this.extent.yMin)+1)*this.heatmapcanvas.height;if(t<=this.heatmapcanvas.width&&0<=t&e<=this.heatmapcanvas.height&&0<=e)return this.heatmapInstance.getValueAt({x:Math.round(t),y:Math.round(e)})}},tn.prototype.showTooltip=function(e){e?(this.tooltipHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.tooltipHandler.setInputAction(e=>{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)},Cesium.ScreenSpaceEventType.MOUSE_MOVE)):(this.tooltip.show(!1),this.tooltipHandler&&this.tooltipHandler.destroy(),this.tooltipHandler=void 0)},tn.prototype.updateHeatmap=function(){this.heatmapcanvas=this.heatmapInstance._renderer.canvas;var e=this.convertCanvasToImage(this.heatmapcanvas);this._worldRectangle.appearance.material.uniforms.image=e.src},tn.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},tn.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},tn.prototype.config=function(e){this.heatmapInstance.configure(e),this.updateHeatmap()},tn.prototype.convertCanvasToImage=function(e){let t=new Image;return t.src=e.toDataURL("image/png"),t},on.prototype.defaultValue=function(e,t){return Cesium.defaultValue(e,t)},on.prototype.create=function(e){this.setData(e),this.flyTo&&this.flyToBounding()},on.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 c={xMin:o-t/10,yMin:n-i/10,xMax:r+t/10,yMax:a+i/10},u;if(this._heatmap)u=this._heatmap.canvas,this._heatmap.clear();else{u=document.createElement("canvas"),document.body.appendChild(u),u.width=1e3,u.height=parseInt(1e3/(c.xMax-c.xMin)*(c.yMax-c.yMin));try{this._heatmap=createWebGLHeatmap({canvas:u,intensityToAlpha:!0})}catch(e){console.error(e)}}this.datas=[];let h=s-l;e.forEach(e=>{var t=(e.x-c.xMin)/(c.xMax-c.xMin)*u.clientWidth,i=(-(e.y-c.yMin)/(c.yMax-c.yMin)+1)*u.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(u,c),this.rectangle=Cesium.Rectangle.fromDegrees(c.xMin,c.yMin,c.xMax,c.yMax);t=Cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=t.radius},on.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})},on.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)},on.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this._heatmap.clear(),this._heatmap.canvas.remove()},on.prototype.dynamicAdjust=function(e){e?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)},on.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.minRadius:e)!==this.radius&&e<=this.maxRadius&&e>=this.minRadius&&this.changeRadius(e)}},on.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},on.prototype.multiply=function(e){this._heatmap.multiply(e),this.updateHeatmap()},on.prototype.changeRadius=function(t){this.radius=t,this.datas.forEach(e=>{e.size=t}),this._heatmap.clear(),this._heatmap.addPoints(this.datas),this.updateHeatmap()},on.prototype.clamp=function(e,t){this._heatmap.clamp(e,t),this.updateHeatmap()},on.prototype.blur=function(){this._heatmap.blur(),this.updateHeatmap()},on.prototype.show=function(e){this._worldRectangle&&(this._worldRectangle.show=e)},on.prototype.setAlpha=function(e){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=e)},on.prototype.convertCanvasToImage=function(e){var t=new Image;return t.src=e.toDataURL("image/png"),t};const rn=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 nn(e){return e>>1^-(1&e)}function an(e,t,i,o,r=!0){let n;if(n=new(2===o?Uint16Array:Uint32Array)(e,t,i),r){let t=0;for(let e=0;e<n.length;++e){var a=n[e];n[e]=t-a,0===a&&++t}}return n}function sn(e,t){const i={};if(e.byteLength<=t)return{extensions:i,extensionsEndPosition:t};let o=t;for(;o<e.byteLength;){var r=e.getUint8(o,!0),n=(o+=Uint8Array.BYTES_PER_ELEMENT,e.getUint32(o,!0)),a=(o+=Uint32Array.BYTES_PER_ELEMENT,new DataView(e.buffer,o,n));switch(r){case 1:i.vertexNormals=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);break;case 2:i.waterMask=a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength);break;default:console.warn("Unknown extension with id "+r)}o+=n}return{extensions:i,extensionsEndPosition:o}}const ln={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},cn={maxDecodingStep:ln.extensions};function un(e,t){var i,o,r,n,a,s,l,c,t=Object.assign({},cn,t),e=new DataView(e),{header:u,headerEndPosition:h}=function(e){let t=0;const i={};for(var[o,r]of rn){const n=8===r?e.getFloat64:e.getFloat32;i[o]=n.call(e,t,!0),t+=r}return{header:i,headerEndPosition:t}}(e);return t.maxDecodingStep<ln.vertices?{header:u}:({vertexData:h,vertexDataEndPosition:i}=function(t,e){var i=t.getUint32(e,!0);const o=new Uint16Array(3*i);e+=Uint32Array.BYTES_PER_ELEMENT;var r=Uint16Array.BYTES_PER_ELEMENT,n=i*r,a=e,s=a+n,l=s+n;let c=0,u=0,h=0;for(let e=0;e<i;e++)c+=nn(t.getUint16(a+r*e,!0)),u+=nn(t.getUint16(s+r*e,!0)),h+=nn(t.getUint16(l+r*e,!0)),o[e]=c,o[e+i]=u,o[e+2*i]=h;return e+=3*n,{vertexData:o,vertexDataEndPosition:e}}(e,h),t.maxDecodingStep<ln.triangleIndices?{header:u,vertexData:h}:({triangleIndices:i,triangleIndicesEndPosition:n}=function(e,t,i){let o=i;return i=(65536<t.length/3?Uint32Array:Uint16Array).BYTES_PER_ELEMENT,o%i!=0&&(o+=i-o%i),t=e.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,t*=3,e=an(e.buffer,o,t,i),{triangleIndicesEndPosition:o+=t*i,triangleIndices:e}}(e,h,i),t.maxDecodingStep<ln.edgeIndices?{header:u,vertexData:h,triangleIndices:i}:({westIndices:a,southIndices:r,eastIndices:n,northIndices:s,edgeIndicesEndPosition:l}=(o=e,n=n,r=(65536<(r=h).length/3?Uint32Array:Uint16Array).BYTES_PER_ELEMENT,a=o.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s=an(o.buffer,n,a,r,!1),a=o.getUint32(n+=a*r,!0),n+=Uint32Array.BYTES_PER_ELEMENT,l=an(o.buffer,n,a,r,!1),a=o.getUint32(n+=a*r,!0),n+=Uint32Array.BYTES_PER_ELEMENT,c=an(o.buffer,n,a,r,!1),a=o.getUint32(n+=a*r,!0),n+=Uint32Array.BYTES_PER_ELEMENT,o=an(o.buffer,n,a,r,!1),{edgeIndicesEndPosition:n+=a*r,westIndices:s,southIndices:l,eastIndices:c,northIndices:o}),t.maxDecodingStep<ln.extensions?{header:u,vertexData:h,triangleIndices:i,westIndices:a,northIndices:s,eastIndices:n,southIndices:r}:(c=sn(e,l)["extensions"],{header:u,vertexData:h,triangleIndices:i,westIndices:a,northIndices:s,eastIndices:n,southIndices:r,extensions:c}))))}function hn(e,t={}){this.sgworld=e,this.contourUniforms=void 0,this.shadingUniforms=void 0,this.min={elevation:10,slope:0},this.max={elevation:2e3,slope:70},this.width=t.width||2,this.spacing=t.spacing||150,this.tf=!1,this.contourColor=t.contourColor||"#ff0000",this.type="none",this.Contour=void 0,this.startColor=t.startColor||"#0055ff",this.endColor=t.endColor||"#ff0000",this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.changeSlopeColor=void 0!==t.changeSlopeColor&&t.changeSlopeColor}hn.prototype.render=function(){"slope"===this.type?(Cesium.ExpandBySmartEarth.displaySlopeMap=!0,this.changeSlopeColor&&this.setShopeColor()):Cesium.ExpandBySmartEarth.displaySlopeMap=!1,this.Contour=this.sgworld.Analysis.createElevationContour(this.tf,"slope"===this.type?"none":this.type,{colorArr:this.colorArr,min:this.min[this.type],max:this.max[this.type],width:this.width,spacing:this.spacing,lineColor:this.contourColor}),this.shadingUniforms=this.Contour.item.shadingUniforms,this.contourUniforms=this.Contour.item.contourUniforms},hn.prototype.setContourColor=function(e){this.contourColor=e,this.Contour&&this.Contour.setMaterialColor(this.contourColor)},hn.prototype.setShopeColor=function(){let i=[],o=[0,6,17,31,45,70,90];this.colorArr.forEach((e,t)=>{i.unshift({val:100*Math.cos(Cesium.Math.toRadians(o[t])),color:e})}),Cesium.ExpandBySmartEarth.SlopeMapPallete=i,Cesium.ExpandBySmartEarth.isSlopeDirty=!0},hn.prototype.setWidth=function(e){this.width=e,this.Contour&&this.Contour.setWidth(this.width)},hn.prototype.setSpacing=function(e){this.spacing=e,this.Contour&&this.Contour.setSpacing(this.spacing)},hn.prototype.setStartColor=function(e){this.startColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},hn.prototype.setEndColor=function(e){this.endColor=e,this.colorArr=this.sgworld.Core.gradientColor(this.startColor,this.endColor,7),this.render()},hn.prototype.setMin=function(e){this.min[this.type]=e,"elevation"===this.type?this.shadingUniforms.minimumHeight=this.min[this.type]:this.render()},hn.prototype.setMax=function(e){this.max[this.type]=e,"elevation"===this.type?this.shadingUniforms.maximumHeight=this.max[this.type]:this.render()},hn.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 U={version:"1.0.0"},mn="doublearrow",dn=.25,pn=.3,gn=.85,fn=.15,_n={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},Cn={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13},z=(U.algorithm={},U.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?U.algorithm.getTempPoint4(i,o,r):this.points[3],this.connPoint=3==n||4==n?z.PlotUtils.mid(i,o):this.points[4],e=z.PlotUtils.isClockWise(i,o,r)?(c=U.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),U.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(c=U.algorithm.getArrowPoints(o,this.connPoint,r,!1),U.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),a=(n-5)/2,s=c.slice(0,a),l=c.slice(a,5+a),c=c.slice(5+a,n),u=e.slice(0,a),h=e.slice(a,5+a),e=e.slice(5+a,n),u=z.PlotUtils.getBezierPoints(u),a=z.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=z.PlotUtils.getBezierPoints(c),n=u.concat(h,a,l,c),e=U.algorithm.array2Dto1D(n);t.controlPoint=[i,o,r,this.tempPoint4,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},U.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=U.algorithm.getTempPoint4(i,o,r),this.tempPoint5=z.PlotUtils.mid(r,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=n<6?z.PlotUtils.mid(i,o):this.points[5],e=z.PlotUtils.isClockWise(i,o,r)?(c=U.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),U.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(c=U.algorithm.getArrowPoints(o,this.connPoint,r,!1),U.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),a=(n-5)/2,s=c.slice(0,a),l=c.slice(a,5+a),c=c.slice(5+a,n),u=e.slice(0,a),h=e.slice(a,5+a),e=e.slice(5+a,n),u=z.PlotUtils.getBezierPoints(u),a=z.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=z.PlotUtils.getBezierPoints(c),n=u.concat(h,a,l,c),e=U.algorithm.array2Dto1D(n);t.controlPoint=[i,o,r,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},U.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},U.algorithm.getArrowPoints=function(e,t,i,o){this.type=mn,this.headHeightFactor=dn,this.headWidthFactor=pn,this.neckHeightFactor=gn,this.neckWidthFactor=fn;var r=z.PlotUtils.mid(e,t),n=z.PlotUtils.distance(r,i),a=z.PlotUtils.getThirdPoint(i,r,0,.3*n,!0),s=z.PlotUtils.getThirdPoint(i,r,0,.5*n,!0),a=[r,z.PlotUtils.getThirdPoint(r,a,z.Constants.HALF_PI,n/5,o),z.PlotUtils.getThirdPoint(r,s,z.Constants.HALF_PI,n/4,o),i],r=U.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=r[0],n=r[4],o=z.PlotUtils.distance(e,t)/z.PlotUtils.getBaseLength(a)/2,i=U.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)},U.algorithm.getArrowHeadPoints=function(e,t,i){this.type=mn,this.headHeightFactor=dn,this.headWidthFactor=pn,this.neckHeightFactor=gn,this.neckWidthFactor=fn;var o=z.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],t=(z.PlotUtils.distance(t,i),o*this.headWidthFactor),i=o*this.neckWidthFactor,n=o*this.neckHeightFactor,o=z.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),e=z.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),n=z.PlotUtils.getThirdPoint(r,o,z.Constants.HALF_PI,t,!1),o=z.PlotUtils.getThirdPoint(r,o,z.Constants.HALF_PI,t,!0);return[z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,i,!1),n,r,o,z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,i,!0)]},U.algorithm.getArrowBodyPoints=function(e,t,i,o){for(var r=z.PlotUtils.wholeDistance(e),n=z.PlotUtils.getBaseLength(e)*o,a=(n-z.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],u=1;u<e.length-1;u++){var h=z.PlotUtils.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2,m=(n/2-(s+=z.PlotUtils.distance(e[u-1],e[u]))/r*a)/Math.sin(h),d=z.PlotUtils.getThirdPoint(e[u-1],e[u],Math.PI-h,m,!0),h=z.PlotUtils.getThirdPoint(e[u-1],e[u],h,m,!1);l.push(d),c.push(h)}return l.concat(c)},U.algorithm.getTempPoint4=function(e,t,i){var o,r,n,t=z.PlotUtils.mid(e,t),a=z.PlotUtils.distance(t,i),i=z.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<z.Constants.HALF_PI?(o=a*Math.sin(i),r=a*Math.cos(i),n=z.PlotUtils.getThirdPoint(e,t,z.Constants.HALF_PI,o,!1),z.PlotUtils.getThirdPoint(t,n,z.Constants.HALF_PI,r,!0)):i>=z.Constants.HALF_PI&&i<Math.PI?(o=a*Math.sin(Math.PI-i),r=a*Math.cos(Math.PI-i),n=z.PlotUtils.getThirdPoint(e,t,z.Constants.HALF_PI,o,!1),z.PlotUtils.getThirdPoint(t,n,z.Constants.HALF_PI,r,!1)):i>=Math.PI&&i<1.5*Math.PI?(o=a*Math.sin(i-Math.PI),r=a*Math.cos(i-Math.PI),n=z.PlotUtils.getThirdPoint(e,t,z.Constants.HALF_PI,o,!0),z.PlotUtils.getThirdPoint(t,n,z.Constants.HALF_PI,r,!0)):(o=a*Math.sin(2*Math.PI-i),r=a*Math.cos(2*Math.PI-i),n=z.PlotUtils.getThirdPoint(e,t,z.Constants.HALF_PI,o,!0),z.PlotUtils.getThirdPoint(t,n,z.Constants.HALF_PI,r,!1));return a},U.algorithm.tailedAttackArrow=function(e){e=U.algorithm.dereplication(e),this.tailWidthFactor=_n.tailWidthFactor,this.swallowTailFactor=_n.swallowTailFactor,this.swallowTailPnt=_n.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];z.PlotUtils.isClockWise(e[0],e[1],e[2])&&(i=e[1],o=e[0]);var e=[z.PlotUtils.mid(i,o)].concat(e.slice(2)),r=U.algorithm.getAttackArrowHeadPoints(e,i,o,_n),n=r[0],a=r[4],s=z.PlotUtils.distance(i,o),l=z.PlotUtils.getBaseLength(e),c=l*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=z.PlotUtils.getThirdPoint(e[1],e[0],0,c,!0);c=U.algorithm.getAttackArrowBodyPoints(e,n,a,s/l),e=c.length,s=[i].concat(c.slice(0,e/2)),l=(s.push(n),[o].concat(c.slice(e/2,e)));l.push(a),s=z.PlotUtils.getQBSplinePoints(s),l=z.PlotUtils.getQBSplinePoints(l),i=U.algorithm.array2Dto1D(s.concat(r,l.reverse(),[this.swallowTailPnt,s[0]])),t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(i)}return t},U.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=z.PlotUtils.getBaseLength(e)*this.headHeightFactor,r=e[e.length-1],n=z.PlotUtils.distance(r,e[e.length-2]),t=z.PlotUtils.distance(t,i),i=(o=o>t*this.headTailFactor?t*this.headTailFactor:o)*this.headWidthFactor,t=o*this.neckWidthFactor,n=(o=n<o?n:o)*this.neckHeightFactor,o=z.PlotUtils.getThirdPoint(e[e.length-2],r,0,o,!0),e=z.PlotUtils.getThirdPoint(e[e.length-2],r,0,n,!0),n=z.PlotUtils.getThirdPoint(r,o,z.Constants.HALF_PI,i,!1),o=z.PlotUtils.getThirdPoint(r,o,z.Constants.HALF_PI,i,!0);return[z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,t,!1),n,r,o,z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,t,!0)]},U.algorithm.getAttackArrowBodyPoints=function(e,t,i,o){for(var r=z.PlotUtils.wholeDistance(e),n=z.PlotUtils.getBaseLength(e)*o,a=(n-z.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],u=1;u<e.length-1;u++){var h=z.PlotUtils.getAngleOfThreePoints(e[u-1],e[u],e[u+1])/2,m=(n/2-(s+=z.PlotUtils.distance(e[u-1],e[u]))/r*a)/Math.sin(h),d=z.PlotUtils.getThirdPoint(e[u-1],e[u],Math.PI-h,m,!0),h=z.PlotUtils.getThirdPoint(e[u-1],e[u],h,m,!1);l.push(d),c.push(h)}return l.concat(c)},U.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,o=[],o=e.filter(function(e){if(e[0]!=t[0]&&e[1]!=t[1])return e;i=!0});return i&&o.push(t),o},U.algorithm.fineArrow=function(t,o){var m,f,_,C,y,v;if(!(t.length<2||o.length<2))return m=Cn.tailWidthFactor,f=Cn.neckWidthFactor,_=Cn.headWidthFactor,C=Cn.headAngle,y=Cn.neckAngle,(v=[])[0]=t,v[1]=o,e=v[0],r=v[1],n=z.PlotUtils.getBaseLength(v),g=n*m,i=n*f,s=n*_,a=z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,g,!0),l=z.PlotUtils.getThirdPoint(r,e,z.Constants.HALF_PI,g,!1),u=z.PlotUtils.getThirdPoint(e,r,C,s,!1),c=z.PlotUtils.getThirdPoint(e,r,C,s,!0),p=z.PlotUtils.getThirdPoint(e,r,y,i,!1),h=z.PlotUtils.getThirdPoint(e,r,y,i,!0),(d=[]).push(a[0],a[1],p[0],p[1],u[0],u[1],r[0],r[1],c[0],c[1],h[0],h[1],l[0],l[1],e[0],e[1]),Cesium.Cartesian3.fromDegreesArray(d)},{version:"1.0.0"});function yn(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 vn(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 wn(t=8,i=16){var o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");let r=[];if(i=i||o.length,t)for(let e=0;e<t;e++)r[e]=o[0|Math.random()*i];else{r[8]=r[13]=r[18]=r[23]="-",r[14]="4";for(let e=0,t;e<36;e++)r[e]||(t=0|16*Math.random(),r[e]=o[19==e?3&t|8:t])}return r.join("")}function bn(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 Tn(){this._core=new f,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,Tn.prototype.ready||Object.defineProperties(Tn.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<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function Sn(i,e,o){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=Ln.indexOf(t=t),t._parentCollection._primitiveOld=o,-1!==e?(i.scene.primitives.remove(Ln[e]._parentCollection),Ln[e]=t):Ln.push(t),!1})}function En(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function Pn(e,t,i,o){Cesium.when.all(t,function(){e.scene.primitives.remove(o)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(o),this._onDestroyTilePrimitive=void 0}}function xn(e,t,i){Pn(e,$.map(t._primitives,function(e){return e.readyPromise}),t,i)}function Dn(e,t,i){Pn(e,$.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function In(e,t,i){e.scene.primitives.remove(i)}function An(e,t,i){Pn(e,[t.readyPromise],t,i)}z.PlotUtils={},z.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},z.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=z.PlotUtils.distance(e[i],e[i+1]);return t},z.PlotUtils.getBaseLength=function(e){return Math.pow(z.PlotUtils.wholeDistance(e),.99)},z.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},z.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var o=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[o[0]-e[1]+t[1],o[1]+e[0]-t[0]],r=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[r[0]-e[1]+i[1],r[1]+e[0]-i[0]];return z.PlotUtils.getIntersectPoint(o,t,r,e)},z.PlotUtils.getIntersectPoint=function(e,t,i,o){var r,n,a;return e[1]==t[1]?[(r=(o[0]-i[0])/(o[1]-i[1]))*(e[1]-i[1])+i[0],a=e[1]]:i[1]==o[1]?[(n=(t[0]-e[0])/(t[1]-e[1]))*(i[1]-e[1])+e[0],a=i[1]]:(n=(t[0]-e[0])/(t[1]-e[1]),r=(o[0]-i[0])/(o[1]-i[1]),[n*(a=(n*e[1]-e[0]-r*i[1]+i[0])/(n-r))-n*e[1]+e[0],a])},z.PlotUtils.getAzimuth=function(e,t){var i,o=Math.asin(Math.abs(t[1]-e[1])/z.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=o+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=z.Constants.TWO_PI-o:t[1]<e[1]&&t[0]<e[0]?i=o:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-o),i},z.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=z.PlotUtils.getAzimuth(t,e)-z.PlotUtils.getAzimuth(t,i);return e<0?e+z.Constants.TWO_PI:e},z.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},z.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},z.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,c=l*n;return[c*t[0]+3*l*e*i[0]+3*n*a*o[0]+s*r[0],c*t[1]+3*l*e*i[1]+3*n*a*o[1]+s*r[1]]},z.PlotUtils.getThirdPoint=function(e,t,i,o,r){e=z.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]},z.PlotUtils.getArcPoints=function(e,t,i,o){for(var r=[],n=(n=o-i)<0?n+z.Constants.TWO_PI:n,a=0;a<=z.Constants.FITTING_COUNT;a++){var s=i+n*a/z.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);r.push([l,s])}return r},z.PlotUtils.getBisectorNormals=function(e,t,i,o){var r,n,a=z.PlotUtils.getNormal(t,i,o),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,a=a[1]/s,c=z.PlotUtils.distance(t,i),u=z.PlotUtils.distance(i,o),s=s>z.Constants.ZERO_TOLERANCE?z.PlotUtils.isClockWise(t,i,o)?(r=[i[0]-(n=e*c)*a,i[1]+n*l],[i[0]+(n=e*u)*a,i[1]-n*l]):(r=[i[0]+(n=e*c)*a,i[1]-n*l],[i[0]-(n=e*u)*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]},z.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)]},z.PlotUtils.getCurvePoints=function(e,t){for(var i=[z.PlotUtils.getLeftMostControlPoint(t)],o=0;o<t.length-2;o++)var r=t[o],n=t[o+1],a=t[o+2],a=z.PlotUtils.getBisectorNormals(e,r,n,a),i=i.concat(a);for(var s=z.PlotUtils.getRightMostControlPoint(t),l=(i.push(s),[]),o=0;o<t.length-1;o++){r=t[o],n=t[o+1],l.push(r);for(e=0;e<z.Constants.FITTING_COUNT;e++){var c=z.PlotUtils.getCubicValue(e/z.Constants.FITTING_COUNT,r,i[2*o],i[2*o+1],n);l.push(c)}l.push(n)}return l},z.PlotUtils.getLeftMostControlPoint=function(e){var i,o,r,n,a,s=e[0],l=e[1],e=e[2],c=z.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=z.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>z.Constants.ZERO_TOLERANCE?(e=z.PlotUtils.mid(s,l),r=s[0]-e[0],i=s[1]-e[1],o=z.PlotUtils.distance(s,l),n=c[0]-e[0],c=c[1]-e[1],a=e[0]+((i=-(o=2/o)*i)*i-(o=o*r)*o)*n+(r=2*i*o)*c,e[1]+r*n+(o*o-i*i)*c):(a=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[a,e]},z.PlotUtils.getRightMostControlPoint=function(e){var i,o,r,n,a,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=z.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=z.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>z.Constants.ZERO_TOLERANCE?(l=z.PlotUtils.mid(c,e),r=e[0]-l[0],i=e[1]-l[1],o=z.PlotUtils.distance(c,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*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[a,l]},z.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=z.PlotUtils.getBinomialFactor(i,a),l=Math.pow(o,a),c=Math.pow(1-o,i-a);r+=s*l*c*e[a][0],n+=s*l*c*e[a][1]}t.push([r,n])}return t.push(e[i]),t},z.PlotUtils.getBinomialFactor=function(e,t){return z.PlotUtils.getFactorial(e)/(z.PlotUtils.getFactorial(t)*z.PlotUtils.getFactorial(e-t))},z.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},z.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=z.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},z.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},z.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},Object.defineProperties(vn.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}}}),vn.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(bn.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}}}),bn.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<l;++s)n=(r=a[s]).prefix?r.prefix+":"+i:i,"*"!=i&&n!=r.nodeName||"*"!=t&&t!=r.namespaceURI||o.push(r);return o},bn.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],o=0;o<t.length;o++){var r=this.parseFeature(t[o]);r&&i.push(r)}return i},bn.prototype.parseFeature=function(e){for(var t,i,o,r,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,t=n[a])).length){(r=this.parseGeometry[t.toLowerCase()])?o=r.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}for(var s,l=this.getElementsByTagNameNS(e,this._gmlns,"Box"),a=0;a<l.length;++a){var c=l[a],u=this.parseGeometry.box.apply(this,[c]),c=c.parentNode;"boundedBy"===(c.localName||c.nodeName.split(":").pop())?s=u:o=u.toGeometry()}this.extractAttributes&&(m=this.parseAttributes(e));for(var h,m={geometryType:t.toLowerCase(),positions:o,attributes:m},d=(m.bounds=s,e.firstChild);d&&(1!=d.nodeType||!(h=d.getAttribute("fid")||d.getAttribute("id")));)d=d.nextSibling;return m.fid=h,m},bn.prototype.parseGeometry={point:function(e){var t=[],i=this.getElementsByTagNameNS(e,this._gmlns,"pos");return 0==(t=0<i.length?i[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):t).length&&(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(t=i[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==t.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length&&(e=this.getElementsByTagNameNS(i[0],this._gmlns,"X"),i=this.getElementsByTagNameNS(i[0],this._gmlns,"Y"),0<e.length&&0<i.length&&(t=[e[0].firstChild.nodeValue,i[0].firstChild.nodeValue])),2==t.length&&(t[2]=null),this.xy?[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]:[parseFloat(t[1]),parseFloat(t[0]),parseFloat(t[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.point.apply(this,[t[r]]))&&i.push(o);return i},linestring:function(e,t){var i=[],o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"posList");if(0<r.length)for(var n,a,s,i=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace),l=parseInt(r[0].getAttribute("dimension")),c=0;c<i.length/l;++c)s=c*l,n=parseFloat(i[s]),a=parseFloat(i[1+s]),s=2==l?null:parseFloat(i[2+s]),this.xy?o.push(n,a,s):o.push(a,n,s);if(0==i.length&&0<(r=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length)for(var u=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace),c=0;c<u.length;++c)2==(i=u[c].split(",")).length&&(i[2]=null),this.xy?o.push(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])):o.push(parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2]));return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r]]))&&i.push(o);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r],!0]))&&i.push(o);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.polygon.apply(this,[t[r]]))&&i.push(o);return i},envelope:function(e){var t,i,o,r,n=[],a=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner"),a=(0<a.length&&(o=[],2==(o=0<a.length?a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):o).length&&(o[2]=null),i=this.xy?new OpenLayers_Geometry_Point(o[0],o[1],o[2]):new OpenLayers_Geometry_Point(o[1],o[0],o[2])),this.getElementsByTagNameNS(e,this._gmlns,"upperCorner"));return 0<a.length&&(o=[],2==(o=0<a.length?a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):o).length&&(o[2]=null),r=this.xy?new OpenLayers_Geometry_Point(o[0],o[1],o[2]):new OpenLayers_Geometry_Point(o[1],o[0],o[2])),i&&r&&(n.push([i.x,i.y,null]),n.push([r.x,i.y,null]),n.push([r.x,r.y,null]),n.push([i.x,r.y,null]),n.push([i.x,i.y,null]),t=new OpenLayers_Geometry_Polygon([[n]])),t},box:function(e){var e=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),t=null,i=null;if(0<e.length&&(2==(e=e[0].firstChild.nodeValue.split(" ")).length&&(t=e[0].split(","),i=e[1].split(","))),null!==t&&null!==i)return[parseFloat(t[0]),parseFloat(t[1]),null,parseFloat(i[0]),parseFloat(i[1]),null]}},bn.prototype.parseAttributes=function(e){for(var t,i,o,r,n,a={},s=e.firstChild;s;){if(1==s.nodeType){for(t=s.childNodes,i=0;i<t.length;++i)1==(o=t[i]).nodeType&&(1==(n=o.childNodes).length?3!=(n=n[0]).nodeType&&4!=n.nodeType||(r=o.prefix?o.nodeName.split(":")[1]:o.nodeName,n=n.nodeValue.replace(this._regExes.trimSpace,""),a[r]=n):a[o.nodeName.split(":").pop()]=null);break}s=s.nextSibling}return a},bn.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var o=e.firstChild;o;o=o.nextSibling)switch(o.nodeType){case 3:case 4:i+=o.nodeValue}return i},Tn.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var Ln=[],Mn=0,Rn=(Tn.prototype.onPreFrame=function(e,t){if(Mn++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Mn%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(Ln,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},Tn.prototype.updateForPick=function(e){},Math.PI,Tn.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},Tn.prototype.getTile=function(e){return this._tileCache[e]},Tn.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},Tn.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},Tn.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},Tn.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":Sn(this.viewer,t,e);break;case"labels":En(this.viewer,t,e);break;case"polygons":xn(this.viewer,t,e);break;case"models":Dn(this.viewer,t,e);break;case"polylines":An(this.viewer,t,e);break;case"points":In(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}},{billboards:Sn,labels:En,polygons:xn,models:Dn,polylines:An,points:In}),On=(Tn.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Rn[i])?i(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)))},!(Tn.prototype.update=function(e){this.level=this._core.getLevel(this.viewer);let t=this.getAllTiles(),i,o;t.forEach(e=>{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 Bn(){}function Vn(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function Fn(t,e){for(var i=!1,o=0,r="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?i||")"!=e[n]||o--:o++,e[n]==t&&(0<o||i)?r+="######":r+=e[n];return e=(e=(e=r).split(t)).map(function(e){return Vn(e.replace(new RegExp("######","g"),t))})}function Hn(e){for(var t="#",i=e.length,o=0;o<i;o++)t+=e[o]+"#";return t}function Gn(e){for(var t="",i=e.length,o=1;o<i;o+=2)t+=e[o];return t}function kn(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function Nn(e){this.lexer=new kn(e),this.currentToken="",this.readNextToken()}function ll(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return ll(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}function cl(e){var t,i=0;if(0!==e.length)for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function ul(e,t){this._style=e||{},this._core=new f,this._bufferAnalysis=new Ai(t,Cesium),t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function hl(e,t){for(var i=e.length,o=0;o<i;o++){var r=t(e[o]);if("polygon"==e[o].geometryType||"multipolygon"==e[o].geometryType){for(var n=e[o],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],c=2;c<l.length;c+=3)l[c]=r;n.positions[s]=l}e[o]=n}else{for(var u=e[o],h=u.positions.length,s=2;s<h;s+=3)u.positions[s]=r;e[o]=u}}return e}function ml(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return}else if(-1==e.originalInstanceIds.indexOf(t))return;return 1}function dl(t){return function(e){e=Number(t.applyConditionalClassification(t._style.altitudeOffset||t._style.height,e.attributes));return e=isNaN(e)?0:e}}function pl(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=Cesium.Color.fromCssColorString("#"+i);return null!=e&&(t=e.red,e.red=e.blue,e.blue=t),e}function gl(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;var e=(e="#"+i).substring(0,7),t=Cesium.Color.fromCssColorString(e);return null!=t&&(e=t.red,t.red=t.blue,t.blue=e),t}}function fl(e){return isNaN(e)?e:parseFloat(e)}function _l(e,i){var t,o=[];return $.each(e.attributeNames,function(e,t){o.push(fl(i[t]))}),1===o.length?t=e.func(o[0]):2===e.attributeNames.length?t=e.func(o[0],o[1]):3===e.attributeNames.length?t=e.func(o[0],o[1],o[2]):4===e.attributeNames.length&&(t=e.func(o[0],o[1],o[2],o[3])),t}function Cl(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}Tn.prototype.initialize=function(e){On||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),On=!0)},Tn.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},Tn.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},Tn.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},Tn.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},Tn.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;o=e.data;if(o.tileBoundingRegion,void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var r=t.cullingVolume,n=o.orientedBoundingBox;!n&&o.renderedMesh&&(n=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;a=e.rectangle,(s=this.cartographicLimitRectangle).west<s.east||(s=Rectangle.clone(s,splitCartographicLimitRectangleScratch),0<Rectangle.center(a,rectangleCenterScratch).longitude?s.east=CesiumMath.PI:s.west=-CesiumMath.PI);var a=s,s=new Cesium.Rectangle,a=Cesium.Rectangle.simpleIntersection(a,e.rectangle,s);if(!a)return Visibility.NONE;if(Cesium.Rectangle.equals(a,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!n)return Cesium.Intersect.INTERSECTING;s=this._clippingPlanes;if(s&&s.enabled){a=s.computeIntersectionWithBoundingVolume(n);if(e.isClipped=a!==Intersect.INSIDE,a===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}s=r.computeVisibility(n);return s!==Cesium.Intersect.OUTSIDE&&(e=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum,t.mode!==Cesium.SceneMode.SCENE3D||e||!i||!(a=o.occludeePointInScaledSpace)||i.ellipsoid.isScaledSpacePointVisible(a))?s:Cesium.Visibility.NONE},Tn.prototype.canRefine=function(e,t,i){return e.level<16},Tn.prototype.showTileThisFrame=function(e,t,i,o){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,o)},Tn.prototype.computeDistanceToTile=function(e,t){s=e,this.terrainProvider,void 0===(r=void 0===(r=s.data)?s.data=new Cesium.GlobeSurfaceTile:r).tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:s.rectangle,ellipsoid:s.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var i,o,r=e.data,n=r.tileBoundingRegion;if(void 0===s)return 9999999999;r.boundingVolumeSourceTile!==s&&(r.boundingVolumeSourceTile=s,(s=e.rectangle)&&s.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(r.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=(s=this,u=r.orientedBoundingBox.center,l=e.rectangle,c=n.maximumHeight,i=r.occludeePointInScaledSpace,a=(s=s.quadtree._occluders.ellipsoid).ellipsoid,o=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,c,a,o[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,c,a,o[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,c,a,o[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,c,a,o[3]),s.computeHorizonCullingPoint(u,o,i))));var a,s,l=n.minimumHeight,c=n.maximumHeight,u=(r.boundingVolumeSourceTile!==e&&(a=t.camera.positionCartographic.height,s=Math.abs(a-l),Math.abs(a-c)<s?(n.minimumHeight=l,n.maximumHeight=l):(n.minimumHeight=c,n.maximumHeight=c)),n.distanceToCamera(t));return n.minimumHeight=l,n.maximumHeight=c,u},Tn.prototype.isDestroyed=function(){return!1},Tn.prototype.destroy=function(){return Cesium.destroyObject(this)},Tn.prototype.remove=function(){this.destroy()},Tn.prototype.getInstance=function(e){var t;return 0==Cesium.defined(e.TileManager)&&(t=new Tn,(e.TileManager=t).viewer=e,t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2}),e.scene.primitives.add(t)),e.TileManager},Bn.sql2ast=function(r,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###",i=(r=(r=(r=(r=r.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";"),["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"]),o=i.map(function(e){return e+" "}),a=(o=(o=o.concat(i.map(function(e){return e+"("}))).concat(o.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")}),s=(r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),Hn)}),[]),l=(o.forEach(function(e){var t,i,o=0;do{}while(-1!=(i=r.indexOf(e,o))&&(t=e.replace(/^((\w|\s)+?)\s?\(?$/i,n),o=i+(s[i]=t).length),-1!=i)}),0),c=(s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))}),a.slice(0)),u=(c=(c=c.map(Hn)).join("|"),r.split(new RegExp(a.join("|"),"i"))),h=(r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(c,"gi"),Gn)}),u=u.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(c,"gi"),Gn)})}),[]),m=(h.SELECT=function(e){return Fn(",",e).filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){return Fn(",",e).filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(Vn)).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var e=e.split(" AS "),t=e[1]||"";return 0===t.indexOf('"')&&t.lastIndexOf('"')==t.length-1&&(t=t.substring(1,t.length-1)),{table:e[0],as:t}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=Vn(t[0]),i.as=Vn(t[1])||"",i.cond=Vn(e[1]),i},h.WHERE=Vn,h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;null!==(i=i.exec(e))&&((e={}).column=Vn(i[1]),e.order=Vn(i[2]),void 0===i[2]&&(e.order="ASC"),o.push(e))}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;null!==(i=i.exec(e))&&((e={}).column=Vn(i[1]),o.push(e))}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi,e=(void 0===(t=t.exec(e))[2]&&(t[2]=0),{});return e.nb=parseInt(Vn(t[3]),10),e.from=parseInt(Vn(t[2]),10),e},h["INSERT INTO"]=function(e){var t=(t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e),e={};return e.table=Vn(t[1]),void 0!==t[3]&&(e.columns=t[3].split(","),e.columns=e.columns.map(Vn)),e},h.VALUES=function(e){var e=Fn(",",e="("!=(e=Vn(e))[0]?"("+e:e),t=[];return e.forEach(function(e){e=Fn(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),t.push(e)}),t},{}),d=0;return s.forEach(function(e,t){var i,o;e=e.toUpperCase(),d++,void 0!==h[e]?(i=h[e](u[d]),void 0!==m[e]?("string"!=typeof m[e]&&void 0!==m[e][0]||(o=m[e],m[e]=[],m[e].push(o)),m[e].push(i)):m[e]=i):console.log("Can't analyze statement \""+e+'"')}),void 0!==m["LEFT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["LEFT JOIN"][0]?m["LEFT JOIN"].forEach(function(e){e.type="left",m.JOIN.push(e)}):(m["LEFT JOIN"].type="left",m.JOIN.push(m["LEFT JOIN"])),delete m["LEFT JOIN"]),void 0!==m["INNER JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["INNER JOIN"][0]?m["INNER JOIN"].forEach(function(e){e.type="inner",m.JOIN.push(e)}):(m["INNER JOIN"].type="inner",m.JOIN.push(m["INNER JOIN"])),delete m["INNER JOIN"]),void 0!==m["RIGHT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["RIGHT JOIN"][0]?m["RIGHT JOIN"].forEach(function(e){e.type="right",m.JOIN.push(e)}):(m["RIGHT JOIN"].type="right",m.JOIN.push(m["RIGHT JOIN"])),delete m["RIGHT JOIN"]),e&&("string"==typeof m.WHERE&&(m.WHERE=Nn.parse(m.WHERE)),void 0!==m.JOIN&&m.JOIN.forEach(function(e,t){m.JOIN[t].cond=Nn.parse(e.cond)})),m},kn.prototype={constructor:kn,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.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}}},kn.tokenize=function(e){var t=new kn(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},Nn.prototype={constructor:Nn,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}},Nn.parse=function(e){return new Nn(e).parseExpressionsRecursively()},Bn.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+ll(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 "+ll(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<parseInt(a.LIMIT.nb,10)?(r=" LIMIT ",void 0!==a.LIMIT.from&&1<parseInt(a.LIMIT.from,10)&&(r+=a.LIMIT.from+","),r+a.LIMIT.nb):""):void 0!==e["INSERT INTO"]?(void 0!==(r=e)["INSERT INTO"]?(a="INSERT INTO "+r["INSERT INTO"].table,void 0!==r["INSERT INTO"].columns?(a+=" (")+r["INSERT INTO"].columns.join(", ")+")":a):"")+(void 0!==(o=e).VALUES?" VALUES "+o.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", "):""):void 0!==e.UPDATE?(void 0!==(o=e).UPDATE?"UPDATE "+o.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?(void 0!==(i=e)["DELETE FROM"]?"DELETE FROM "+i["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+t(e):null},Bn.trim=Vn,Bn.protect=Hn,Bn.unprotect=Gn,Bn.protect_split=Fn,Bn.CondLexer=kn,Bn.CondParser=Nn;var yl,vl=function(e){for(var t=[],i=0;i<e.length;i++)for(var o=0;o<e[i].positions.length;o+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o+0],e[i].positions[o+1],0));return t},wl=function(e,t,i,o){for(var r=0,n=0;n<e.length;n++)for(var a=o?bl:i(e[n]),s=2;s<e[n].positions.length;s+=3){null==t[r].height&&(t[r].height=0),null==e[n].absoluteHeightPositions&&(e[n].absoluteHeightPositions=[]),e[n].absoluteHeightPositions[s-2]=e[n].positions[s-2],e[n].absoluteHeightPositions[s-1]=e[n].positions[s-1],e[n].absoluteHeightPositions[+s]=e[n].positions[+s];var l=o?0:e[n].positions[s];e[n].absoluteHeightPositions[s]=l+t[r].height+a,r++}},bl=1,Tl=(Object.defineProperties(ul.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),ul.prototype.clonePartOfMultiFeature=function(e,t){var i=e.geometryType.includes("multi")?e.fid+"."+t:e.fid;return{positions:e.positions[t],attributes:e.attributes,fid:i,geometryType:e.geometryType}},ul.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],o=[],r=e.features.numPositions=0;r<e.features.length;r++){var n=e.features[r];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":o.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)o.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<o.length&&(e.features=o,this.createPointPrimitive(e))},ul.prototype.createPolygonPrimitive=function(g){function f(t){if(t.isQuery)t.onFinishedQuery(e);else{var o="",e=[],r=[],n=[],a=[],s=[],l=b.style.polygon,c=l.clampToGround||!l.perPositionHeight&&!l.extrudedHeight&&!l.height;let i;l.text&&(i=new Cesium.LabelCollection);for(var u,h,m,d=0;d<t.features.length;d++){var p=t.features[d];if(ml(t,p.fid)){var g,f=p.absoluteHeightPositions||p.positions,_=b.createPolygonOptions(f,p.attributes),f=b.createCommonOptions(p.attributes),C=Cesium.BoundingSphere.fromPoints(_.hierarchy.positions);if(p.absoluteHeightPositions&&delete p.absoluteHeightPositions,e.push(C),!t.isQuery){let e;if(_.randomColor&&(e=Cesium.Color.fromRandom()),_.outline&&!c?(g=b.createPolygonGeometryHelper("outline",p,_.outlineColor,_),n.push(g)):_.outline&&n.push(new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:_.hierarchy.positions,width:_.outlineWidth})})),_.text){var y=b._core.getCenterOfMass(_.hierarchy.positions);let t=b.createPointOptions(y,p.attributes);if(c||null!=b.style.pointHeight||!_.extrudedHeight&&!_.height||(t.position=Cesium.Cartesian3.fromDegrees(y[0],y[1],_.extrudedHeight?(_.height||0)+_.extrudedHeight:_.height)),(_.labelNear||_.labelFar)&&(t.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(_.labelNear||0,_.labelFar||1/0)),_.offsetPoint&&_.offsetPoint[t.label.text]){let e=b._core.toDegrees(t.position);b._core.getCenterOfMass(_.hierarchy.positions);y=_.offsetPoint[t.label.text];y[0]&&(e.lon=y[0]),y[1]&&(e.lat=y[1]),void 0!==y[2]&&(e.height=y[2]),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)}let e=i.add({id:p,position:t.position,...t.label});delete e.id.positions,e.id.boundingSphere=C}if(_.colorConfig){let e;for(var v in _.colorConfig){for(var w in _.colorConfig[v])if(p.attributes[v]==w){e=_.colorConfig[v][w];break}if(e)break;_.colorConfig[v]["#"]&&(e=_.colorConfig[v]["#"])}e&&(_.material=Cesium.Color.fromCssColorString(e))}_.fill&&0<_.material.alpha&&(g=b.createPolygonGeometryHelper("fill",p,e||_.material,_),r.push(g)),t.parentLayer.addRenderedFeatureId(p.fid),o+=p.fid+";",a.push(p.fid),s.push(f.tooltip)}}}""!=o&&(l=new Cesium.PrimitiveCollection,h=new Cesium.PerInstanceColorAppearance({flat:0==_.material.alpha,translucent:_.material.alpha<1}),i&&l.add(i),0<r.length&&(_.water&&(u={color:_.water.color||"rgba(135,206,235,0.6)",image:_.water.image||window.SmartEarthRootUrl+I.water,frequency:_.water.frequency||1e3,speed:_.water.speed||10,amplitude:_.water.amplitude||10},m=Cesium.Color.fromCssColorString(u.color),h=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:m,blendColor:m,normalMap:u.image,frequency:u.frequency,animationSpeed:u.speed/1e3,amplitude:u.amplitude}}})})),((m=c?new Cesium.GroundPrimitive({geometryInstances:r,appearance:h,classificationType:_.classificationType}):new Cesium.Primitive({geometryInstances:r,appearance:h}))._parentCollection=l).add(m)),0<n.length&&(_.clampToGround?l.add(new Cesium.GroundPolylinePrimitive({geometryInstances:n,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:_.outlineColor}}})})})):((m=new Cesium.Primitive({geometryInstances:n,appearance:h}))._parentCollection=l).add(m)),l.ID="polygons:"+cl(o),l._instanceIds=a,l._tooltips=s,t.onFinishedCreatePrimitive(l,e))}}var e,b=this;3==this.style.altitudeMethod?(g.features=hl(g.features,dl(b)),f(g)):(e=function(e){for(var t=[],i=e.length,o=0;o<i;o++)for(var r=e[o],n=r.positions.length,a=0;a<n;a++)for(var s=r.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(g.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){for(var t=2==b._style.altitudeMethod,i=g.features,o=e,r=dl(b),n=t,a=0,s=0;s<i.length;s++){var l=i[s],c=n?bl:r(l);null==l.absoluteHeightPositions&&(l.absoluteHeightPositions=[]);for(var u=0;u<l.positions.length;u++)for(var h=l.positions[u],m=l.absoluteHeightPositions[u]=[],d=2;d<h.length;d+=3){var p=n?0:h[d];null==o[a].height&&(o[a].height=0),m[d-2]=h[d-2],m[d-1]=h[d-1],m[+d]=h[+d],m[d]=p+o[a].height+c,a++}}f(g)}))},ul.prototype.createPolygonGeometryHelper=function(e,t,i,o){var r=o.hierarchy,n=o.perPositionHeight,a=o.extrudedHeight,s=o.height,l=o.water,c=null!=a||void 0!==s?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT;l&&(c=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT),void 0!==a&&void 0!==s&&(a+=s);let u;return l=o.bulidingWall?new(u="fill"===e?Cesium.CorridorGeometry:Cesium.CorridorOutlineGeometry)({positions:r.positions,width:o.bulidingWallWidth||.8,vertexFormat:c,extrudedHeight:a,height:s,cornerType:Cesium.CornerType.MITERED}):new(u="fill"===e?Cesium.PolygonGeometry:Cesium.PolygonOutlineGeometry)({polygonHierarchy:r,vertexFormat:c,perPositionHeight:void 0!==s?void 0:n,extrudedHeight:a,height:s}),new Cesium.GeometryInstance({geometry:l,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}})},ul.prototype.createLinestringPrimitive=function(e){var t=this,o=(t&&t.style&&void 0!==t.style.height&&(e.features=hl(e.features,dl(t))),e);if(o.isQuery)o.onFinishedQuery(a);else{var r,n="",a=[],s=[],l=[];let i=new Cesium.PrimitiveCollection;for(var c=0;c<o.features.length;c++){var u=o.features[c];if(ml(o,u.fid)){var h=u.absoluteHeightPositions||u.positions,h=t.createLinestringOptions(h,u.attributes),m=t.createCommonOptions(u.attributes);if(h.vertexFormat=(r?Cesium.PerInstanceColorAppearance:Cesium.PolylineColorAppearance).VERTEX_FORMAT,u.absoluteHeightPositions&&delete u.absoluteHeightPositions,a.push(Cesium.BoundingSphere.fromPoints(h.positions)),!o.isQuery){d=h.clampToGround?new Cesium.GroundPolylineGeometry({positions:h.positions,width:h.width}):new Cesium.PolylineGeometry(h);var d=new Cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}});o.parentLayer.addRenderedFeatureId(u.fid),n+=u.fid+";",s.push(u.fid),l.push(m.tooltip);let e=null,t;t=h.dash?new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineDashType,{color:h.material,gapColor:h.gapColor||Cesium.Color.TRANSPARENT,dashLength:h.dashLength||20})}):new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineOutline",uniforms:{color:h.material,outlineColor:h.outlineColor||h.material,outlineWidth:h.outlineWidth||0}}})}),e=h.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:d,appearance:t,classificationType:h.classificationType}):new Cesium.Primitive({geometryInstances:d,appearance:t}),i.add(e)}}}""!=n&&((e=i).ID="polylines:"+cl(n),e._instanceIds&&0===e._instanceIds.length&&(e._instanceIds=s),e._tooltips=l,o.onFinishedCreatePrimitive(e,a))}},ul.prototype.createPointPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(n);else{for(var t,i,o="",r=[],n=[],a=[],s=new Cesium.LabelCollection({scene:v.viewer.scene}),l=new Cesium.PointPrimitiveCollection({scene:v.viewer.scene}),c=new Cesium.BillboardCollection({scene:v.viewer.scene}),u=new Cesium.PrimitiveCollection,h=new Cesium.PolylineCollection,m=0;m<e.features.length;m++){var d,p,f,_,C,y=e.features[m];ml(e,y.fid)&&(d=y.absoluteHeightPositions||y.positions,d=v.createPointOptions(d,y.attributes),p=v.createCommonOptions(y.attributes),y.clampToGround=d.clampToGround,d.sgsPointPosition&&(y.sgsPointPosition=d.sgsPointPosition,delete d.sgsPointPosition),y.absoluteHeightPositions&&delete y.absoluteHeightPositions,n.push(Cesium.BoundingSphere.fromPoints([d.position])),e.isQuery||(d.label&&(d.label.position=d.position,d.label.id=y,v.setEyeOffset(d.label),null!=d.label.imageFile&&(d.label.image=v.applyConditionalClassification(d.label.imageFile,y.attributes),d.label.label=d.label,c.add(d.label),v.setEyeOffset(d.label,-5)),null!=d.label.imageFile&&null!=d.label.showText&&d.label.showText&&(v.viewer.scene.onHoverShowTextArray[d.label.id]=!0),null!=d.label.isBold&&d.label.isBold?s.add(g):null!=d.label.isUnderline&&d.label.isUnderline?(_=null!=d.label.text.match(/[iljf1]/g)?d.label.text.match(/[iljf1]/g):[],f=d.label.text.length,f=Array(Math.ceil(f-.5*_.length)).join("_"),_=$.extend({},d.label),null!=d.label.image&&delete d.label.image,_.position=d.label.position,_.id=d.label.id,_.text=f,_.alignment=null!=d.label.alignment?d.label.alignment:void 0,_.underline=!0,_.textRelativeToImage=null!=d.label.textRelativeToImage?d.label.textRelativeToImage:void 0,-1<d.label.font.indexOf("pt")?Number(d.label.font.split("pt")[0]):-1<d.label.font.indexOf("px")&&Number(d.label.font.split("px")[0]),_.pixelOffset=new Cesium.Cartesian2(0,-45),s.add(_)):s.add(d.label)),d.billboard&&(d.billboard.position=d.position,d.billboard.id=y,v.setEyeOffset(d.billboard),c.add(d.billboard)),d.model&&(d.model.url=d.model.uri,d.model.id=y,u.add(Cesium.Model.fromGltf(d.model))),d.point&&(d.point.position=d.position,d.point.id=y,v.setEyeOffset(d.point),l.add(d.point)),0!=d.lineToGround&&(f=Cesium.Cartographic.fromCartesian(d.position),_=Cesium.Cartesian3.fromRadians(f.longitude,f.latitude,0),2==d.lineToGround&&(C=d.lineToGroundLength/Cesium.Cartesian3.distance(d.position,_),Cesium.Cartesian3.lerp(d.position,_,C,_)),h.add({show:!0,width:1,positions:[d.position,_],material:Cesium.Material.fromType("Color",{color:d.lineToGroundColor})})),e.parentLayer.addRenderedFeatureId(y.fid),o+=y.fid+";",r.push(y.fid),a.push(p.tooltip)))}""!=o&&(i=new Cesium.PrimitiveCollection,0<s.length&&($.each(s._labels,function(e,t){t._type="Label"}),(s._billboardCollection._parentCollection=i).add(s),t="labels"),0<c.length&&($.each(c._billboards,function(e,t){t._type="Billboard"}),(c._parentCollection=i).add(c),t="billboards"),0<u.length&&($.each(u._primitives,function(e,t){t._type="Model",t._parentCollection=i}),i.add(u),t="models"),0<l.length&&($.each(l._pointPrimitives,function(e,t){t._type="Point"}),(l._parentCollection=i).add(l),t="points"),0<h.length&&($.each(h._polylines,function(e,t){t._type="L2G"}),(h._parentCollection=i).add(h),t="L2G"),i.ID=t+":"+cl(o),i._instanceIds=r,i._tooltips=a,e.onFinishedCreatePrimitive(i,n))}}var e,v=this;3==this.style.altitudeMethod?(i.features=hl(i.features,dl(v)),o(i)):(e=vl(i.features),e=Cesium.sampleRenderedData(e),Cesium.when(e,function(e){var t=2==v._style.altitudeMethod;wl(i.features,e,dl(v),t),o(i)}).otherwise(function(e){}))},ul.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},ul.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.preLoad&&i.preLoad(i.polygon,t),i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var o=1;o<e.length;o++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[o])});var r,n=this.applyConditionalClassification(i.polygon.material,t);return i.polygon.material=pl(n),null!=i.polygon.fill&&null!=i.polygon.fromKml&&(1<(r=this.applyConditionalClassification(i.polygon.fill,t))&&(r/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,r)),i.polygon.height&&(i.polygon.height=Number(this.getValueFromProp(i.polygon.height,t))),i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")&&(n=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],void 0!==(n=parseInt(n))&&(i.polygon.extrudedHeight=3*n)),i.polygon.extrudedHeight&&(i.polygon.extrudedHeight=Number(i.polygon.extrudedHeight)),t.FSCALE&&(r=this.getLevelDistance(t.FSCALE),i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,r)),n=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=pl(n),i.polygon},ul.prototype.translateLineWidth=function(e,t){t=this.applyConditionalClassification(e.polyline.width,t);return 0<t?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<t&&(e.polyline.widthInMeters=!0,t*=.8,0<e.polyline.backgroundOpacity&&(t*=.8)):t=1<t?2:1:t<0?t=Math.min(5,Math.abs(t)):0==t&&(t=1),t},ul.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style),e=(i.preLoad&&i.preLoad(i.polyline,t),i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),this.applyConditionalClassification(i.polyline.material,t));return i.polyline.material=pl(e),i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE&&(e=this.getLevelDistance(t.FSCALE),i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,e)),i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},ul.prototype.getValueFromProp=function(e,i){let o=e&&e.defaultValue?e.defaultValue:e;if(o&&o.indexOf)if(-1<o.indexOf("[")&&-1<o.indexOf("]"))o=o.replace("[","").replace("]",""),o=this.getPropValue(i,o);else if(-1<o.indexOf("{")&&-1<o.indexOf("}")){let e=o.match(/\{[^\}]+\}/g);e.forEach(e=>{var t=this.getPropValue(i,e.substring(1,e.length-1));o=o.replace(e,t)}),o=o.replaceAll("\\n","\n")}return o},ul.prototype.getPropValue=function(e,t){return e[t]||(t.includes(":")?e[t.split(":")[1]]:void 0)},ul.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o,r=fl(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(r))return r;if(r instanceof Cesium.Color)return r}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(r===t)r=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)r=Cl(r,"["+name+"]",i[name]);else r=Cl(r,t,i[e.attributeName])}else void 0!==e.classification?r=_l(e.classification,i):void 0!==(o=e.classificationArray)&&$(Object.keys(o)).each(function(e,t){t=function(e,t){var i;if(void 0!==e&&0!==e.condition.length)return void 0===e.func||!(i=void 0)===_l(e,t)?fl(e.value):i}(o[t],i);t&&(r=t)});return r}},ul.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=gl(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,"string"==typeof(i=this.applyConditionalClassification(e.lineToGroundLength,t))&&-1<i.indexOf("[")&&-1<i.indexOf("]")&&(i=t[i.substring(1,i.length-1)]||0),e.lineToGroundLength=Number(i)):(e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0)},ul.prototype.createPointOptions=function(e,t){var i,o,r,n,a,s=this.getPointStyle(this.style);return s.pointHeight?(o=s.pointHeight,o=this.getValueFromProp(o,t)||0,s.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],o),e[2]=o):s.position=Array.isArray(e)?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]):e,s.sgsPointPosition=e,s.id=t,s.label&&(s.label.text=this.getValueFromProp(s.label.text,t),s.label.text=this.o(s.label.text)?this.s(s.label.text):s.label.text,-1<s.label.text.indexOf("[")&&-1<s.label.text.indexOf("]")&&(s.label.text=""),null!=s.label.family&&(o=this.applyConditionalClassification(s.label.family,t),e=this.applyConditionalClassification(s.label.font,t),s.label.font=0<=e?(3*e/4).toString()+"pt "+o:(3*(-1*(72*e/96))/4).toString()+"pt "+o),s.label.fillColor=gl(this.applyConditionalClassification(s.label.fillColor,t)),s.label.backgroundColor=gl(this.applyConditionalClassification(s.label.backgroundColor,t)),null==s.label.backgroundColor&&(s.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),s.label.showBackground=!0,null!=s.label.showText&&((a=this.applyConditionalClassification(s.label.showText,t))&&1===Number(a)&&(s.label.onHoverShowText=!0),a&&null==viewer.scene.canvas.onHoverShowText&&(i=viewer.scene,new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function(e){var t={};i.screenToWorld(e.endPosition,t),Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=i.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=i._lastObjectShowOnText&&i._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=i._lastObjectShowOnText.show&&(i._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=i.onHoverShowTextArray[t.pickPrimitive.label.id],null!=i._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=i._lastObjectShowOnText&&null!=i._lastObjectShowOnText.show&&(i._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0)),null!=s.label.textRelativeToImage&&null!=s.label.textAlignment&&(s.label.textRelativeToImage=this.applyConditionalClassification(s.label.textRelativeToImage,t),s.label.alignment=this.applyConditionalClassification(s.label.textAlignment,t)),null!=s.label.underline&&(s.label.isUnderline=this.applyConditionalClassification(s.label.underline,t)),null!=s.label.bold&&1==this.applyConditionalClassification(s.label.bold,t)&&(s.label.font="bold "+s.label.font),null!=s.label.italic&&1==this.applyConditionalClassification(s.label.italic,t)&&(s.label.font="italic "+s.label.font),null!=s.label.backgroundOpacity&&(s.label.backgroundColor.alpha=this.applyConditionalClassification(s.label.backgroundOpacity,t)),null!=s.label.minViewingHeight&&(r=this.applyConditionalClassification(s.label.minViewingHeight,t),n=650*this.applyConditionalClassification(s.label.scaleMPP,t),s.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(r,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),s.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),s.label.disableDepthTestDistance||(s.label.disableDepthTestDistance=1e3),s.clampToGround&&(s.label.heightReference=1)),s.billboard&&(s.billboard.sizeInMeters=!1,null!=s.billboard.imageColor&&(e=gl(e=this.applyConditionalClassification(s.billboard.imageColor,t)),s.billboard.color=e),null!=s.billboard.imageOpacity&&null!=s.billboard.color.alpha&&(s.billboard.color.alpha=Number(this.applyConditionalClassification(s.billboard.imageOpacity,t))),s.billboard.image=this.applyConditionalClassification(s.billboard.image,t),null!=s.billboard.minViewingHeight&&(r=this.applyConditionalClassification(s.billboard.minViewingHeight,t),n=650*this.applyConditionalClassification(s.billboard.scaleMPP,t),s.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(r,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),s.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),s.billboard.link&&s.id&&"object"==typeof s.id&&(s.id.link=this.applyConditionalClassification(s.billboard.link,t)),s.billboard.disableDepthTestDistance||(s.billboard.disableDepthTestDistance=1e3),s.clampToGround&&(s.billboard.heightReference=1)),s.model&&(o=function(e){e=Number(e);return e=Cesium.defined(e)&&!isNaN(e)?e:0},s.model.uri=this.applyClassification(s.model.uri,t),s.model.scale=o(this.applyClassification(s.model.scale,t)),e=o(this.applyClassification(s.model.heading,t)),r=o(this.applyClassification(s.model.pitch,t)),n=o(this.applyClassification(s.model.roll,t)),a=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e),Cesium.Math.toRadians(r),Cesium.Math.toRadians(n)),s.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(s.position,a)),this.createLineToGroundOptions(s,t),s},ul.prototype.s=function(e){return e.split("").reverse().join("")},ul.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},ul.prototype.o=function(e){return e&&new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},ul.prototype.applyClassification=function(e,t){if("string"===$.type(e)){if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=Cl(e,"["+i+"]",t[i]);for(var o=/(\<([^\>]+)\>)/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},ul.prototype.getPolygonStyle=function(e){return $.extend(!0,{},Tl.DEFAULT_POLYGON_STYLE,e)},ul.prototype.getLinestringStyle=function(e){return $.extend(!0,{},Tl.DEFAULT_POLYLINE_STYLE,e)},ul.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},Tl.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},Tl.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},Tl.DEFAULT_MODEL_STYLE,e):null!=e.point?$.extend(!0,{},Tl.DEFAULT_POINT_STYLE,e):Tl.DEFAULT_POINT_STYLE},ul.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)},{});function W(e,t,i,o,r,n,a,s,l){var u=this;function h(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function c(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=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(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(o=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=o.z)}return e}function d(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=c(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function p(e){this.value=new Float32Array([e])}this._viewer=e,this._Viewer=e,u.G=65535,yl=new Tn,Il=new de({workerPath:SmartEarthRootUrl+"Workers/featurefetcherworker.js"}),Cesium.sampleRenderedData||(Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(Cesium.defined(e))return new p(e);throw new DeveloperError("zbias is required.")},p.toValue=function(e,t){if(Cesium.defined(e))return Cesium.defined(t)?color.toBytes(t):new Float32Array(e);throw new DeveloperError("zbias is required.")},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(r,e){var t,i=2,o=4,n=8,a=(null==e&&(e=i|o),Cesium.when.defer()),s=[],l=(i<e?r.forEach(function(e){s.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):s=r,[]),c=(e&i&&l.push(h(u._Viewer.terrainProvider,r)),0<(e&n));return e&(o|n)&&l.push((i=s,Cesium.Check.defined("positions",i),t=Cesium.when.defer(),Cesium.when(m(i),function(e){t.resolve(e)}),t.promise)),Cesium.when.all(l).then(function(e){if(1<l.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||c)&&(i.height=o.height)}a.resolve(e[0])}),a.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(m(e),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}),r=r||{},this._level=o||{min:0,max:22},"number"==typeof this._level&&(this._level={min:o,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._visible=!0,this._gmlParser=new bn(!0,null,null,!0);var g,o=!this._viewer.TileManager;this._tileManager=yl.getInstance(e),this._tileManager.tileLevel[this._guid]={level:this._level,visible:this._visible},this._tileManager._loadTileEvent.addEventListener(W.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=r.showAttributesAsMessage,delete r.showAttributesAsMessage,this._entityCreator=new ul(r,e),this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=!0,this._addedFeatures=[],this.simpleSqlParser=Bn,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},t=(g=this).cleanUrl(g._url).replace("{s}",g.sTag(g._layerName.length,g._layerName.length,g._level)),t=(t+=Pl(t))+("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+g._layerName),i=Cesium.TrustedServers.contains(Sl(g._url,g._subdomains)),$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(t),success:function(e){var i,o;o=g,El(e,"FeatureType","wfs").each(function(e,t){return El(t,"Name","wfs").text()!=o._layerName||(1===(t=El(t,"LatLongBoundingBox","wfs")).length&&(o._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value),parseFloat(t[0].attributes.miny.value),parseFloat(t[0].attributes.maxx.value),parseFloat(t[0].attributes.maxy.value))),!1)}),i=g,$(e).find("FeatureType").each(function(e,t){return $(t).children("Name").text()!=i._layerName||(0!=(t=$(t).children("Operations")).length&&t.children().each(function(){i._operations[this.tagName.toLowerCase()]={}}),!1)})}}),xl(this),void 0!==s&&this.setVisibility(s),o||this.refresh()}function Sl(e,t){t=-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e;return t}function El(e,t,i){var o=$(e).find(t);return 0<(o=0==o.length&&"wfs"===i.toLowerCase()?$(e).find("wfs\\:"+t+","+t):o).length?o:$([])}function Pl(e){return-1<e.indexOf("?")?"&":"?"}function xl(i){i.featureColumnNames=null;var e=i.cleanUrl(i._url).replace("{s}",i.sTag(i._layerName.length,i._layerName.length,i._level)),t=(e=(e+=Pl(e))+("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+i._layerName),Cesium.TrustedServers.contains(Sl(i._url,i._subdomains)));$.ajax({dataType:"xml",xhrFields:{withCredentials:t},url:encodeURI(e),success:function(e){var o,t;o=i,e=e,t=$(e).find("[type^='gml:']"),o._geometryFieldName=$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=function(e,t){let i=eval;if(null==e)return null;try{var o=(new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):"+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 Dl(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(Tl,{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 Il,Al=180/Math.PI;function Ll(e){this.Viewer=e,this._core=new f,this.colorTool=this._core.gradientColor()}function Ml(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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",n="",$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',n+=t+="</wfs:Update>"}),r="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}",n),a="Failed to save changes to server",e=Sl(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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"),a=(n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3),""),e=(""!=e.replace(/[ ]/g,"")&&(a=(a="<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>")+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="<ogc:"+o+("like"==t.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";n+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var a=null==(r=(r=-1!=i.indexOf(t.right)?t.left:t.right).replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n=n+("<ogc:Literal>"+(r="like"==t.operator.toLowerCase()&&a?"%"+r+"%":r))+"</ogc:Literal></ogc:"+o+">"}a="and"==t.logic.toLowerCase()?"And":"Or",n="<ogc:"+a+">";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)+"</ogc:"+a+">"}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o)+"</ogc:Filter>"),n=n.replace("{wfs_filter}",a),Sl(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(){var e,t;return this.featureColumnNames||(0==(e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element")).length&&(e=$(this.geometryResponseData).find("sequence").find("element")),t=[],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<i;e++)t[e].data.wfsLayerData[this._guid]&&t[e].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[e]);e&&xl(this)}},W.prototype.setVisibility=function(e){if(this._visible!=e)if(this._visible=e,0==(this._tileManager.tileLevel[this._guid].visible=e))for(var t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&o[i].data.wfsLayerData[this._guid].primitive&&(o[i].data.wfsLayerData[this._guid].primitive.show=!1);else for(var o,t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&(o[i].data.wfsLayerData[this._guid].primitive?o[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(o[i]))},W.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=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<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(W.prototype.loadTile,this),Cesium.destroyObject(this)},W.prototype.sTag=function(e,t,i){return null==this._subdomains?"":(e=(e+t+i)%this._subdomains.length,this._subdomains[e])},W.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},W.prototype.beginLoadWFSData=function(t){if((null==this.latLon||this.latLon)&&(null==this.BoundingBox||0!=this.BoundingBox.width&&0!=this.BoundingBox.height||(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0===this.BoundingBox||void 0!==Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle))){var e=[Al*t.rectangle.west,Al*t.rectangle.south,Al*t.rectangle.east,Al*t.rectangle.north],i=this,o=this.cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level));o+=Pl(o);o+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(",");e=Cesium.TrustedServers.contains(Sl(this._url,this._subdomains));t.data.wfsLayerData[this._guid].xhr=$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(o),cache:!0,xhrFields:{withCredentials:e},success:function(e){i.processWFSData(t,e,"GML2")},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+o+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})}},W.prototype.processWFSData=function(e,t,i){var o;e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers?Il.queueWorkItem({id:e.data.id,text:t,format:i,geometryFieldName:(o=this)._geometryFieldName}).then(function(e){o.addFeaturesToTile(e)}):(i=this._gmlParser.read(t),this.addFeaturesToTile({id:e.data.id,features:i}))},W.prototype.boundingSphereFromGML=function(e,i){var t=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;Il.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){e={parentLayer:o,features:e.features,sampleTerrainLevel:t+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(e)})},W.prototype.boundingSphereFromFeature=function(e){var t,i=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel;return this._entityCreator.createPrimitiveFromWFSFeatures({parentLayer:this,features:[e],sampleTerrainLevel:i+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}}),t},W.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},W.prototype.removeRenderedFeatureId=function(i,o){if(o&&o.geometryType&&o.geometryType.includes("multi"))for(let e=0,t;e<o.positions.length;e++)t=i+"."+e,null!=this._addedFeatures[t]&&this._addedFeatures[t]--,0==this._addedFeatures[t]&&(this._addedFeatures[t]=void 0);else null!=this._addedFeatures[i]&&this._addedFeatures[i]--,0==this._addedFeatures[i]&&(this._addedFeatures[i]=void 0)},W.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},W.prototype.addFeaturesToTile=function(i,o){var r,e,n=this._tileManager.getTile(i.id);void 0!==n&&(e=o?n.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,e={parentLayer:r=this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){var t;null!=i.features&&null!=n.data.wfsLayerData&&(n.data.wfsLayerData[r._guid].features=i.features,o||r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features),(void 0===e.length||0<e.length)&&(t=n.data.wfsLayerData[r._guid].primitive,e.show=r.show,(n.data.wfsLayerData[r._guid].primitive=e).parentLayer=r,e.parentTileId=i.id,e._guid=Cesium.createGuid(),o?r._tileManager.replaceInScene(t,e):r._tileManager.addToScene(e)))}},this._entityCreator.createPrimitiveFromWFSFeatures(e))},W.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},W.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t,i=e.length,o=0;o<i;o++)t=e[o].fid,!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,t)&&(this._featuresMap[t].refCount--,0===this._featuresMap[t].refCount&&delete this._featuresMap[t],this.removeRenderedFeatureId(t,e[o]))},W.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},W.prototype.updateTile=function(e){e=this._tileManager.getTile(e);void 0!==e&&(null==e.data.wfsLayerData[this._guid].features?this.loadTile(e):this.addFeaturesToTile(e.data.wfsLayerData[this._guid],!0))},W.blockRequestPrimitiveFromPrimitive=function(e){var t;if(null!=e)return null==(t=Dl(e))&&(e._labelCollection&&e._labelCollection._billboardCollection?t=Dl(e._labelCollection._billboardCollection):e._billboardCollection&&(t=Dl(e._billboardCollection))),t},W.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Ll.prototype.CreateWfs=function(e,t){let i={},o,r;var n;if("point"===e?t.sgStyleJSON?i=this.getSGStyle("point",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#ffffff")),n=this.colorTool.colorRgb(this._core.defaultValue(t.bgColor,"#010101")),i={preLoad:t.preLoad,lineToGround:{defaultValue:t.lineToGround?t.lineToGroundLength?"2":"1":"0"},lineToGroundLength:{defaultValue:t.lineToGroundLength||0},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(t.clampToGround,!1),pointHeight:this._core.defaultValue(t.height,void 0)},t.text&&(t.offsetX&&(t.offsetX=parseInt(t.offsetX)),t.offsetY&&(t.offsetY=parseInt(t.offsetY)),i.label={text:{defaultValue:t.text},scaleMPP:{defaultValue:"15000"},fillColor:{defaultValue:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},scaleByDistance:{near:150,nearValue:1,far:8e5,farValue:.5},minViewingHeight:{defaultValue:"0"},font:{defaultValue:"12"},family:{defaultValue:this._core.defaultValue(t.font,"Arial")},backgroundColor:{defaultValue:{red:n[0]/255,green:n[1]/255,blue:n[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},scale:this._core.defaultValue(t.scale,2),backgroundOpacity:{defaultValue:t.bgColor?"0.5":"0"},italic:{defaultValue:t.italic?"1":"0"},bold:{defaultValue:t.bold?"1":"0"},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?-10:0)),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor,"#ffffff")),outlineWidth:this._core.defaultValue(t.outlineWidth,2),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:"Infinity"===t.disableDepthTestDistance?Number.POSITIVE_INFINITY:t.disableDepthTestDistance}),t.outlineColor&&i.label&&(i.label.style=Cesium.LabelStyle.FILL_AND_OUTLINE),t.image&&(i.billboard={image:t.image,scale:this._core.defaultValue(t.imageScale,1),disableDepthTestDistance:t.disableDepthTestDistance,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,link:t.link})):"polyline"===e?i=t.sgStyleJSON?this.getSGStyle("polyline",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#ffff00")),{preLoad:t.preLoad,polyline:{material:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)},outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor,"#ffffff")),lineOpacity:this._core.defaultValue(t.alpha,1),outlineWidth:this._core.defaultValue(t.outlineWidth,0),width:this._core.defaultValue(t.width,4),clampToGround:this._core.defaultValue(t.clampToGround,!0),classificationType:t.classificationType,dash:t.dash,gapColor:t.gapColor&&Cesium.Color.fromCssColorString(t.gapColor),dashLength:t.dashLength},height:t.height}):"polygon"===e&&(t.sgStyleJSON?i=this.getSGStyle("polygon",t.sgStyleJSON,t.name):(o=this.colorTool.colorRgb(this._core.defaultValue(t.color,"#6bbeef")),r=this.colorTool.colorRgb(this._core.defaultValue(t.outlineColor,"#ffffff")),i={preLoad:t.preLoad,pointHeight:this._core.defaultValue(t.pointHeight,void 0),polygon:{text:!!t.text,labelNear:t.labelNear,labelFar:t.labelFar,offsetPoint:t.offsetPoint,outlineColor:{defaultValue:{red:r[0]/255,green:r[1]/255,blue:r[2]/255,alpha:1}},outlineWidth:t.outlineWidth,fill:{defaultValue:this._core.defaultValue(t.alpha,1)},height:t.height,extrudedHeight:t.extrudedHeight,clampToGround:this._core.defaultValue(t.clampToGround,void 0===t.extrudedHeight&&void 0===t.height),classificationType:t.classificationType,water:t.water,bulidingWall:t.bulidingWall,bulidingWallWidth:t.bulidingWallWidth,randomColor:t.randomColor,colorConfig:t.colorConfig,outline:this._core.defaultValue(t.outline,!0),material:{defaultValue:{red:o[0]/255,green:o[1]/255,blue:o[2]/255,alpha:this._core.defaultValue(t.alpha,1)}},fromKml:!0}},t.text&&(i.label={style:Cesium.LabelStyle.FILL_AND_OUTLINE,text:{defaultValue:t.text},scaleMPP:{defaultValue:"15000"},fillColor:{defaultValue:Cesium.Color.fromCssColorString(this._core.defaultValue(t.labelColor||t.color,"#ffffff"))},scaleByDistance:{near:150,nearValue:1,far:8e5,farValue:.5},minViewingHeight:{defaultValue:"0"},font:{defaultValue:"12"},family:{defaultValue:this._core.defaultValue(t.font,"Arial")},backgroundColor:{defaultValue:{red:0,green:0,blue:0,alpha:0}},scale:this._core.defaultValue(t.scale,2),backgroundOpacity:{defaultValue:t.bgColor?"0.5":"0"},italic:{defaultValue:t.italic?"1":"0"},bold:{defaultValue:t.bold?"1":"0"},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?-10:0)),outlineColor:Cesium.Color.fromCssColorString(this._core.defaultValue(t.labelOutlineColor||t.outlineColor,"#ffffff")),outlineWidth:this._core.defaultValue(t.scale,2),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:"Infinity"===t.disableDepthTestDistance?Number.POSITIVE_INFINITY:t.disableDepthTestDistance}))),i||!t.sgStyleJSON)return i.position_x&&(t.lon=i.position_x,t.lat=i.position_y,t.height=i.position_z),new W(this.Viewer,this._core.defaultValue(t.urls,i.urls),this._core.defaultValue(t.layer,i.layer),{min:this._core.defaultValue(t.minimumLevel,i.minimumLevel||0),max:this._core.defaultValue(t.maximumLevel,i.maximumLevel||22)},i,this._core.defaultValue(t.layer,i.layer),t.pID||"0",t.checked,void 0);console.log(t.name+"获取样式失败!")},Ll.prototype.getSGColor=function(e){let t=parseInt(e).toString(16);return 2===t.length?t="0000"+t:4===t.length&&(t="00"+t),t="#"+t.slice(4)+t.slice(2,4)+t.slice(0,2)},Ll.prototype.getSGStyle=function(r,e,n){let a;return $.ajax({url:e,async:!1,contentType:"application/json",success:e=>{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(/<Value>(\S*)<\/Value>/)[1],t.Text.match(/<DefaultValue>(\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};ii=function(e,t,i){return t&&Rl(e.prototype,t),i&&Rl(e,i),e};function Rl(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ol(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=this,i=Ol;if(!(t instanceof i))throw new TypeError("Cannot call a class as a function");this._url="http://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 Bl(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function Vl(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V}Ml.prototype.BaiduImageryProvider=(ii(Ol,[{key:"getTileCredits",value:function(e,t,i){}},{key:"requestImage",value:function(e,t,i){var o,r;if(this.ready)return 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),Cesium.ImageryProvider.loadImage(this,e);throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.")}},{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}}]),Ol),Bl.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},Bl.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<e.length;i++){var o=e[i];t.image=o.image,this._viewer.entities.add({name:"",position:this._cesium.Cartesian3.fromDegrees(o.log,o.lat,o.height),billboard:t})}return this},Bl.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,c=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"box",position:{x:this._cesium.Math.toDegrees(c.longitude),y:this._cesium.Math.toDegrees(c.latitude),z:this._cesium.Math.toDegrees(c.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}}},Bl.prototype.setTreeobj=function(e){this.treeobj=e},Bl.prototype.setVisibility=function(e){this.item&&(this.item.show=b)},Bl.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item),this.item=void 0},Vl.prototype.createBoxGeojsonFeatureLayer=function(e,t,i,o,n){var r={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:CesiumMath.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC},a=(this._core.isnull(i)||this._core.isnull(i.material)||"["==i.material.charAt(0)&&"]"==i.material.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.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.extend(r,i,!0)),r=(null==t&&console.log("geojson is required"),null),r=t.then?t:this._cesium.GeoJsonDataSource.load(t),s=this;return r.then(function(e){for(var t=e.entities.values,i=[],o=0;o<t.length;o++){var r=t[o],r=(a.polygonHierarchy=new s._cesium.PolygonHierarchy(r.polyline.positions._value,[]),new s._cesium.GeometryInstance({id:r,geometry:new s._cesium.PolygonGeometry(a),attributes:{color:new s._cesium.ColorGeometryInstanceAttribute.fromColor(a.material)}}));i.push(r)}e=s._viewer.scene.primitives.add(new s._cesium.Primitive({geometryInstances:i,appearance:new s._cesium.PerInstanceColorAppearance({translucent:!1}),shadows:s._cesium.ShadowMode.ENABLED}));e.show=a.show,s.item=e,"function"==typeof n&&n(e)}),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this._tree.insertGroupId({id:a.id,name:e,checked:a.show,pId:this._core.isnull(o)?0:o,type:"polylineLayer",item:this},this._core.isnull(o)?0:o),this};let Fl=new f;function Hl(e,t){this._viewer=e,this.type=t.type,this.videoContainer=t.videoContainer||t.video&&t.video.container,this.prop=t.prop,this.cameraPosition=t.cameraPosition.x&&t.cameraPosition.y&&t.cameraPosition.z?t.cameraPosition:Cesium.Cartesian3.fromDegrees(t.cameraPosition.lon,t.cameraPosition.lat,t.cameraPosition.height),this.position=t.position&&(t.position instanceof Cesium.Cartesian3?t.position:Cesium.Cartesian3.fromDegrees(t.position.lon,t.position.lat,t.position.height)),this.heading=t.heading||0,this.pitch=t.pitch||0,this.alpha=t.alpha||.9,this.horizonAngle=t.horizonAngle||60,this.verticalAngle=t.verticalAngle||40,this.far=t.far||30,this.showFarScale=t.showFarScale||5,this.show=!0,this.useLine=Cesium.defaultValue(t.useLine,!0),this._viewer.scene.primitives.add(this),this.init()}Hl.prototype.createViewCone=function(){this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),this.useLine&&(this.line=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.FrustumOutlineGeometry(this.cameraData),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}}),appearance:new Cesium.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._viewer.scene.primitives.add(this.line))},Hl.prototype.createVideoPlane=function(){var t=new Float64Array(24);Cesium.FrustumGeometry._computeNearFarPlanes(this.cameraData.origin,this.cameraData.orientation,0,this.cameraData.frustum,t);let i=[];for(let e=12;e<t.length;e+=3)i.push(t[e],t[e+1],t[e+2]);this.plan&&this.plan.destroy();let e=Cesium.Material.fromType("Image");e.uniforms.image=this.videoContainer,e.uniforms.color.alpha=this.alpha,this.plan=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:i}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:[0,1,2,0,2,3],primitiveType:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(i)}),id:this.prop}),appearance:new Cesium.MaterialAppearance({flat:!0,material:e})})},Hl.prototype.isShow=function(){return this.show&&Fl.getPointToCameraDistance(this._viewer,this.cameraPosition)<this.far*this.showFarScale},Hl.prototype.init=function(){this.plan||(this.createCamera(),this.createVideoPlane(),this.createViewCone())},Hl.prototype.createCamera=function(){let e=this.videoCamera||new Cesium.Camera(this._viewer.scene);e.frustum.fov=Cesium.Math.toRadians(this.horizonAngle),e.frustum.aspectRatio=this.horizonAngle/this.verticalAngle,e.frustum.near=1,e.frustum.far=this.far,this.position?(e.position=this.cameraPosition,e.direction=Cesium.Cartesian3.subtract(this.position,this.cameraPosition,new Cesium.Cartesian3(0,0,0)),e.up=Cesium.Cartesian3.normalize(this.cameraPosition,new Cesium.Cartesian3(0,0,0)),t=Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.position,this.cameraPosition,new Cesium.Cartesian3),new Cesium.Cartesian3),e.direction=t,this.heading=Cesium.Math.toDegrees(e.heading),this.pitch=Cesium.Math.toDegrees(e.pitch),this.position=null):e.setView({destination:this.cameraPosition,orientation:{heading:Cesium.Math.toRadians(this.heading),pitch:Cesium.Math.toRadians(this.pitch),roll:0}});var t=new Cesium.Cartesian3,i=new Cesium.Matrix3,o=new Cesium.Quaternion,r=e.positionWC,n=e.upWC,a=e.rightWC,a=Cesium.Cartesian3.negate(a,t),t=i,i=(Cesium.Matrix3.setColumn(t,0,a,t),Cesium.Matrix3.setColumn(t,1,n,t),Cesium.Matrix3.setColumn(t,2,e.direction,t),Cesium.Quaternion.fromRotationMatrix(t,o));this.videoCamera=e,this.cameraData={orientation:i,origin:r,frustum:e.frustum}},Hl.prototype.flyTo=function(){this.videoCamera&&this._viewer.camera.flyTo({destination:this.videoCamera.position,orientation:{heading:this.videoCamera.heading,pitch:this.videoCamera.pitch,roll:0}})},Hl.prototype.updatePost=function(e){e.cameraPosition&&(this.cameraPosition=e.cameraPosition instanceof Cesium.Cartesian3?e.cameraPosition:Cesium.Cartesian3.fromDegrees(e.cameraPosition.lon,e.cameraPosition.lat,e.cameraPosition.height)),e.position&&(this.position=e.position instanceof Cesium.Cartesian3?e.position:Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),isNaN(e.heading)||"number"!=typeof e.heading||(this.heading=e.heading),isNaN(e.pitch)||"number"!=typeof e.pitch||(this.pitch=e.pitch),isNaN(e.alpha)||"number"!=typeof e.alpha||(this.alpha=e.alpha),isNaN(e.horizonAngle)||"number"!=typeof e.horizonAngle||(this.horizonAngle=e.horizonAngle),isNaN(e.verticalAngle)||"number"!=typeof e.verticalAngle||(this.verticalAngle=e.verticalAngle),isNaN(e.far)||"number"!=typeof e.far||(this.far=e.far),isNaN(e.showFarScale)||"number"!=typeof e.showFarScale||(this.showFarScale=e.showFarScale),void 0!==e.useLine&&(this.useLine=e.useLine),e.prop&&(this.prop=e.prop),this.createCamera(),0<=e.type.indexOf("h265")?this.createCanvasPlane():this.createVideoPlane(),this.createViewCone()},Hl.prototype.update=function(e){var t;this.plan&&this.show&&(t=this.isShow(),this.plan&&(this.plan.show=t),this.line&&(this.line.show=t),this.plan.update(e))},Hl.prototype.setVisibility=function(e){this.show=e,this.plan&&(this.plan.show=e),this.line&&(this.line.show=e)},Hl.prototype.destroy=function(){return this.plan&&(this.plan.destroy(),this.plan=void 0),this._viewer.scene.primitives.remove(this),this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),Cesium.destroyObject(this)};let Y={opacity:1,poolSize:16,canvas:null,layers:new Array,showid:null,width:0,height:0,cesium:null,viewer:null,workers:new Array,oceanCanvas:null,oceanCtx:null,oceanWorker:null};var Gl,kl=!1,Nl=!1,jl=Math.floor(204),Ul=[NaN,NaN,null],zl=null,Wl=null,Yl=[],Jl=[[30,[10,25,68]],[33,[10,25,250]],[33.5,[24,255,255]],[34,[105,233,252]],[34.5,[255,233,65]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,255,15]],[35,[255,235,15]],[35,[255,215,15]],[35,[255,195,15]],[35,[255,175,15]],[35,[255,155,15]],[35,[255,135,15]],[35,[255,115,15]],[35,[255,95,15]],[35,[255,75,15]],[35,[255,55,15]],[35,[255,35,15]],[35,[255,15,15]]];function Kl(){for(var a={},e=Math.round(7*Gl.width),s=[],t=0;t<e;t++)s.push(oc({age:ic(0,100)}));var i=Gl.valMax-Gl.valMin;i/=zl.length-1;for(t=0;t<zl.length;t++)zl[t][0]=Gl.valMin+t*i;var l=function(e){for(var n=[],a=[],s=[],t=0;t<e.length-1;t++)n.push(e[t+1][0]),a.push(function(e,t){var i=e[0],o=e[1],r=e[2],n=t[0]-i,a=t[1]-o,s=t[2]-r;return function(e,t){return[Math.floor(i+e*n),Math.floor(o+e*a),Math.floor(r+e*s),t]}}(e[t][1],e[t+1][1])),s.push([e[t][0],e[t+1][0]]);return function(e,t){for(var i=0;i<n.length-1&&!(e<=n[i]);i++);var o,r=s[i];return a[i]((o=r[0],r=r[1],(function(e,t,i){return Math.max(t,Math.min(e,i))}(e,o,r)-o)/(r-o)),t)}}(zl);kl=!1,Y.oceanCtx.clearRect(0,0,Y.oceanCanvas.width,Y.oceanCanvas.height),function e(){try{if(!kl&&!Nl){if(a=[],s.forEach(function(e){100<e.age&&(e.xt=void 0,e.yt=void 0,oc(e).age=0),e.xt&&e.yt&&(e.x=e.xt,e.y=e.yt);var t=e.x,i=e.y,o=ec(t,i),r=o[2];null===r?e.age=100:tc(t=t+o[0],i=i+o[1])?(e.xt=t,e.yt=i,r="rgba("+(o=l(r,jl))[0]+", "+o[1]+", "+o[2]+", "+jl+")",null==a[r]&&(a[r]=[]),a[r].push(e)):(e.x=t,e.y=i),e.age+=1}),!Nl){var t,i=Y.oceanCtx,o=(i.lineWidth=1,i.fillStyle="rgba(0, 0, 0, 0.97)",i.globalCompositeOperation);for(t in i.globalCompositeOperation="destination-in",i.fillRect(0,0,Y.oceanCanvas.width,Y.oceanCanvas.height),i.globalCompositeOperation=o,a){var r=a[t];if(0<r.length){for(var n in i.beginPath(),i.strokeStyle=t,r){n=r[n];i.moveTo(n.x,n.y),i.lineTo(n.xt,n.yt),n.x=n.xt,n.y=n.yt}i.stroke(),i.strokeStyle="#fff"}}}Wl=setTimeout(e,30)}}catch(e){}}()}function Ql(e){zl=e.color||Jl,Y.oceanWorker=new Worker(SmartEarthRootUrl+"Workers/field/oceanWorker.js"),Y.oceanWorker.onmessage=function(e){var t=e.data;switch(t.type){case"success":break;case"draw":Gl=t.data,Yl=Gl.drawData,Kl()}},Y.oceanWorker.postMessage(e.message)}function ql(l,c){var t,i;t={message:{id:l.id,ncpath:l.ncpath,variable:l.variable,depth:l.depth},callback:function(e){n=e.width,t=e.height,null!=Y.canvas&&(Y.canvas.remove(),Y.canvas=null),Y.canvas=document.createElement("canvas"),Y.canvas.width=n,Y.canvas.height=t;for(var t,i,o,r,n=Y.canvas.getContext("2d"),a=n.getImageData(0,0,e.width,e.height),s=0;s<e.arrayBufferView.length;s++)a.data[s]=e.arrayBufferView[s];n.putImageData(a,0,0),t=e,n=l.id,i=e.minx,o=e.miny,r=e.maxx,t=e.maxy,i=Y.cesium.Rectangle.fromDegrees(i,o,r,t),o=new Y.cesium.ImageMaterialProperty({image:Y.canvas,transparent:!0}),mlayer=Y.viewer.entities.add({show:!0,rectangle:{coordinates:i,material:o}}),Y.layers[n]=mlayer,"function"==typeof c&&c(l.id)}},(i=new Worker(SmartEarthRootUrl+"Workers/field/rendermapWorker.js")).onmessage=function(e){t.callback(e.data),i.terminate()},i.postMessage(t.message)}function Xl(e){var t={x:0,y:0,z:0};return t.x=e.x,t.y=e.y,t.z=e.z,t}function Zl(){for(var e=Y.viewer.scene,t=e.camera,i=[],o=[],r=Xl(t.positionWC),n=Xl(t.directionWC),a=Xl(t.rightWC),s=Xl(t.upWC),l=0;l<16;l++)i[l]=t.viewMatrix[l],o[l]=t.frustum.projectionMatrix[l];return{width:e.canvas.clientWidth,height:e.canvas.clientHeight,viewMatrix:i,projectionMatrix:o,frustum:{fovy:t.frustum.fovy,aspectRatio:t.frustum.aspectRatio,near:t.frustum.near},positionWC:r,directionWC:n,rightWC:a,upWC:s}}function $l(t,i){switch(t.type){case"single":ql({id:0,ncpath:t.ncpath,variable:t.variable,depth:t.depth},i);break;case"mfile":ql({id:0,ncpath:t.ncpath.format(t.params[0]),variable:t.variable,depth:t.depth},function(){"function"==typeof i&&i(0);for(var e=1;e<t.params.length;e++)ql({id:e,ncpath:t.ncpath.format(t.params[e]),variable:t.variable,depth:t.depth})});break;case"mdepth":break;case"ocean":var o={id:0,upath:t.upath,vpath:t.vpath},r=Zl();if(null==Y.oceanCanvas){Y.oceanCanvas=document.createElement("canvas"),Y.oceanCanvas.width=r.width,Y.oceanCanvas.height=r.height,Y.oceanCanvas.id="animation",Y.oceanCanvas.style="position: absolute;left: 0px;top: 0px;pointer-events: none;",document.getElementsByClassName("cesium-widget")[0].appendChild(Y.oceanCanvas),Y.oceanCtx=Y.oceanCanvas.getContext("2d");var n={childList:!0,attributes:!0,subtree:!0};let e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,t=new e(function(){Y.oceanCanvas.width=Y.viewer.cesiumWidget.canvas.width,Y.oceanCanvas.height=Y.viewer.cesiumWidget.canvas.height});t.observe(Y.viewer.cesiumWidget.canvas,n),Ql({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:r},callback:function(e){}}),Y.viewer.scene.camera.moveStart.addEventListener(function(){Wl&&clearTimeout(Wl),(Wl=null)!=Y.oceanWorker&&(Y.oceanWorker.postMessage({type:"stop"}),Nl=!0,Yl=[],Y.oceanCtx.clearRect(0,0,Y.oceanCanvas.width,Y.oceanCanvas.height))}),Y.viewer.scene.camera.moveEnd.addEventListener(function(){null!=Y.oceanWorker&&(Nl=!1,Y.oceanWorker.postMessage({type:"update",scene:Zl()}))})}else Ql({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:r},callback:function(e){}});break;default:ql({id:0,ncpath:t.ncpath,variable:t.variable,depth:t.depth})}}function ec(e,t){e=Yl[Math.round(e)];return e&&e[Math.round(t)]||Ul}function tc(e,t){return null!==ec(e,t)[2]}function ic(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}function oc(e){for(var t,i,o=0;!tc(t=Math.round(ic(0,Y.viewer.scene.canvas.clientWidth)),i=Math.round(ic(0,Y.viewer.scene.canvas.clientHeight)))&&o++<30;);return e.x=t,e.y=i,e}function rc(e,t){Y.viewer=e,Y.cesium=t}function nc(e,t={}){for(var i in this._viewer=e,this._cache={},this.option={id:wn(),size:18,pixelRange:40,gradient:{1e-4:"rgb(0,191,255)",.001:"rgb(0,128,0)",.01:"rgb(255,165,0)",.1:"rgb(255,0,0)"},fontSize:12,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,fontColor:"rgb(0,0,0)",style:"circle",...t},this.option.gradient)this.option.gradient[i]=Cesium.Color.fromCssColorString(this.option.gradient[i]);this.dataSource=new Cesium.CustomDataSource(this.option.id),this.dataSource.clustering.enabled=!0,this.dataSource.clustering.pixelRange=this.option.pixelRange,this.dataSource.clustering.clusterEvent.addEventListener(this._clusterEventHandler,this),this._viewer.dataSources.add(this.dataSource)}Y.hide=function(){(Y.showid||0==Y.showid)&&Y.layers[Y.showid]&&(Y.layers[Y.showid].show=!1)},Y.show=function(e){(Y.showid||0==Y.showid)&&Y.layers[Y.showid]&&(Y.layers[Y.showid].show=!1),(e||0==e)&&Y.layers[e]&&(Y.layers[e].show=!0,Y.showid=e)},Y.draw=function(e,t){$l(e,t)},Y.destroy=function(){try{for(var e=0;e<Y.layers.length;e++)Y.viewer.entities.remove(Y.layers[e]);Y.layers=[]}catch(e){}try{for(e=0;e<Y.workers.length;e++)try{Y.workers[e].terminate()}catch(e){}Y.workers=[]}catch(e){}try{Wl&&clearTimeout(Wl),Wl=null}catch(e){}try{Y.oceanWorker.terminate(),Y.oceanWorker=null,Y.oceanCtx.clearRect(0,0,Y.oceanCanvas.width,Y.oceanCanvas.height)}catch(e){}},String.prototype.format=function(e){var t,i=this;if(0<arguments.length)if(1==arguments.length&&"object"==typeof e)for(var o in e)void 0!==e[o]&&(t=new RegExp("({"+o+"})","g"),i=i.replace(t,e[o]));else for(var r,n=0;n<arguments.length;n++)void 0!==arguments[n]&&(r=new RegExp("({)"+n+"(})","g"),i=i.replace(r,arguments[n]));return i},rc.prototype.createField=function(e,t){return Y.draw(e,t),this},rc.prototype.destroy=function(){Y.destroy()},rc.prototype.remove=function(){Y.destroy()},nc.prototype.add=function(e,t={}){return this.dataSource.entities.add({id:t.id||wn(),name:t.name,position:Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height),billboard:{image:t.image||window.SmartEarthRootUrl+I.mark1,scale:t.scale||1,horizontalOrigin:this.option.horizontalOrigin,verticalOrigin:this.option.verticalOrigin,disableDepthTestDistance:Number.POSITIVE_INFINITY}})},nc.prototype._drawCircle=function(i,o){var r=o.length,n=this.option.size*(r+1),a=i.toCssColorString()+"-"+n,r=n/2-r*this.option.fontSize/3,s=(n+this.option.fontSize)/2;if(!this._cache[a]){let e=document.createElement("canvas"),t=(e.width=n,e.height=n,e.getContext("2d"));t.save(),t.scale(n/24,n/24),t.fillStyle=i.withAlpha(.2).toCssColorString(),t.beginPath(),t.arc(12,12,9,0,2*Math.PI),t.closePath(),t.fill(),t.beginPath(),t.arc(12,12,6,0,2*Math.PI),t.fillStyle=i.toCssColorString(),t.fill(),t.closePath(),t.restore(),t.font=`bold ${this.option.fontSize}px sans-serif`,t.fillStyle=this.option.fontColor,t.fillText(o,r,s),this._cache[a]=e.toDataURL()}return this._cache[a]},nc.prototype._drawClustering=function(i,o){var r=o.length,n=this.option.size*(r+1),a=i.toCssColorString()+"-"+n,r=n/2-r*this.option.fontSize/3,s=(n+this.option.fontSize)/2;let l=-Math.PI/12;var c=Math.PI/2,u=Math.PI/6;if(!this._cache[a]){let e=document.createElement("canvas"),t=(e.width=n,e.height=n,e.getContext("2d"));t.save(),t.scale(n/24,n/24),t.beginPath(),t.arc(12,12,6,0,2*Math.PI),t.fillStyle=i.toCssColorString(),t.fill(),t.closePath(),t.lineWidth=2;for(let e=0;e<3;e++)t.beginPath(),t.arc(12,12,8,l,l+c,!1),t.strokeStyle=i.withAlpha(.4).toCssColorString(),t.stroke(),t.arc(12,12,11,l,l+c,!1),t.strokeStyle=i.withAlpha(.2).toCssColorString(),t.stroke(),t.closePath(),l=l+c+u;t.restore(),t.font=`bold ${this.option.fontSize}px sans-serif`,t.fillStyle=this.option.fontColor,t.fillText(o,r,s),this._cache[a]=e.toDataURL()}return this._cache[a]},nc.prototype._clusterEventHandler=function(e,t){if(this.dataSource.clustering.enabled&&(t.billboard.show=!0,t.label.show=!1,t.billboard.disableDepthTestDistance=Number.POSITIVE_INFINITY,this.dataSource.entities.values.length)){var i,o,r=this.dataSource.entities.values.length||0;for(i in this.option.gradient)e.length>=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))}},nc.prototype.clear=function(){this.dataSource.entities.removeAll(),this._cache={}},nc.prototype.setVisibility=function(e){this.dataSource&&(this.dataSource.show=e)},nc.prototype.deleteObject=function(){this.clear(),this._viewer.dataSources.remove(this.dataSource),Cesium.destroyObject(this)},Object.defineProperties(nc.prototype,{enableCluster:{set:function(e){this.dataSource.clustering.enabled=e},get:function(){return this.dataSource.clustering.enabled}}});var ac="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 sc(e){return e.scene.colorAdjustment||(this.item=new Cesium.PostProcessStage({name:"czm_colorAdjustment",fragmentShader:ac,uniforms:{brightness:1,contrast:1,saturation:1}}),this.item.enabled=!0,e.scene.postProcessStages.add(this.item),e.scene.colorAdjustment=this)}function lc(e){this._viewer=e,this._core=new f,this._tree=V}function cc(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function uc(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 hc(){this._core=new f,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,hc.prototype.ready||Object.defineProperties(hc.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<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}})}function mc(i,e,o){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=yc.indexOf(t=t),t._parentCollection._primitiveOld=o,-1!==e?(i.scene.primitives.remove(yc[e]._parentCollection),yc[e]=t):yc.push(t),!1})}function dc(e,t,i){e.scene.primitives.remove(i),t._onDestroyTilePrimitive=function(){e.scene.primitives.remove(i),this._onDestroyTilePrimitive=void 0}}function pc(e,t,i,o){Cesium.when.all(t,function(){e.scene.primitives.remove(o)}),i._onDestroyTilePrimitive=function(){e.scene.primitives.remove(o),this._onDestroyTilePrimitive=void 0}}function gc(e,t,i){pc(e,$.map(t._primitives,function(e){return e.readyPromise}),t,i)}function fc(e,t,i){pc(e,$.map(t._primitives[0]._primitives,function(e){return e.readyPromise}),t,i)}function _c(e,t,i){e.scene.primitives.remove(i)}function Cc(e,t,i){pc(e,[t.readyPromise],t,i)}Object.defineProperties(sc.prototype,{brightness:{get:function(){return this.item.uniforms.brightness},set:function(e){this.item.uniforms.brightness=e}},contrast:{get:function(){return this.item.uniforms.contrast},set:function(e){this.item.uniforms.contrast=e}},saturation:{get:function(){return this.item.uniforms.saturation},set:function(e){this.item.uniforms.saturation=e}}}),lc.prototype.create=function(e,t,i={}){this.angle=(i.angle||10)/2,this.heading=this.pitch=this.roll=0;let o={subdivisions:6,stackPartitions:30,slicePartitions:30,innerRadii:new Cesium.Cartesian3(1,1,1),radii:new Cesium.CallbackProperty(()=>new 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},lc.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)},lc.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))))},lc.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()},lc.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()},lc.prototype.changeAngle=function(e){this.angle=e/2},lc.prototype.setTreeobj=function(e){this.treeobj=e},lc.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},lc.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},cc.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<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y,t[a].z));else for(a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x,t[a].y));else if(2===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1]));else if(3===t[0].length)for(var a=0;a<t.length;a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0],t[a][1],t[a][2]));i.positions=n;r=this._viewer.entities.add({name:e,id:this._core.getuid(),corridor:i});return this.item=r,this._tree.insertGroupId({id:r.id,name:e,pId:this._core.isnull(o)?0:o,type:"corridor",item:this},this._core.isnull(o)?0:o),this}console.log("options is required")},cc.prototype.getstyles=function(){var e={};return e.show=!this.item.ellipse.show||this.item.ellipse.show._value,e.positions=this.item.ellipse.positions?this.item.ellipse.positions.getValue().toString():void 0,e.width=this.item.ellipse.width&&this.item.ellipse.width._value?this.item.ellipse.width.toString():void 0,e.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height.toString():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.cornerType=this.item.ellipse.cornerType?this.item.ellipse.cornerType._value:void 0,e.material={},tyles.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?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?this.item.ellipse.material.image._value:void 0,e.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,e.fill=this.item.ellipse.fill?this.item.ellipse.fill._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.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},cc.prototype.setVisibility=function(e){this.item.show=e},cc.prototype.getVisibility=function(){return this.item.show},cc.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},cc.prototype.setItem=function(e){this.item=e},cc.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(uc.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}}}),uc.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<l;++s)n=(r=a[s]).prefix?r.prefix+":"+i:i,"*"!=i&&n!=r.nodeName||"*"!=t&&t!=r.namespaceURI||o.push(r);return o},uc.prototype.read=function(e){for(var t=this.getElementsByTagNameNS(e.documentElement,this._gmlns,this.featureName),i=[],o=0;o<t.length;o++){var r=this.parseFeature(t[o]);r&&i.push(r)}return i},uc.prototype.parseFeature=function(e){for(var t,i,o,r,n=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<n.length;++a)if(0<(i=this.getElementsByTagNameNS(e,this._gmlns,t=n[a])).length){(r=this.parseGeometry[t.toLowerCase()])?o=r.apply(this,[i[0]]):console.log("unsupportedGeometryType:"+t);break}for(var s,l=this.getElementsByTagNameNS(e,this._gmlns,"Box"),a=0;a<l.length;++a){var c=l[a],u=this.parseGeometry.box.apply(this,[c]),c=c.parentNode;"boundedBy"===(c.localName||c.nodeName.split(":").pop())?s=u:o=u.toGeometry()}this.extractAttributes&&(m=this.parseAttributes(e));for(var h,m={geometryType:t.toLowerCase(),positions:o,attributes:m},d=(m.bounds=s,e.firstChild);d&&(1!=d.nodeType||!(h=d.getAttribute("fid")||d.getAttribute("id")));)d=d.nextSibling;return m.fid=h,m},uc.prototype.parseGeometry={point:function(e){var t=[],i=this.getElementsByTagNameNS(e,this._gmlns,"pos");return 0==(t=0<i.length?i[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):t).length&&(0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length&&(t=i[0].firstChild.nodeValue.replace(this._regExes.removeSpace,"").split(","))),0==t.length&&0<(i=this.getElementsByTagNameNS(e,this._gmlns,"coord")).length&&(e=this.getElementsByTagNameNS(i[0],this._gmlns,"X"),i=this.getElementsByTagNameNS(i[0],this._gmlns,"Y"),0<e.length&&0<i.length&&(t=[e[0].firstChild.nodeValue,i[0].firstChild.nodeValue])),2==t.length&&(t[2]=null),this.xy?[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]:[parseFloat(t[1]),parseFloat(t[0]),parseFloat(t[2])]},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Point"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.point.apply(this,[t[r]]))&&i.push(o);return i},linestring:function(e,t){var i=[],o=[],r=this.getElementsByTagNameNS(e,this._gmlns,"posList");if(0<r.length)for(var n,a,s,i=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace),l=parseInt(r[0].getAttribute("dimension")),c=0;c<i.length/l;++c)s=c*l,n=parseFloat(i[s]),a=parseFloat(i[1+s]),s=2==l?null:parseFloat(i[2+s]),this.xy?o.push(n,a,s):o.push(a,n,s);if(0==i.length&&0<(r=this.getElementsByTagNameNS(e,this._gmlns,"coordinates")).length)for(var u=this.getChildValue(r[0]).replace(this._regExes.trimSpace,"").replace(this._regExes.trimComma,",").split(this._regExes.splitSpace),c=0;c<u.length;++c)2==(i=u[c].split(",")).length&&(i[2]=null),this.xy?o.push(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])):o.push(parseFloat(i[1]),parseFloat(i[0]),parseFloat(i[2]));return o},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LineString"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r]]))&&i.push(o);return i},polygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"LinearRing"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.linestring.apply(this,[t[r],!0]))&&i.push(o);return i},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this._gmlns,"Polygon"),i=[];if(0<t.length)for(var o,r=0;r<t.length;++r)(o=this.parseGeometry.polygon.apply(this,[t[r]]))&&i.push(o);return i},envelope:function(e){var t,i,o,r,n=[],a=this.getElementsByTagNameNS(e,this._gmlns,"lowerCorner"),a=(0<a.length&&(o=[],2==(o=0<a.length?a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):o).length&&(o[2]=null),i=this.xy?new OpenLayers_Geometry_Point(o[0],o[1],o[2]):new OpenLayers_Geometry_Point(o[1],o[0],o[2])),this.getElementsByTagNameNS(e,this._gmlns,"upperCorner"));return 0<a.length&&(o=[],2==(o=0<a.length?a[0].firstChild.nodeValue.replace(this._regExes.trimSpace,"").split(this._regExes.splitSpace):o).length&&(o[2]=null),r=this.xy?new OpenLayers_Geometry_Point(o[0],o[1],o[2]):new OpenLayers_Geometry_Point(o[1],o[0],o[2])),i&&r&&(n.push([i.x,i.y,null]),n.push([r.x,i.y,null]),n.push([r.x,r.y,null]),n.push([i.x,r.y,null]),n.push([i.x,i.y,null]),t=new OpenLayers_Geometry_Polygon([[n]])),t},box:function(e){var e=this.getElementsByTagNameNS(e,this._gmlns,"coordinates"),t=null,i=null;if(0<e.length&&(2==(e=e[0].firstChild.nodeValue.split(" ")).length&&(t=e[0].split(","),i=e[1].split(","))),null!==t&&null!==i)return[parseFloat(t[0]),parseFloat(t[1]),null,parseFloat(i[0]),parseFloat(i[1]),null]}},uc.prototype.parseAttributes=function(e){for(var t,i,o,r,n,a={},s=e.firstChild;s;){if(1==s.nodeType){for(t=s.childNodes,i=0;i<t.length;++i)1==(o=t[i]).nodeType&&(1==(n=o.childNodes).length?3!=(n=n[0]).nodeType&&4!=n.nodeType||(r=o.prefix?o.nodeName.split(":")[1]:o.nodeName,n=n.nodeValue.replace(this._regExes.trimSpace,""),a[r]=n):a[o.nodeName.split(":").pop()]=null);break}s=s.nextSibling}return a},uc.prototype.getChildValue=function(e,t){var i=t||"";if(e)for(var o=e.firstChild;o;o=o.nextSibling)switch(o.nodeType){case 3:case 4:i+=o.nodeValue}return i},hc.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var yc=[],vc=0,wc=(hc.prototype.onPreFrame=function(e,t){if(vc++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&vc%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(yc,function(e,t){t.ready&&this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}},hc.prototype.updateForPick=function(e){},Math.PI,hc.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:this.viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},hc.prototype.getTile=function(e){return this._tileCache[e]},hc.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},hc.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},hc.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):this.viewer.scene.primitives.remove(e)},hc.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&this.viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,this.viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":mc(this.viewer,t,e);break;case"labels":dc(this.viewer,t,e);break;case"polygons":gc(this.viewer,t,e);break;case"models":fc(this.viewer,t,e);break;case"polylines":Cc(this.viewer,t,e);break;case"points":_c(this.viewer,0,e);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)}},{billboards:mc,labels:dc,polygons:gc,models:fc,polylines:Cc,points:_c}),bc=(hc.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=wc[i])?i(t,e):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(e)))},!(hc.prototype.update=function(e){this.level=this._core.getLevel(this.viewer);let t=this.getAllTiles(),i,o;t.forEach(e=>{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 Tc(){}function Sc(e){return"string"==typeof e?e.replace(/^\s+/g,"").replace(/\s+$/g,""):e}function Ec(t,e){for(var i=!1,o=0,r="",n=0;n<e.length;n++)!i&&/['"`]/.test(e[n])?i=e[n]:i&&e[n]==i?i=!1:i||"("!=e[n]?i||")"!=e[n]||o--:o++,e[n]==t&&(0<o||i)?r+="######":r+=e[n];return e=(e=(e=r).split(t)).map(function(e){return Sc(e.replace(new RegExp("######","g"),t))})}function Pc(e){for(var t="#",i=e.length,o=0;o<i;o++)t+=e[o]+"#";return t}function xc(e){for(var t="",i=e.length,o=1;o<i;o+=2)t+=e[o];return t}function Dc(e){this.source=e,this.cursor=0,this.currentChar="",this.readNextChar()}function Ic(e){this.lexer=new Dc(e),this.currentToken="",this.readNextToken()}function Ac(e,t){var i="";return void 0!==e.logic?(i=(i=e.terms.map(function(e){return Ac(e,!0)})).join(" "+e.logic+" "),void 0!==t&&(i="("+i+")")):void 0!==e.left?(i=e.left,void 0!==e.operator&&(i+=" "+e.operator,void 0!==e.right&&("IN"===e.operator?i+=" ("+e.right+")":i+=" "+e.right))):i=e,i}function Lc(e){var t,i=0;if(0!==e.length)for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;return i}function Mc(e,t){this._style=e||{},this._core=new f,this._bufferAnalysis=new Ai(t,Cesium),t.scene.onHoverShowTextArray={},t.scene._lastObjectShowOnText=null,this.setEyeOffset=function(e,t){void 0===t&&(t=0),e.eyeOffset=Cesium.DynamicEyeOffset(t)},this.viewer=t}function Rc(e,t){for(var i=e.length,o=0;o<i;o++){var r=t(e[o]);if("polygon"==e[o].geometryType||"multipolygon"==e[o].geometryType){for(var n=e[o],a=n.positions.length,s=0;s<a;s++){for(var l=n.positions[s],c=2;c<l.length;c+=3)l[c]=r;n.positions[s]=l}e[o]=n}else{for(var u=e[o],h=u.positions.length,s=2;s<h;s+=3)u.positions[s]=r;e[o]=u}}return e}function Oc(e,t){if(null==e.isQuery)if(null==e.originalInstanceIds){if(e.parentLayer.isExistRenderedFeatureId(t))return}else if(-1==e.originalInstanceIds.indexOf(t))return;return 1}function Bc(t){return function(e){e=Number(t.applyConditionalClassification(t._style.altitudeOffset||t._style.height,e.attributes));return e=isNaN(e)?0:e}}function Vc(e){if("string"!=typeof e)return e;var t=Number(e);if(isNaN(t))return e;var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;e=Cesium.Color.fromCssColorString("#"+i);return null!=e&&(t=e.red,e.red=e.blue,e.blue=t),e}function Fc(e){if(null!=e){var t=parseInt(e);if(null!=e.alpha||isNaN(t))return e;t<0&&(t&=16777215);var i=t.toString(16);if(i.length<6&&null!=i)for(var o=i.length;o<6;)i="0"+i,o++;var e=(e="#"+i).substring(0,7),t=Cesium.Color.fromCssColorString(e);return null!=t&&(e=t.red,t.red=t.blue,t.blue=e),t}}function Hc(e){return isNaN(e)?e:parseFloat(e)}function Gc(e,i){var t,o=[];return $.each(e.attributeNames,function(e,t){o.push(Hc(i[t]))}),1===o.length?t=e.func(o[0]):2===e.attributeNames.length?t=e.func(o[0],o[1]):3===e.attributeNames.length?t=e.func(o[0],o[1],o[2]):4===e.attributeNames.length&&(t=e.func(o[0],o[1],o[2],o[3])),t}function kc(e,t,i){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),i)}hc.prototype.initialize=function(e){bc||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),bc=!0)},hc.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},hc.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},hc.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)},hc.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},hc.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);if(e._distance=o,t.fog.enabled&&1<=Cesium.Math.fog(o,t.fog.density))return Cesium.Visibility.NONE;o=e.data;if(o.tileBoundingRegion,void 0===o.boundingVolumeSourceTile)return Cesium.Visibility.PARTIAL;var r=t.cullingVolume,n=o.orientedBoundingBox;!n&&o.renderedMesh&&(n=o.renderedMesh.boundingSphere3D),o.clippedByBoundaries=!1;a=e.rectangle,(s=this.cartographicLimitRectangle).west<s.east||(s=Rectangle.clone(s,splitCartographicLimitRectangleScratch),0<Rectangle.center(a,rectangleCenterScratch).longitude?s.east=CesiumMath.PI:s.west=-CesiumMath.PI);var a=s,s=new Cesium.Rectangle,a=Cesium.Rectangle.simpleIntersection(a,e.rectangle,s);if(!a)return Visibility.NONE;if(Cesium.Rectangle.equals(a,e.rectangle)||(o.clippedByBoundaries=!0),t.mode,Cesium.SceneMode.SCENE3D,!n)return Cesium.Intersect.INTERSECTING;s=this._clippingPlanes;if(s&&s.enabled){a=s.computeIntersectionWithBoundingVolume(n);if(e.isClipped=a!==Intersect.INSIDE,a===Cesium.Intersect.OUTSIDE)return Cesium.Visibility.NONE}s=r.computeVisibility(n);return s!==Cesium.Intersect.OUTSIDE&&(e=t.mode===Cesium.SceneMode.SCENE3D&&t.camera.frustum instanceof Cesium.OrthographicFrustum,t.mode!==Cesium.SceneMode.SCENE3D||e||!i||!(a=o.occludeePointInScaledSpace)||i.ellipsoid.isScaledSpacePointVisible(a))?s:Cesium.Visibility.NONE},hc.prototype.canRefine=function(e,t,i){return e.level<16},hc.prototype.showTileThisFrame=function(e,t,i,o){e.data.geometryPrimitive&&e.data.geometryPrimitive.update(t,i,o)},hc.prototype.computeDistanceToTile=function(e,t){s=e,this.terrainProvider,void 0===(r=void 0===(r=s.data)?s.data=new Cesium.GlobeSurfaceTile:r).tileBoundingRegion&&(r.tileBoundingRegion=new Cesium.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:s.rectangle,ellipsoid:s.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var i,o,r=e.data,n=r.tileBoundingRegion;if(void 0===s)return 9999999999;r.boundingVolumeSourceTile!==s&&(r.boundingVolumeSourceTile=s,(s=e.rectangle)&&s.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(r.orientedBoundingBox=Cesium.OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=(s=this,u=r.orientedBoundingBox.center,l=e.rectangle,c=n.maximumHeight,i=r.occludeePointInScaledSpace,a=(s=s.quadtree._occluders.ellipsoid).ellipsoid,o=[new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3,new Cesium.Cartesian3],Cesium.Cartesian3.fromRadians(l.west,l.south,c,a,o[0]),Cesium.Cartesian3.fromRadians(l.east,l.south,c,a,o[1]),Cesium.Cartesian3.fromRadians(l.west,l.north,c,a,o[2]),Cesium.Cartesian3.fromRadians(l.east,l.north,c,a,o[3]),s.computeHorizonCullingPoint(u,o,i))));var a,s,l=n.minimumHeight,c=n.maximumHeight,u=(r.boundingVolumeSourceTile!==e&&(a=t.camera.positionCartographic.height,s=Math.abs(a-l),Math.abs(a-c)<s?(n.minimumHeight=l,n.maximumHeight=l):(n.minimumHeight=c,n.maximumHeight=c)),n.distanceToCamera(t));return n.minimumHeight=l,n.maximumHeight=c,u},hc.prototype.isDestroyed=function(){return!1},hc.prototype.destroy=function(){return Cesium.destroyObject(this)},hc.prototype.remove=function(){this.destroy()},hc.prototype.getInstance=function(e){var t;return 0==Cesium.defined(e.TileManager)&&(t=new hc,(e.TileManager=t).viewer=e,t=new Cesium.QuadtreePrimitive({tileProvider:e.TileManager,maximumScreenSpaceError:2}),e.scene.primitives.add(t)),e.TileManager},Tc.sql2ast=function(r,e){function n(e,t){return t}null==e&&(e=!0);var t="###semi-colon###",i=(r=(r=(r=(r=r.replace(/[("'`].*;.*[)"'`]/g,function(e){return e.replace(/;/g,t)})).replace(/;/g,"###EOR###")).split("###EOR###")[0]).replace(new RegExp(t,"g"),";"),["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"]),o=i.map(function(e){return e+" "}),a=(o=(o=o.concat(i.map(function(e){return e+"("}))).concat(o.map(function(e){return e.toLowerCase()}))).map(function(e){return e.replace("(","[\\(]")}),s=(r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(a.join("|"),"gi"),Pc)}),[]),l=(o.forEach(function(e){var t,i,o=0;do{}while(-1!=(i=r.indexOf(e,o))&&(t=e.replace(/^((\w|\s)+?)\s?\(?$/i,n),o=i+(s[i]=t).length),-1!=i)}),0),c=(s.forEach(function(e,t){t<l?delete s[t]:(l=parseInt(t,10)+e.length,"JOIN"==e&&(s[t]="INNER JOIN"))}),a.slice(0)),u=(c=(c=c.map(Pc)).join("|"),r.split(new RegExp(a.join("|"),"i"))),h=(r=r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(c,"gi"),xc)}),u=u.map(function(e){return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(e){return e.replace(new RegExp(c,"gi"),xc)})}),[]),m=(h.SELECT=function(e){return Ec(",",e).filter(function(e){return""!==e}).map(function(e){return{name:e}})},h.SET=function(e){return Ec(",",e).filter(function(e){return""!==e}).map(function(e){return{expression:e}})},h.FROM=h["DELETE FROM"]=h.UPDATE=function(e){var i=e.split(",");return(i=i.map(Sc)).forEach(function(e,t){""===e&&i.splice(t)}),i=i.map(function(e){var e=e.split(" AS "),t=e[1]||"";return 0===t.indexOf('"')&&t.lastIndexOf('"')==t.length-1&&(t=t.substring(1,t.length-1)),{table:e[0],as:t}})},h["LEFT JOIN"]=h.JOIN=h["INNER JOIN"]=h["RIGHT JOIN"]=function(e){var t=(e=e.split(" ON "))[0].split(" AS "),i={};return i.table=Sc(t[0]),i.as=Sc(t[1])||"",i.cond=Sc(e[1]),i},h.WHERE=Sc,h["ORDER BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;null!==(i=i.exec(e))&&((e={}).column=Sc(i[1]),e.order=Sc(i[2]),void 0===i[2]&&(e.order="ASC"),o.push(e))}),o},h["GROUP BY"]=function(e){e=e.split(",");var o=[];return e.forEach(function(e,t){var i=/([A-Za-z0-9_\.]+)/gi;null!==(i=i.exec(e))&&((e={}).column=Sc(i[1]),o.push(e))}),o},h.LIMIT=function(e){var t=/((\d+)\s*,\s*)?(\d+)/gi,e=(void 0===(t=t.exec(e))[2]&&(t[2]=0),{});return e.nb=parseInt(Sc(t[3]),10),e.from=parseInt(Sc(t[2]),10),e},h["INSERT INTO"]=function(e){var t=(t=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e),e={};return e.table=Sc(t[1]),void 0!==t[3]&&(e.columns=t[3].split(","),e.columns=e.columns.map(Sc)),e},h.VALUES=function(e){var e=Ec(",",e="("!=(e=Sc(e))[0]?"("+e:e),t=[];return e.forEach(function(e){e=Ec(",",e=e.replace(/^\(/g,"").replace(/\)$/g,"")),t.push(e)}),t},{}),d=0;return s.forEach(function(e,t){var i,o;e=e.toUpperCase(),d++,void 0!==h[e]?(i=h[e](u[d]),void 0!==m[e]?("string"!=typeof m[e]&&void 0!==m[e][0]||(o=m[e],m[e]=[],m[e].push(o)),m[e].push(i)):m[e]=i):console.log("Can't analyze statement \""+e+'"')}),void 0!==m["LEFT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["LEFT JOIN"][0]?m["LEFT JOIN"].forEach(function(e){e.type="left",m.JOIN.push(e)}):(m["LEFT JOIN"].type="left",m.JOIN.push(m["LEFT JOIN"])),delete m["LEFT JOIN"]),void 0!==m["INNER JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["INNER JOIN"][0]?m["INNER JOIN"].forEach(function(e){e.type="inner",m.JOIN.push(e)}):(m["INNER JOIN"].type="inner",m.JOIN.push(m["INNER JOIN"])),delete m["INNER JOIN"]),void 0!==m["RIGHT JOIN"]&&(void 0===m.JOIN&&(m.JOIN=[]),void 0!==m["RIGHT JOIN"][0]?m["RIGHT JOIN"].forEach(function(e){e.type="right",m.JOIN.push(e)}):(m["RIGHT JOIN"].type="right",m.JOIN.push(m["RIGHT JOIN"])),delete m["RIGHT JOIN"]),e&&("string"==typeof m.WHERE&&(m.WHERE=Ic.parse(m.WHERE)),void 0!==m.JOIN&&m.JOIN.forEach(function(e,t){m.JOIN[t].cond=Ic.parse(e.cond)})),m},Dc.prototype={constructor:Dc,readNextChar:function(){"string"!=typeof this.source?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.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}}},Dc.tokenize=function(e){var t=new Dc(e),i=[];do{var o=t.readNextToken()}while("empty"!=o.type&&i.push(o),t.currentChar);return i},Ic.prototype={constructor:Ic,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}},Ic.parse=function(e){return new Ic(e).parseExpressionsRecursively()},Tc.ast2sql=function(e){function t(e){return void 0!==e.WHERE?" WHERE "+Ac(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 "+Ac(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<parseInt(a.LIMIT.nb,10)?(r=" LIMIT ",void 0!==a.LIMIT.from&&1<parseInt(a.LIMIT.from,10)&&(r+=a.LIMIT.from+","),r+a.LIMIT.nb):""):void 0!==e["INSERT INTO"]?(void 0!==(r=e)["INSERT INTO"]?(a="INSERT INTO "+r["INSERT INTO"].table,void 0!==r["INSERT INTO"].columns?(a+=" (")+r["INSERT INTO"].columns.join(", ")+")":a):"")+(void 0!==(o=e).VALUES?" VALUES "+o.VALUES.map(function(e){return"("+e.join(", ")+")"}).join(", "):""):void 0!==e.UPDATE?(void 0!==(o=e).UPDATE?"UPDATE "+o.UPDATE.map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+(void 0!==(i=e).SET?" SET "+i.SET.map(function(e){return e.expression}).join(", "):"")+t(e):void 0!==e["DELETE FROM"]?(void 0!==(i=e)["DELETE FROM"]?"DELETE FROM "+i["DELETE FROM"].map(function(e){var t=e.table;return""!==e.as&&(t+=" AS "+e.as),t}).join(", "):"")+t(e):null},Tc.trim=Sc,Tc.protect=Pc,Tc.unprotect=xc,Tc.protect_split=Ec,Tc.CondLexer=Dc,Tc.CondParser=Ic;var Nc,jc=function(e){for(var t=[],i=0;i<e.length;i++)for(var o=0;o<e[i].positions.length;o+=3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o+0],e[i].positions[o+1],0));return t},Uc=function(e,t,i,o){for(var r=0,n=0;n<e.length;n++)for(var a=o?zc:i(e[n]),s=2;s<e[n].positions.length;s+=3){null==t[r].height&&(t[r].height=0),null==e[n].absoluteHeightPositions&&(e[n].absoluteHeightPositions=[]),e[n].absoluteHeightPositions[s-2]=e[n].positions[s-2],e[n].absoluteHeightPositions[s-1]=e[n].positions[s-1],e[n].absoluteHeightPositions[+s]=e[n].positions[+s];var l=o?0:e[n].positions[s];e[n].absoluteHeightPositions[s]=l+t[r].height+a,r++}},zc=1,Wc=(Object.defineProperties(Mc.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}}}),Mc.prototype.clonePartOfMultiFeature=function(e,t){var i=e.geometryType.includes("multi")?e.fid+"."+t:e.fid;return{positions:e.positions[t],attributes:e.attributes,fid:i,geometryType:e.geometryType}},Mc.prototype.createPrimitiveFromWFSFeatures=function(e){new Cesium.PrimitiveCollection;for(var t=[],i=[],o=[],r=e.features.numPositions=0;r<e.features.length;r++){var n=e.features[r];switch(this.sanitizePositions(n.positions),e.features.numPositions+=n.positions.length,n.geometryType){case"polygon":t.push(n);break;case"multipolygon":for(var a=n.positions.length,s=0;s<a;s++)t.push(this.clonePartOfMultiFeature(n,s));break;case"linestring":i.push(n);break;case"multilinestring":for(a=n.positions.length,s=0;s<a;s++)i.push(this.clonePartOfMultiFeature(n,s));break;case"point":o.push(n);break;case"multipoint":for(a=n.positions.length,s=0;s<a;s++)o.push(this.clonePartOfMultiFeature(n,s))}}0<t.length?(e.features=t,this.createPolygonPrimitive(e)):0<i.length?(e.features=i,this.createLinestringPrimitive(e)):0<o.length&&(e.features=o,this.createPointPrimitive(e))},Mc.prototype.createPolygonPrimitive=function(g){function f(t){if(t.isQuery)t.onFinishedQuery(e);else{var o="",e=[],r=[],n=[],a=[],s=[],l=b.style.polygon,c=l.clampToGround||!l.perPositionHeight&&!l.extrudedHeight&&!l.height;let i;l.text&&(i=new Cesium.LabelCollection);for(var u,h,m,d=0;d<t.features.length;d++){var p=t.features[d];if(Oc(t,p.fid)){var g,f=p.absoluteHeightPositions||p.positions,_=b.createPolygonOptions(f,p.attributes),f=b.createCommonOptions(p.attributes),C=Cesium.BoundingSphere.fromPoints(_.hierarchy.positions);if(p.absoluteHeightPositions&&delete p.absoluteHeightPositions,e.push(C),!t.isQuery){let e;if(_.randomColor&&(e=Cesium.Color.fromRandom()),_.outline&&!c?(g=b.createPolygonGeometryHelper("outline",p,_.outlineColor,_),n.push(g)):_.outline&&n.push(new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:_.hierarchy.positions,width:_.outlineWidth})})),_.text){var y=b._core.getCenterOfMass(_.hierarchy.positions);let t=b.createPointOptions(y,p.attributes);if(c||null!=b.style.pointHeight||!_.extrudedHeight&&!_.height||(t.position=Cesium.Cartesian3.fromDegrees(y[0],y[1],_.extrudedHeight?(_.height||0)+_.extrudedHeight:_.height)),(_.labelNear||_.labelFar)&&(t.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(_.labelNear||0,_.labelFar||1/0)),_.offsetPoint&&_.offsetPoint[t.label.text]){let e=b._core.toDegrees(t.position);b._core.getCenterOfMass(_.hierarchy.positions);y=_.offsetPoint[t.label.text];y[0]&&(e.lon=y[0]),y[1]&&(e.lat=y[1]),void 0!==y[2]&&(e.height=y[2]),t.position=Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)}let e=i.add({id:p,position:t.position,...t.label});delete e.id.positions,e.id.boundingSphere=C}if(_.colorConfig){let e;for(var v in _.colorConfig){for(var w in _.colorConfig[v])if(p.attributes[v]==w){e=_.colorConfig[v][w];break}if(e)break;_.colorConfig[v]["#"]&&(e=_.colorConfig[v]["#"])}e&&(_.material=Cesium.Color.fromCssColorString(e))}_.fill&&0<_.material.alpha&&(g=b.createPolygonGeometryHelper("fill",p,e||_.material,_),r.push(g)),t.parentLayer.addRenderedFeatureId(p.fid),o+=p.fid+";",a.push(p.fid),s.push(f.tooltip)}}}""!=o&&(l=new Cesium.PrimitiveCollection,h=new Cesium.PerInstanceColorAppearance({flat:0==_.material.alpha,translucent:_.material.alpha<1}),i&&l.add(i),0<r.length&&(_.water&&(u={color:_.water.color||"rgba(135,206,235,0.6)",image:_.water.image||window.SmartEarthRootUrl+I.water,frequency:_.water.frequency||1e3,speed:_.water.speed||10,amplitude:_.water.amplitude||10},m=Cesium.Color.fromCssColorString(u.color),h=new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:m,blendColor:m,normalMap:u.image,frequency:u.frequency,animationSpeed:u.speed/1e3,amplitude:u.amplitude}}})})),((m=c?new Cesium.GroundPrimitive({geometryInstances:r,appearance:h,classificationType:_.classificationType}):new Cesium.Primitive({geometryInstances:r,appearance:h}))._parentCollection=l).add(m)),0<n.length&&(_.clampToGround?l.add(new Cesium.GroundPolylinePrimitive({geometryInstances:n,appearance:new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:_.outlineColor}}})})})):((m=new Cesium.Primitive({geometryInstances:n,appearance:h}))._parentCollection=l).add(m)),l.ID="polygons:"+Lc(o),l._instanceIds=a,l._tooltips=s,t.onFinishedCreatePrimitive(l,e))}}var e,b=this;3==this.style.altitudeMethod?(g.features=Rc(g.features,Bc(b)),f(g)):(e=function(e){for(var t=[],i=e.length,o=0;o<i;o++)for(var r=e[o],n=r.positions.length,a=0;a<n;a++)for(var s=r.positions[a],l=0;l<s.length;l+=3)t.push(Cesium.Cartographic.fromDegrees(s[l+0],s[l+1],0));return t}(g.features),e=Cesium.sampleRenderedData(e,Cesium.SampleRenderedDataFlags.TERRAIN|Cesium.SampleRenderedDataFlags.FLOOR),Cesium.when(e,function(e){for(var t=2==b._style.altitudeMethod,i=g.features,o=e,r=Bc(b),n=t,a=0,s=0;s<i.length;s++){var l=i[s],c=n?zc:r(l);null==l.absoluteHeightPositions&&(l.absoluteHeightPositions=[]);for(var u=0;u<l.positions.length;u++)for(var h=l.positions[u],m=l.absoluteHeightPositions[u]=[],d=2;d<h.length;d+=3){var p=n?0:h[d];null==o[a].height&&(o[a].height=0),m[d-2]=h[d-2],m[d-1]=h[d-1],m[+d]=h[+d],m[d]=p+o[a].height+c,a++}}f(g)}))},Mc.prototype.createPolygonGeometryHelper=function(e,t,i,o){var r=o.hierarchy,n=o.perPositionHeight,a=o.extrudedHeight,s=o.height,l=o.water,c=null!=a||void 0!==s?Cesium.PerInstanceColorAppearance.VERTEX_FORMAT:Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT;l&&(c=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT),void 0!==a&&void 0!==s&&(a+=s);let u;return l=o.bulidingWall?new(u="fill"===e?Cesium.CorridorGeometry:Cesium.CorridorOutlineGeometry)({positions:r.positions,width:o.bulidingWallWidth||.8,vertexFormat:c,extrudedHeight:a,height:s,cornerType:Cesium.CornerType.MITERED}):new(u="fill"===e?Cesium.PolygonGeometry:Cesium.PolygonOutlineGeometry)({polygonHierarchy:r,vertexFormat:c,perPositionHeight:void 0!==s?void 0:n,extrudedHeight:a,height:s}),new Cesium.GeometryInstance({geometry:l,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(i)}})},Mc.prototype.createLinestringPrimitive=function(e){var t=this,o=(t&&t.style&&void 0!==t.style.height&&(e.features=Rc(e.features,Bc(t))),e);if(o.isQuery)o.onFinishedQuery(a);else{var r,n="",a=[],s=[],l=[];let i=new Cesium.PrimitiveCollection;for(var c=0;c<o.features.length;c++){var u=o.features[c];if(Oc(o,u.fid)){var h=u.absoluteHeightPositions||u.positions,h=t.createLinestringOptions(h,u.attributes),m=t.createCommonOptions(u.attributes);if(h.vertexFormat=(r?Cesium.PerInstanceColorAppearance:Cesium.PolylineColorAppearance).VERTEX_FORMAT,u.absoluteHeightPositions&&delete u.absoluteHeightPositions,a.push(Cesium.BoundingSphere.fromPoints(h.positions)),!o.isQuery){d=h.clampToGround?new Cesium.GroundPolylineGeometry({positions:h.positions,width:h.width}):new Cesium.PolylineGeometry(h);var d=new Cesium.GeometryInstance({id:u,geometry:d,attributes:{color:new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}});o.parentLayer.addRenderedFeatureId(u.fid),n+=u.fid+";",s.push(u.fid),l.push(m.tooltip);let e=null,t;t=h.dash?new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType(Cesium.Material.PolylineDashType,{color:h.material,gapColor:h.gapColor||Cesium.Color.TRANSPARENT,dashLength:h.dashLength||20})}):new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"PolylineOutline",uniforms:{color:h.material,outlineColor:h.outlineColor||h.material,outlineWidth:h.outlineWidth||0}}})}),e=h.clampToGround?new Cesium.GroundPolylinePrimitive({geometryInstances:d,appearance:t,classificationType:h.classificationType}):new Cesium.Primitive({geometryInstances:d,appearance:t}),i.add(e)}}}""!=n&&((e=i).ID="polylines:"+Lc(n),e._instanceIds&&0===e._instanceIds.length&&(e._instanceIds=s),e._tooltips=l,o.onFinishedCreatePrimitive(e,a))}},Mc.prototype.createPointPrimitive=function(i){function o(e){if(e.isQuery)e.onFinishedQuery(n);else{for(var t,i,o="",r=[],n=[],a=[],s=new Cesium.LabelCollection({scene:v.viewer.scene}),l=new Cesium.PointPrimitiveCollection({scene:v.viewer.scene}),c=new Cesium.BillboardCollection({scene:v.viewer.scene}),u=new Cesium.PrimitiveCollection,h=new Cesium.PolylineCollection,m=0;m<e.features.length;m++){var d,p,f,_,C,y=e.features[m];Oc(e,y.fid)&&(d=y.absoluteHeightPositions||y.positions,d=v.createPointOptions(d,y.attributes),p=v.createCommonOptions(y.attributes),y.clampToGround=d.clampToGround,d.sgsPointPosition&&(y.sgsPointPosition=d.sgsPointPosition,delete d.sgsPointPosition),y.absoluteHeightPositions&&delete y.absoluteHeightPositions,n.push(Cesium.BoundingSphere.fromPoints([d.position])),e.isQuery||(d.label&&(d.label.position=d.position,d.label.id=y,v.setEyeOffset(d.label),null!=d.label.imageFile&&(d.label.image=v.applyConditionalClassification(d.label.imageFile,y.attributes),d.label.label=d.label,c.add(d.label),v.setEyeOffset(d.label,-5)),null!=d.label.imageFile&&null!=d.label.showText&&d.label.showText&&(v.viewer.scene.onHoverShowTextArray[d.label.id]=!0),null!=d.label.isBold&&d.label.isBold?s.add(g):null!=d.label.isUnderline&&d.label.isUnderline?(_=null!=d.label.text.match(/[iljf1]/g)?d.label.text.match(/[iljf1]/g):[],f=d.label.text.length,f=Array(Math.ceil(f-.5*_.length)).join("_"),_=$.extend({},d.label),null!=d.label.image&&delete d.label.image,_.position=d.label.position,_.id=d.label.id,_.text=f,_.alignment=null!=d.label.alignment?d.label.alignment:void 0,_.underline=!0,_.textRelativeToImage=null!=d.label.textRelativeToImage?d.label.textRelativeToImage:void 0,-1<d.label.font.indexOf("pt")?Number(d.label.font.split("pt")[0]):-1<d.label.font.indexOf("px")&&Number(d.label.font.split("px")[0]),_.pixelOffset=new Cesium.Cartesian2(0,-45),s.add(_)):s.add(d.label)),d.billboard&&(d.billboard.position=d.position,d.billboard.id=y,v.setEyeOffset(d.billboard),c.add(d.billboard)),d.model&&(d.model.url=d.model.uri,d.model.id=y,u.add(Cesium.Model.fromGltf(d.model))),d.point&&(d.point.position=d.position,d.point.id=y,v.setEyeOffset(d.point),l.add(d.point)),0!=d.lineToGround&&(f=Cesium.Cartographic.fromCartesian(d.position),_=Cesium.Cartesian3.fromRadians(f.longitude,f.latitude,0),2==d.lineToGround&&(C=d.lineToGroundLength/Cesium.Cartesian3.distance(d.position,_),Cesium.Cartesian3.lerp(d.position,_,C,_)),h.add({show:!0,width:1,positions:[d.position,_],material:Cesium.Material.fromType("Color",{color:d.lineToGroundColor})})),e.parentLayer.addRenderedFeatureId(y.fid),o+=y.fid+";",r.push(y.fid),a.push(p.tooltip)))}""!=o&&(i=new Cesium.PrimitiveCollection,0<s.length&&($.each(s._labels,function(e,t){t._type="Label"}),(s._billboardCollection._parentCollection=i).add(s),t="labels"),0<c.length&&($.each(c._billboards,function(e,t){t._type="Billboard"}),(c._parentCollection=i).add(c),t="billboards"),0<u.length&&($.each(u._primitives,function(e,t){t._type="Model",t._parentCollection=i}),i.add(u),t="models"),0<l.length&&($.each(l._pointPrimitives,function(e,t){t._type="Point"}),(l._parentCollection=i).add(l),t="points"),0<h.length&&($.each(h._polylines,function(e,t){t._type="L2G"}),(h._parentCollection=i).add(h),t="L2G"),i.ID=t+":"+Lc(o),i._instanceIds=r,i._tooltips=a,e.onFinishedCreatePrimitive(i,n))}}var e,v=this;3==this.style.altitudeMethod?(i.features=Rc(i.features,Bc(v)),o(i)):(e=jc(i.features),e=Cesium.sampleRenderedData(e),Cesium.when(e,function(e){var t=2==v._style.altitudeMethod;Uc(i.features,e,Bc(v),t),o(i)}).otherwise(function(e){}))},Mc.prototype.createCommonOptions=function(e){var t={};return t.tooltip=this.applyConditionalClassification(this.style.tooltip,e),t},Mc.prototype.createPolygonOptions=function(e,t){var i=this.getPolygonStyle(this.style);i.preLoad&&i.preLoad(i.polygon,t),i.polygon.hierarchy={positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[0]),holes:[]};for(var o=1;o<e.length;o++)i.polygon.hierarchy.holes.push({positions:Cesium.Cartesian3.fromDegreesArrayHeights(e[o])});var r,n=this.applyConditionalClassification(i.polygon.material,t);return i.polygon.material=Vc(n),null!=i.polygon.fill&&null!=i.polygon.fromKml&&(1<(r=this.applyConditionalClassification(i.polygon.fill,t))&&(r/=100),i.polygon.material=new Cesium.Color(i.polygon.material.red,i.polygon.material.green,i.polygon.material.blue,r)),i.polygon.height&&(i.polygon.height=Number(this.getValueFromProp(i.polygon.height,t))),i.polygon.extrudedHeight&&i.polygon.extrudedHeight&&i.polygon.extrudedHeight.indexOf&&-1<i.polygon.extrudedHeight.indexOf("[")&&-1<i.polygon.extrudedHeight.defaultValue.indexOf("]")&&(n=t[i.polygon.extrudedHeight.defaultValue.substring(1,i.polygon.extrudedHeight.defaultValue.length-1)],void 0!==(n=parseInt(n))&&(i.polygon.extrudedHeight=3*n)),i.polygon.extrudedHeight&&(i.polygon.extrudedHeight=Number(i.polygon.extrudedHeight)),t.FSCALE&&(r=this.getLevelDistance(t.FSCALE),i.polygon.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,r)),n=this.applyConditionalClassification(i.polygon.outlineColor,t),i.polygon.outlineColor=Vc(n),i.polygon},Mc.prototype.translateLineWidth=function(e,t){t=this.applyConditionalClassification(e.polyline.width,t);return 0<t?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?1<t&&(e.polyline.widthInMeters=!0,t*=.8,0<e.polyline.backgroundOpacity&&(t*=.8)):t=1<t?2:1:t<0?t=Math.min(5,Math.abs(t)):0==t&&(t=1),t},Mc.prototype.createLinestringOptions=function(e,t){var i=this.getLinestringStyle(this.style),e=(i.preLoad&&i.preLoad(i.polyline,t),i.id=t,i.polyline.positions=Cesium.Cartesian3.fromDegreesArrayHeights(e),this.applyConditionalClassification(i.polyline.material,t));return i.polyline.material=Vc(e),i.polyline.far&&(i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(void 0!==i.polyline.near?i.polyline.near:0,i.polyline.far)),t.FSCALE&&(e=this.getLevelDistance(t.FSCALE),i.polyline.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,e)),i.polyline.width=this.applyConditionalClassification(i.polyline.width,t),i.polyline},Mc.prototype.getValueFromProp=function(e,i){let o=e&&e.defaultValue?e.defaultValue:e;if(o&&o.indexOf)if(-1<o.indexOf("[")&&-1<o.indexOf("]"))o=o.replace("[","").replace("]",""),o=this.getPropValue(i,o);else if(-1<o.indexOf("{")&&-1<o.indexOf("}")){let e=o.match(/\{[^\}]+\}/g);e.forEach(e=>{var t=this.getPropValue(i,e.substring(1,e.length-1));o=o.replace(e,t)}),o=o.replaceAll("\\n","\n")}return o},Mc.prototype.getPropValue=function(e,t){return e[t]||(t.includes(":")?e[t.split(":")[1]]:void 0)},Mc.prototype.applyConditionalClassification=function(e,i){if(null!=e){if(null==e.defaultValue)return e;var o,r=Hc(e.defaultValue);if(void 0===e.classificationArray){if(!isNaN(r))return r;if(r instanceof Cesium.Color)return r}if(void 0!==e.attributeName){var t="["+e.attributeName+"]";if(r===t)r=i[e.attributeName];else if(e.multipleAttributeReplacementNeeded)for(name in i)r=kc(r,"["+name+"]",i[name]);else r=kc(r,t,i[e.attributeName])}else void 0!==e.classification?r=Gc(e.classification,i):void 0!==(o=e.classificationArray)&&$(Object.keys(o)).each(function(e,t){t=function(e,t){var i;if(void 0!==e&&0!==e.condition.length)return void 0===e.func||!(i=void 0)===Gc(e,t)?Hc(e.value):i}(o[t],i);t&&(r=t)});return r}},Mc.prototype.createLineToGroundOptions=function(e,t){var i=this.applyConditionalClassification(e.lineToGround,t);null!=i&&0!=Number(i)?(e.lineToGround=i,i=Fc(i=this.applyConditionalClassification(e.lineToGroundColor,t)),e.lineToGroundColor=i,"string"==typeof(i=this.applyConditionalClassification(e.lineToGroundLength,t))&&-1<i.indexOf("[")&&-1<i.indexOf("]")&&(i=t[i.substring(1,i.length-1)]||0),e.lineToGroundLength=Number(i)):(e.lineToGround=0,e.lineToGroundColor=0,e.lineToGroundLength=0)},Mc.prototype.createPointOptions=function(e,t){var i,o,r,n,a,s=this.getPointStyle(this.style);return s.pointHeight?(o=s.pointHeight,o=this.getValueFromProp(o,t)||0,s.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],o),e[2]=o):s.position=Array.isArray(e)?Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]):e,s.sgsPointPosition=e,s.id=t,s.label&&(s.label.text=this.getValueFromProp(s.label.text,t),s.label.text=this.o(s.label.text)?this.s(s.label.text):s.label.text,-1<s.label.text.indexOf("[")&&-1<s.label.text.indexOf("]")&&(s.label.text=""),null!=s.label.family&&(o=this.applyConditionalClassification(s.label.family,t),e=this.applyConditionalClassification(s.label.font,t),s.label.font=0<=e?(3*e/4).toString()+"pt "+o:(3*(-1*(72*e/96))/4).toString()+"pt "+o),s.label.fillColor=Fc(this.applyConditionalClassification(s.label.fillColor,t)),s.label.backgroundColor=Fc(this.applyConditionalClassification(s.label.backgroundColor,t)),null==s.label.backgroundColor&&(s.label.backgroundColor=new Cesium.Color(.165,.165,.165,0)),s.label.showBackground=!0,null!=s.label.showText&&((a=this.applyConditionalClassification(s.label.showText,t))&&1===Number(a)&&(s.label.onHoverShowText=!0),a&&null==viewer.scene.canvas.onHoverShowText&&(i=viewer.scene,new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function(e){var t={};i.screenToWorld(e.endPosition,t),Cesium.defined(t.pickPrimitive)&&"Billboard"==t.pickPrimitive.constructor.name&&null!=t.pickPrimitive.label?null!=i.onHoverShowTextArray[t.pickPrimitive.label.id]&&(null!=i._lastObjectShowOnText&&i._lastObjectShowOnText.id!=t.pickPrimitive.label.id&&null!=i._lastObjectShowOnText.show&&(i._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=i.onHoverShowTextArray[t.pickPrimitive.label.id],null!=i._lastObjectShowOnText.show&&(viewer.scene._lastObjectShowOnText.show=!0)):null!=i._lastObjectShowOnText&&null!=i._lastObjectShowOnText.show&&(i._lastObjectShowOnText.show=!1)},Cesium.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0)),null!=s.label.textRelativeToImage&&null!=s.label.textAlignment&&(s.label.textRelativeToImage=this.applyConditionalClassification(s.label.textRelativeToImage,t),s.label.alignment=this.applyConditionalClassification(s.label.textAlignment,t)),null!=s.label.underline&&(s.label.isUnderline=this.applyConditionalClassification(s.label.underline,t)),null!=s.label.bold&&1==this.applyConditionalClassification(s.label.bold,t)&&(s.label.font="bold "+s.label.font),null!=s.label.italic&&1==this.applyConditionalClassification(s.label.italic,t)&&(s.label.font="italic "+s.label.font),null!=s.label.backgroundOpacity&&(s.label.backgroundColor.alpha=this.applyConditionalClassification(s.label.backgroundOpacity,t)),null!=s.label.minViewingHeight&&(r=this.applyConditionalClassification(s.label.minViewingHeight,t),n=650*this.applyConditionalClassification(s.label.scaleMPP,t),s.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(r,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),s.label.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),s.label.disableDepthTestDistance||(s.label.disableDepthTestDistance=1e3),s.clampToGround&&(s.label.heightReference=1)),s.billboard&&(s.billboard.sizeInMeters=!1,null!=s.billboard.imageColor&&(e=Fc(e=this.applyConditionalClassification(s.billboard.imageColor,t)),s.billboard.color=e),null!=s.billboard.imageOpacity&&null!=s.billboard.color.alpha&&(s.billboard.color.alpha=Number(this.applyConditionalClassification(s.billboard.imageOpacity,t))),s.billboard.image=this.applyConditionalClassification(s.billboard.image,t),null!=s.billboard.minViewingHeight&&(r=this.applyConditionalClassification(s.billboard.minViewingHeight,t),n=650*this.applyConditionalClassification(s.billboard.scaleMPP,t),s.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(r,n)),t.FSCALE&&(a=this.getLevelDistance(t.FSCALE),s.billboard.distanceDisplayCondition=new Cesium.DistanceDisplayCondition(1,a)),s.billboard.link&&s.id&&"object"==typeof s.id&&(s.id.link=this.applyConditionalClassification(s.billboard.link,t)),s.billboard.disableDepthTestDistance||(s.billboard.disableDepthTestDistance=1e3),s.clampToGround&&(s.billboard.heightReference=1)),s.model&&(o=function(e){e=Number(e);return e=Cesium.defined(e)&&!isNaN(e)?e:0},s.model.uri=this.applyClassification(s.model.uri,t),s.model.scale=o(this.applyClassification(s.model.scale,t)),e=o(this.applyClassification(s.model.heading,t)),r=o(this.applyClassification(s.model.pitch,t)),n=o(this.applyClassification(s.model.roll,t)),a=new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e),Cesium.Math.toRadians(r),Cesium.Math.toRadians(n)),s.model.modelMatrix=Cesium.Transforms.headingPitchRollToFixedFrame(s.position,a)),this.createLineToGroundOptions(s,t),s},Mc.prototype.s=function(e){return e.split("").reverse().join("")},Mc.prototype.getLevelDistance=function(e){var t=2e7;switch(parseInt(e)){case 2:t=10123e3;break;case 3:t=7123e3;break;case 4:t=6321e3;break;case 5:t=5522e3;break;case 6:t=3436e3;break;case 7:t=539e3;break;case 8:t=305e3;break;case 9:t=18e4;break;case 10:t=133e3;break;case 11:t=1e5;break;case 12:t=76500;break;case 13:t=58200;break;case 14:t=23500;break;case 15:t=9600;break;case 16:t=4e3;break;case 17:t=2e3;break;case 18:t=1700;break;case 19:t=1500;break;case 20:t=1e3;break;case 21:t=500;break;case 22:t=200;break;case 23:t=100}return t},Mc.prototype.o=function(e){return e&&new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0])},Mc.prototype.applyClassification=function(e,t){if("string"===$.type(e)){if(null!=/(\[([^\]]+)\])/g.exec(e))for(var i in t)e=kc(e,"["+i+"]",t[i]);for(var o=/(\<([^\>]+)\>)/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},Mc.prototype.getPolygonStyle=function(e){return $.extend(!0,{},Wc.DEFAULT_POLYGON_STYLE,e)},Mc.prototype.getLinestringStyle=function(e){return $.extend(!0,{},Wc.DEFAULT_POLYLINE_STYLE,e)},Mc.prototype.getPointStyle=function(e){return null!=e.label?$.extend(!0,{},Wc.DEFAULT_LABEL_STYLE,e):null!=e.billboard?$.extend(!0,{},Wc.DEFAULT_BILLBOARD_STYLE,e):null!=e.model?$.extend(!0,{},Wc.DEFAULT_MODEL_STYLE,e):null!=e.point?$.extend(!0,{},Wc.DEFAULT_POINT_STYLE,e):Wc.DEFAULT_POINT_STYLE},Mc.prototype.sanitizePositions=function(e){for(var t=0;t<e.length;t++)e[t]instanceof Array?this.sanitizePositions(e[t]):isNaN(e[t])&&(e[t]=0)},{});function J(e,t,i,o,r,n,a,s,l){var u=this;function h(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function c(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=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(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(o=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=o.z)}return e}function d(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=c(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function p(e){this.value=new Float32Array([e])}this._viewer=e,this._Viewer=e,u.G=65535,Nc=new hc,Xc=new de({workerPath:SmartEarthRootUrl+"Workers/featurefetcherworker.js"}),Cesium.sampleRenderedData||(Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),p.fromZBias=function(e){if(Cesium.defined(e))return new p(e);throw new DeveloperError("zbias is required.")},p.toValue=function(e,t){if(Cesium.defined(e))return Cesium.defined(t)?color.toBytes(t):new Float32Array(e);throw new DeveloperError("zbias is required.")},p.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},p.defaultBias=function(){return p.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.ZBiasGeometryInstanceAttribute=p,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(r,e){var t,i=2,o=4,n=8,a=(null==e&&(e=i|o),Cesium.when.defer()),s=[],l=(i<e?r.forEach(function(e){s.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):s=r,[]),c=(e&i&&l.push(h(u._Viewer.terrainProvider,r)),0<(e&n));return e&(o|n)&&l.push((i=s,Cesium.Check.defined("positions",i),t=Cesium.when.defer(),Cesium.when(m(i),function(e){t.resolve(e)}),t.promise)),Cesium.when.all(l).then(function(e){if(1<l.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||c)&&(i.height=o.height)}a.resolve(e[0])}),a.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(m(e),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(d(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}),r=r||{},this._level=o||{min:0,max:22},"number"==typeof this._level&&(this._level={min:o,max:22}),this._url=t,this._layerName=i,this._guid=Cesium.createGuid(),this._visible=!0,this._gmlParser=new uc(!0,null,null,!0);var g,o=!this._viewer.TileManager;this._tileManager=Nc.getInstance(e),this._tileManager.tileLevel[this._guid]={level:this._level,visible:this._visible},this._tileManager._loadTileEvent.addEventListener(J.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=n,this._showAttributesAsMessage=r.showAttributesAsMessage,delete r.showAttributesAsMessage,this._entityCreator=new Mc(r,e),this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=a,this.latLon=!0,this._addedFeatures=[],this.simpleSqlParser=Tc,this.myLayer=l,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},t=(g=this).cleanUrl(g._url).replace("{s}",g.sTag(g._layerName.length,g._layerName.length,g._level)),t=(t+=Kc(t))+("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+g._layerName),i=Cesium.TrustedServers.contains(Yc(g._url,g._subdomains)),$.ajax({dataType:"xml",xhrFields:{withCredentials:i},url:encodeURI(t),success:function(e){var i,o;o=g,Jc(e,"FeatureType","wfs").each(function(e,t){return Jc(t,"Name","wfs").text()!=o._layerName||(1===(t=Jc(t,"LatLongBoundingBox","wfs")).length&&(o._boundingBox=Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value),parseFloat(t[0].attributes.miny.value),parseFloat(t[0].attributes.maxx.value),parseFloat(t[0].attributes.maxy.value))),!1)}),i=g,$(e).find("FeatureType").each(function(e,t){return $(t).children("Name").text()!=i._layerName||(0!=(t=$(t).children("Operations")).length&&t.children().each(function(){i._operations[this.tagName.toLowerCase()]={}}),!1)})}}),Qc(this),void 0!==s&&this.setVisibility(s),o||this.refresh()}function Yc(e,t){t=-1!=e.indexOf("{s}")?null!=t&&0<t.length?e.replace("{s}",t[0]):console.error("Error - sTag with no subdomains."):e;return t}function Jc(e,t,i){var o=$(e).find(t);return 0<(o=0==o.length&&"wfs"===i.toLowerCase()?$(e).find("wfs\\:"+t+","+t):o).length?o:$([])}function Kc(e){return-1<e.indexOf("?")?"&":"?"}function Qc(i){i.featureColumnNames=null;var e=i.cleanUrl(i._url).replace("{s}",i.sTag(i._layerName.length,i._layerName.length,i._level)),t=(e=(e+=Kc(e))+("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+i._layerName),Cesium.TrustedServers.contains(Yc(i._url,i._subdomains)));$.ajax({dataType:"xml",xhrFields:{withCredentials:t},url:encodeURI(e),success:function(e){var o,t;o=i,e=e,t=$(e).find("[type^='gml:']"),o._geometryFieldName=$(t).attr("name"),o.geometryResponseData=e,o.wfsNamespace=function(e,t){let i=eval;if(null==e)return null;try{var o=(new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):"+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 qc(e){return null==e?void 0:e.parentLayer?e:e._parentCollection||(e.primitive&&e.primitive._parentCollection?e.primitive._parentCollection:void 0)}Object.defineProperties(Wc,{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 Xc,Zc=180/Math.PI;function $c(){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 eu(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=lu.indexOf(t=t),t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(lu[e]._parentCollection),lu[e]=t):lu.push(t),!1})}function tu(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function iu(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 ou(e,t){iu($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function ru(e,t){iu($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function nu(e,t){viewer.scene.primitives.remove(t)}function au(e,t){iu([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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",n="",$(e).each(function(){var e=this,t='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$(i).each(function(){t+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+e[this]+"</wfs:Value></wfs:Property>"}),t+='<ogc:Filter><ogc:FeatureId fid="'+e.originFid+'"/></ogc:Filter>',n+=t+="</wfs:Update>"}),r="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}",n),a="Failed to save changes to server",e=Yc(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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"),a=(n=(n=n.replace("{layer_name}",this._layerName)).replace("{REQUEST_MAX_FEATURES}",1e3),""),e=(""!=e.replace(/[ ]/g,"")&&(a=(a="<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>")+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="<ogc:"+o+("like"==t.operator.toLowerCase()?' wildCard="*" singleChar="*" escape="*"':"")+">";n+="<ogc:PropertyName>"+r+"</ogc:PropertyName>";var a=null==(r=(r=-1!=i.indexOf(t.right)?t.left:t.right).replace(/^'|'$$/g,"")).match(/^[%]|[%]$$/);return n=n+("<ogc:Literal>"+(r="like"==t.operator.toLowerCase()&&a?"%"+r+"%":r))+"</ogc:Literal></ogc:"+o+">"}a="and"==t.logic.toLowerCase()?"And":"Or",n="<ogc:"+a+">";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)+"</ogc:"+a+">"}(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+e).WHERE,o)+"</ogc:Filter>"),n=n.replace("{wfs_filter}",a),Yc(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(){var e,t;return this.featureColumnNames||(0==(e=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element")).length&&(e=$(this.geometryResponseData).find("sequence").find("element")),t=[],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<i;e++)t[e].data.wfsLayerData[this._guid]&&t[e].data.wfsLayerData[this._guid].freeResources(),this.loadTile(t[e]);e&&Qc(this)}},J.prototype.setVisibility=function(e){if(this._visible!=e)if(this._visible=e,0==(this._tileManager.tileLevel[this._guid].visible=e))for(var t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&o[i].data.wfsLayerData[this._guid].primitive&&(o[i].data.wfsLayerData[this._guid].primitive.show=!1);else for(var o,t=(o=this._tileManager.getAllTiles()).length,i=0;i<t;i++)o[i].data.wfsLayerData[this._guid]&&(o[i].data.wfsLayerData[this._guid].primitive?o[i].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(o[i]))},J.prototype.loadTile=function(e){var t=this;e.data.wfsLayerData[this._guid]={id:e.data.id,primitive:void 0,freeResources:function(){Cesium.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),Cesium.defined(this.features)&&(t.removeFeaturesFromLayer(this.features),this.features=void 0),Cesium.defined(this.primitive)&&(t._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&e.level>=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<t)for(var i=0;i<t;i++)e[i].data.wfsLayerData[this._guid]&&e[i].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(J.prototype.loadTile,this),Cesium.destroyObject(this)},J.prototype.sTag=function(e,t,i){return null==this._subdomains?"":(e=(e+t+i)%this._subdomains.length,this._subdomains[e])},J.prototype.cleanUrl=function(e){return-1!=e.indexOf("?")?e.split("?")[0]:e},J.prototype.beginLoadWFSData=function(t){if((null==this.latLon||this.latLon)&&(null==this.BoundingBox||0!=this.BoundingBox.width&&0!=this.BoundingBox.height||(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),void 0===this.BoundingBox||void 0!==Cesium.Rectangle.intersection(this.BoundingBox,t.rectangle))){var e=[Zc*t.rectangle.west,Zc*t.rectangle.south,Zc*t.rectangle.east,Zc*t.rectangle.north],i=this,o=this.cleanUrl(this._url).replace("{s}",this.sTag(t.x,t.y,t.level));o+=Kc(o);o+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+e.join(",");e=Cesium.TrustedServers.contains(Yc(this._url,this._subdomains));t.data.wfsLayerData[this._guid].xhr=$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(o),cache:!0,xhrFields:{withCredentials:e},success:function(e){i.processWFSData(t,e,"GML2")},error:function(e,t,i){"abort"!==i&&console.log("Failed to retrieve data from "+o+" :"+i)},complete:function(){t.data.wfsLayerData[i._guid].xhr=void 0}})}},J.prototype.processWFSData=function(e,t,i){var o;e.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers?Xc.queueWorkItem({id:e.data.id,text:t,format:i,geometryFieldName:(o=this)._geometryFieldName}).then(function(e){o.addFeaturesToTile(e)}):(i=this._gmlParser.read(t),this.addFeaturesToTile({id:e.data.id,features:i}))},J.prototype.boundingSphereFromGML=function(e,i){var t=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,o=this;Xc.queueWorkItem({id:"0",text:e,geometryFieldName:this._geometryFieldName}).then(function(e){e={parentLayer:o,features:e.features,sampleTerrainLevel:t+1,isQuery:!0,onFinishedQuery:function(e){var t;0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e)),i(t)}};o._entityCreator.createPrimitiveFromWFSFeatures(e)})},J.prototype.boundingSphereFromFeature=function(e){var t,i=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel;return this._entityCreator.createPrimitiveFromWFSFeatures({parentLayer:this,features:[e],sampleTerrainLevel:i+1,isQuery:!0,onFinishedQuery:function(e){0<e.length&&(t=Cesium.BoundingSphere.fromBoundingSpheres(e))}}),t},J.prototype.addRenderedFeatureId=function(e){null==this._addedFeatures[e]&&(this._addedFeatures[e]=0),this._addedFeatures[e]++},J.prototype.removeRenderedFeatureId=function(i,o){if(o&&o.geometryType&&o.geometryType.includes("multi"))for(let e=0,t;e<o.positions.length;e++)t=i+"."+e,null!=this._addedFeatures[t]&&this._addedFeatures[t]--,0==this._addedFeatures[t]&&(this._addedFeatures[t]=void 0);else null!=this._addedFeatures[i]&&this._addedFeatures[i]--,0==this._addedFeatures[i]&&(this._addedFeatures[i]=void 0)},J.prototype.isExistRenderedFeatureId=function(e){return null!=this._addedFeatures[e]},J.prototype.addFeaturesToTile=function(i,o){var r,e,n=this._tileManager.getTile(i.id);void 0!==n&&(e=o?n.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,e={parentLayer:r=this,originalInstanceIds:e,features:i.features,onFinishedCreatePrimitive:function(e){var t;null!=i.features&&null!=n.data.wfsLayerData&&(n.data.wfsLayerData[r._guid].features=i.features,o||r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features),(void 0===e.length||0<e.length)&&(t=n.data.wfsLayerData[r._guid].primitive,e.show=r.show,(n.data.wfsLayerData[r._guid].primitive=e).parentLayer=r,e.parentTileId=i.id,e._guid=Cesium.createGuid(),o?r._tileManager.replaceInScene(t,e):r._tileManager.addToScene(e)))}},this._entityCreator.createPrimitiveFromWFSFeatures(e))},J.prototype.addFeaturesToLayer=function(e){this._statistics.numberOfAddedFeatures+=e.length,this._statistics.numberOfAddePositions+=Cesium.defaultValue(e.numPositions,0);for(var t=e.length,i=0;i<t;i++)!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e[i].fid)?this._featuresMap[e[i].fid]={refCount:1,feature:e[i]}:this._featuresMap[e[i].fid].refCount++},J.prototype.removeFeaturesFromLayer=function(e){this._statistics.numberOfDeletedFeatures+=e.length,this._statistics.numberOfDeletedPositions+=Cesium.defaultValue(e.numPositions,0);for(var t,i=e.length,o=0;o<i;o++)t=e[o].fid,!1!==Object.prototype.hasOwnProperty.call(this._featuresMap,t)&&(this._featuresMap[t].refCount--,0===this._featuresMap[t].refCount&&delete this._featuresMap[t],this.removeRenderedFeatureId(t,e[o]))},J.prototype.getFeature=function(e){return!1===Object.prototype.hasOwnProperty.call(this._featuresMap,e)?null:this._featuresMap[e]},J.prototype.updateTile=function(e){e=this._tileManager.getTile(e);void 0!==e&&(null==e.data.wfsLayerData[this._guid].features?this.loadTile(e):this.addFeaturesToTile(e.data.wfsLayerData[this._guid],!0))},J.blockRequestPrimitiveFromPrimitive=function(e){var t;if(null!=e)return null==(t=qc(e))&&(e._labelCollection&&e._labelCollection._billboardCollection?t=qc(e._labelCollection._billboardCollection):e._billboardCollection&&(t=qc(e._billboardCollection))),t},J.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null},Object.defineProperties($c.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<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),$c.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var su,lu=[],cu=0,uu=!($c.prototype.onPreFrame=function(e,t){if(cu++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&cu%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(lu,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}}),hu=($c.prototype.initialize=function(e){uu||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),uu=!0)},$c.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},$c.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},$c.prototype.updateForPick=function(e){},$c.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError},Math.PI,$c.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},$c.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},$c.prototype.getTile=function(e){return this._tileCache[e]},$c.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},$c.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(o=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(o))},$c.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},$c.prototype.computeDistanceToTile=function(e,t){var i=new Cesium.Cartesian3,e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,e=Cesium.Cartesian3.subtract(e.center,t.camera.positionWC,i),t=Cesium.Cartesian3.magnitude(e);return Math.max(1,t-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},$c.prototype.isDestroyed=function(){return!1},$c.prototype.destroy=function(){return Cesium.destroyObject(this)},$c.prototype.getInstance=function(t){var i;return 0==Cesium.defined(t.TileManager)&&(t.TileManager=new e,i=new Cesium.QuadtreePrimitive({tileProvider:t.TileManager,maximumScreenSpaceError:2}),t.scene.primitives.add(i)),t.TileManager},$c.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},$c.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},$c.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":eu(t,e);break;case"labels":tu(t,e);break;case"polygons":ou(t,e);break;case"models":ru(t,e);break;case"polylines":au(t,e);break;case"points":nu(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}},{billboards:eu,labels:tu,polygons:ou,models:ru,polylines:au,points:nu});function mu(e,t){this._viewer=e,this._cesium=t,su=new $c}function du(e){this._viewer=e,this._cesium=Cesium,this._core=new f,this._tree=V}function pu(e,t){this._viewer=e,this._cesium=t}function gu(e,t){this._viewer=e,this._cesium=t,this._tree=V,this._core=new f,this._Color=new m(this._viewer,this._cesium)}function fu(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}$c.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=hu[i])?i(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e)))},mu.prototype.CreateWfsFeatureLayer=function(e,t,i,o,r,n,a,s,l){return new J(e,t,i,o,r,n,a,s,l)},mu.prototype.initTileManager=function(){this._viewer.scene;var i=this._viewer;i.scene.preRender.addEventListener(function(e,t){su.getInstance(i).streamSpeed=2})},du.prototype.createPolylineVolume=function(e,t,i,o,r){var n={positions:[],shape:this.starPositions(7,3e4,2e4),material:this._cesium.Color.fromRandom({alpha:1})};if(!this._core.isnull(o)){o=this._core.extend(n,o,!0);var a=[];if(t[0].x||t[0].y)if(t[0].z)for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y,t[s].z));else for(s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x,t[s].y));else if(2===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1]));else if(3===t[0].length)for(var s=0;s<t.length;s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0],t[s][1],t[s][2]));o.positions=a,"circle"===i?o.shape=this.computeCircle(o.radius||10):"star"===i?(o.shape=this.starPositions(o.arms||7,o.rOuter||30,o.rInner||20),o.cornerType=Cesium.CornerType.MITERED):"box"===i&&(o.radius=o.radius||10,o.shape=[new this._cesium.Cartesian2(-o.radius,-o.radius),new this._cesium.Cartesian2(o.radius,-o.radius),new this._cesium.Cartesian2(o.radius,o.radius),new this._cesium.Cartesian2(-o.radius,o.radius)],o.cornerType=Cesium.CornerType.BEVELED);n=this._viewer.entities.add({id:this._core.getuid(),name:e,polylineVolume:o});return this.item=n,this._tree.insertGroupId({id:n.id,name:e,pId:this._core.isnull(r)?0:r,type:"polylinevolume",item:this},this._core.isnull(r)?0:r),this}console.log("options is required")},du.prototype.getstyles=function(){var e={};return e.show=!this.item.polylineVolume.show||this.item.polylineVolume.show._value,e.positions=this.item.polylineVolume.positions.getValue().toString(),e.shape=this.item.polylineVolume.shape.toString(),e.cornerType=this.item.polylineVolume.cornerType?this.item.polylineVolume.cornerType.toString():null,e.granularity=this.item.polylineVolume.granularity?this.item.polylineVolume.granularity.toString():null,e.fill=this.item.polylineVolume.fill?this.item.polylineVolume.fill._value:null,e.material=this.item.polylineVolume.material?this.item.polylineVolume.material.toString():null,e.outline=this.item.polylineVolume.outline?this.item.polylineVolume.outline._value:null,e.outlineWidth=this.item.polylineVolume.outlineWidth?this.item.polylineVolume.outlineWidth.toString():null,e.outlineColor=this.item.polylineVolume.outlineColor&&this.item.polylineVolume.outlineColor._value?"rgba"+this.item.polylineVolume.outlineColor.toString():null,e.near=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.near:null,e.far=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.far:null,e},du.prototype.executeWall=function(t,i){var a=[],o=void 0,s=this,r=(e.prototype._init=function(){var n=this,e=(this.options.wall.maximumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++){if(!a[t])return;var i=s._viewer.scene.globe.ellipsoid,o=new s._cesium.Cartesian3(a[t].x,a[t].y,a[t].z),i=i.cartesianToCartographic(o),o=s._cesium.Math.toDegrees(i.latitude),r=s._cesium.Math.toDegrees(i.longitude);i.height,e.push(r),e.push(o)}return s._cesium.Cartesian3.fromDegreesArray(e)},!1),s._viewer.entities.add(this.options));s.item=e,s._tree.insertGroupId({id:this.options.id,name:t,pId:s._core.isnull(i)?0:i,type:"wall",item:s},s._core.isnull(i)?0:i)},e);function e(e){this.options={id:s._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:s._cesium.Color.AQUA.withAlpha(1)}},this.positions=e,this._init()}var n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);0==a.length&&a.push(C.clone(e)),a.push(C.clone(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.endPosition,s._viewer.scene.globe.ellipsoid);1<=a.length&&(s._cesium.defined(o)?(a.pop(),a.push(e)):o=new r(a))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),a.pop()},s._cesium.ScreenSpaceEventType.RIGHT_CLICK)},du.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 this._cesium.Cartesian2(Math.cos(n*o)*a,Math.sin(n*o)*a);r.push(a)}return r},du.prototype.computeCircle=function(e){for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},du.prototype.setVisibility=function(e){this.item.polylineVolume.show=e},du.prototype.getVisibility=function(){return this.item.polylineVolume.show},du.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(du.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(du.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),du.prototype.setItem=function(e){this.item=e},du.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(du.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(du.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(du.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(du.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(du.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(du.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),pu.prototype.createPosition=function(e,t,i){return new this.Cartesian3.fromDegrees(e,t,i)},pu.prototype.CreatePosition=function(e,t,i,o,r,n,a,s){return{X:e,Y:t,Altitude:i,AltitudeType:o,Yaw:r,Pitch:n,Roll:a,Distance:s}},gu.prototype.createImageLabel=function(e,t,i,o){var r={id:this._core.getuid(),image:"../images/Cesium_Logo_overlay.png",show:!0,color:this._cesium.Color.IVORY},r=this._core.extend(r,t,!0),t=(!r.color||this._core.isnull(r)||this._core.isnull(r.color)||"["==r.color.toString().charAt(0)&&"]"==r.color.toString().charAt(r.color.length-1)||(this._core.isHtmlColor(r.color)&&/^#/.test(r.color.toString())?r.color=this._Color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=this._Color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color.r&&(r.color=this._Color.createColor(r.color.r,r.color.g,r.color.b,r.color.a)))),r.near&&r.far&&(r.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(r.near,r.far)),this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),billboard:r}),{id:this.item.id,name:o,pId:this._core.isnull(i)?0:i,type:"Imagelabel",item:this});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},gu.prototype.getstyles=function(){var e={};return e.show=!this.item.billboard.show||this.item.billboard.show._value,e.image=this.item.billboard.image&&this.item.billboard.image._value?this.item.billboard.image._value:void 0,e.scale=this.item.billboard.scale&&this.item.billboard.scale._value?this.item.billboard.scale._value:void 0,e.pixelOffset=this.item.billboard.pixelOffset?this.item.billboard.pixelOffset._value:void 0,e.horizontalOrigin=this.item.billboard.horizontalOrigin&&this.item.billboard.horizontalOrigin._value?this.item.billboard.horizontalOrigin._value:void 0,e.verticalOrigin=this.item.billboard.verticalOrigin&&this.item.billboard.verticalOrigin._value?this.item.billboard.verticalOrigin._value:void 0,e.heightReference=this.item.billboard.heightReference&&this.item.billboard.heightReference._value&&this.item.billboard.heightReference._value?this.item.billboard.heightReference._value:null,e.color=this.item.billboard.color&&this.item.billboard.color._value?"rgba"+this.item.billboard.color.toString():void 0,e.width=this.item.billboard.width&&this.item.billboard.width._value?this.item.billboard.width._value:void 0,e.height=this.item.billboard.height&&this.item.billboard.height._value?this.item.billboard.height._value:void 0,e.near=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.near:void 0,e.far=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.far:void 0,e.position=this.item.position.getValue().toString(),e},gu.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},gu.prototype.setDistanceDisplayCondition=function(e,t){e=new this._cesium.DistanceDisplayCondition(e,t);try{this.item._billboard.distanceDisplayCondition=e}catch(e){console.log(e)}return this},gu.prototype.setUrl=function(e){this.item._billboard.image=e},gu.prototype.setVisibility=function(e){this.item.show=e},gu.prototype.getVisibility=function(){return this.item.show},gu.prototype.setColor=function(e){try{this.item._billboard.color=new m(this._viewer,this._cesium).colorFromHtmlColor(e),this.item.color=this.item._billboard.color}catch(e){console.log(e)}return this},gu.prototype.setWidth=function(e){try{this.item._billboard.width=e}catch(e){console.log(e)}return this},gu.prototype.setColorAlpha=function(e){try{this.item._billboard.color._value.alpha=e}catch(e){console.log(e)}return this},gu.prototype.setHeight=function(e){try{this.item._billboard.height=e}catch(e){console.log(e)}return this},gu.prototype.setHeightType=function(e){try{1==e?this.item._billboard.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:2==e?this.item._billboard.heightReference=this._cesium.HeightReference.NONE:3==e&&(this.item._billboard.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(e){console.log(e)}return this},gu.prototype.setRotation=function(e){try{this.item._billboard.rotation=this._cesium.Math.toRadians(e)}catch(e){console.log(e)}return this},gu.prototype.setItem=function(e){this.item=e},gu.prototype.setScale=function(e){try{this.item._billboard.scale=e}catch(e){console.log(e)}return this},gu.prototype.CreateImageLabel=function(e,t,i,o,r){i={id:this._core.getuid(),image:gu,show:!0,scale:i.Scale,color:i.IconColor,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)},this.item=this._viewer.entities.add({name:r,position:this._cesium.Cartesian3.fromDegrees(positions.X,positions.X,positions.Altitude),billboard:i}),i=this.item.id,r={id:this.item.id,name:i=""==r?r:i,pId:this._core.isnull(o)?0:o,type:"Imagelabel",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(o)?0:o),this},gu.prototype.export=function(){var e=null==this.item.billboard.image?void 0:this.item.billboard.image._value,t=null==this.item.billboard.show?void 0:this.item.billboard.show._value,i=null==this.item.billboard.scale?void 0:this.item.billboard.scale._value,o=null==this.item.billboard.horizontalOrigin?void 0:this.item.billboard.horizontalOrigin._value,r=null==this.item.billboard.verticalOrigin?void 0:this.item.billboard.verticalOrigin._value,n=null==this.item.billboard.rotation?void 0:this.item.billboard.rotation._value,a=null==this.item.billboard.width?void 0:this.item.billboard.width._value,s=null==this.item.billboard.height?void 0:this.item.billboard.height._value,l=null==this.item.billboard.color?void 0:"rgba("+this.item.billboard.color._value.red+","+this.item.billboard.color._value.green+","+this.item.billboard.color._value.blue+","+this.item.billboard.color._value.alpha+")",c=null==this.item.billboard.heightReference?void 0:this.item.billboard.heightReference._value,u=this.item.billboard.distanceDisplayCondition,h=null==u?void 0:u._value.near,u=null==u?void 0:u._value.far,m=this._cesium.Cartographic.fromCartesian(this.item.position._value);return{type:"image",position:{x:this._cesium.Math.toDegrees(m.longitude),y:this._cesium.Math.toDegrees(m.latitude),z:this._cesium.Math.toDegrees(m.height)},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{image:e,show:t,scale:i,horizontalOrigin:o,verticalOrigin:r,rotation:n,width:a,height:s,color:l,heightReference:c,near:h,far:u}}},gu.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(gu.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(e){try{var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=this._cesium.Math.toDegrees(t.latitude),r=(this._cesium.Math.toDegrees(t.height),this._cesium.Cartesian3.fromDegrees(i,o,e));this.item.position.position=r,this._postion.Altitude=e}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}catch(e){console.log(e)}}},Roll:{get:function(){return this._postion.Roll},set:function(e){try{this._postion.Roll=e}catch(e){console.log(e)}}},X:{get:function(){return this._postion.X},set:function(e){try{this._postion.X=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=(this._cesium.Math.toDegrees(t.longitude),this._cesium.Math.toDegrees(t.latitude)),o=this._cesium.Math.toDegrees(t.height),r=this._cesium.Cartesian3.fromDegrees(e,i,o);this.item.position.position=r}catch(e){console.log(e)}}},Y:{get:function(){return this._postion.Y},set:function(e){try{this._postion.Y=e;var t=this._cesium.Cartographic.fromCartesian(this.item.position._value),i=this._cesium.Math.toDegrees(t.longitude),o=(this._cesium.Math.toDegrees(t.latitude),this._cesium.Math.toDegrees(t.height)),r=this._cesium.Cartesian3.fromDegrees(i,e,o);this.item.position.position=r}catch(e){console.log(e)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(e){try{this._postion.Yaw=e}catch(e){console.log(e)}}}},LabelStyle:{BackgroundColor:{get:function(){return""},set:function(e){}},Bold:{get:function(){return""},set:function(e){}},FontName:{get:function(){return""},set:function(e){}},FontSize:{get:function(){return""},set:function(e){}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){return""},set:function(e){}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{get:function(){return""},set:function(e){}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),gu.prototype.CreateImageLabel=function(e,t,i,o,r){this._postion=e;t={id:this._core.getuid(),image:t,backgroundColor:i.BackgroundColor,fillColor:i.IconColor,font:i.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,outlineColor:i.LineColor,show:!0,scale:i.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(i.MinViewingHeight,i.MaxViewingHeight)},i.Italic&&(t.font="italic "+t.font),i.Italic&&(t.font="Bold "+t.font),t=this._core.extend(t,i,!0),this.item=this._viewer.entities.add({name:r,position:this._cesium.Cartesian3.fromDegrees(e.X,e.Y,e.Altitude),billboard:t}),i={id:this.item.id,name:r,pId:this._core.isnull(o)?0:o,type:"ImageLabel",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),this},Object.defineProperties(gu.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)}}}},LabelStyle:{BackgroundColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.backgroundColor=e,this.item.backgroundColor=e)},500),get:function(){var e=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Bold:{get:function(){return-1!=this.item._label.font.getValue().indexOf("bold")},set:function(){var e="bold "+this.item._label.font.getValue();this.item._label.font.setValue(e)}},FontName:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if("bold"!=e[t]&&-1==e[t].indexOf("px")&&-1==e[t].indexOf("PX"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)"bold"!=t[o]&&-1==t[o].indexOf("px")&&-1==t[o].indexOf("PX")||(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FontSize:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("px"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1!=t[o].indexOf("px")&&(i=i+" "+t[o]);this.item._label.font.setValue(i)}},FrameFileName:{get:function(){return""},set:function(e){}},IconColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.fillColor=e)},500),get:function(){var e=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},Italic:{get:function(){for(var e=this.item._label.font.getValue().split(" "),t=0;t<e.length;t++)if(-1!=e[t].indexOf("italic"))return e[t]},set:function(e){for(var t=this.item._label.font.getValue().split(" "),i=e,o=0;o<t.length;o++)-1!=t[o].indexOf("italic")&&(i=i+" "+t[o]);this.item._label.font.setValue(i)}},LimitScreenSize:{get:function(){return""},set:function(e){}},LineColor:{set:C.debounce(function(e){this._core.isnull(e)||(this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._Color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._Color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._Color.createColor(e.r,e.g,e.b,e.a))),this.item.label.outlineColor=e)},500),get:function(){var e=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}},LineToGround:{get:function(){return""},set:function(e){}},LockMode:{get:function(){return""},set:function(e){}},MaxImageSize:{get:function(){return""},set:function(e){}},MaxViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.far},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(t,e)}},MinViewingHeight:{get:function(){if(null!=this.item._label.distanceDisplayCondition)return this.item._label.distanceDisplayCondition._value.near},set:function(e){var t=0;null!=this.item._label.distanceDisplayCondition&&(t=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,t)}},MultilineJustification:{get:function(){return""},set:function(e){}},PivotAlignment:{get:function(){return""},set:function(e){}},Scale:{get:function(){if(null!=this.item._label.scale)return this.item.label.scale.getValue()},set:function(e){this.item.label.scale.setValue(e)}},TextAlignment:{get:function(){return""},set:function(e){}},TextColor:{get:function(){return""},set:function(e){}},TextOnImage:{get:function(){return""},set:function(e){}},Underline:{get:function(){return""},set:function(e){}}}}),fu.prototype.createWall=function(t,e,i,o){var r=[];if("object"==typeof t){let e=t;var n=this._core.defaultValue(e.alpha,.6);e.points.forEach(e=>{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 f;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;a<e.length;a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y,e[a].z));else for(a=0;a<e.length;a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a].x,e[a].y));else if(2===e[0].length)for(var a=0;a<e.length;a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1]));else if(3===e[0].length)for(var a=0;a<e.length;a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a][0],e[a][1],e[a][2]));i.positions=r,void 0!==i.minHeight&&(i.minimumHeights=new Array(i.positions.length).fill(i.minHeight)),void 0!==i.maxHeight&&(i.maximumHeights=new Array(i.positions.length).fill(i.maxHeight)),this.item=this._viewer.entities.add({name:t,id:this._core.getuid(),wall:i}),this.item.positions=i.positions}return this._tree.insertGroupId({id:this.item.id,name:t,pId:this._core.isnull(o)?0:o,type:"wall",item:this},this._core.isnull(o)?0:o),this},fu.prototype.executeWall=function(t,i){var a=[],o=void 0,s=this,r=(e.prototype._init=function(){var n=this,e=(this.options.wall.maximumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(2e3);return e},!1),this.options.wall.minimumHeights=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++)e.push(1e3);return e},!1),this.options.wall.positions=new s._cesium.CallbackProperty(function(){for(var e=[],t=0;t<n.positions.length;t++){if(!a[t])return;var i=s._viewer.scene.globe.ellipsoid,o=new s._cesium.Cartesian3(a[t].x,a[t].y,a[t].z),i=i.cartesianToCartographic(o),o=s._cesium.Math.toDegrees(i.latitude),r=s._cesium.Math.toDegrees(i.longitude);i.height,e.push(r),e.push(o)}return s._cesium.Cartesian3.fromDegreesArray(e)},!1),s._viewer.entities.add(this.options));s.item=e,s._tree.insertGroupId({id:this.options.id,name:t,pId:s._core.isnull(i)?0:i,type:"wall",item:s},s._core.isnull(i)?0:i)},e);function e(e){this.options={id:s._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:s._core.setImageMaterialProperty("img/arrow.png",s._cesium,1)}},this.positions=e,this._init()}var n=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.position,s._viewer.scene.globe.ellipsoid);0==a.length&&a.push(C.clone(e)),a.push(C.clone(e))},s._cesium.ScreenSpaceEventType.LEFT_CLICK),n.setInputAction(function(e){e=s._viewer.scene.camera.pickEllipsoid(e.endPosition,s._viewer.scene.globe.ellipsoid);1<=a.length&&(s._cesium.defined(o)?(a.pop(),a.push(e)):o=new r(a))},s._cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(function(e){n.destroy(),a.pop()},s._cesium.ScreenSpaceEventType.RIGHT_CLICK)};var _u="a",Cu=0;function yu(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._BaiduImageryProvider=new Ml(e,t)}fu.prototype.drawCanvasImage=function(e,t){var i=document.getElementById("canvas-"+_u),o=i.getContext("2d"),r=new Image;return r.src="img/arrow.png",o.clearRect(0,0,700,100),r.onload=function(){Cu<=700?(o.drawImage(r,Cu,0),o.drawImage(r,Cu+100,0)):Cu=0,Cu+=5},_u="a"===_u?"b":"a",i},fu.prototype.setVisibility=function(e){this.item.wall.show=e},fu.prototype.getVisibility=function(){return this.item.wall.show},fu.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)},Object.defineProperties(fu.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(e){this.item.rectangle=e}}}),Object.defineProperties(fu.prototype,{polyline:{get:function(){return this.item.polyline},set:function(e){this.item.polyline=e}}}),fu.prototype.setItem=function(e){this.item=e},fu.prototype.setTreeobj=function(e){this.treeobj=e},Object.defineProperties(fu.prototype,{polygon:{get:function(){return this.item.polygon},set:function(e){this.item.polygon=e}}}),Object.defineProperties(fu.prototype,{point:{get:function(){return this.item.point},set:function(e){this.item.point=e}}}),Object.defineProperties(fu.prototype,{label:{get:function(){return this.item.label},set:function(e){this.item.label=e}}}),Object.defineProperties(fu.prototype,{model:{get:function(){return this.item.model},set:function(e){this.item.model=e}}}),Object.defineProperties(fu.prototype,{wall:{get:function(){return this.item.wall},set:function(e){this.item.wall=e}}}),Object.defineProperties(fu.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}}),yu.prototype.createArcGisImageryLayer=function(e,t,i,o,r,n){var a={url:""},s=null,a=(this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层"),new this._cesium.ArcGisMapServerImageryProvider(s));let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?(e.split&&(e=e.split(",")),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(a,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);t=this._core.getuid(),a={id:s.id||t,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"arcgis",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},yu.prototype.createImageryLayerGrid=function(e){e=this._viewer.imageryLayers.addImageryProvider(new this._cesium.GridImageryProvider(e));return this.item=e,this},yu.prototype.createWebMapServerImageLayer=function(e,t,i,o,r,n){var a={url:"",layers:"",parameters:{service:"WMS",format:"image/png",transparent:!0}},s=null,a=(this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层"),new this._cesium.WebMapServiceImageryProvider(s));let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?(e.split&&(e=e.split(",")),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(a,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);t=this._core.getuid(),a={id:s.id||t,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"wms",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},yu.prototype.createMVTWithStyle=function(e,t,i,o){this.item=this._viewer.imageryLayers.addImageryProvider(t),checked||this.setVisibility(!1),t.show=!1;t=this._core.getuid(),t={id:options.id||t,name:e,checked:checked,pId:(this._core.isnull(0),0),type:"ImageryProvider",show:!1,item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,(this._core.isnull(0),0)),this},yu.prototype.createWebMapTileServerImageLayer=function(e,t,i,o,r,n){var a={url:""},s=null;this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层");let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?(e.split&&(e=e.split(",")),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}a=s.TD_SD?new vn(s.url,!1,l.minimumTerrainLevel||0,l.maximumTerrainLevel||21):new this._cesium.WebMapTileServiceImageryProvider(s),s.addLevel&&(a.addLevel=s.addLevel),s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(a,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);t=this._core.getuid(),a={id:s.id||t,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"skymap",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},yu.prototype.createUrlTemplateImageryProvider=function(e,t,i,o,r,n){var a={url:""},s=null,a=(this._core.isUrl(t)?(s=a).url=t:s=this._core.extend(a,t,!0),this._core.isnull(e)&&(e="新建影像图层"),new this._cesium.UrlTemplateImageryProvider(s));let l={alpha:s.alpha,brightness:s.brightness,availability:s.availability};if(void 0!==s.Level||void 0!==s.level){let e=this._core.defaultValue(s.Level,s.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?(e.split&&(e=e.split(",")),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}s.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:s.time.start?this._cesium.JulianDate.fromDate(new Date(s.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:s.time.end?this._cesium.JulianDate.fromDate(new Date(s.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(a,l),this._viewer.imageryLayers.add(this.item,o),r||this.setVisibility(!1),n&&"function"==typeof n&&n(this.item);t=this._core.getuid(),a={id:s.id||t,name:e,checked:r,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",smtype:"goglemap",item:this};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),this},yu.prototype.createImageryProvider=function(e,t,i,o,r,n,a){var s,i=this._core.extend({},i,!0);"arcgis"==t?s=new this._cesium.ArcGisMapServerImageryProvider(i):"geoserver"==t||"wms"==t?s=new this._cesium.WebMapServiceImageryProvider(i):"cesiumBlack"==t||"tms"==t?s=new this._cesium.TileMapServiceImageryProvider(i):"skymap"==t?s=new this._cesium.WebMapTileServiceImageryProvider(i):"goglemap"==t?s=new this._cesium.UrlTemplateImageryProvider(i):"BingMap"==t?s=new this._cesium.BingMapsImageryProvider(i):"OpenStreetMap"==t?s=new this._cesium.OpenStreetMapImageryProvider(i):"MapBox"==t?s=new this._cesium.MapboxImageryProvider(i):"BaiduMap"==t&&(s=new this._BaiduImageryProvider.BaiduImageryProvider(i));let l={alpha:i.alpha,brightness:i.brightness,availability:i.availability};if(void 0!==i.Level||void 0!==i.level){let e=this._core.defaultValue(i.Level,i.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?(e.split&&(e=e.split(",")),l.maximumTerrainLevel=e[1],l.minimumTerrainLevel=e[0]):l.minimumTerrainLevel=e}i.time&&(l.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:i.time.start?this._cesium.JulianDate.fromDate(new Date(i.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:i.time.end?this._cesium.JulianDate.fromDate(new Date(i.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=l.availability,this.item=new this._cesium.ImageryLayer(s,l),this._viewer.imageryLayers.add(this.item,r),n||this.setVisibility(!1),a&&"function"==typeof a&&a(this.item),this._core.isnull(i.id)&&(i.id=this._core.getuid());t={id:i.id,name:e,pId:this._core.isnull(o)?0:o,type:"ImageryProvider",checked:n,item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(o)?0:o),this},yu.prototype.createCacheImageryProvider=function(e,t,i,o,r,n){o|=1;t=this._core.extend({fileExtension:"jpg",cacheMaxLevel:16},t,!0);let a={alpha:t.alpha,brightness:t.brightness,availability:t.availability,show:!0},s={alpha:t.alpha,brightness:t.brightness,availability:t.availability,show:!0};if(t.time&&(a.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:t.time.start?this._cesium.JulianDate.fromDate(new Date(t.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:t.time.end?this._cesium.JulianDate.fromDate(new Date(t.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),s.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:t.time.start?this._cesium.JulianDate.fromDate(new Date(t.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:t.time.end?this._cesium.JulianDate.fromDate(new Date(t.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),void 0!==t.Level||void 0!==t.level){let e=this._core.defaultValue(t.Level,t.level);e.indexOf&&-1<e.indexOf(",")||Array.isArray(e)?((e=e.split?e.split(","):e)[1]>t.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?(c=this.items.push(new this._cesium.ImageryLayer(l,s)),this._viewer.imageryLayers.add(this.items[c-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,c={id:t.id,name:e,pId:this._core.isnull(i)?0:i,type:"ImageryProvider",checked:r,item:this};return this.setTreeobj(c),this._tree.insertGroupId(c,this._core.isnull(i)?0:i),this},yu.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},yu.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},yu.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}}},yu.prototype.setTreeobj=function(e){this.treeobj=e},yu.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},yu.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<this.items.length;t++)this.items[t].show=e,this.items[t]._availability&&!e?this.items[t]._availability=void 0:this.availability&&e&&(this.items[t]._availability=this.availability)},yu.prototype.getVisibility=function(){return this.item.show},yu.prototype.getType=function(){return{label:"影像",value:"ImageryProvider"}},yu.prototype.deleteObject=function(){return this._viewer.imageryLayers.remove(this.item)},Object.defineProperties(yu.prototype,{url:{set:function(e){},get:function(){}}}),yu.prototype.setItem=function(e){this.item=e};var vu=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var i=t,o=[],r=!0,t=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(o.push(a.value),!i||o.length!==i);r=!0);}catch(e){t=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(t)throw n}}return o}throw new TypeError("Invalid attempt to destructure non-iterable instance")},wu="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 bu(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function Tu(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this.UrlData={output:i.output,resultmode:i.resultmode,uid:i.uid,st:i.st,words:i.words,area:i.area,callback:i.callback},this.minLevel1=i.minLevel1,this.minLevel3=i.minLevel3,this._url=i.url,this._urlTemplate=i.url,this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this.dx={},this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this.cluster="city",this.primitivecount=null,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),c=this._lonLatToTileInWGS84([n,a],s),u=Math.min(l[0],c[0]),h=Math.max(l[0],c[0]),m=Math.min(l[1],c[1]),l=Math.max(l[1],c[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:l,minRow:u,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}function Su(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=this._cesium.PointPrimitiveCollection(),this.gd=0,this.model=[],this.Legend=[],this.sj=!0}Tu.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":wu(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Tu.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},Tu.prototype._lonLatToTileInWGS84=function(e,t){var e=vu(e,2),i=e[0],e=e[1];return[Math.floor(Math.pow(2,t)*(90-e)/180),Math.floor(Math.pow(2,t)*(180+i)/180)]},Tu.prototype._radianToDegree=function(e){return e/Math.PI*180},Tu.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},Tu.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},Tu.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;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,bu(e))}):(t=o[i]).push.apply(t,bu(e))});var e=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),t=a._Cesium.BoundingSphere.fromPoints(e.positions).center,t=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:e,height:t,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),t=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(t)})):console.warn('GeoJSONVectorTileProviderPolymerization: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},Tu.prototype._cameraMoveEndHandler=function(){var t,e,i,o,r,n,a,s,l;this._stop||(t=this,n=Date.now(),s=(l=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),e=Math.min.apply(Math,bu(s)),i=Math.max.apply(Math,bu(s)),t._removeObsoletePrimitives(t._primitiveByTile,[]),i<this._lowerLevelLimit&&(t._tileKeys=[],t._removeObsoletePrimitives(t._primitiveByTile,[]),l=[]),this._upperLevelLimit&&e>this._upperLevelLimit&&(t._tileKeys=[],t._removeObsoletePrimitives(t._primitiveByTile,[]),l=[]),(l=2<i-e?l.filter(function(e){return e.level>=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}))},Tu.prototype._refineTiles=function(e,s){var l=[],c=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)c.includes(t)||(l.push(e),c.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);c.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),c.push(r))}else{var n,a=e.level-s;0==a?c.includes(t)||(l.push(e),c.push(t)):(t=2*a,a=Math.floor(e.x/t),t=Math.floor(e.y/t),c.includes(n="Z"+s+"X"+a+"Y"+t)||(l.push({x:a,y:t,level:s}),c.push(n)))}}),l},Tu.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||removed&&delete e[i]},Tu.prototype.addTo=function(e){this._viewer=e,this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},Tu.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},Tu.prototype.setStatus=function(e){this._stop=e},Tu.prototype.isRemoved=function(){return this._isRemoved},Tu.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},Tu.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},Su.prototype.createLabelPointGeoJsonFeatureLayer=function(e,t,s,i,l){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),c=this,o=(o.then(function(e){for(var t={Name:"",text:"",font:" 30px sans-serif",stylet:c._cesium.LabelStyle.OUTLINE,fillColor:c._cesium.Color.WHITE,outlineColor:c._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new c._cesium.Color(.165,.165,.165,.8),backgroundPadding:new c._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:c._cesium.HorizontalOrigin.CENTER,verticalOrigin:c._cesium.VerticalOrigin.CENTER,eyeOffset:c._cesium.Cartesian3.ZERO,pixelOffset:c._cesium.Cartesian2.ZERO,heightReference:c._cesium.HeightReference.NONE,scaleByDistance:new c._cesium.NearFarScalar(0,0,1,1)},i=(s.material,c._core.isnull(s)||c._core.isnull(s.fillColor)||/^\[/.test(s.fillColor)&&"["==s.fillColor.toString().charAt(0)&&"]"==s.fillColor.toString().charAt(s.fillColor.length-1)||(c._core.isHtmlColor(s.fillColor)?s.fillColor=c._color.colorFromHtmlColor(s.fillColor):(/^rgb/.test(s.fillColor)&&(s.fillColor=c._color.rgbaStringToRgbaObj(s.fillColor)),1<s.fillColor.r&&(s.fillColor.r=s.fillColor.r/255),1<s.fillColor.g&&(s.fillColor.g=s.fillColor.g/255),1<s.fillColor.b&&(s.fillColor.b=s.fillColor.b/255),1<s.fillColor.a&&(s.fillColor.a=s.fillColor.a/255),s.fillColor=c._color.createColor(s.fillColor.r,s.fillColor.g,s.fillColor.b,s.fillColor.a))),c._core.isnull(s)||c._core.isnull(s.material)||/^\[/.test(s.material)&&"["==s.material.toString().charAt(0)&&"]"==s.material.toString().charAt(s.material.length-1)||(c._core.isHtmlColor(s.material)?s.material=c._color.colorFromHtmlColor(s.material):(/^rgb/.test(s.material)&&(s.material=c._color.rgbaStringToRgbaObj(s.material)),1<s.material.r&&(s.material.r=s.fillColor.r/255),1<s.material.g&&(s.material.g=s.fillColor.g/255),1<s.material.b&&(s.material.b=s.material.b/255),1<s.material.a&&(s.material.a=s.material.a/255),s.material=c._color.createColor(s.material.r,s.material.g,s.material.b,s.material.a))),c._core.isnull(s)||c._core.isnull(s.outlineColor)||/^\[/.test(s.outlineColor)&&"["==s.outlineColor.toString().charAt(0)&&"]"==s.outlineColor.toString().charAt(s.outlineColor.length-1)||(c._core.isHtmlColor(s.outlineColor)?s.outlineColor=c._color.colorFromHtmlColor(s.outlineColor):(/^rgb/.test(s.outlineColor)&&(s.outlineColor=c._color.rgbaStringToRgbaObj(s.outlineColor)),1<s.outlineColor.r&&(s.outlineColor.r=s.outlineColor.r/255),1<s.outlineColor.g&&(s.outlineColor.g=s.outlineColor.g/255),1<s.outlineColor.b&&(s.outlineColor.b=s.outlineColor.b/255),1<s.outlineColor.a&&(s.outlineColor.a=s.outlineColor.a/255),s.outlineColor=c._color.createColor(s.outlineColor.r,s.outlineColor.g,s.outlineColor.b,s.outlineColor.a))),c._core.isnull(s)||c._core.isnull(s.backgroundColor)||/^\[/.test(s.backgroundColor)&&"["==s.backgroundColor.toString().charAt(0)&&"]"==s.backgroundColor.toString().charAt(s.backgroundColor.length-1)||(c._core.isHtmlColor(s.backgroundColor)?s.backgroundColor=c._color.colorFromHtmlColor(s.backgroundColor):(/^rgb/.test(s.backgroundColor)&&(s.backgroundColor=c._color.rgbaStringToRgbaObj(s.backgroundColor)),1<s.backgroundColor.r&&(s.backgroundColor.r=s.backgroundColor.r/255),1<s.backgroundColor.g&&(s.backgroundColor.g=s.backgroundColor.g/255),1<s.backgroundColor.b&&(s.backgroundColor.b=s.backgroundColor.b/255),1<s.backgroundColor.a&&(s.backgroundColor.a=s.backgroundColor.a/255),s.backgroundColor=c._color.createColor(s.backgroundColor.r,s.backgroundColor.g,s.backgroundColor.b,s.backgroundColor.a))),c._core.extend(t,s,!0)),o=(c.item=e).entities.values,t=(c._core.isnull(s.near)&&(s.near=0),c._core.isnull(s.far)&&(s.far=999999999),parseFloat(s.near)),e=parseFloat(s.far),t=new c._cesium.DistanceDisplayCondition(t,e),r=(i.distanceDisplayCondition=t,c._core.isnull(s.font_size)&&(s.font_size="30px"),c._core.isnull(s.font_family)&&(s.font_family=" sans-serif"),i.font=parseFloat(s.font_size)+"px "+s.font_family,new c._cesium.LabelCollection),n=0;n<o.length;n++){var a=o[n],a=(i.position=a.position._value,i.text="a label","fillColor:"+255*i.fillColor.red+","+255*i.fillColor.green+","+255*i.fillColor.blue+";outlineColor:"+255*i.outlineColor.red+","+255*i.outlineColor.green+","+255*i.outlineColor.blue);c.Legend.push(a),r.add(i)}e=c._viewer.scene.primitives.add(r);"function"==typeof l&&l(e)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t,style:options};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Su.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(e,t,u,i,h,m){var o={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},d=this,p=(this._core.isnull(u)||this._core.isnull(u.fillColor)||(this._core.isHtmlColor(u.fillColor)?u.fillColor=this._color.colorFromHtmlColor(u.fillColor):(/^rgb/.test(u.fillColor)&&(u.fillColor=this._color.rgbaStringToRgbaObj(u.fillColor)),1<u.fillColor.r&&(u.fillColor.r=u.fillColor.r/255),1<u.fillColor.g&&(u.fillColor.g=u.fillColor.g/255),1<u.fillColor.b&&(u.fillColor.b=u.fillColor.b/255),1<u.fillColor.a&&(u.fillColor.a=u.fillColor.a/255),u.fillColor=this._color.createColor(u.fillColor.r,u.fillColor.g,u.fillColor.b,u.fillColor.a))),this._core.isnull(u)||this._core.isnull(u.outlineColor)||(this._core.isHtmlColor(u.outlineColor)?u.outlineColor=this._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=this._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=this._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),this._core.isnull(u)||this._core.isnull(u.backgroundColor)||(this._core.isHtmlColor(u.backgroundColor)?u.backgroundColor=this._color.colorFromHtmlColor(u.backgroundColor):(/^rgb/.test(u.backgroundColor)&&(u.backgroundColor=this._color.rgbaStringToRgbaObj(u.backgroundColor)),1<u.backgroundColor.r&&(u.backgroundColor.r=u.backgroundColor.r/255),1<u.backgroundColor.g&&(u.backgroundColor.g=u.backgroundColor.g/255),1<u.backgroundColor.b&&(u.backgroundColor.b=u.backgroundColor.b/255),1<u.backgroundColor.a&&(u.backgroundColor.a=u.backgroundColor.a/255),u.backgroundColor=this._color.createColor(u.backgroundColor.r,u.backgroundColor.g,u.backgroundColor.b,u.backgroundColor.a))),d._core.isnull(u.near)&&(u.near=0),d._core.isnull(u.far)&&(u.far=999999999),this._core.extend(o,u,!0)),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),d=this,o=(o.then(function(e){var t=(d.item=e).entities.values;d._core.isnull(p.font_size)&&(p.font_size="30"),d._core.isnull(p.font_family)&&(p.font_family=" sans-serif"),p.font=p.font_size+"px "+p.font_family;for(var i=0;i<t.length;i++){var o=t[i],r=(p.font=d._core.extendgl(o,u.font,p.font),p.style=parseInt(d._core.extendgl(o,u.stylet,p.stylet)),p.fillColor=d._core.extendgl(o,u.fillColor,p.fillColor),p.outlineColor=d._core.extendgl(o,u.outlineColor,p.outlineColor),p.outlineWidth=parseFloat(d._core.extendgl(o,u.outlineWidth,p.outlineWidth)),p.show=d._core.extendgl(o,u.show,p.show),p.showBackground=d._core.extendgl(o,u.showBackground,p.showBackground),p.backgroundColor=d._core.extendgl(o,u.backgroundColor,p.backgroundColor),p.backgroundPadding=d._core.extendgl(o,u.backgroundPadding,p.backgroundPadding),p.scale=parseFloat(d._core.extendgl(o,u.scale,p.scale)),p.horizontalOrigin=d._core.extendgl(o,u.horizontalOrigin,p.horizontalOrigin),p.pointHeight=parseFloat(d._core.extendgl(o,u.pointHeight,p.pointHeight)),p.text=d._core.extendgl(o,u.text,p.text),parseFloat(d._core.extendgl(o,p.near))),n=parseFloat(d._core.extendgl(o,p.far)),r=new d._cesium.DistanceDisplayCondition(r,n),n=(p.distanceDisplayCondition=r,p.text=null==o.properties[p.text]?p.text:o.properties[p.text]._value,o.billboard.color=d._cesium.Color.WHITE.withAlpha(0),o.label=new d._cesium.LabelGraphics(p),d._viewer.scene.globe.ellipsoid,d._cesium.Cartographic.fromCartesian(o.position._value)),r=d._cesium.Math.toDegrees(n.longitude),a=d._cesium.Math.toDegrees(n.latitude),n=p.pointHeight||n.height,r=new d._cesium.Cartesian3.fromDegrees(r,a,n);o.position._value=r}e.clustering.enabled=!0,e.clustering.pixelRange=45,e.clustering.minimumClusterSize=3;for(var s,l=new d._cesium.PinBuilder,c=(l.fromText("50+",d._cesium.Color.RED,48).toDataURL(),l.fromText("40+",d._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",d._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",d._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",d._cesium.Color.BLUE,48).toDataURL(),new Array(8)),i=0;i<c.length;++i)c[i]=l.fromText(""+(i+2),d._cesium.Color.VIOLET,48).toDataURL();s=d._cesium.defined(s)?void s():e.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=d._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,d._cesium.Color.BLUE,48).toDataURL():t.billboard.image=c[e.length-2]}),s=e.clustering.pixelRange,e.clustering.pixelRange=0,e.clustering.pixelRange=s,h||d.setVisibility(h),d._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Su.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(e,t,u,i,h,m){var o={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},d=(this._core.isnull(u)||this._core.isnull(u.color)||"["==u.color.toString().charAt(0)&&"]"==u.color.toString().charAt(u.color.length-1)||(this._core.isHtmlColor(u.color)?u.color=this._color.colorFromHtmlColor(u.color):(/^rgb/.test(u.color)&&(u.color=this._color.rgbaStringToRgbaObj(u.color)),1<u.color.r&&(u.color.r=u.color.r/255),1<u.color.g&&(u.color.g=u.color.g/255),1<u.color.b&&(u.color.b=u.color.b/255),1<u.color.a&&(u.color.a=u.color.a/255),u.color=this._color.createColor(u.color.r,u.color.g,u.color.b,u.color.a))),this._core.isnull(u)||this._core.isnull(u.outlineColor)||"["==u.outlineColor.toString().charAt(0)&&"]"==u.outlineColor.toString().charAt(u.outlineColor.length-1)||(this._core.isHtmlColor(u.outlineColor)?u.outlineColor=this._color.colorFromHtmlColor(u.outlineColor):(/^rgb/.test(u.outlineColor)&&(u.outlineColor=this._color.rgbaStringToRgbaObj(u.outlineColor)),1<u.outlineColor.r&&(u.outlineColor.r=u.outlineColor.r/255),1<u.outlineColor.g&&(u.outlineColor.g=u.outlineColor.g/255),1<u.outlineColor.b&&(u.outlineColor.b=u.outlineColor.b/255),1<u.outlineColor.a&&(u.outlineColor.a=u.outlineColor.a/255),u.outlineColor=this._color.createColor(u.outlineColor.r,u.outlineColor.g,u.outlineColor.b,u.outlineColor.a))),this._core.extend(o,u,!0)),o=(this._viewer.scene.camera,this._viewer.scene.canvas,this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))),p=this,o=(o.then(function(e){for(var t=(p.item=e).entities.values,i=0;i<t.length;i++){var o=t[i],r=(d.color=p._core.extendgl(o,u.color,d.color),d.pixelSize=parseInt(p._core.extendgl(o,u.pixelSize,d.pixelSize)),d.outlineColor=p._core.extendgl(o,u.outlineColor,d.outlineColor),d.outlineWidth=parseFloat(p._core.extendgl(o,u.outlineWidth,d.outlineWidth)),d.show=p._core.extendgl(o,u.show,d.show),d.height=parseFloat(p._core.extendgl(o,u.height,d.height)),d.scaleByDistance=p._core.extendgl(o,u.scaleByDistance,d.scaleByDistance),parseFloat(p._core.extendgl(o,d.minDistanceDisplay))),n=parseFloat(p._core.extendgl(o,d.maxDistanceDisplay)),r=new p._cesium.DistanceDisplayCondition(r,n),n=(o.billboard.image="",d.distanceDisplayCondition=r,o.point=new p._cesium.PointGraphics(d),d.pointHeight=p._core.extendgl(o,u.pointHeight,d.pointHeight),d.pointHeight=parseFloat(d.pointHeight),p._viewer.scene.globe.ellipsoid,p._cesium.Cartographic.fromCartesian(o.position._value)),r=p._cesium.Math.toDegrees(n.longitude),a=p._cesium.Math.toDegrees(n.latitude),n=d.pointHeight||n.height,r=new p._cesium.Cartesian3.fromDegrees(r,a,n);o.position._value=r}e.clustering.enabled=!0,e.clustering.pixelRange=45,e.clustering.minimumClusterSize=3;for(var s,l=new p._cesium.PinBuilder,c=(l.fromText("50+",p._cesium.Color.RED,48).toDataURL(),l.fromText("40+",p._cesium.Color.ORANGE,48).toDataURL(),l.fromText("30+",p._cesium.Color.YELLOW,48).toDataURL(),l.fromText("20+",p._cesium.Color.GREEN,48).toDataURL(),l.fromText("10+",p._cesium.Color.BLUE,48).toDataURL(),new Array(8)),i=0;i<c.length;++i)c[i]=l.fromText(""+(i+2),p._cesium.Color.VIOLET,48).toDataURL();s=p._cesium.defined(s)?void s():e.clustering.clusterEvent.addEventListener(function(e,t){t.label.show=!1,t.point.show=!1,t.billboard.show=!0,t.billboard.id=t.label.id,t.billboard.verticalOrigin=p._cesium.VerticalOrigin.BOTTOM,50<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.RED,48).toDataURL():40<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.ORANGE,48).toDataURL():30<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.YELLOW,48).toDataURL():20<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.GREEN,48).toDataURL():10<=e.length?t.billboard.image=l.fromText(e.length,p._cesium.Color.BLUE,48).toDataURL():t.billboard.image=c[e.length-2]}),s=e.clustering.pixelRange,e.clustering.pixelRange=0,e.clustering.pixelRange=s,h||p.setVisibility(h),p._cesium.knockout.track({pixelRange:45,minimumClusterSize:3}),"function"==typeof m&&m(ps)}),this._core.getuid()),o={id:o,name:e=this._core.isnull(e)?"新建图层"+o:e,checked:h,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t};return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Su.prototype._cameraMoveEndHandler=function(){if(this._viewer.camera.getMagnitude()<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var e=0;e<this.labelCollections1.length;e++)this.labelCollections.add(this.labelCollections1[e]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections),new this._cesium.BillboardCollection;for(e=0;e<this.labelCollections2.length;e++)this.BillboardCollections.add(this.labelCollections2[e]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}},Su.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(e,t,i,o,r,n){for(var a=t,s=(this._viewer.scene.primitives,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=i.height,new this._cesium.BillboardCollection,{}),l=[],c=0;c<a.length;c++){var u={position:new this._cesium.Cartesian3.fromDegrees(a[c].lng,a[c].lat,100),text:a[c].name},h=(this.labelCollections1.push(u),a[c]);if(s[h[i.adminname]])for(var m=0;m<l.length;m++){var d=l[m];if(d.adminname==h[i.adminname]){d.data.push(h);break}}else l.push({adminname:h[i.adminname],name:h.name,showBackground:!0,lat:h.lat,lng:h.lng,data:[h]}),s[h[i.adminname]]=h}for(c=0;c<l.length;c++){u={position:new this._cesium.Cartesian3.fromDegrees(l[c].lng,l[c].lat,100),image:pinBuilder.fromText(l[c].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(u),this.BillboardCollections.add(u)}this._viewer.scene.primitives.add(this.BillboardCollections)},Su.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(e,t,i,o,r,n){var a={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED},s={url:t.url,upperLevelLimit:21,lowerLevelLimit:0,minLevel1:t.minLevel1,minLevel3:t.minLevel3,rectangle:this._cesium.Rectangle.fromDegrees(118.74324788700017,32.036708147800084,118.7994917630001,32.07298490959994),Cesium:this._cesium,output:t.output,resultmode:t.resultmode,uid:t.uid,st:t.st,words:t.words,area:t.area,callback:t.callback},l=(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):/^http/.test(i.material)||(/^rgb/.test(i.material)&&(i.material=this._color.rgbaStringToRgbaObj(i.material)),1<i.material.r&&(i.material.r=i.material.r/255),1<i.material.g&&(i.material.g=i.material.g/255),1<i.material.b&&(i.material.b=i.material.b/255),1<i.material.a&&(i.material.a=i.material.a/255),i.material=this._color.createColor(i.material.r,i.material.g,i.material.b,i.material.a))),this._core.isnull(i)||this._core.isnull(i.fill)||"["==i.fill.toString().charAt(0)&&"]"==i.fill.toString().charAt(i.fill.length-1)||(this._core.isHtmlColor(i.fill)?i.fill=this._color.colorFromHtmlColor(i.fill):/^http/.test(i.fill)||(/^rgb/.test(i.fill)&&(i.fill=this._color.rgbaStringToRgbaObj(i.fill)),1<i.fill.r&&(i.fill.r=i.fill.r/255),1<i.fill.g&&(i.fill.g=i.fill.g/255),1<i.fill.b&&(i.fill.b=i.fill.b/255),1<i.fill.a&&(i.fill.a=i.fill.a/255),i.fill=this._color.createColor(i.fill.r,i.fill.g,i.fill.b,i.fill.a))),this._core.extend(a,i,!0)),c=this,a=new Tu(this._viewer,this._cesium,s),s=((this._Provider=a)._loadTile=function(e,o){c._viewer.scene.primitives.remove(c.labelCollections),c.labelCollections=new(""==o?c._cesium.PointPrimitiveCollection:c._cesium.BillboardCollection);var r=new c._cesium.PinBuilder;return e.result.features.forEach(function(e){var t,i={};null!=e.lng&&(t=new c._cesium.Cartesian3.fromDegrees(e.lng,e.lat,l.height),i=""==o?{id:e,color:l.material,position:t}:{position:t,image:r.fromText(e.count+"",l.fill,l.size).toDataURL(),verticalOrigin:c._cesium.VerticalOrigin.BOTTOM},c.labelCollections.add(i))}),c._viewer.scene.primitives.add(c.labelCollections),c.item=c.labelCollections,c.labelCollections},a.addTo(this._viewer),r||this.setVisibility(!1),this._core.isnull(l.id)&&(l.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+l.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:l.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"polygonLayer",item:this,url:t.url,style:i});return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},Su.prototype.createLabelGeoJsonFeatureLayerProvider=function(e,t,a,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},s=this,n=(a.material,s._core.isnull(a)||s._core.isnull(a.fillColor)||/^\[/.test(a.fillColor)&&"["==a.fillColor.toString().charAt(0)&&"]"==a.fillColor.toString().charAt(a.fillColor.length-1)||(s._core.isHtmlColor(a.fillColor)?a.fillColor=s._color.colorFromHtmlColor(a.fillColor):(/^rgb/.test(a.fillColor)&&(a.fillColor=s._color.rgbaStringToRgbaObj(a.fillColor)),1<a.fillColor.r&&(a.fillColor.r=a.fillColor.r/255),1<a.fillColor.g&&(a.fillColor.g=a.fillColor.g/255),1<a.fillColor.b&&(a.fillColor.b=a.fillColor.b/255),1<a.fillColor.a&&(a.fillColor.a=a.fillColor.a/255),a.fillColor=s._color.createColor(a.fillColor.r,a.fillColor.g,a.fillColor.b,a.fillColor.a))),s._core.isnull(a)||s._core.isnull(a.material)||/^\[/.test(a.material)&&"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(s._core.isHtmlColor(a.material)?a.material=s._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=s._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=s._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),new v(this._viewer,this._cesium,n)),n=((this._Provider=n)._loadTile=function(e){var r,t={Name:"",text:"",font:" 30px sans-serif",style:s._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},n=s._core.extend(t,a,!0),t=(s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999),parseFloat(a.near)),i=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(t,i);return n.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),n.font=parseFloat(a.font_size)+"px "+a.font_family,r=new(null!=n.image&&null!=n.image?s._cesium.BillboardCollection:s._cesium.LabelCollection),e.features.forEach(function(e){n.id=e;var t,i=n.pointHeight,o=(/^\[/.test(i)&&/\]$/.test(i)?(o=i.replace(/\[/,"").replace(/\]/,""),i=parseFloat(e.properties[o])):null!=i&&""!=i?i=parseFloat(i):null!=e.properties.height&&(i=parseFloat(e.properties.height)),n.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],i),/^\[/.test(a.fillColor)&&/\]$/.test(a.fillColor)&&(t=a.fillColor.replace(/\[/,"").replace(/\]/,""),n.fillColor=e.properties[t],s._core.isHtmlColor(n.fillColor)?n.fillColor=s._color.colorFromHtmlColor(n.fillColor):(/^rgb/.test(n.fillColor)&&(n.fillColor=s._color.rgbaStringToRgbaObj(n.fillColor)),1<n.fillColor.r&&(n.fillColor.r=n.fillColor.r/255),1<n.fillColor.g&&(n.fillColor.g=n.fillColor.g/255),1<n.fillColor.b&&(n.fillColor.b=n.fillColor.b/255),1<n.fillColor.a&&(n.fillColor.a=n.fillColor.a/255),n.fillColor=s._color.createColor(n.fillColor.r,n.fillColor.g,n.fillColor.b,n.fillColor.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(t=a.outlineColor.replace(/\[/,"").replace(/\]/,""),n.outlineColor=e.properties[t],s._core.isHtmlColor(n.outlineColor)?n.outlineColor=s._color.colorFromHtmlColor(n.outlineColor):(/^rgb/.test(n.outlineColor)&&(n.outlineColor=s._color.rgbaStringToRgbaObj(n.outlineColor)),1<n.outlineColor.r&&(n.outlineColor.r=n.outlineColor.r/255),1<n.outlineColor.g&&(n.outlineColor.g=n.outlineColor.g/255),1<n.outlineColor.b&&(n.outlineColor.b=n.outlineColor.b/255),1<n.outlineColor.a&&(n.outlineColor.a=n.outlineColor.a/255),n.outlineColor=s._color.createColor(n.outlineColor.r,n.outlineColor.g,n.outlineColor.b,n.outlineColor.a))),"fillColor:"+255*n.fillColor.red+","+255*n.fillColor.green+","+255*n.fillColor.blue+";outlineColor:"+255*n.outlineColor.red+","+255*n.outlineColor.green+","+255*n.outlineColor.blue);s.Legend.push(o),/^\[/.test(a.text)&&/\]$/.test(a.text)&&(t=a.text.replace(/\[/,"").replace(/\]/,""),n.text=e.properties[t]),r.add(n)}),r},a&&a.time&&(n.availability=new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({start:a.time.start?s._cesium.JulianDate.fromDate(new Date(a.time.start)):s._cesium.Iso8601.MINIMUM_VALUE,stop:a.time.end?s._cesium.JulianDate.fromDate(new Date(a.time.end)):s._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"labelPointLayer",item:this,url:t.url,style:a});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Su.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(e,t,u,i,h,m){null==t&&console.log("geojson is required");var o=this._cesium.GeoJsonDataSource.load(t),d=(this._viewer.dataSources.add(o),this),p=new this._cesium.PointPrimitiveCollection,o=(d.optiontext=[],o.then(function(e){for(var t=(d.item=e).entities.values,i=0;i<t.length;i++){var o,r,n=t[i],n=(o=/^\[/.test(u.text)&&/\]$/.test(u.text)?(o=u.text.replace(/\[/,"").replace(/\]/,""),n.properties[o]._value):u.text,d.optiontext.push(o),n.billboard=void 0,d._viewer.scene.globe.ellipsoid,d._cesium.Cartographic.fromCartesian(n.position._value)),n=[d._cesium.Math.toDegrees(n.longitude),d._cesium.Math.toDegrees(n.latitude),u.pointHeight||n.height],a=d._core.getuid();n instanceof Array?2===n.length?r=d._cesium.Cartesian3.fromDegrees(n[0],n[1]):3===n.length&&(r=d._cesium.Cartesian3.fromDegrees(n[0],n[1],n[2])):r=n.z?d._cesium.Cartesian3.fromDegrees(n.x,n.y,n.z):d._cesium.Cartesian3.fromDegrees(n.x,n.y),p.add({id:"DivPoint"+a,position:r,color:d._cesium.Color.YELLOW,description:u.text})}d.item=p,d.pointPrimitive=d._viewer.scene.primitives.add(p);var s,l,c=!0;d.pointPrimitive.update=function(){for(var e,t,i=0;i<d.pointPrimitive.length;i++){if(e=d.pointPrimitive.get(i),l=e.position,!(l=d._viewer.scene.cartesianToCanvasCoordinates(l)))return;(s=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+d.optiontext[i]+"</div>\n           </div>",$(".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)+")"}c&&(h||d.setVisibility(!1),c=!1)},"function"==typeof m&&m(e)}),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="富文本"),{id:u.id,name:e,checked:h,pId:this._core.isnull(i)?0:i,type:"DivPoint",item:this,url:t,style:u});return this.setTreeobj(o),this._tree.insertGroupId(o,this._core.isnull(i)?0:i),this},Su.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},c=this,r=new v(this._viewer,this._cesium,r),r=((this._Provider=r)._loadTile=function(e){var o,r,n=new c._cesium.PointPrimitiveCollection,a=(c.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 c._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]),c._core.getuid());n.add({id:"DivPoint"+i,position:Cartesian3,color:c._cesium.Color.YELLOW,description:s.text}),c.optiontext.push(option.text)}),c.pointPrimitive=c._viewer.scene.primitives.add(n),!0);return c.pointPrimitive.update=function(){for(var e,t,i=0;i<c.pointPrimitive.length;i++){if(e=c.pointPrimitive.get(i),r=e.position,!(r=c._viewer.scene.cartesianToCanvasCoordinates(r)))return;(o=document.getElementById(e.id))||(t='<div id="'+e.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+I.divpoint1+');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">'+c.optiontext[i]+"</div>\n           </div>",$(".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||c.setVisibility(!1),a=!1)},c.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},Su.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<n.color.r&&(n.color.r=n.color.r/255),1<n.color.g&&(n.color.g=n.color.g/255),1<n.color.b&&(n.color.b=n.color.b/255),1<n.color.a&&(n.color.a=n.color.a/255),n.color=s._color.createColor(n.color.r,n.color.g,n.color.b,n.color.a))),new v(this._viewer,this._cesium,a)),a=((this._Provider=a)._loadTile=function(e){var t={url:"",modelMatrix:s._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:s._cesium.Color.DARKSALMON,scale:2},o=s._core.extend(t,n,!0),t=(s._core.isnull(n.near)&&(n.near=0),s._core.isnull(n.far)&&(n.far=999999999),parseFloat(n.near)),i=parseFloat(n.far),t=new s._cesium.DistanceDisplayCondition(t,i),r=(o.distanceDisplayCondition=t,new s._cesium.PrimitiveCollection);return e.features.forEach(function(e){o.id=e;var t=o.height,i=(null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(o.height)&&/\]$/.test(o.height)&&(i=o.height.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])),o.modelMatrix=s._cesium.Transforms.eastNorthUpToFixedFrame(s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t)),s._cesium.Model.fromGltf({id:e,url:o.uri,color:o.color,modelMatrix:o.modelMatrix,scale:o.scale,heightReference:parseInt(o.heightReference),distanceDisplayCondition:o.distanceDisplayCondition}));r.add(i)}),r},this.item=a._primitiveCollection,a.addTo(this._viewer),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+n.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,o||this.setVisibility(!1),{id:n.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"modelLayer",item:this,url:t.url,style:n});return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Su.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,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},s=this,n=(s._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),new v(this._viewer,this._cesium,n)),n=((this._Provider=n)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:s._cesium.LabelStyle.OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1)},r=(a.material,s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),s._core.extend(t,a,!0)),t=(s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999),parseFloat(a.near)),i=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(t,i),n=(r.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),r.font=parseFloat(a.font_size)+"px "+a.font_family,new s._cesium.PointPrimitiveCollection);return e.features.forEach(function(e){r.id=e;var t=0,i=(/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(i=r.pointHeight.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])):void 0!==r.pointHeight&&""!==r.pointHeight?t=parseFloat(r.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(o=a.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[o],s._core.isHtmlColor(r.color)?r.color=s._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=s._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=s._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(o=a.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[o],s._core.isHtmlColor(r.outlineColor)?r.outlineColor=s._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=s._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=s._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),r.text=e.properties.name,{show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e}),o="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;s.Legend.push(o),n.add(i)}),n},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Su.prototype.createPointGeoJsonFeatureLayerProvider=function(e,t,a,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},s=this,n=(s._core.isnull(a)||s._core.isnull(a.color)||/^\[/.test(a.color)&&"["==a.color.toString().charAt(0)&&"]"==a.color.toString().charAt(a.color.length-1)||(s._core.isHtmlColor(a.color)?a.color=s._color.colorFromHtmlColor(a.color):(/^rgb/.test(a.color)&&(a.color=s._color.rgbaStringToRgbaObj(a.color)),1<a.color.r&&(a.color.r=a.color.r/255),1<a.color.g&&(a.color.g=a.color.g/255),1<a.color.b&&(a.color.b=a.color.b/255),1<a.color.a&&(a.color.a=a.color.a/255),a.color=s._color.createColor(a.color.r,a.color.g,a.color.b,a.color.a))),s._core.isnull(a)||s._core.isnull(a.outlineColor)||/^\[/.test(a.outlineColor)&&"["==a.outlineColor.toString().charAt(0)&&"]"==a.outlineColor.toString().charAt(a.outlineColor.length-1)||(s._core.isHtmlColor(a.outlineColor)?a.outlineColor=s._color.colorFromHtmlColor(a.outlineColor):(/^rgb/.test(a.outlineColor)&&(a.outlineColor=s._color.rgbaStringToRgbaObj(a.outlineColor)),1<a.outlineColor.r&&(a.outlineColor.r=a.outlineColor.r/255),1<a.outlineColor.g&&(a.outlineColor.g=a.outlineColor.g/255),1<a.outlineColor.b&&(a.outlineColor.b=a.outlineColor.b/255),1<a.outlineColor.a&&(a.outlineColor.a=a.outlineColor.a/255),a.outlineColor=s._color.createColor(a.outlineColor.r,a.outlineColor.g,a.outlineColor.b,a.outlineColor.a))),new v(this._viewer,this._cesium,n)),n=((this._Provider=n)._loadTile=function(e){var t={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:s._cesium.LabelStyle.OUTLINE,fillColor:s._cesium.Color.WHITE,outlineColor:s._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new s._cesium.Color(.165,.165,.165,.8),backgroundPadding:new s._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:s._cesium.HorizontalOrigin.CENTER,verticalOrigin:s._cesium.VerticalOrigin.CENTER,eyeOffset:s._cesium.Cartesian3.ZERO,pixelOffset:s._cesium.Cartesian2.ZERO,heightReference:s._cesium.HeightReference.NONE,scaleByDistance:new s._cesium.NearFarScalar(0,0,1,1)},r=(a.material,s._core.isnull(a)||s._core.isnull(a.backgroundColor)||/^\[/.test(a.backgroundColor)&&"["==a.backgroundColor.toString().charAt(0)&&"]"==a.backgroundColor.toString().charAt(a.backgroundColor.length-1)||(s._core.isHtmlColor(a.backgroundColor)?a.backgroundColor=s._color.colorFromHtmlColor(a.backgroundColor):(/^rgb/.test(a.backgroundColor)&&(a.backgroundColor=s._color.rgbaStringToRgbaObj(a.backgroundColor)),1<a.backgroundColor.r&&(a.backgroundColor.r=a.backgroundColor.r/255),1<a.backgroundColor.g&&(a.backgroundColor.g=a.backgroundColor.g/255),1<a.backgroundColor.b&&(a.backgroundColor.b=a.backgroundColor.b/255),1<a.backgroundColor.a&&(a.backgroundColor.a=a.backgroundColor.a/255),a.backgroundColor=s._color.createColor(a.backgroundColor.r,a.backgroundColor.g,a.backgroundColor.b,a.backgroundColor.a))),s._core.extend(t,a,!0)),t=(s._core.isnull(a.near)&&(a.near=0),s._core.isnull(a.far)&&(a.far=999999999),parseFloat(a.near)),i=parseFloat(a.far),t=new s._cesium.DistanceDisplayCondition(t,i),n=(r.distanceDisplayCondition=t,s._core.isnull(a.font_size)&&(a.font_size="30px"),s._core.isnull(a.font_family)&&(a.font_family=" sans-serif"),r.font=parseFloat(a.font_size)+"px "+a.font_family,new s._cesium.PointPrimitiveCollection);return e.features.forEach(function(e){r.id=e;var t=0,i=(/^\[/.test(r.pointHeight)&&/\]$/.test(r.pointHeight)?(i=r.pointHeight.replace(/\[/,"").replace(/\]/,""),t=parseFloat(e.properties[i])):void 0!==r.pointHeight&&""!==r.pointHeight?t=parseFloat(r.pointHeight):null!=e.properties.height&&(t=parseFloat(e.properties.height)),/^\[/.test(a.color)&&/\]$/.test(a.color)&&(o=a.color.replace(/\[/,"").replace(/\]/,""),r.color=e.properties[o],s._core.isHtmlColor(r.color)?r.color=s._color.colorFromHtmlColor(r.color):(/^rgb/.test(r.color)&&(r.color=s._color.rgbaStringToRgbaObj(r.color)),1<r.color.r&&(r.color.r=r.color.r/255),1<r.color.g&&(r.color.g=r.color.g/255),1<r.color.b&&(r.color.b=r.color.b/255),1<r.color.a&&(r.color.a=r.color.a/255),r.color=s._color.createColor(r.color.r,r.color.g,r.color.b,r.color.a))),/^\[/.test(a.outlineColor)&&/\]$/.test(a.outlineColor)&&(o=a.outlineColor.replace(/\[/,"").replace(/\]/,""),r.outlineColor=e.properties[o],s._core.isHtmlColor(r.outlineColor)?r.outlineColor=s._color.colorFromHtmlColor(r.outlineColor):(/^rgb/.test(r.outlineColor)&&(r.outlineColor=s._color.rgbaStringToRgbaObj(r.outlineColor)),1<r.outlineColor.r&&(r.outlineColor.r=r.outlineColor.r/255),1<r.outlineColor.g&&(r.outlineColor.g=r.outlineColor.g/255),1<r.outlineColor.b&&(r.outlineColor.b=r.outlineColor.b/255),1<r.outlineColor.a&&(r.outlineColor.a=r.outlineColor.a/255),r.outlineColor=s._color.createColor(r.outlineColor.r,r.outlineColor.g,r.outlineColor.b,r.outlineColor.a))),r.position=new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1],t),r.text=e.properties.name,{show:r.show,position:r.position,pixelSize:r.pixelSize,color:r.color,outlineColor:r.outlineColor,outlineWidth:r.outlineWidth,id:e}),o="color:"+255*r.color.red+","+255*r.color.green+","+255*r.color.blue+";outlineColor:"+255*r.outlineColor.red+","+255*r.outlineColor.green+","+255*r.outlineColor.blue;s.Legend.push(o),n.add(i)}),n},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(a.id)&&(a.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+a.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:a.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"pointLayer",item:this,url:t.url,style:a});return this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item),this},Su.prototype.setTreeobj=function(e){this.treeobj=e},Su.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Su.prototype.deleteObject=function(){if(null!=this._Provider&&this._Provider.setStatus(!1),null!=this.items&&null!=this.items&&0<this.items.length)for(var e=0;e<this.items.length;e++)this._viewer.scene.primitives.remove(this.items[e]);else this._viewer.scene.primitives.remove(this.item);if("DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(e=0;e<this.item._pointPrimitives.length;e++){var t=document.getElementById(this.item._pointPrimitives[e].id);t&&t.remove()}try{this._Provider.remove()}catch(e){}},Su.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Su.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Su.prototype.setVisibility=function(e){if(null!=this.treeobj&&"DivPoint"===this.treeobj.type&&this.item&&null!=this.item._pointPrimitives&&null!=this.item._pointPrimitives)for(var t=0;t<this.item._pointPrimitives.length;t++){var i=document.getElementById(this.item._pointPrimitives[t].id);i&&(i.style.display=e?"block":"none")}null!=this.item&&(this.item.show=e),this._Provider&&this._Provider.setStatus(!e)},Object.defineProperties(Su.prototype,{labelText:{set:C.debounce(function(e){var t=e;if(!this._core.isnull(e)){var i=this.item.entities&&this.item.entities.values;if(i&&0<i.length)for(var o=0;o<i.length;o++)if(/^\[/.test(e)&&(t=e.replace(/\[/,"").replace(/\]/,""),t=i[o].properties[t]._value),i[o].label){i[o].label.text=t;try{i[o].point.show=!1}catch(e){}}else{try{i[o].point.show=!1}catch(e){}i[o].label=new this._cesium.LabelGraphics({text:t,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.style=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.style:void 0}},labelFont:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o=16;if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[0]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=o+"px "+e}}},500)},labelFontSize1:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),!t||/^point.fid/.test(t[0]._id)||null!=t[0].label){var i=t[0].label.font,o="sans-serif";if(i&&(o=(i=i._value.trimLeft().trimRight()).split("px")[1]),t&&0<t.length&&t[0].label)for(var r=0;r<t.length;r++)t[r].label.font=e+"px  "+o}}},500)},labelFontSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if(e=e.toString().replace(/px/g,""),(!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.font=e+"px  sans-serif"}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?parseFloat(e[0].label.font):void 0}},labelFillColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.fillColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.fillColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},labelOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.outlineWidth=e}},200),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.outlineWidth;if(e)return e._value}}},labelBackgroundColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.backgroundColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?(e=e[0].label.backgroundColor,this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")):void 0}},labelBackground:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.showBackground=e},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.background:void 0}},labelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].label.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.scale;if(e)return e._value}}},labelHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.horizontalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.horizontalOrigin;if(e)return e._value}}},labelVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.verticalOrigin=parseInt(e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.verticalOrigin;if(e)return e._value}}},labelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=0;i<t.length;i++)t[i].label.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label){e=e[0].label.heightReference;if(e)return e._value}}},labelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,parseInt(e)),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(i,1,parseInt(e),0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},labelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].label)&&t&&0<t.length&&t[0].label)for(var i=t[0].label.distanceDisplayCondition?t[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(e),i),t[o].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(e),1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.distanceDisplayCondition?e[0].label.distanceDisplayCondition._value.near:0:void 0}},labelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},labelShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].label&&e?(t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(t[i].label&&(t[i].label.show=e),t[i].point&&(t[i].point.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].label)&&e&&0<e.length&&e[0].label?e[0].label.show:void 0}},modelShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e),!t[i].model&&e?t[i].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(t[i].model&&(t[i].model.show=e),t[i].label&&(t[i].label.show=!e),t[i].point&&(t[i].point.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.show:void 0}},modelUri:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)t[o].model?t[o].model.uri=e:(/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].model=new this._cesium.ModelGraphics({uri:e,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}))}},500)},modelScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){e=parseFloat(e);var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].model.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.scale;if(e)return e._value}}},modelShadows:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.shadows=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.shadows:void 0}},modelHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.heightReference;if(e)return e._value}}},modelDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;e&&!/^point.fid/.test(e[0]._id)&&null==e[0].model||e&&0<e.length&&e[0].model&&(e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE)}},modelDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=t[0].model.distanceDisplayCondition?t[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model?e[0].model.distanceDisplayCondition?e[0].model.distanceDisplayCondition._value.near:0:void 0}},modelColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelLightColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].model)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].model.lightColor=e}},100),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].model)&&e&&0<e.length&&e[0].model){e=e[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},modelHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},pointColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].point&&e?(t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e),t[i].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(t[i].point&&(t[i].point.show=e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.show:void 0}},pointPixelSize:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.pixelSize=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.pixelSize;if(e)return e._value}}},pointOutlineColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.outlineColor=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},pointOutlineWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)/^\[/.test(e)&&(e=e.replace(/\[/,"").replace(/\]/,""),e=t[i].properties[e]),t[i].point.outlineWidth=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.outlineWidth;if(e)return e._value}}},pointHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=0;i<t.length;i++)t[i].point.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point){e=e[0].point.heightReference;if(e)return e._value}}},pointDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},pointDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].point)&&t&&0<t.length&&t[0].point)for(var i=t[0].point.distanceDisplayCondition?t[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].point.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].point)&&e&&0<e.length&&e[0].point?e[0].point.distanceDisplayCondition?e[0].point.distanceDisplayCondition._value.near:0:void 0}},pointHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}},billboardShow:{set:C.debounce(function(e){var t=this.item.entities&&this.item.entities.values;if(t&&0<t.length)for(var i=0;i<t.length;i++)!t[i].billboard&&e?(t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].model&&(t[i].model.show=!e),t[i].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(t[i].billboard&&(t[i].billboard.show=e),t[i].point&&(t[i].point.show=!e),t[i].label&&(t[i].label.show=!e),t[i].billboard&&(t[i].billboard.show=!e))},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.show:void 0}},billboardImage:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length)for(var i,o=0;o<t.length;o++)/^\[/.test(e)&&(e=1<(i=e.split("[")).length?i[0]+i[1].replace(/\[/,"").replace(/\]/,""):(e=e.replace(/\[/,"").replace(/\]/,""),t[o].properties[e])),t[o].billboard?t[o].billboard.image=e:t[o].billboard=new this._cesium.BillboardGraphics({image:e,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}},500)},billboardScale:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.scale=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.scale;if(e)return e._value}}},billboardHorizontalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.horizontalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.horizontalOrigin:void 0}},billboardVerticalOrigin:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.verticalOrigin=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.verticalOrigin:void 0}},billboardWidth:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.width=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.width;if(e)return e._value}}},billboardHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.height=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.height;if(e)return e._value}}},billboardColor:{set:C.debounce(function(e){if(!this._core.isnull(e)){this._core.isnull(e)||(e=this._core.isHtmlColor(e)?this._color.colorFromHtmlColor(e):(1<(e=/^rgb/.test(e)?this._color.rgbaStringToRgbaObj(e):e).r&&(e.r=e.r/255),1<e.g&&(e.g=e.g/255),1<e.b&&(e.b=e.b/255),1<e.a&&(e.a=e.a/255),this._color.createColor(e.r,e.g,e.b,e.a)));var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=0;i<t.length;i++)t[i].billboard.color=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard){e=e[0].billboard.color;try{return this._color.toHtmlColor("rgb("+255*e._value.red+","+255*e._value.green+","+255*e._value.blue+","+255*e._value.alpha+")")}catch(e){}}}},billboardHeightReference:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].model)for(var i=0;i<t.length;i++)t[i].billboard.heightReference=e}},500),get:function(){var e=this.item.entities&&this.item.entities.values;if((!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].model){e=e[0].billboard.heightReference;if(e)return e._value}}},billboardDistanceDisplayMaxCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.near:0,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(i,e),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(i,1,e,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE:void 0}},billboardDistanceDisplayMinCondition:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].billboard)&&t&&0<t.length&&t[0].billboard)for(var i=t[0].billboard.distanceDisplayCondition?t[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,o=0;o<t.length;o++)t[o].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(e,i),t[o].billboard.scaleByDistance=new this._cesium.NearFarScalar(e,1,i,0)}},500),get:function(){var e=this.item.entities&&this.item.entities.values;return(!e||/^point.fid/.test(e[0]._id)||null!=e[0].billboard)&&e&&0<e.length&&e[0].billboard?e[0].billboard.distanceDisplayCondition?e[0].billboard.distanceDisplayCondition._value.near:0:void 0}},billboardPHeight:{set:C.debounce(function(e){if(!this._core.isnull(e)){var t=this.item.entities&&this.item.entities.values;if((!t||/^point.fid/.test(t[0]._id)||null!=t[0].position)&&t&&0<t.length&&t[0].position)for(var i=0;i<t.length;i++){var o=this._cesium.Cartographic.fromCartesian(t[i].position._value),r=this._cesium.Math.toDegrees(o.longitude),o=this._cesium.Math.toDegrees(o.latitude),r=this._cesium.Cartesian3.fromDegrees(r,o,e);t[i].position=r}}},500),get:function(){return 0}}});function Eu(e,u,h,m){var d=[],p=void 0!==e[0].longitude;return e.forEach(function(e){var t,i,o,r,n,a,s,l,c=[],e=p?e:Pu.scene.globe.ellipsoid.cartesianToCartographic(e);t=e,o=m,r=(i=u).west,n=u.east,a=u.south,i=u.north-a,s=180*t.longitude/Math.PI,l=180*t.latitude/Math.PI,t.normalizedLongitude=(s-r)/(n-r)*h,t.normalizedLatitude=(l-a)/i*o,e=t,c.push(e.normalizedLongitude),c.push(e.normalizedLatitude),d.push(c)}),d}var Pu,xu=function(e,t,i){var o=t.west*Cesium.Math.DEGREES_PER_RADIAN,r=t.east*Cesium.Math.DEGREES_PER_RADIAN,n=t.south*Cesium.Math.DEGREES_PER_RADIAN,t=t.north*Cesium.Math.DEGREES_PER_RADIAN,o=new Cesium.Rectangle(o,n,r,t),a=Eu(e,o,32,32),n="#FF0000",r=32,t=32;e=void 0,(e=document.createElement("canvas")).width=r,e.height=t;var s=e.getContext("2d");if(!(a.length<=0)){s.moveTo(a[0][0],a[0][1]);for(var l=0;l<a.length;l++)s.lineTo(a[l][0],a[l][1]);return null!=n&&(s.fillStyle=n,s.fill()),e}};function Du(e,t){return Math.floor(Math.random()*(t-e+1))+e}function Iu(e,o){var t=Cesium.when.defer(),r=[];return e.forEach(function(e){var t,i;r.push((e=e,t=o,i=Cesium.when.defer(),(Du=xu(e.vertices,t,e.heights[0])).timeStamp=e.timeStamp,Du.mtHeight=e.heights,Du.mtType=e.mtType,Du.fromKML=e.fromKML,Du.rect=e.rectangle,Du.level=e.level,i.resolve(Du),i))}),Cesium.when.all(r,function(e){e[0].lenght;var o;1===e.length?t.resolve(e[0]):(e=e.sort(function(e,t){return t.timeStamp-e.timeStamp}),o=e.shift(),e.forEach(function(i){o.forEach(function(e,t){e===Du&&i[t]!==Du&&(o[t]=i[t])})}),t.resolve(o))}),t}function Au(e,t){if(Pu=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._modelFloorMasks={},this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this.readyPromise=Cesium.when.resolve(!0),this._subdomains=t.subdomains,t.firstRequestUrl=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+t.layerName+"&Styles=&Format=image/mpt";var i=this,e=t.pngOnly;void 0!==t.maxTerrainLevel&&isNaN(t.maxTerrainLevel)&&(t.maxTerrainLevel=void 0),this._maxTerrainLevel=Cesium.defaultValue(t.maxTerrainLevel,30),e?i.setFormatMPT(!1):$.ajax({url:t.cacheUrl?t.cacheUrl+"/0/0/0."+(t.cacheFormat||"mpt"):this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i.setFormatMPT(!1),null;i.setFormatMPT(!0)},error:function(){return i.setFormatMPT(!1),null},async:!1}),t.cacheUrl&&(this.isCache=!0,this.cacheLevel=t.cacheLevel||16,this._cacheUrl=t.cacheUrl+"/{z}/{x}/{reverseY}."+(t.cacheFormat||"mpt"));let o=this._maxTerrainLevel;this._availability={computeMaximumLevelAtPosition:function(e){return Math.min(o,16)}},this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new de({workerPath:SmartEarthRootUrl+"Workers/ParseElevationWorker.js"}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)}Au._geometricErrorFactor=2,Object.defineProperties(Au.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),Au.prototype.setFormatMPT=function(e){var t;e&&this.pngOnly||(t=this._format,this._format=e?"mpt":"png",t!==this._format&&(this._isMPT=e,void 0!==this._urlTemplate&&(this._urlTemplate=this._urlTemplate.replace("image/"+t,"image/"+this._format))))},Au.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*Au._geometricErrorFactor},Au.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},Au.prototype.getTileDataAvailable=function(e,t,i){var o=Math.min(this._maxTerrainLevel,25);return!!this._isMPT||i<o},Au.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2),t=Math.min(t,e);return Math.pow(2,t)},Au.prototype.getRequestBaseTerrainUrl=function(e,t,i,o){return this.getRequestUrl(e,t,i,o)},Au.prototype.getRequestElevationLayer=function(e,t,i){return this.getRequestUrl(e,t,i,!1,!0)},Au.prototype.getRequestUrl=function(e,t,i,o,r){var n,a=i,s=null!=o?this.requestFactorForLevel(i):1,e=null!=o?(e-e%s)/s:e,t=null!=o?(t-t%s)/s:t,i=null!=o?i-Math.log(s)/Math.log(2):i;return this.isCache&&0!==i&&i<=this.cacheLevel?(n=this.tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,this._cacheUrl.replace("{x}",e).replace("{reverseY}",n).replace("{z}",i)):(n=this.tilingScheme.tileXYToNativeRectangle(e,t,i),o=this.heightMapWidth*s==256&&o?1:0,r&&(o=0),this._urlTemplate.replace("{south}",n.south).replace("{north}",n.north).replace("{west}",n.west).replace("{east}",n.east).replace("{optimizedOnly}",o).replace("{width}",this.heightMapWidth*s).replace("{height}",this.heightMapHeight*s).replace("{s}",this.sTag(e,t,i))+"&level="+i+"&origLevel="+a)},Au.prototype.isT_Inside_E=function(e,t){return e.west>=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},Au.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)},Au.prototype.sTag=function(e,t,i){return null==this._subdomains?"":(e=(e+t+i)%this._subdomains.length,this._subdomains[e])},Au.prototype.refreshElevationLayer=function(e){e.rectangle&&void 0!==Pu.scene.globe._surface._levelZeroTiles&&this.findDirectParent(e.rectangle,!0).freeResources()},Au.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<o;r++){var n=e.children[r];if(Cesium.Rectangle.contains(n._rectangle,Cesium.Rectangle.center(t)))return a(n,t,i)}return null}if(e.width!=Math.PI)for(var i=0;i<Pu.scene.globe._surface._levelZeroTiles.length;i++){var o=a(Pu.scene.globe._surface._levelZeroTiles[i],e,t);if(o)return o}return null},Au.prototype.isTileAvailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);if(r&&r.data&&r.data.terrainData){if(!(0<r.data.terrainData._childTileMask))return!1;for(var n=r.children.length,a=0;a<n;a++){var s=r.children[a];if(Cesium.Rectangle.equals(s._rectangle,o))return r.data.terrainData._childTileMask&1<<a}}return!0},Au.prototype.markTileAsUnavailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);r&&r.data&&r.data.terrainData&&0<r.data.terrainData._childTileMask&&$.each(r.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,o)){switch(e){case 0:r.data.terrainData._childTileMask&=-5;break;case 1:r.data.terrainData._childTileMask&=-9;break;case 2:r.data.terrainData._childTileMask&=-2;break;case 3:r.data.terrainData._childTileMask&=-3}return!1}return!0})},Au.prototype.requestBaseTerrainTileGeometry=function(e,t,i,o){return this.requestTileGeometryBuffers(e,t,i,o)},Au.prototype.requestElevationLayerTileGeometry=function(e,t,i,o,r){return this.requestTileGeometryBuffers(e,t,i,o,r)},Au.prototype.requestTileGeometryBuffers=function(e,t,i,o,r){var m=this,d={};d.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(e,t,i),d.layer=r;var n,a,p=Cesium.when.defer(),s=this.requestTileHeightBuffer(e,t,i,o,void 0,r);return void 0===s?void 0:(n=this.requestTileHeightBuffer(e+1,t,i,o,!0,r),a=this.requestTileHeightBuffer(e,t+1,i,o,!0,r),e=this.requestTileHeightBuffer(e+1,t+1,i,o,!0,r),Cesium.when.all([s,n,a,e],function(e){if(null!=e[0].myReject&&e[0].myReject)p.reject();else{for(var t=m.heightMapWidth+1,i=m.heightMapHeight+1,o=new Float32Array(t*i),r=e[0].isFloor,n=0;n<t;n++)for(var a=0;a<i;a++){var s=n,l=a,c=0,u=(a===t-1&&(l=0,c=1,r&&(c=0,l=t-2)),n===i-1&&(s=0,c=2),n*t+a),s=s*m.heightMapWidth+l;null===e[c]||null!=e[c].myReject&&e[c].myReject||(o[u]=e[c][s])}null!=e[3].myReject&&e[3].myReject||(o[t*i-1]=e[3][0]);var h=m.arrayToHeightmapTerrainData(o,t,i,15);d.buffer=h,p.resolve(d)}}).otherwise(function(){p.reject()}),p)},Au.prototype.requestTileGeometry=function(o,r,n,a){var s=this,l=[],c=s.tilingScheme.tileXYToNativeRectangle(o,r,n),u=(null!=this._allElevationLayers&&0<this._allElevationLayers.length&&7<n?$(this._allElevationLayers).each(function(e,t){var i;t.show?(i=t.rectangle,s.isT_Inside_E(c,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(o,r,n,a,t))):(null!=s.isT_Intersects_E(c,i)?(s.setFormatMPT(!1),l.push(s.requestElevationLayerTileGeometry(o,r,n,a,t))):s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a)))):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a)))}):(s.setFormatMPT(!0),l.push(s.requestBaseTerrainTileGeometry(o,r,n,a))),Cesium.when.defer());return Cesium.when.all(l,function(e){var t,i;1===e.length?(void 0!==e.layer&&console.log("missing scale and offset"),u.resolve(e[0].buffer)):1<e.length?(t=$.grep(e,function(e){return void 0!==e.layer}),i=$.grep(e,function(e){return void 0===e.layer}),0===t.length?u.resolve(e[0].buffer):(e=t[t.length-1],t=i[i.length-1],i={tolerance:e.layer.nullTolerance,nullValueNumber:e.layer.nullValueNumber,verticesX:e.layer.polygonVerticesX,verticesY:e.layer.polygonVerticesY,scale:Cesium.defaultValue(e.layer.scale,1),offset:Cesium.defaultValue(e.layer.offset,0)},u.resolve(s.mergeBuffers(t.buffer,e.buffer,i,t.requestedRectangle)))):u.reject()}).otherwise(function(){u.reject()}),u},Au.prototype.mergeBuffers=function(e,t,i,o){o.west,o.north,o.east,o.south,o.width,o.height;for(var r,n,a,s,l=i.scale,c=i.offset,o=i.nullValueNumber,u=i.tolerance,h=void 0!==o&&void 0!==u,m=(h&&(a=Cesium.defaultValue(i.nullValueNumber,0),s=Cesium.defaultValue(Number(i.tolerance),0)),new Float32Array(1089)),d=0;d<33;d++)for(r=0,0;r<33;r++,0)m[n=33*d+r]=h?!t._buffer[n]||t._buffer[n]>=a-s&&t._buffer[n]<=a+s?e._buffer[n]:t._buffer[n]*l+c:t._buffer[n]?t._buffer[n]*l+c:e._buffer[n];return this.arrayToHeightmapTerrainData(m,33,33,15)},Au.prototype.requestTileHeightBuffer=function(c,u,h,e,t,o){if(!isNaN(c+u+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(c,u,h).replace(this._options.url,o.getUrlFromSTag(c,u,h)+"/Elevation").replace(this._options.layerName,o.name),"mpt"===o.format&&(i=i.replace("image/png","image/mpt"))):(i=this.getRequestBaseTerrainUrl(c,u,h,e||t),m=Pu.terrainProvider.tilingScheme.tileXYToRectangle(c,u,h),e=Pu.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)}),!(0<n.length)||1===n.length&&n[0].modelFloorBestLevel&&h>n[0].modelFloorBestLevel)?r.resolve("NoMerge"):(t=Iu(n,m),Cesium.when(t,function(e){r.resolve(e)}).otherwise(function(e){console.log(e)})),d=Cesium.when.defer(),(1===(e=$.grep([],function(e){return 0<e._selectedTiles.length})).length&&e[0].level&&h>e[0].level||(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,c=e.getHRMTFP(e,s,!0);65535!==(l=null!=c&&c.content&&c.content._model&&c.content._model.floor?c.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"),Pu.scene.globe.ellipsoid),!1===this._requestsCache.hasOwnProperty(i)){if(this._requestsCache[i]={},this._requestsCacheKeys.push(i),100<this._requestsCacheKeys.length){for(var a=0;a<50;a++)delete this._requestsCache[this._requestsCacheKeys[a]];this._requestsCacheKeys.splice(0,50)}}else{t=this._requestsCacheKeys.indexOf(i);this._requestsCacheKeys.splice(t,1),this._requestsCacheKeys.push(i)}var f,s=this._requestsCache[i];if(void 0!==s.dataLoaded||(s.dataLoaded=Cesium.Resource.fetchArrayBuffer(i),Cesium.defined(s.dataLoaded)))return(f=this)._pendingRequests++,Cesium.when(s.dataLoaded,function(e){void 0===s.workerFinished&&(s.workerFinished=f._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==o,level:h})),Cesium.when.all([s.workerFinished,r,d],function(e){var t=void 0!==e[1]&&"NoMerge"!==e[1],i=void 0!==e[2]&&"NoFloor"!==e[2];if(e[0].rejected){for(var o=f.heightMapWidth*f.heightMapHeight,r=new Int16Array(o),n=0;n<o;n++)r[n]=300;return 2<h&&(r.myReject=!0),g.resolve(r),g}var a=f.extractTileHeightBuffer(e[0].buffer,c,u,h);if(f._pendingRequests--,t)for(n=0;n<32;n++)for(var s=0;s<32;s++)a[l=32*n+s]=e[1].mtHeight[0];if(i){for(var l,n=0;n<32;n++)for(s=0;s<32;s++)a[l=32*n+s]=(65535===e[2][l]||10500<e[2][l]?a:e[2])[l];a.isFloor=!0}g.resolve(a)}).otherwise(function(){for(var e=f.heightMapWidth*f.heightMapHeight,t=new Int16Array(e),i=0;i<e;i++)t[i]=300;return 2<h&&(t.myReject=!0),g.resolve(t),g})}).otherwise(function(){f._pendingRequests--,g.reject()}),g}},Au.prototype.extractTileHeightBuffer=function(e,t,i,o){try{for(var r=this.requestFactorForLevel(o),n=t%r,a=i%r,s=new Float32Array(this.heightMapWidth*this.heightMapHeight),l=1e6,c=-1e5,u=0;u<this.heightMapHeight;u++)for(var h=0;h<this.heightMapWidth;h++){var m=u+a*this.heightMapHeight,d=h+n*this.heightMapWidth,p=u*this.heightMapWidth+h,g=m*this.heightMapWidth*r+d;e[g]>c&&(c=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},Au.prototype.arrayToHeightmapTerrainData=function(e,t,i,o){return!1===Cesium.defined(e)&&(e=new Int16Array(t*i)),new Cesium.HeightmapTerrainData({buffer:e,width:t,height:i,childTileMask:o})};function Lu(e,t,i){var o,r,n,a,s,l=t.west*Cesium.Math.DEGREES_PER_RADIAN,c=t.east*Cesium.Math.DEGREES_PER_RADIAN,u=t.south*Cesium.Math.DEGREES_PER_RADIAN,t=t.north*Cesium.Math.DEGREES_PER_RADIAN,l=new Cesium.Rectangle(l,u,c,t),h=(o=l,n=r=32,a=[],s=void 0!==e[0].longitude,e.forEach(function(e){var t=[],e=s?e:Mu.scene.globe.ellipsoid.cartesianToCartographic(e),e=Ru(e,o,r,n);t.push(e.normalizedLongitude),t.push(e.normalizedLatitude),a.push(t)}),a),u="#FF0000",c=32,t=32,m=(l=void 0,(l=document.createElement("canvas")).width=c,l.height=t,l.getContext("2d"));if(!(h.length<=0)){m.moveTo(h[0][0],h[0][1]);for(var d=0;d<h.length;d++)m.lineTo(h[d][0],h[d][1]);return null!=u&&(m.fillStyle=u,m.fill()),l}}var Mu,Ru=function(e,t,i,o){var r=t.west,n=t.east,a=t.south,t=t.north-a,s=180*e.longitude/Math.PI,l=180*e.latitude/Math.PI;return e.normalizedLongitude=(s-r)/(n-r)*i,e.normalizedLatitude=(l-a)/t*o,e};function Ou(e,t){if(Mu=e,!Cesium.defined(t))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._credit=t.credit,"string"==typeof this._credit&&(this._credit=new Cesium.Credit(this._credit)),t.heightMapWidth=Cesium.defaultValue(t.heightMapWidth,32),t.heightMapHeight=Cesium.defaultValue(t.heightMapHeight,32),this._options=t,this._subdomains=t.subdomains,t.url=t.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers="+t.layerName+"&Styles=&Format=image/mpt",t.token&&(this._firstRequest+="&token="+t.token),this._requestVertexNormals=Cesium.defaultValue(t.requestVertexNormals,!1);var i=this;$.ajax({url:t.cacheUrl?t.cacheUrl+"/0/0/0."+(t.cacheFormat||"mpt"):this._firstRequest,success:function(e){if(!!(Cesium.defined(e.childNodes)&&0<e.childNodes.length))return i._isMPT=!1,i._format="png",null;i._isMPT=!0,i._format="mpt"},error:function(){return i._isMPT=!1,i._format="png",null},async:!1}),t.cacheUrl&&(this.isCache=!0,this.cacheLevel=t.cacheLevel||16,this._cacheUrl=t.cacheUrl+"/{z}/{x}/{reverseY}."+(t.cacheFormat||"mpt"));this._availability={computeMaximumLevelAtPosition:function(e){return Math.min(16,16)}},this._urlTemplate=t.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+t.layerName+"&Styles=&Format=image/"+this._format,t.token&&(this._urlTemplate+="&token="+t.token),this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,4*t.heightMapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new de({workerPath:SmartEarthRootUrl+"Workers/ParseElevationWorker.js"}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(e){},this)}function Bu(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function Vu(e){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=Cesium.defaultValue(e.requestVertexNormals,!1),this._requestWaterMask=Cesium.defaultValue(e.requestWaterMask,!1),this._requestMetadata=Cesium.defaultValue(e.requestMetadata,!0),this._errorEvent=new Cesium.Event;var v,w,b,t=e.credit,i=("string"==typeof t&&(t=new Cesium.Credit(t)),this._credit=t,this._availability=void 0,Cesium.when.defer()),T=(this._ready=!1,this._readyPromise=i,this._tileCredits=void 0,this),S=this._layers=[],E="",P=[],x=0;function D(e){var t;if(e.format)if(e.tiles&&0!==e.tiles.length){var i=!1,o=!1,r=!1,n=!0,a=!1;if("heightmap-1.0"===e.format)a=!0,Cesium.defined(T._heightmapStructure)||(T._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),T._requestWaterMask=o=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return t='The tile format "'+e.format+'" is invalid or not supported.',void(b=Cesium.TileProviderError.handleError(b,T,T._errorEvent,t,void 0,void 0,void 0,A));var s=e.tiles,l=e.maxzoom;if(x=Math.max(x,l),e.projection&&"EPSG:4326"!==e.projection){if("EPSG:3857"!==e.projection)return t='The projection "'+e.projection+'" is invalid or not supported.',void(b=Cesium.TileProviderError.handleError(b,T,T._errorEvent,t,void 0,void 0,void 0,A));T._tilingScheme=new Cesium.WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:T._ellipsoid})}else T._tilingScheme=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:T._ellipsoid});if(T._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(T._tilingScheme.ellipsoid,T._heightmapWidth,T._tilingScheme.getNumberOfXTilesAtLevel(0)),!e.scheme||"tms"===e.scheme||"slippyMap"===e.scheme){T._scheme=e.scheme,Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?i=!0:Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(n=!(i=!0)),Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(o=!0),Cesium.defined(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(r=!0);var c,u=e.metadataAvailability,h=e.available;if(Cesium.defined(h)&&!Cesium.defined(u))for(var m=new Cesium.TileAvailability(T._tilingScheme,h.length),d=0;d<h.length;++d){var p=h[d],g=T._tilingScheme.getNumberOfYTilesAtLevel(d);Cesium.defined(P[d])||(P[d]=[]);for(var f=0;f<p.length;++f){var _=p[f],C=g-_.endY-1,y=g-_.startY-1;P[d].push([_.startX,C,_.endX,y]),m.addAvailableTileRange(d,_.startX,C,_.endX,y)}}else Cesium.defined(u)&&(c=new Cesium.TileAvailability(T._tilingScheme,l),m=new Cesium.TileAvailability(T._tilingScheme,l),P[0]=[[0,0,1,0]],m.addAvailableTileRange(0,0,0,1,0));T._hasWaterMask=T._hasWaterMask||o,T._hasVertexNormals=T._hasVertexNormals||i,T._hasMetadata=T._hasMetadata||r,Cesium.defined(e.attribution)&&(0<E.length&&(E+=" "),E+=e.attribution),S.push(new Bu({resource:v,version:e.version,isHeightmap:a,tileUrlTemplates:s,availability:m,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:u,availabilityTilesLoaded:c,littleEndianExtensionSize:n}));l=e.parentUrl;if(Cesium.defined(l)){if(!Cesium.defined(m))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),Cesium.when.resolve();(v=v.getDerivedResource({url:l})).appendForwardSlash();a=(w=v.getDerivedResource({url:"layer.json"})).fetchJson();return Cesium.when(a,D,I)}return Cesium.when.resolve()}t='The scheme "'+e.scheme+'" is invalid or not supported.'}else t="The layer.json file does not specify any tile URL templates.";else t="The tile format is not specified in the layer.json file.";b=Cesium.TileProviderError.handleError(b,T,T._errorEvent,t,void 0,void 0,void 0,A)}function I(e){var t="An error occurred while accessing "+w.url+".";b=Cesium.TileProviderError.handleError(b,T,T._errorEvent,t,void 0,void 0,void 0,A)}function o(e){D(e).then(function(){if(!Cesium.defined(b)){var e,t=P.length;if(0<t)for(var i=T._availability=new Cesium.TileAvailability(T._tilingScheme,x),o=0;o<t;++o)for(var r=P[o],n=0;n<r.length;++n){var a=r[n];i.addAvailableTileRange(o,a[0],a[1],a[2],a[3])}0<E.length&&(e=new Cesium.Credit(E),Cesium.defined(T._tileCredits)?T._tileCredits.push(e):T._tileCredits=[e]),T._ready=!0,T._readyPromise.resolve(!0)}})}function r(e){o({extensions:["octvertexnormals"],format:"quantized-mesh-1.0",maxzoom:18,minzoom:0,name:"world",projection:"EPSG:3857",scheme:"slippyMap",tilejson:"1.0",tiles:["{z}/{x}/{y}.terrain"],version:"1.0.0"})}function A(){Cesium.when(w.fetchJson()).then(o).otherwise(r)}Cesium.when(e.url).then(function(e){e=Cesium.Resource.createIfNeeded(e);e.appendForwardSlash(),w=(v=e).getDerivedResource({url:"layer.json"}),T._tileCredits=e.credits,A()}).otherwise(function(e){i.reject(e)})}Ou._geometricErrorFactor=2,Object.defineProperties(Ou.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}}),Ou.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)*Ou._geometricErrorFactor},Ou.prototype.createKeyFromTile=function(e,t,i){return e+"_"+t+"_"+i},Ou.prototype.getTileDataAvailable=function(e,t,i){return this._isMPT?void 0:i<16},Ou.prototype.requestFactorForLevel=function(e){var t=Math.log(this._requestGridSize)/Math.log(2),t=Math.min(t,e);return Math.pow(2,t)},Ou.prototype.getRequestUrl=function(e,t,i,o){var r,n=this.requestFactorForLevel(i);return e=(e-e%n)/n,t=(t-t%n)/n,i-=Math.log(n)/Math.log(2),this.isCache&&0!==i&&i<=this.cacheLevel?(r=this.tilingScheme.getNumberOfYTilesAtLevel(i)-t-1,this._cacheUrl.replace("{x}",e).replace("{reverseY}",r).replace("{z}",i)):(r=this.tilingScheme.tileXYToNativeRectangle(e,t,i),o=this.heightMapWidth*n==256&&o?1:0,this._urlTemplate.replace("{south}",r.south).replace("{north}",r.north).replace("{west}",r.west).replace("{east}",r.east).replace("{optimizedOnly}",o).replace("{width}",this.heightMapWidth*n).replace("{height}",this.heightMapHeight*n).replace("{s}",this.sTag(e,t,i)))},Ou.prototype.sTag=function(e,t,i){return null==this._subdomains?"":(e=(e+t+i)%this._subdomains.length,this._subdomains[e])},Ou.prototype.findDirectParent=function(e){function n(e,t){if(e._rectangle.width<=2.1*t.width&&Cesium.Rectangle.contains(e._rectangle,Cesium.Rectangle.center(t)))return e;for(var i=e.children.length,o=0;o<i;o++){var r=e.children[o];if(Cesium.Rectangle.contains(r._rectangle,Cesium.Rectangle.center(t)))return n(r,t)}return null}if(e.width!=Math.PI)for(var t=0;t<Mu.scene.globe._surface._levelZeroTiles.length;t++){var i=n(Mu.scene.globe._surface._levelZeroTiles[t],e);if(i)return i}return null},Ou.prototype.isTileAvailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);if(r&&r.data&&r.data.terrainData){if(!(0<r.data.terrainData._childTileMask))return!1;for(var n=r.children.length,a=0;a<n;a++){var s=r.children[a];if(Cesium.Rectangle.equals(s._rectangle,o))return r.data.terrainData._childTileMask&1<<a}}return!0},Ou.prototype.markTileAsUnavailable=function(e,t,i){var o=this._tilingScheme.tileXYToRectangle(e,t,i,new Cesium.Rectangle),r=this.findDirectParent(o);r&&r.data&&r.data.terrainData&&0<r.data.terrainData._childTileMask&&$.each(r.children,function(e,t){if(Cesium.Rectangle.equals(t._rectangle,o)){switch(e){case 0:r.data.terrainData._childTileMask&=-5;break;case 1:r.data.terrainData._childTileMask&=-9;break;case 2:r.data.terrainData._childTileMask&=-2;break;case 3:r.data.terrainData._childTileMask&=-3}return!1}return!0})},Ou.prototype.requestTileGeometry=function(h,m,d,e){var p,t,i,g,o=this.requestTileHeightBuffer(h,m,d,e);if(void 0!==o)return t=(p=this).requestTileHeightBuffer(h+1,m,d,e,!0),i=this.requestTileHeightBuffer(h,m+1,d,e,!0),e=this.requestTileHeightBuffer(h+1,m+1,d,e,!0),g=Cesium.when.defer(),Cesium.when.all([o,t,i,e],function(e){if(null!=e[0].myReject&&e[0].myReject)p.markTileAsUnavailable(h,m,d),g.reject();else{for(var t=p.heightMapWidth+1,i=p.heightMapHeight+1,o=new Float32Array(t*i),r=0;r<t;r++)for(var n=0;n<i;n++){var a=r,s=n,l=0,c=(n===t-1&&(s=0,l=1),r===i-1&&(a=0,l=2),r*t+n),a=a*p.heightMapWidth+s;null===e[l]||null!=e[l].myReject&&e[l].myReject||(o[c]=e[l][a])}null!=e[3].myReject&&e[3].myReject||(o[t*i-1]=e[3][0]);var u=p.arrayToHeightmapTerrainData(o,t,i,15);g.resolve(u)}}).otherwise(function(){g.reject()}),g},Ou.prototype.requestTileHeightBuffer=function(l,c,u,e,t,i){if(!isNaN(l+c+u)){var e=0==(e=Cesium.defined(e)&&!1!==e?e:new Cesium.Request({defer:!0})).defer,h=(t=Cesium.defaultValue(e,!1),Cesium.when.defer()),t=this.getRequestUrl(l,c,u,e||t);if(!1===this._requestsCache.hasOwnProperty(t)){if(this._requestsCache[t]={},this._requestsCacheKeys.push(t),100<this._requestsCacheKeys.length){for(var o=0;o<50;o++)delete this._requestsCache[this._requestsCacheKeys[o]];this._requestsCacheKeys.splice(0,50)}}else{var r=this._requestsCacheKeys.indexOf(t);this._requestsCacheKeys.splice(r,1),this._requestsCacheKeys.push(t)}var n,m,d,p,a=this._requestsCache[t];if(void 0!==a.dataLoaded||(a.dataLoaded=e?Cesium.RequestScheduler.request(t,Cesium.loadArrayBuffer):Cesium.loadArrayBuffer(t),Cesium.defined(a.dataLoaded)))return n=Mu.terrainProvider.tilingScheme.tileXYToRectangle(l,c,u),r=Mu.terrainProvider._modifyTerrainObjects,(d=m=null)!=r&&0<r.length&&r.forEach(function(e){e.show&&Cesium.Rectangle.intersection(n,e.rectangle,new Cesium.Rectangle)&&(m=Lu((d=e).vertices,n,d.heights[0]))}),(p=this)._pendingRequests++,Cesium.when(a.dataLoaded,function(e){void 0===a.workerFinished&&(a.workerFinished=p._workerPool.queueWorkItem({buffer:e,isElevation:void 0!==i,level:u})),Cesium.when(a.workerFinished,function(e){if(e.rejected){for(var t=p.heightMapWidth*p.heightMapHeight,i=new Int16Array(t),o=0;o<t;o++)i[o]=300;return 2<u&&(p.markTileAsUnavailable(l,c,u),i.myReject=!0),h.resolve(i),h}var r=p.extractTileHeightBuffer(e.buffer,l,c,u);if(null!=m)for(var n=m.getContext("2d").getImageData(0,0,32,32).data,a=0;a<32;a++)for(var s=0;s<32;s++)0!==n[4*(32*a+s)]&&(r[32*(31-a)+s]=d.heights[0]);p._pendingRequests--,h.resolve(r)})}).otherwise(function(){p._pendingRequests--,h.reject()}),h}},Ou.prototype.extractTileHeightBuffer=function(e,t,i,o){try{for(var r=this.requestFactorForLevel(o),n=t%r,a=i%r,s=new Float32Array(this.heightMapWidth*this.heightMapHeight),l=1e6,c=-1e5,u=0;u<this.heightMapHeight;u++)for(var h=0;h<this.heightMapWidth;h++){var m=u+a*this.heightMapHeight,d=h+n*this.heightMapWidth,p=u*this.heightMapWidth+h,g=m*this.heightMapWidth*r+d;e[g]>c&&(c=e[g]),e[g]<l&&(l=e[g]),s[p]=e[g]}}catch(e){console.log(e.message)}return s},Ou.prototype.arrayToHeightmapTerrainData=function(e,t,i,o){return!1===Cesium.defined(e)&&(e=new Int16Array(t*i)),new Cesium.HeightmapTerrainData({buffer:e,width:t,height:i,childTileMask:o})};var Fu={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Hu(e){return Cesium.defined(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function Gu(k,N,j,U,z,e){if(!Cesium.defined(z))return Cesium.when.reject(new Cesium.RuntimeError("Terrain tile doesn't exist"));var t=z.tileUrlTemplates;if(0!==t.length){i=k._scheme&&"tms"!==k._scheme?j:k._tilingScheme.getNumberOfYTilesAtLevel(U)-j-1;var i,o,r=[],t=(k._requestVertexNormals&&z.hasVertexNormals&&r.push(z.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),k._requestWaterMask&&z.hasWaterMask&&r.push("watermask"),k._requestMetadata&&z.hasMetadata&&r.push("metadata"),t[(N+i+U)%t.length]),n=z.resource,r=Cesium.defined(n._ionEndpoint)&&!Cesium.defined(n._ionEndpoint.externalType)?(0!==r.length&&(o={extensions:r.join("-")}),Hu(void 0)):Hu(r),n=n.getDerivedResource({url:t,templateValues:{version:z.version,z:U,x:N,y:i},queryParameters:o,headers:r,request:e}).fetchArrayBuffer();if(Cesium.defined(n))return n.then(function(e){if(Cesium.defined(k._heightmapStructure))return h=k,c=e,u=new Uint16Array(c,0,h._heightmapWidth*h._heightmapWidth),new Cesium.HeightmapTerrainData({buffer:u,childTileMask:new Uint8Array(c,u.byteLength,1)[0],waterMask:new Uint8Array(c,u.byteLength+1,c.byteLength-u.byteLength-1),width:h._heightmapWidth,height:h._heightmapWidth,structure:h._heightmapStructure,credits:h._tileCredits});for(var t=k,i=e,o=U,r=N,n=j,a=z,s=a.littleEndianExtensionSize,l=0,c=3*Float64Array.BYTES_PER_ELEMENT,u=4*Float64Array.BYTES_PER_ELEMENT,h=3*Uint16Array.BYTES_PER_ELEMENT,e=Uint16Array.BYTES_PER_ELEMENT,m=3*e,d=new DataView(i),V=new Cesium.Cartesian3(d.getFloat64(l,!0),d.getFloat64(l+8,!0),d.getFloat64(l+16,!0)),p=d.getFloat32(l+=c,!0),g=(l+=Float32Array.BYTES_PER_ELEMENT,d.getFloat32(l,!0)),F=(l+=Float32Array.BYTES_PER_ELEMENT,new Cesium.BoundingSphere(new Cesium.Cartesian3(d.getFloat64(l,!0),d.getFloat64(l+8,!0),d.getFloat64(l+16,!0)),d.getFloat64(l+c,!0))),u=(l+=u,new Cesium.Cartesian3(d.getFloat64(l,!0),d.getFloat64(l+8,!0),d.getFloat64(l+16,!0))),f=d.getUint32(l+=c,!0),c=(l+=Uint32Array.BYTES_PER_ELEMENT,new Uint16Array(i,l,3*f)),h=(l+=f*h,65536<f&&(m=3*(e=Uint32Array.BYTES_PER_ELEMENT)),c.subarray(0,f)),_=c.subarray(f,2*f),C=c.subarray(2*f,3*f),h=(Cesium.AttributeCompression.zigZagDeltaDecode(h,_,C),l%e!=0&&(l+=e-l%e),d.getUint32(l,!0)),y=(l+=Uint32Array.BYTES_PER_ELEMENT,Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f,i,l,3*h)),v=(l+=h*m,0),H=y.length,w=0;w<H;++w){var b=y[w];y[w]=v-b,0===b&&++v}var T,S,_=d.getUint32(l,!0),C=(l+=Uint32Array.BYTES_PER_ELEMENT,Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f,i,l,_)),h=d.getUint32(l+=_*e,!0),m=(l+=Uint32Array.BYTES_PER_ELEMENT,Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f,i,l,h)),_=d.getUint32(l+=h*e,!0),h=(l+=Uint32Array.BYTES_PER_ELEMENT,Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f,i,l,_)),_=d.getUint32(l+=_*e,!0),G=(l+=Uint32Array.BYTES_PER_ELEMENT,Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f,i,l,_));for(l+=_*e;l<d.byteLength;){var E=d.getUint8(l,!0),P=(l+=Uint8Array.BYTES_PER_ELEMENT,d.getUint32(l,s));if(l+=Uint32Array.BYTES_PER_ELEMENT,E===Fu.OCT_VERTEX_NORMALS&&t._requestVertexNormals)T=new Uint8Array(i,l,2*f);else if(E===Fu.WATER_MASK&&t._requestWaterMask)S=new Uint8Array(i,l,P);else if(E===Fu.METADATA&&t._requestMetadata){E=d.getUint32(l,!0);if(0<E){var x=Cesium.getJsonFromTypedArray(new Uint8Array(i),l+Uint32Array.BYTES_PER_ELEMENT,E).available;if(Cesium.defined(x))for(var D=0;D<x.length;++D)for(var I=o+D+1,A=x[D],L=t._tilingScheme.getNumberOfYTilesAtLevel(I),M=0;M<A.length;++M){var R=A[M],O=L-R.endY-1,B=L-R.startY-1;t.availability.addAvailableTileRange(I,R.startX,O,R.endX,B),a.availability.addAvailableTileRange(I,R.startX,O,R.endX,B)}}a.availabilityTilesLoaded.addAvailableTileRange(o,r,n,r,n)}l+=P}return _=5*t.getLevelMaximumGeometricError(o),e=t._tilingScheme.tileXYToRectangle(r,n,o),e=Cesium.OrientedBoundingBox.fromRectangle(e,p,g,t._tilingScheme.ellipsoid),new Cesium.QuantizedMeshTerrainData({center:V,minimumHeight:p,maximumHeight:g,boundingSphere:F,orientedBoundingBox:e,horizonOcclusionPoint:u,quantizedVertices:c,encodedNormals:T,indices:y,westIndices:C,southIndices:m,eastIndices:h,northIndices:G,westSkirtHeight:_,southSkirtHeight:_,eastSkirtHeight:_,northSkirtHeight:_,childTileMask:t.availability.computeChildMaskForTile(o,r,n),waterMask:S,credits:t._tileCredits})}).otherwise(function(e){return Cesium.when.resolve(new Cesium.HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}))})}}function ku(e,t,i,o){if(0!==o)return{level:e=o%(e=e.availabilityLevels)==0?o-e:(o/e|0)*e,x:t/(t=1<<o-e)|0,y:i/t|0}}function Nu(e,t,i,o,r,n){if(Cesium.defined(r.availabilityLevels))for(var a,s,l,c=function(){delete r.availabilityPromiseCache[l]},u=r.availabilityTilesLoaded,h=r.availability,m=ku(r,t,i,o);Cesium.defined(m);){if(h.isTileAvailable(m.level,m.x,m.y)&&!u.isTileAvailable(m.level,m.x,m.y))return n||(l=m.level+"-"+m.x+"-"+m.y,s=r.availabilityPromiseCache[l],Cesium.defined(s)||(a=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN}),s=Gu(e,m.x,m.y,m.level,r,a),Cesium.defined(s)&&(r.availabilityPromiseCache[l]=s).then(c))),{result:!0,promise:s};m=ku(r,m.x,m.y,m.level)}return{result:!1}}Vu.prototype.requestTileGeometry=function(e,t,i,o){var r,n=this._layers,a=n.length;if(1===a)r=n[0];else for(var s=0;s<a;++s){var l=n[s];if(!Cesium.defined(l.availability)||l.availability.isTileAvailable(i,e,t)){r=l;break}}return Gu(this,e,t,i,r,o)},Object.defineProperties(Vu.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}}),Vu.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},Vu.prototype.getTileDataAvailable=function(e,t,i){if(Cesium.defined(this._availability)){if(!(i>this._availability._maximumLevel)){if(this._availability.isTileAvailable(i,e,t))return!0;if(this._hasMetadata)for(var o=this._layers,r=o.length,n=0;n<r;++n)if(Nu(this,e,t,i,o[n],0===n).result)return}return!1}},Vu.prototype.loadTileDataAvailability=function(e,t,i){if(!(!Cesium.defined(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var o=this._layers,r=o.length,n=0;n<r;++n){var a=Nu(this,e,t,i,o[n],0===n);if(Cesium.defined(a.promise))return a.promise}},Vu._getAvailabilityTile=ku;const ju=new Uint8Array([172,223,96,7,210,166,80,193,62,133,0,92,97,125,81,193,175,204,114,156,24,171,39,65,215,131,189,193,92,143,98,193,172,223,224,55,148,164,80,193,62,133,128,115,254,122,81,193,175,204,114,40,74,169,39,65,199,225,33,1,165,221,10,65,165,248,77,38,221,233,229,191,118,168,124,106,57,4,231,191,208,126,103,119,149,64,191,63,9,0,0,0,254,127,253,127,254,127,253,127,0,0,254,255,255,127,0,128,0,0,254,127,253,127,0,0,254,127,0,128,0,0,0,0,253,255,254,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,2,0,3,0,0,0,4,0,0,0,2,0,5,0,0,0,0,0,7,0,0,0,0,0,2,0,9,0,7,0,4,0,9,0,1,0,5,0,9,0,3,0,3,0,0,0,0,0,0,0,3,0,3,0,0,0,1,0,7,0,2,0,3,0,0,0,7,0,5,0,8,0,3,0,0,0,4,0,5,0,6,0]);class Uu{constructor(e={}){if(this.ready=!1,this.dummyTile=un(ju.buffer),this.tilingScheme=e.tilingScheme||new Cesium.WebMercatorTilingScheme,void 0===e.url)throw new Error("url option is missing");void 0!==e.credit&&(this.credits=[new Cesium.Credit(e.credit)]),this.urlTemplates=e.url,0!==this.urlTemplates.length&&"/"===this.urlTemplates[this.urlTemplates.length-1]||(this.urlTemplates=this.urlTemplates+"/"),this.readyPromise=Promise.resolve(!0),this.ready=!0}getUrl(e,t,i){return this.urlTemplates+(i+`/${e}/${t}.terrain`)}generateDummyTileHeader(e,t,i){var o=this.tilingScheme.tileXYToRectangle(e,t,i),e=this.tilingScheme.tileXYToNativeRectangle(e,t,i),t=Cesium.Cartographic.toCartesian(Cesium.Rectangle.center(o)),i=Cesium.Ellipsoid.WGS84.transformPositionToScaledSpace(t);return{centerX:t.x,centerY:t.y,centerZ:t.z,minHeight:0,maxHeight:0,boundingSphereCenterX:t.x,boundingSphereCenterY:t.y,boundingSphereCenterZ:t.z,boundingSphereRadius:e.height,horizonOcclusionPointX:i.x,horizonOcclusionPointY:i.y,horizonOcclusionPointZ:i.z}}createQuantizedMeshData(e,t,i,o){t=this.tilingScheme.tileXYToRectangle(t,i,o),i=new Cesium.Cartesian3(e.header.boundingSphereCenterX,e.header.boundingSphereCenterY,e.header.boundingSphereCenterZ),o=new Cesium.BoundingSphere(i,e.header.boundingSphereRadius),i=new Cesium.Cartesian3(e.header.horizonOcclusionPointX,e.header.horizonOcclusionPointY,e.header.horizonOcclusionPointZ);let r;return t.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(r=Cesium.OrientedBoundingBox.fromRectangle(t,e.header.minHeight,e.header.maxHeight)),new Cesium.QuantizedMeshTerrainData({minimumHeight:e.header.minHeight,maximumHeight:e.header.maxHeight,quantizedVertices:e.vertexData,indices:e.triangleIndices,boundingSphere:o,orientedBoundingBox:r,horizonOcclusionPoint:i,westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:100,southSkirtHeight:100,eastSkirtHeight:100,northSkirtHeight:100,childTileMask:15,credits:this.credits})}generateDummyTile(e,t,i){return Object.assign({},this.dummyTile,this.generateDummyTileHeader(e,t,i))}decodeResponse(e,t,i,o){return e.arrayBuffer().then(e=>un(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<<e)}}function zu(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V,this._url="",this._show=!0}function Wu(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this.item={show:!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._primitiveByTile={},this._tileKeys=[],this._primitiveCollection=new this._cesium.PrimitiveCollection,this._cache=!1,this._forceRefreshPrvimitive=null}zu.prototype.createTerrainLayer=function(e,t,i,o,r,n){"Topography"==n?this.createTerrain(e,t,i,o,r):"sgs"==n?this.createSFSTerrain(e,t,i,o,r):"Arcgis"==n?this.createArcGISTerrain(e,t,i,o,r):"Cesium"==r&&this.createCesiumTerrain(e,t,i,o)},zu.prototype.createTerrain=function(e,t,i,o,r){var n,a={type:"default",url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""},r=(this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createTerrain",null);return this._core.isUrl(t)?(r=a).url=t:r=this._core.extend(a,t,!0),this._options=r,this._url=r.url,o?(V.setVisibility(i,!1,this._viewer,this._cesium),a=new("vector"===r.type?Vu:Cesium.CesiumTerrainProvider)(r),n=(this._viewer.scene.terrainProvider=a,this.item=a,this._show=!0,{id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this}),this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)):(n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)),this},zu.prototype.createCesiumTerrain=function(e,t,i,o){this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.type="createCesiumTerrain";var r,n=this._core.extend({requestVertexNormals:!0},t,!0),n=(this._options=n,Cesium.createWorldTerrain(n));return this.type="Cesium",this.item=n,o?(V.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.scene.terrainProvider=n,this._show=!0,r={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i)):(r={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(r),this._tree.insertGroupId(r,this._core.isnull(i)?0:i)),this},zu.prototype.createSFSTerrain=function(e,t,i,o,r){var n,a=new Au(this._viewer,t);return this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createSFSTerrain",this.type="SGS",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,o?(V.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=a,this.item=a,this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)):(this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)),this},zu.prototype.createSFSTerrain71=function(e,t,i,o,r){var n,a=new Ou(this._viewer,t);return this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createSFSTerrain",this.type="SGS71",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,o?(V.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=a,this.item=a,this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)):(this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)),this},zu.prototype.createWMTSTerrain=function(e,t,i,o,r){var n,a=new Uu({url:t.url});return this._viewer.scene.mode=this._cesium.SceneMode.COLUMBUS_VIEW,this.name=e,this.option=t,this.GroupID=i,this.checked=void 0===o||o,this.Description=r,this.type="createWMTSTerrain",this.type="WMTSTerrain",this._url=t.url,this.layerName=t.layerName,this.requestVertexNormals=t.requestVertexNormals,this.checked?(V.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=a,this.item=a,this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)):(this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)),this},zu.prototype.createArcGISTerrain=function(e,t,i,o,r){var n,a={url:""},r=(this.name=e,this.option=t,this.GroupID=i,this.checked=o,this.Description=r,this.type="createArcGISTerrain",null),a=(this._core.isUrl(t)?(r=a).url=t:r=this._core.extend(a,t,!0),this.type="ArcGIS",this._url=r.url,new this._cesium.ArcGISTiledElevationTerrainProvider(r));return o?(V.setVisibility(i,!1,this._viewer,this._cesium),this._viewer.terrainProvider=a,this.item=a,this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)):(this._show=!0,n={id:t.id||this._core.getuid(),name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"terrain",item:this},this.setTreeobj(n),this._tree.insertGroupId(n,this._core.isnull(i)?0:i)),this},zu.prototype.getType=function(){return{label:"影像",value:"TerrainProvider"}},zu.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.item._layers[0].resource.url;return{type:"TerrainLayer",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:e,url:t}}},zu.prototype.setVisibility=function(e){var t,i;e?(V.setVisibility(this.GroupID,!1,this._viewer,this._cesium),i="SGS"===this.type?(t=this.option,new Au(this._viewer,t)):"SGS71"===this.type?(t=this.option,new Ou(this._viewer,t)):"ArcGIS"===this.type?(t=this.option,new Cesium.ArcGISTiledElevationTerrainProvider(t)):"Cesium"===this.type?Cesium.createWorldTerrain(this._options):(e=this._options,i={url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""},this._core.isUrl(e)?(t=i).url=e:t=this._core.extend(i,e,!0),new this._cesium.CesiumTerrainProvider(t)),this._show=!0,this.item=i):(i=new this._cesium.EllipsoidTerrainProvider({}),this.item=i,this._show=!1),this._viewer.scene.terrainProvider=i},zu.prototype.getVisibility=function(){return this._show},zu.prototype.setTreeobj=function(e){this.treeobj=e},zu.prototype.deleteObject=function(){try{this.item=new this._cesium.EllipsoidTerrainProvider({}),this._viewer.scene.terrainProvider=this.item}catch(e){console.log(e.message)}},Object.defineProperties(zu.prototype,{}),Wu.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,r,e,a,s,t,i){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},l=(this._core.isnull(e)||this._core.isnull(e.material)||"["==e.material.toString().charAt(0)&&"]"==e.material.toString().charAt(e.material.length-1)||(this._core.isHtmlColor(e.material)?e.material=this._color.colorFromHtmlColor(e.material):(/^rgb/.test(e.material)&&(e.material=this._color.rgbaStringToRgbaObj(e.material)),1<e.material.r&&(e.material.r=e.material.r/255),1<e.material.g&&(e.material.g=e.material.g/255),1<e.material.b&&(e.material.b=e.material.b/255),1<e.material.a&&(e.material.a=e.material.a/255),e.material=this._color.createColor(e.material.r,e.material.g,e.material.b,e.material.a))),this._core.extend(n,e,!0)),c=(this._core.isnull(a)&&(a=16),this._core.isnull(s)&&(s=14),null==r&&console.log("url is required"),null==o&&console.log("layername is required"),[]),u=this;this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(e,t){var i,n;(this.tile=t).state===u._cesium.QuadtreeTileLoadState.START&&(t.data={lines:[],geometryPrimitive:void 0},t.level>=s&&t.level<a?0!=(i=C.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&i[0].data&&0<i[0].data.length?(t.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:i[0].data,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED}),t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(c.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,u._core.xhr({url:r+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+n.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+n.x+"&TILEROW="+n.y,type:"get",dataType:"json",success:function(e){var t=[];for(var i=0;i<e.features.length;i++){var o=[],r=(!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):o.push(t[i])}(e.features[i].geometry.coordinates[0]),u._cesium.Cartesian3.fromDegreesArray(o)),r=(l.positions=r,new u._cesium.GeometryInstance({geometry:new u._cesium.PolylineVolumeGeometry({polylinePositions:l.positions}),attributes:{color:new u._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}}));t.push(r)}C.filter(c,function(e){return e.x==n.x&&e.y==n.y})[0].data=t,n.data.geometryPrimitive=new u._cesium.Primitive({geometryInstances:t,appearance:new u._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:u._cesium.ShadowMode.ENABLED})},error:function(){c=C.remove(c,function(e){return e.x==n.x&&e.y==n.y&&e.level==n.level})},complete:function(){n.state=u._cesium.QuadtreeTileLoadState.LOADING,n.state===u._cesium.QuadtreeTileLoadState.LOADING&&(n.data.geometryPrimitive&&n.data.geometryPrimitive.update(e,[]),n.state=u._cesium.QuadtreeTileLoadState.DONE,n.renderable=!0)}})):(t.state=u._cesium.QuadtreeTileLoadState.LOADING,t.state===u._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=u._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new u._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3}),this._viewer.scene.primitives.add(this._primitive)},Wu.prototype.createVolumeGeoJsonFeatureLayer1=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED},o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,c=[],t=(s.shapePositions=this.computeCircle(n.radius),o.then(function(e){for(var t=l._cesium.Color.WHITE,i=(l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):C.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a))),e.entities.values),o=0;o<i.length;o++){var r=i[o],r=(s.polylinePositions=r.polyline.positions._value,new l._cesium.PolylineVolumeGeometry(s)),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});c.push(r)}e="material:"+255*t.red+","+255*t.green+","+255*t.blue,l.Legend.push(e),e=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:c,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=e,0==n.show&&(e.show=!1),"function"==typeof a&&a(e)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id),{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Wu.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Wu.prototype.createVolumeGeoJsonFeatureLayerProvider1=function(e,t,u,i,o,r){var h=this,n={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(t.minx,t.miny,t.maxx,t.maxy),Cesium:this._cesium},m=(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<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._core.extend(n,u,!0)),n=new v(this._viewer,this._cesium,a),d=(this._Provider=n,this),a=(n._loadTile=function(e){var c=new d._cesium.PrimitiveCollection;return d.Legend=[],e.features.forEach(function(e){var t=[];/^\[/.test(u.material)&&/\]$/.test(u.material)&&(s=u.material.replace(/\[/,"").replace(/\]/,""),m.material=e.properties[s],h._core.isHtmlColor(m.material)?m.material=h._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=h._color.rgbaStringToRgbaObj(m.material)),1<m.material.r&&(m.material.r=m.material.r/255),1<m.material.g&&(m.material.g=m.material.g/255),1<m.material.b&&(m.material.b=m.material.b/255),1<m.material.a&&(m.material.a=m.material.a/255),m.material=h._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)));for(var i=0;i<e.geometry.coordinates.length;i++){var o=e.geometry.coordinates[i];if(0<o.length)if(Array.isArray(o[0]))for(var r=0;r<o.length;r++){var n=o[r],n=d._cesium.Cartesian3.fromDegrees(n[0],n[1],m.height);t.push(n)}else{var a=d._cesium.Cartesian3.fromDegrees(o[0],o[1],m.height);t.push(a)}}m.position=t,e.positions=t,"0"==m.slttype||0==m.slttype?m.shape=d._core.computeCircle(m.radius):"1"==m.slttype||1==m.slttype?m.shape=d._core.starPositions(m.number,m.exradius,m.inradius):"2"!=m.slttype&&2!=m.slttype||(s=m.orth_width/2,l=m.orth_height/2,m.shape=[new d._cesium.Cartesian2(-s,-l),new d._cesium.Cartesian2(s,-l),new d._cesium.Cartesian2(s,l),new d._cesium.Cartesian2(-s,l)]);var s={polylinePositions:m.position,shapePositions:m.shape,cornerType:m.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},l=new d._cesium.PolylineVolumeGeometry(s),s=new d._cesium.GeometryInstance({id:e,geometry:l,attributes:{color:new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),l="material:"+255*m.material.red+","+255*m.material.green+","+255*m.material.blue,l=(d.Legend.push(l),new d._cesium.Primitive({allowPicking:!0,appearance:new d._cesium.MaterialAppearance({material:new d._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}}),faceForward:!0,flat:!1}),shadows:m.shadows,geometryInstances:s}));c.add(l)}),c},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+m.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:m.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:u});this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Wu.prototype.createVolumeGeoJsonFeatureLayerProvider=function(e,t,w,i,o,r){var n,a=this,s={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,radiusScale:1},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,Cesium:this._cesium},b=(this._core.isnull(w)||this._core.isnull(w.material)||"["==w.material.toString().charAt(0)&&"]"==w.material.toString().charAt(w.material.length-1)||(this._core.isHtmlColor(w.material)?w.material=this._color.colorFromHtmlColor(w.material):(/^rgb/.test(w.material)&&(w.material=this._color.rgbaStringToRgbaObj(w.material)),1<w.material.r&&(w.material.r=w.material.r/255),1<w.material.g&&(w.material.g=w.material.g/255),1<w.material.b&&(w.material.b=w.material.b/255),1<w.material.a&&(w.material.a=w.material.a/255),w.material=this._color.createColor(w.material.r,w.material.g,w.material.b,w.material.a))),this._core.extend({...s},w,!0));"string"==typeof b.radius&&-1<b.radius.indexOf("[")&&-1<b.radius.indexOf("]")?(b.radius=b.radius.replace("[",""),b.radius=b.radius.replace("]",""),b.shape=void 0):"0"==b.slttype||0==b.slttype?(b.shape=this._core.computeCircle(b.radius),m=b.radius/2,d=b.radius/2,b.shape1=[new this._cesium.Cartesian2(-m,-d),new this._cesium.Cartesian2(m,-d),new this._cesium.Cartesian2(m,d),new this._cesium.Cartesian2(-m,d)]):"1"==b.slttype||1==b.slttype?b.shape=this._core.starPositions(b.number,b.exradius,b.inradius):"2"!=b.slttype&&2!=b.slttype||(m=b.orth_width/2,d=b.orth_height/2,b.shape=[new this._cesium.Cartesian2(-m,-d),new this._cesium.Cartesian2(m,-d),new this._cesium.Cartesian2(m,d),new this._cesium.Cartesian2(-m,d)]);let c=-1<t.url.indexOf("/gisserver/");n=c?t.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:t.url+"?"+this._serialize(l.urlParams),this._urlTemplate=n,this._Provider=new T(this._viewer,this._cesium,c?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=w.level_max-1,this._Provider._minimumHeight=parseFloat(w.height||0),this.item.show=o,this.initThisProvider=()=>{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.level<w.level_max&&v.item.show){if(c&&(y.reverseY=v._Provider.tilingScheme.getNumberOfYTilesAtLevel(y.level)-y.y-1),v.TileMatrixLimits){var i=v.TileMatrixLimits[y.level];if(!i||y.x>i.maxCol||y.x<i.minCol||y.y>i.maxRow||y.y<i.minRow)return void(y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0)}i=n.replace(window.encodeURIComponent("{x}"),y.x).replace(window.encodeURIComponent("{y}"),y.reverseY||y.y).replace(window.encodeURIComponent("{z}"),y.level);v._cache&&(i+="&"+v._core.getuid()),v._core.xhr({url:i,type:"get",dataType:"json",success:function(t){if(null==t)y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0;else{if(!b.shape&&"string"==typeof b.radius&&0<t.features.length){let e;t.features[0]&&t.features[0].properties[b.radius]?(e=t.features[0].properties[b.radius]).indexOf&&(-1<e.indexOf("*")||-1<e.indexOf("x")||-1<e.indexOf("X"))?(-1<e.indexOf("*")?e=e.split("*"):-1<e.indexOf("X")?e=e.split("X"):-1<e.indexOf("x")&&(e=e.split("x")),f=parseFloat(e[0])*b.radiusScale,_=parseFloat(e[1])*b.radiusScale,b.shape=[new v._cesium.Cartesian2(-f,-_),new v._cesium.Cartesian2(f,-_),new v._cesium.Cartesian2(f,_),new v._cesium.Cartesian2(-f,_)]):b.shape=v._core.computeCircle(e*b.radiusScale):b.shape=v._core.computeCircle(.5)}v.Legend=[];for(var e=[],i=0;i<t.features.length;i++){for(var o=t.features[i],r=(/^\[/.test(w.material)&&/\]$/.test(w.material)&&(p=w.material.replace(/\[/,"").replace(/\]/,""),b.material=o.properties[p],v._core.isHtmlColor(b.material)?b.material=v._color.colorFromHtmlColor(b.material):(/^rgb/.test(b.material)&&(b.material=v._color.rgbaStringToRgbaObj(b.material)),1<b.material.r&&(b.material.r=b.material.r/255),1<b.material.g&&(b.material.g=b.material.g/255),1<b.material.b&&(b.material.b=b.material.b/255),1<b.material.a&&(b.material.a=b.material.a/255),b.material=v._color.createColor(b.material.r,b.material.g,b.material.b,b.material.a))),[]),n=[],a=parseFloat(w.height||0),s=0;s<o.geometry.coordinates.length;s++){var l=o.geometry.coordinates[s];if(0<l.length)if(Array.isArray(l[0]))for(var c=0;c<l.length;c++){var u=l[c],a=a<(u[2]||0)?u[2]||0:a,u=v._cesium.Cartesian3.fromDegrees(u[0],u[1],b.height);r.push(u),n.push(b.material)}else{a=a<(l[2]||0)?l[2]||0:a;var h=v._cesium.Cartesian3.fromDegrees(l[0],l[1],b.height);r.push(h),n.push(b.material)}}y._minimumHeight=a,b.position=r,o.positions=r;var m,d="",p="",g=(p="0"!=b.slttype&&0!=b.slttype||y.level>=parseFloat(w.level_max)-8&&19<parseFloat(w.level_max)||y.level>=parseFloat(w.level_max)-4&&16<parseFloat(w.level_max)||y.level>=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}else y.state=Cesium.QuadtreeTileLoadState.DONE,y.renderable=!0},"function"==typeof r&&r(this.item)};let u,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<e.radius.indexOf("[")&&-1<e.radius.indexOf("]")?(b.radius=b.radius.replace("[",""),b.radius=b.radius.replace("]",""),b.shape=void 0):e.radius&&("0"==b.slttype||0==b.slttype?(b.shape=this._core.computeCircle(b.radius),t=b.radius/2,i=b.radius/2,b.shape1=[new this._cesium.Cartesian2(-t,-i),new this._cesium.Cartesian2(t,-i),new this._cesium.Cartesian2(t,i),new this._cesium.Cartesian2(-t,i)]):"1"==b.slttype||1==b.slttype?b.shape=this._core.starPositions(b.number,b.exradius,b.inradius):"2"!=b.slttype&&2!=b.slttype||(t=b.orth_width/2,i=b.orth_height/2,b.shape=[new this._cesium.Cartesian2(-t,-i),new this._cesium.Cartesian2(t,-i),new this._cesium.Cartesian2(t,i),new this._cesium.Cartesian2(-t,i)])),w=a._core.extend(w,e,!0),b=a._core.extend(b,w,!0),a._Provider._normalTile=w.level_max-1,a._primitive&&a._primitive._tilesToRender&&a._primitive._tilesToRender.length&&(clearTimeout(u),u=setTimeout(()=>{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){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),m.add(this._primitive),this._core.getWMTSData({url:t.url,layer:t.layer,srs:t.srs||"EPSG:4490",gisserverTMS:c},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 Yu="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 Ju(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,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}Wu.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Yu(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Wu.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.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=this._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a))),this),d=this._core.extend(a,h,!0),l=("0"==d.slttype||0==d.slttype?d.shape=m._core.computeCircle(d.radius):"1"==d.slttype||1==d.slttype?d.shape=m._core.starPositions(d.number,d.exradius,d.inradius):"2"!=d.slttype&&2!=d.slttype||(a=d.orth_width/2,n=d.orth_height/2,d.shape=[new m._cesium.Cartesian2(-a,-n),new m._cesium.Cartesian2(a,-n),new m._cesium.Cartesian2(a,n),new m._cesium.Cartesian2(-a,n)]),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]);this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=h.level_max-1,this._Provider.loadTile=function(e,t){var u,i,o;this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&m.item.show&&(u="z"+t.level+"x"+t.x+"y"+t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=h.level_min&&t.level<h.level_max&&m.item.show?m.Primitivekey.includes(u)||(i=t,o=m._urlTemplate.replace(window.encodeURIComponent("{x}"),i.x).replace(window.encodeURIComponent("{y}"),i.y).replace(window.encodeURIComponent("{z}"),i.level),m.tilesLength++,m._cache&&(o+="&"+m._core.getuid()),m._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=[],o=new m._cesium.PrimitiveCollection;function r(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):s.push(e[t])}function t(){/^\[/.test(h.material)&&/\]$/.test(h.material)&&(e=h.material.replace(/\[/,"").replace(/\]/,""),d.material=l.properties[e],m._core.isHtmlColor(d.material)?d.material=m._color.colorFromHtmlColor(d.material):(/^rgb/.test(d.material)&&(d.material=m._color.rgbaStringToRgbaObj(d.material)),1<d.material.r&&(d.material.r=d.material.r/255),1<d.material.g&&(d.material.g=d.material.g/255),1<d.material.b&&(d.material.b=d.material.b/255),1<d.material.a&&(d.material.a=d.material.a/255),d.material=m._color.createColor(d.material.r,d.material.g,d.material.b,d.material.a)));var e=m._cesium.Cartesian3.fromDegreesArray(s),e=(d.position=e,l.positions=e,{polylinePositions:d.position,shapePositions:d.shape,cornerType:d.cornerType}),e=new m._cesium.PolylineVolumeGeometry(e),e=new m._cesium.GeometryInstance({id:l,geometry:e,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material)}}),t="material:"+255*d.material.red+","+255*d.material.green+","+255*d.material.blue,t=(m.Legend.push(t),i.push(e),new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:d.material}}}),faceForward:!0,flat:!1}),shadows:d.shadows,geometryInstances:e}));o.add(t)}m.Legend=[];for(var n,a=0;a<e.features.length;a++){var s=[],l=e.features[a];if(Array.isArray(l.geometry.coordinates)&&0<l.geometry.coordinates.length)if(Array.isArray(l.geometry.coordinates[0][0]))for(var c=0;c<l.geometry.coordinates.length;c++)s=[],l.geometry.coordinates[c].pop(),r(l.geometry.coordinates[c]),2<s.length&&t();else r(l.geometry.coordinates),2<s.length&&t()}0<i.length&&(m.PrimitiveObj.data=o,m.PrimitiveObj.key=m.Primitivekey[m.returnCount],n={key:m.Primitivekey[m.returnCount],data:o},m.PrimitiveData.push(n),m._primitiveCollection.add(o),m._viewer.scene.primitives.add(o),m.datas.push(o),m.returnCount++,m._primitiveByTile[u]=o)},error:function(){l=C.remove(l,function(e){return e.x==i.x&&e.y==i.y&&e.level==i.level})},complete:function(e,t){i.state=m._cesium.QuadtreeTileLoadState.LOADING,i.state===m._cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive&&(i.state=m._cesium.QuadtreeTileLoadState.DONE),i.renderable=!0)}})):(t.state=m._cesium.QuadtreeTileLoadState.LOADING,t.state===m._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=m._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0)))},this._primitive=new m._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});this._viewer.scene.primitives.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:h};this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Wu.prototype.setTreeobj=function(e){this.treeobj=e},Wu.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},Wu.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Wu.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Wu.prototype.getLegend=function(){var e=[];return e=null!=this.Legend?this._core.unique(this.Legend):e},Wu.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(!e)}catch(e){}},Wu.prototype.setVisibility=function(e){this.item.show=e,this._Provider&&this._Provider.setStatus(e)},Wu.prototype.isCache=function(e){this._cache=e},Wu.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Wu.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}};var Ku="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 Qu(e,t){this._viewer=e,this._cesium=t,this.SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",this.SkyBoxVS="attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}function qu(e,t){this._viewer=e,this._cesium=t,this._core=new f}Ju.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":Ku(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},Ju.prototype.createVolumeVectorGeoJsonFeatureLayer=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},c=(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.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),u={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._core._serialize(s.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){var l,e;(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show&&(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&h.item.show?0!=(e=C.filter(c,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&e[0].data&&0<e[0].data.length?(t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:e[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(c.push({level:t.level,x:t.x,y:t.y,data:void 0}),l=t,e=h._urlTemplate.replace(window.encodeURIComponent("{x}"),l.x).replace(window.encodeURIComponent("{y}"),l.y).replace(window.encodeURIComponent("{z}"),l.level),h._cache&&(e+="&"+h._core.getuid()),h._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)?(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),u.extrudedHeight=parseFloat(a.properties[e])):u.extrudedHeight=parseFloat(h._option.extrudedHeight),u.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),u.material=a.properties[e],h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=h._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))):(h._option.material&&(u.material=h._option.material),u.material&&(h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=h._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))));var e=h._cesium.Cartesian3.fromDegreesArray(n),e=(u.polygonHierarchy=new h._cesium.PolygonHierarchy(e),new h._cesium.PolygonGeometry(u)),e=h._cesium.PolygonGeometry.createGeometry(e),e=new h._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}}),t="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue;h.Legend.push(t),i.push(e)}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}l.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows})},error:function(){c=C.remove(c,function(e){return e.x==l.x&&e.y==l.y&&e.level==l.level})},complete:function(e,t){l.state=h._cesium.QuadtreeTileLoadState.LOADING,l.state===h._cesium.QuadtreeTileLoadState.LOADING&&(l.data.geometryPrimitive&&l.data.geometryPrimitive.update(i),l.state=h._cesium.QuadtreeTileLoadState.DONE,l.renderable=!0)}})):(t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=h._cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider});a=this._viewer.scene.primitives,o&&o.time&&(this._Provider._availability=new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({start:o.time.start?h._cesium.JulianDate.fromDate(new Date(o.time.start)):h._cesium.Iso8601.MINIMUM_VALUE,stop:o.time.end?h._cesium.JulianDate.fromDate(new Date(o.time.end)):h._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(e){var t;if(Cesium.defined(e))return t=this._availability,!Cesium.defined(t)||t.contains(e);throw new Cesium.DeveloperError("time is required.")}),a.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,s={id:u.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},Ju.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(e,t,a,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},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(a)||this._core.isnull(a.material)||"["==a.material.toString().charAt(0)&&"]"==a.material.toString().charAt(a.material.length-1)||(this._core.isHtmlColor(a.material)?a.material=this._color.colorFromHtmlColor(a.material):(/^rgb/.test(a.material)&&(a.material=this._color.rgbaStringToRgbaObj(a.material)),1<a.material.r&&(a.material.r=a.material.r/255),1<a.material.g&&(a.material.g=a.material.g/255),1<a.material.b&&(a.material.b=a.material.b/255),1<a.material.a&&(a.material.a=a.material.a/255),a.material=this._color.createColor(a.material.r,a.material.g,a.material.b,a.material.a))),this._option=this._core.extend(n,a,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),u={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=a.level_max-1,this._Provider.loadTile=function(e,t){if(this.tile=null,(this.tile=t).state===this._cesium.QuadtreeTileLoadState.START&&h.item.show){var i="z"+t.level+"x"+t.x+"y"+t.y;if(t.data={lines:[],geometryPrimitive:void 0},t.level>=a.level_min&&t.level<a.level_max&&h.item.show){var o=C.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level});if(0!=o.length&&o[0].data&&0<o[0].data.length)t.data.geometryPrimitive=new h._cesium.Primitive({geometryInstances:o[0].data,appearance:new h._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:h._cesium.ShadowMode.ENABLED}),t.state=h._cesium.QuadtreeTileLoadState.LOADING,t.state===h._cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&(t.state=h._cesium.QuadtreeTileLoadState.DONE),t.renderable=!0);else{if(0<h.PrimitiveData.length)for(var r=0;r<h.PrimitiveData.length;r++)if(h.PrimitiveData[r].key==i)return void h.Primitivekey.push(i);h.Primitivekey.includes(i)||(h.Primitivekey.push(i),l.push({level:t.level,x:t.x,y:t.y,data:void 0}),n=t,o=h._urlTemplate.replace(window.encodeURIComponent("{x}"),n.x).replace(window.encodeURIComponent("{y}"),n.y).replace(window.encodeURIComponent("{z}"),n.level),h._cache&&(o+="&"+h._core.getuid()),h.tilesLength++,h._core.xhr({url:o,type:"get",dataType:"json",success:function(e){var i=[];function o(e){for(var t=0;t<e.length;t++)Array.isArray(e[t])?o(e[t]):n.push(e[t])}function t(){/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)&&(e=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),u.extrudedHeight=parseFloat(a.properties[e])),u.extrudedHeight=parseFloat(h._option.extrudedHeight),u.material=h._option.material,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(e=h._option.material.replace(/\[/,"").replace(/\]/,""),u.material=a.properties[e],h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=h._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))):(h._option.material&&(u.material=h._option.material),u.material&&(h._core.isHtmlColor(u.material)?u.material=h._color.colorFromHtmlColor(u.material):(/^rgb/.test(u.material)&&(u.material=h._color.rgbaStringToRgbaObj(u.material)),1<u.material.red&&(u.material.red=u.material.red/255),1<u.material.green&&(u.material.green=u.material.green/255),1<u.material.blue&&(u.material.blue=u.material.blue/255),1<u.material.alpha&&(u.material.a=u.material.alpha/255),u.material=h._color.createColor(u.material.red,u.material.green,u.material.blue,u.material.alpha))));var e=h._cesium.Cartesian3.fromDegreesArray(n),e=(u.polygonHierarchy=new h._cesium.PolygonHierarchy(e),new h._cesium.PolygonGeometry(u)),e=new h._cesium.GeometryInstance({id:a,geometry:e,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material)}}),t="material:"+255*u.material.red+","+255*u.material.green+","+255*u.material.blue;h.Legend.push(t),i.push(e)}h.Legend=[];for(var r=0;r<e.features.length;r++){var n=[],a=e.features[r];if(Array.isArray(a.geometry.coordinates)&&0<a.geometry.coordinates.length)if(Array.isArray(a.geometry.coordinates[0][0]))for(var s=0;s<a.geometry.coordinates.length;s++)n=[],a.geometry.coordinates[s].pop(),o(a.geometry.coordinates[s]),t();else o(a.geometry.coordinates),t()}var l=new h._cesium.Primitive({geometryInstances:i,appearance:new h._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:h._core.Shaders("vertexShaderSource"),fragmentShaderSource:h._core.Shaders("fragmentShaderSource")}),shadows:h._option.shadows}),c=(h.PrimitiveObj.data=l,h.PrimitiveObj.key=h.Primitivekey[h.returnCount],{key:h.Primitivekey[h.returnCount],data:l});h.PrimitiveData.push(c),h._viewer.scene.primitives.add(l),h.datas.push(l),h.returnCount++,h.returnCount>=h.tilesLength&&(h.returnCount=0,h.tilesLength=0,h.Primitivekey=[])},error:function(){l=C.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(u.id)&&(u.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+u.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;n={id:u.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)},Ju.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.material.r&&(o.material.r=o.material.r/255),1<o.material.g&&(o.material.g=o.material.g/255),1<o.material.b&&(o.material.b=o.material.b/255),1<o.material.a&&(o.material.a=o.material.a/255),o.material=this._color.createColor(o.material.r,o.material.g,o.material.b,o.material.a))),this._core.isnull(o)||this._core.isnull(o.outlineColor)||"["==o.outlineColor.toString().charAt(0)&&"]"==o.outlineColor.toString().charAt(o.outlineColor.length-1)||(this._core.isHtmlColor(o.outlineColor)?o.outlineColor=this._color.colorFromHtmlColor(o.outlineColor):(/^rgb/.test(o.outlineColor)&&(o.outlineColor=this._color.rgbaStringToRgbaObj(o.outlineColor)),1<o.outlineColor.r&&(o.outlineColor.r=o.outlineColor.r/255),1<o.outlineColor.g&&(o.outlineColor.g=o.outlineColor.g/255),1<o.outlineColor.b&&(o.outlineColor.b=o.outlineColor.b/255),1<o.outlineColor.a&&(o.outlineColor.a=o.outlineColor.a/255),o.outlineColor=this._color.createColor(o.outlineColor.r,o.outlineColor.g,o.outlineColor.b,o.outlineColor.a))),this._option=this._core.extend(a,o,!0),null==t&&console.log("geoOptions is required"),null==e&&console.log("layername is required"),[]),h={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.RED},m=this,a=(this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),t.url.split("geoserver")[0]+"geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName="+s.urlParams.LAYER+"&outputFormat=application%2Fjson");m._core.xhr({url:a,type:"get",async:!1,dataType:"json",success:function(e){m.datas=e.features}}),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(i,t){var u,e;(this.tile=t).state===Cesium.QuadtreeTileLoadState.START&&m.item.show&&(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&m.item.show?0!=(e=C.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&e[0].data&&0<e[0].data.length?(t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:e[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(l.push({level:t.level,x:t.x,y:t.y,data:void 0}),u=t,e=m._urlTemplate.replace(window.encodeURIComponent("{x}"),u.x).replace(window.encodeURIComponent("{y}"),u.y).replace(window.encodeURIComponent("{z}"),u.level),m._cache&&(e+="&"+m._core.getuid()),m._core.xhr({url:e,type:"get",dataType:"json",success:function(e){var t=[];m.Legend=[];for(var i,o,r=0;r<e.features.length;r++){var n=[],a=e.features[r].id,a=parseInt(a.split(".")[1])+1,s=m.datas[a];if(Array.isArray(s.geometry.coordinates)&&0<s.geometry.coordinates.length&&Array.isArray(s.geometry.coordinates[0][0][0]))for(var l=0;l<s.geometry.coordinates[0].length;l++)n=[],function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?(3==t[i].length&&(t[i].splice(2,1),t[i].push(this._option.height)),e(t[i])):n.push(t[i])}(s.geometry.coordinates[0][l]),o=i=void 0,/^\[/.test(m._option.extrudedHeight)&&/\]$/.test(m._option.extrudedHeight)?(i=m._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h.extrudedHeight=parseFloat(s.properties[i])):h.extrudedHeight=parseFloat(m._option.extrudedHeight),h.material=m._option.material,/^\[/.test(m._option.material)&&/\]$/.test(m._option.material)?(i=m._option.material.replace(/\[/,"").replace(/\]/,""),h.material=s.properties[i],m._core.isHtmlColor(h.material)?h.material=m._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=m._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=m._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha))):(m._option.material&&(h.material=m._option.material),h.material&&(m._core.isHtmlColor(h.material)?h.material=m._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=m._color.rgbaStringToRgbaObj(h.material)),1<h.material.red&&(h.material.red=h.material.red/255),1<h.material.green&&(h.material.green=h.material.green/255),1<h.material.blue&&(h.material.blue=h.material.blue/255),1<h.material.alpha&&(h.material.a=h.material.alpha/255),h.material=m._color.createColor(h.material.red,h.material.green,h.material.blue,h.material.alpha)))),i=Cesium.Cartesian3.fromDegreesArrayHeights(n),h.polygonHierarchy=new Cesium.PolygonHierarchy(i),i={positions:Cesium.Cartesian3.fromDegreesArrayHeights(n),width:m._option.outlineWidth,color:Cesium.ColorGeometryInstanceAttribute.fromColor(m._option.outlineColor)},i=new Cesium.PolylineGeometry(i),i=new Cesium.GeometryInstance({geometry:i}),o="material:"+255*h.material.red+","+255*h.material.green+","+255*h.material.blue,m.Legend.push(o),t.push(i)}var c=new Cesium.PrimitiveCollection;c.add(new Cesium.Primitive({geometryInstances:t,appearance:new Cesium.PolylineColorAppearance})),u.data.geometryPrimitive=c},error:function(){l=C.remove(l,function(e){return e.x==u.x&&e.y==u.y&&e.level==u.level})},complete:function(e,t){u.state=Cesium.QuadtreeTileLoadState.LOADING,u.state===Cesium.QuadtreeTileLoadState.LOADING&&(u.data.geometryPrimitive&&u.data.geometryPrimitive.update(i),u.state=Cesium.QuadtreeTileLoadState.DONE,u.renderable=!0)}})):(t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(i,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new m._cesium.QuadtreePrimitive({tileProvider:this._Provider});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;s={id:h.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};return this.setTreeobj(s),this._tree.insertGroupId(s,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item),this},Ju.prototype.createVolumeVectorGeoJsonFeatureLayerDth=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._option=this._core.extend(a,o,!0),null==t&&console.log("url is required"),null==e&&console.log("layername is required"),[]),u=(Cesium.VertexFormat.DEFAULT,Cesium.Ellipsoid.WGS84,Cesium.ArcType.GEODESIC,Cesium.Color.WHITE),h=this;this._urlTemplate=t.url+"?"+this._serialize(s.urlParams),this._Provider=new T(this._viewer,this._cesium),this._Provider._normalTile=o.level_max-1,this._Provider.loadTile=function(e,t){var c,i;this.tile=t,_serialize,t.state===Cesium.QuadtreeTileLoadState.START&&h.item.show&&(t.level,t.x,t.y,t.data={lines:[],geometryPrimitive:void 0},t.level>=o.level_min&&t.level<o.level_max&&h.item.show?0!=(i=C.filter(l,function(e){return e.x==t.x&&e.y==t.y&&e.level==t.level})).length&&i[0].data&&0<i[0].data.length?(t.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:i[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)):(l.push({level:t.level,x:t.x,y:t.y,data:void 0}),c=t,i=h._urlTemplate.replace(window.encodeURIComponent("{x}"),c.x).replace(window.encodeURIComponent("{y}"),c.y).replace(window.encodeURIComponent("{z}"),c.level),h._cache&&(i+="&"+h._core.getuid()),h._core.xhr({url:i,type:"get",dataType:"json",success:function(e){var t=[],i=(h.Legend=[],new h._cesium.PrimitiveCollection);for(var o=0;o<e.features.length;o++){var r,n=[],a=e.features[o],s=(!function e(t){for(var i=0;i<t.length;i++)Array.isArray(t[i])?e(t[i]):n.push(t[i])}(e.features[o].geometry.coordinates[0]),/^\[/.test(h._option.extrudedHeight)&&/\]$/.test(h._option.extrudedHeight)?(r=h._option.extrudedHeight.replace(/\[/,"").replace(/\]/,""),h._option.extrudedHeight=parseFloat(a.properties[r])):h._option.extrudedHeight=parseFloat(h._option.extrudedHeight),1==h._option.heightReference&&delete h._option.height,1==h._option.extrudedHeightReference&&delete h._option.extrudedHeight,/^\[/.test(h._option.material)&&/\]$/.test(h._option.material)?(r=h._option.material.replace(/\[/,"").replace(/\]/,""),h._option.material=a.properties[r],h._core.isHtmlColor(h._option.material)?h._option.material=h._color.colorFromHtmlColor(h._option.material):(/^rgb/.test(h._option.material)&&(h._option.material=h._color.rgbaStringToRgbaObj(h._option.material)),1<h._option.material.red&&(h._option.material.red=h._option.material.red/255),1<h._option.material.green&&(h._option.material.green=h._option.material.green/255),1<h._option.material.blue&&(h._option.material.blue=h._option.material.blue/255),1<h._option.material.alpha&&(h._option.material.a=h._option.material.alpha/255),h._option.material=h._color.createColor(h._option.material.red,h._option.material.green,h._option.material.blue,h._option.material.alpha))):(h._option.material&&(h._option.material=h._option.material),h._option.material&&(h._core.isHtmlColor(h._option.material)?h._option.material=h._color.colorFromHtmlColor(h._option.material):(/^rgb/.test(h._option.material)&&(h._option.material=h._color.rgbaStringToRgbaObj(h._option.material)),1<h._option.material.red&&(h._option.material.red=h._option.material.red/255),1<h._option.material.green&&(h._option.material.green=h._option.material.green/255),1<h._option.material.blue&&(h._option.material.blue=h._option.material.blue/255),1<h._option.material.alpha&&(h._option.material.a=h._option.material.alpha/255),h._option.material=h._color.createColor(h._option.material.red,h._option.material.green,h._option.material.blue,h._option.material.alpha)))),Cesium.Cartesian3.fromDegreesArray(n)),s=(a.positions=s,h._option.polygonHierarchy=new Cesium.PolygonHierarchy(s),new Cesium.PolygonGeometry(h._option)),s=Cesium.PolygonGeometry.createGeometry(s),l="material:"+255*u.red+","+255*u.green+","+255*u.blue,l=(h.Legend.push(l),new Cesium.GeometryInstance({id:a,geometry:s,attributes:{color:new h._cesium.ColorGeometryInstanceAttribute.fromColor(h._option.material)}}),new Cesium.ClassificationPrimitive({geometryInstances:t,appearance:new Cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:h._option.classificationType,shadows:Cesium.ShadowMode.ENABLED}));i.add(l)}c.data.geometryPrimitive=i},error:function(){l=C.remove(l,function(e){return e.x==c.x&&e.y==c.y&&e.level==c.level})},complete:function(){c.state=Cesium.QuadtreeTileLoadState.LOADING,c.state===Cesium.QuadtreeTileLoadState.LOADING&&(c.data.geometryPrimitive&&c.data.geometryPrimitive.update(e,[]),c.state=Cesium.QuadtreeTileLoadState.DONE,c.renderable=!0)}})):(t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive&&t.data.geometryPrimitive.update(e,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)))},this._primitive=new h._cesium.QuadtreePrimitive({tileProvider:this._Provider});this._viewer.scene.primitives.add(this._primitive),r||this.setVisibility(!1),this._core.isnull(h._option.id)&&(h._option.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h._option.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy;a={id:h._option.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polygonLayer",item:this,url:t.url,style:o};this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof n&&n(this.item)},Ju.prototype.createVolumeGeoJsonFeatureLayer=function(e,t,n,i,a){var s={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED},o=(null==t&&console.log("geojson is required"),null),o=t.then?t:this._cesium.GeoJsonDataSource.load(t),l=this,c=[],t=(s.shapePositions=this.computeCircle(n.radius),o.then(function(e){for(var t=l._cesium.Color.WHITE,i=(l._core.isnull(n)||l._core.isnull(n.material)||(t="["==n.material.toString().charAt(0)&&"]"==n.material.toString().charAt(n.material.length-1)?n.material.replace(/\[/,"").replace("/]/",""):C.clone(n.material),t=l._core.isHtmlColor(t)?l._color.colorFromHtmlColor(n.material):(1<(t=/^rgb/.test(t)?l._color.rgbaStringToRgbaObj(t):t).r&&(t.r=t.r/255),1<t.g&&(t.g=t.g/255),1<t.b&&(t.b=t.b/255),1<t.a&&(t.a=t.a/255),l._color.createColor(t.r,t.g,t.b,t.a))),e.entities.values),o=0;o<i.length;o++){var r=i[o],r=(s.polylinePositions=r.polyline.positions._value,new l._cesium.PolylineVolumeGeometry(s)),r=l._cesium.PolylineVolumeGeometry.createGeometry(r),r=new l._cesium.GeometryInstance({geometry:r});c.push(r)}e=l._viewer.scene.primitives.add(new l._cesium.Primitive({geometryInstances:c,appearance:new l._cesium.MaterialAppearance({material:new l._cesium.Material({fabric:{type:"Color",uniforms:{color:t}}}),faceForward:!0,flat:!1})}));l.item=e,0==n.show&&(e.show=!1),"function"==typeof a&&a(e)}),this._core.isnull(n.id)&&(n.id=this._core.getuid()),this._core.isnull(e)&&(e="新建管状图层"+n.id),{id:n.id,name:e,checked:!0,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:n});return this.setTreeobj(t),this._tree.insertGroupId(t,this._core.isnull(i)?0:i),this},Ju.prototype.computeCircle=function(e){this._core.isnull(e)&&(e=4);for(var t=[],i=0;i<360;i++){var o=this._cesium.Math.toRadians(i);t.push(new this._cesium.Cartesian2(e*Math.cos(o),e*Math.sin(o)))}return t},Ju.prototype.createVolumeGeoJsonFeatureLayerProvider=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.RECEIVE_ONLY},a={url:t.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:t.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:t.upperLevelLimit,lowerLevelLimit:t.lowerLevelLimit,Cesium:this._cesium},h=(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<u.material.r&&(u.material.r=u.material.r/255),1<u.material.g&&(u.material.g=u.material.g/255),1<u.material.b&&(u.material.b=u.material.b/255),1<u.material.a&&(u.material.a=u.material.a/255),u.material=this._color.createColor(u.material.r,u.material.g,u.material.b,u.material.a))),this._core.extend(n,u,!0)),n=new v(this._viewer,this._cesium,a),m=(this._Provider=n,this),a=(n._loadTile=function(e){var c=new m._cesium.PrimitiveCollection;return e.features.forEach(function(e){var t=[];/^\[/.test(u.material)&&/\]$/.test(u.material)&&(s=u.material.replace(/\[/,"").replace(/\]/,""),h.material=e.properties[s],that._core.isHtmlColor(h.material)?h.material=that._color.colorFromHtmlColor(h.material):(/^rgb/.test(h.material)&&(h.material=that._color.rgbaStringToRgbaObj(h.material)),1<h.material.r&&(h.material.r=h.material.r/255),1<h.material.g&&(h.material.g=h.material.g/255),1<h.material.b&&(h.material.b=h.material.b/255),1<h.material.a&&(h.material.a=h.material.a/255),h.material=that._color.createColor(h.material.r,h.material.g,h.material.b,h.material.a)));for(var i=0;i<e.geometry.coordinates.length;i++){var o=e.geometry.coordinates[i];if(0<o.length)if(Array.isArray(o[0]))for(var r=0;r<o.length;r++){var n=o[r],n=m._cesium.Cartesian3.fromDegrees(n[0],n[1],h.height);t.push(n)}else{var a=m._cesium.Cartesian3.fromDegrees(o[0],o[1],h.height);t.push(a)}}h.position=t,e.positions=t,"0"==h.slttype||0==h.slttype?h.shape=m._core.computeCircle(h.radius):"1"==h.slttype||1==h.slttype?h.shape=m._core.starPositions(h.number,h.exradius,h.inradius):"2"!=h.slttype&&2!=h.slttype||(s=h.orth_width/2,l=h.orth_height/2,h.shape=[new m._cesium.Cartesian2(-s,-l),new m._cesium.Cartesian2(s,-l),new m._cesium.Cartesian2(s,l),new m._cesium.Cartesian2(-s,l)]);var s={polylinePositions:h.position,shapePositions:h.shape,cornerType:h.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},l=new m._cesium.PolylineVolumeGeometry(s),s=m._cesium.PolylineVolumeGeometry.createGeometry(l),l=new m._cesium.GeometryInstance({id:e,geometry:s,attributes:{color:new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material)}}),s=new m._cesium.Primitive({allowPicking:!0,appearance:new m._cesium.MaterialAppearance({material:new m._cesium.Material({fabric:{type:"Color",uniforms:{color:h.material}}}),faceForward:!0,flat:!1}),shadows:h.shadows,geometryInstances:l});c.add(s)}),c},this.item=n._primitiveCollection,n.addTo(this._viewer),o||this.setVisibility(!1),this._core.isnull(h.id)&&(h.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+h.id),this.west=t.minx,this.south=t.miny,this.east=t.maxx,this.north=t.maxy,{id:h.id,name:e,checked:o,pId:this._core.isnull(i)?0:i,type:"polylineVolumeLayer",item:this,url:t.url,style:u});this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(i)?0:i),"function"==typeof r&&r(this.item)},Ju.prototype.setTreeobj=function(e){this.treeobj=e},Ju.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},Ju.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},Ju.prototype.setRefresh=function(e){try{this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ju.prototype.setVisibility=function(e){try{null!=this.item&&null!=this.item.show&&(this.item.show=e),this._Provider&&this._Provider.setStatus(e)}catch(e){}},Ju.prototype.isCache=function(e){this._cache=e},Ju.prototype.edit=function(e,t){return this.isEditting=e,this.editoption=t,this._Provider&&this._Provider.edit&&this._Provider.edit(e,t)},Ju.prototype.forceRefresh=function(){try{for(var e=0;e<this._Provider.quadtree._levelZeroTiles.length;e++)this._Provider.quadtree._levelZeroTiles[e].freeResources()}catch(e){}},Qu.prototype.setSpaceBackground=function(e){return this.clear&&this.clear(),this._viewer.container.style.backgroundImage="url("+e+")",this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,0),this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!1),this.clear=()=>{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},Qu.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},Qu.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},qu.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},qu.prototype._init=function(){this.windField=this.createField();for(var e=0;e<this.WindFieldOption.num;e++)this.particles.push(this.randomParticle(new Xu))},qu.prototype.createField=function(){var e=this._parseWindJson();return new Zu(e)},qu.prototype.animate=function(){var o,r,n=this,a=n.windField,e=n.particles,s=[];e.forEach(function(e){var t,i;e.age<=0&&n.randomParticle(e),0<e.age&&(t=e.x,i=e.y,a.isInBound(t,i)?(r=a.getIn(t,i),o=t+n.WindFieldOption.speed*r[0],r=i+n.WindFieldOption.speed*r[1],e.path.push(o,r),e.x=o,e.y=r,s.push(n._createLineInstance(n._map(e.path),e.age/e.birthAge)),e.age--):e.age=0)}),s.length<=0&&this.removeLines(),n._drawLines(s)},qu.prototype._parseWindJson=function(){var t=null,i=null,o=null;return this.windData.forEach(function(e){switch(e.header.parameterCategory+","+e.header.parameterNumber){case"2,2":t=e.data,o=e.header;break;case"2,3":i=e.data}}),{header:o,uComponent:t,vComponent:i}},qu.prototype.removeLines=function(){this.lines&&(this.primitives.remove(this.lines),this.lines.destroy())},qu.prototype._map=function(e){for(var t=e.length,i=this.windField,o=i.dx,r=i.dy,n=i.west,a=i.north,s=[],l=0;l<=t-2;l+=2)s.push(n+e[l]*o,a-e[l+1]*r);return s},qu.prototype._createLineInstance=function(e,t){for(var i=[],o=e.length,r=o/2,n=0;n<o;n++)i.push("random"===this.WindFieldOption.color?this._cesium.Color.fromRandom({alpha:n/r*t*this.WindFieldOption.brighten}):this.WindFieldOption.color.withAlpha(n/r*t*this.WindFieldOption.brighten));return new this._cesium.GeometryInstance({geometry:new this._cesium.PolylineGeometry({positions:this._cesium.Cartesian3.fromDegreesArray(e),colors:i,width:1.5,colorsPerVertex:!0})})},qu.prototype._drawLines=function(e){this.removeLines();e=new this._cesium.Primitive({appearance:new this._cesium.PolylineColorAppearance({translucent:!0}),geometryInstances:e,asynchronous:!1});this.lines=this.primitives.add(e)},qu.prototype.randomParticle=function(e){for(var t,i,o=30;t=Math.floor(Math.random()*(this.windField.cols-2)),i=Math.floor(Math.random()*(this.windField.rows-2)),this.windField.getIn(t,i)[2]<=0&&o++<30;);return e.x=t,e.y=i,e.age=Math.round(Math.random()*this.WindFieldOption.maxAge),e.birthAge=e.age,e.path=[t,i],e},qu.prototype.changeColor=function(e){this.WindFieldOption.color="random"===e?e:this._cesium.Color.fromCssColorString(e)},qu.prototype.setSpeed=function(e){this.WindFieldOption.speed=e},qu.prototype.setMaxAge=function(e){this.WindFieldOption.maxAge=e},qu.prototype.setBrighten=function(e){this.WindFieldOption.brighten=e},qu.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.removeLines()};var Xu=function(){this.x=null,this.dx=null,this.dx=null,this.y=null,this.age=null,this.birthAge=null,this.path=null},Zu=function(e){this.west=null,this.east=null,this.south=null,this.north=null,this.rows=null,this.cols=null,this.dx=null,this.dy=null,this.unit=null,this.date=null,this.grid=null,this._init(e)},$u=(Zu.prototype={constructor:Zu,_init:function(e){for(var t,i=e.header,o=e.uComponent,r=e.vComponent,n=(this.west=+i.lo1,this.east=+i.lo2,this.south=+i.la2,this.north=+i.la1,this.rows=+i.ny,this.cols=+i.nx,this.dx=+i.dx,this.dy=+i.dy,this.unit=i.parameterUnit,this.date=i.refTime,this.grid=[],0),a=null,s=0;s<this.rows;s++){for(var a=[],l=0;l<this.cols;l++,n++)t=this._calcUV(o[n],r[n]),a.push(t);this.grid.push(a)}},_calcUV:function(e,t){return[+e,+t,Math.sqrt(e*e+t*t)]},_bilinearInterpolation:function(e,t,i,o,r,n){var a=1-e,s=1-t,l=a*s,s=e*s,a=a*t,e=e*t,t=i[0]*l+o[0]*s+r[0]*a+n[0]*e,i=i[1]*l+o[1]*s+r[1]*a+n[1]*e;return this._calcUV(t,i)},getIn:function(e,t){var i,o,r,n,a,s=Math.floor(e),l=Math.floor(t);return s===e&&l===t?this.grid[t][e]:(a=s+1,i=l+1,o=this.getIn(s,l),r=this.getIn(a,l),n=this.getIn(s,i),a=this.getIn(a,i),this._bilinearInterpolation(e-s,t-l,o,r,n,a))},isInBound:function(e,t){return 0<=e&&e<this.cols-2&&0<=t&&t<this.rows-2}},"uniform vec4 u_moveColor;\nuniform vec4 u_lineColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_lineColor;\nfloat dt = clamp(tan(uv.x * 5.0  - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n");function eh(e){this._viewer=e,this.PrimitiveCollection=[],this.lineColor=Cesium.Color.fromCssColorString("#330066").withAlpha(.8),this.pointColor=Cesium.Color.fromCssColorString("#CCFFFF").withAlpha(1)}eh.prototype.create=function(e={}){this.position=e.position||void 0,this.positions=e.positions||void 0,this.linewidth=e.width||void 0,this.near=e.near,this.far=e.far,this._speed=e.speed,Cesium.defined(this._speed)||(this._speed=1),this._id=e.id,e.color&&(this.lineColor=Cesium.Color.fromCssColorString(e.color)),e.pointColor&&(this.pointColor=Cesium.Color.fromCssColorString(e.pointColor)),this.getShader(),this.collection=new Cesium.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.PrimitiveCollection.push(this.collection),this.addPathLayer()},eh.prototype.addPathLayer=async function(){this.position?this.getInstance():this.positions&&this.getInstances(),this.instances.forEach(e=>{this.addGroundLine(e)})},eh.prototype.getById=function(e){for(var t=null,i=this._viewer.scene.primitives,o=i.length,r=0;r<o;r++){var n=i.get(r);n._guid===e&&(t=n)}return t},eh.prototype.remove=function(e){e=this.getById(e);e&&this._viewer.scene.primitives.remove(e)},eh.prototype.removeAll=function(){for(var e=0;e<this.PrimitiveCollection.length;e++){var t=this.PrimitiveCollection[e];this._viewer.scene.primitives.remove(t)}this.PrimitiveCollection=[]},eh.prototype.show=function(e){for(var t=0;t<this.PrimitiveCollection.length;t++)this.PrimitiveCollection[t].show=e},eh.prototype.getInstance=function(){let e;e=this.position[0]instanceof Cesium.Cartesian3?this.position:Cesium.Cartesian3.fromDegreesArray(this.position);var t=new Cesium.GroundPolylineGeometry({positions:e,width:this.linewidth,vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT});this.instances=new Cesium.GeometryInstance({geometry:t,attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})},eh.prototype.getInstances=function(){this.instances=[];for(let t=0;t<this.positions.length;t++){let e;e=this.positions[t][0]instanceof Cesium.Cartesian3?this.positions[t]:Cesium.Cartesian3.fromDegreesArray(this.positions[t]);var i=new Cesium.GeometryInstance({geometry:new Cesium.GroundPolylineGeometry({positions:e,width:this.linewidth,vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(i)}},eh.prototype.addGroundLine=async function(e){e=new Cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new Cesium.MaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})})});this.collection.add(e)},eh.prototype.addLine=function(){var e=new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})}),e=new Cesium.Primitive({geometryInstances:this.instances,appearance:e});this.collection.add(e)},eh.prototype.getShader=function(){this.fs=$u.replace("{speed}",this._speed.toFixed(1))};var th,ih="uniform vec4 u_moveColor;\nuniform vec4 u_wallColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_wallColor;\nfloat dt = clamp(tan(uv.y * 5.0  - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nif(uv.y < 0.5){\nalpha = 1.0;\nfinalColor = u_wallColor;\nif(uv.y > 0.4){\nalpha = (0.5 - uv.y) * 5.0 + 0.5;\n}\n}\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n";function oh(e){this._viewer=e,this.PrimitiveCollection=[],this.color=Cesium.Color.BLUE}function rh(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new f,this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._polylines=[],this.Streamerpath=new eh(this._viewer),this.Streamerwall=new oh(this._viewer)}function nh(e){this._viewer=e,this._cesium=Cesium,this._core=new f,this._Buffer=new Ai(e,Cesium),this._tree=V}function ah(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function K(e){this._viewer=e,this._core=new f,this._tree=V,this._getPosition=new y(this._viewer,Cesium),this._popupmessage=new Si(this._viewer,Cesium),this.tooltip=this._core.CreateTooltip({id:"_jb"}),this.objectsToExclude=[],this.MilitaryStandardObj=[],this.drawHandler=void 0,this.editHandler=null,this.heightpointsId=[],this.state=0,this.isEditting=!1,this.editProp=!1,this.openEdit=!0}function sh(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this._Provider=void 0}function lh(e){this._viewer=e,this._cesium=Cesium,this._core=new f,this._tree=V,this.texturePixel=1024}function ch(e){this._viewer=e,this._core=new f}function uh(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._tree=V}function hh(e){if(this._viewer=e,this._cesium=Cesium,this._core=new f,this._tree=V,!window.h337){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/heatmap/heatmap.min.js"),e.addJs(window.SmartEarthRootUrl+"Workers/heatmap/webgl-heatmap.js")}}function mh(e,t){this._viewer=e,this._cesium=t,this._core=new f,this.TrailEntitys=[]}function dh(e){this.lon=0,this.lat=0,this.hei=e,this.phei=e/2,this.time=0}function ph(e,t){this._viewer=e,this._cesium=t,this._core=new f,this._color=new m(this._viewer,this._cesium),this._tree=V,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0}function gh(e){this._viewer=e,th=e}function fh(e,t){this._viewer=e,this._cesium=t,this._core=new f,this.isPause=!1,this.isLoad=!1}function _h(e,t){if(this._viewer=e,this._cesium=t,this._core=new f,!Cesium.GeoWTFS){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/cesiumTdt.js")}}function Ch(e){this._viewer=e,this._core=new f,this._tree=V}function yh(e){this._viewer=e,this._core=new f}oh.prototype.create=function(e={}){this.position=e.position||void 0,this.positions=e.positions||void 0,this.height=e.height||50,this.minHeight=e.minHeight,this.near=e.near,this.far=e.far,this._speed=e.speed||1,this._id=e.id,e.color&&(this.color=Cesium.Color.fromCssColorString(e.color)),this.getShader(),this.collection=new Cesium.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.position?this.getInstance():this.positions&&this.getInstances(),this.addWall(),this.PrimitiveCollection.push(this.collection)},oh.prototype.getById=function(e){for(var t=null,i=this._viewer.scene.primitives,o=i.length,r=0;r<o;r++){var n=i.get(r);n._guid===e&&(t=n)}return t},oh.prototype.remove=function(e){e=this.getById(e);null!=e&&this._viewer.scene.primitives.remove(e)},oh.prototype.removeAll=function(){for(var e=0;e<this.PrimitiveCollection.length;e++){var t=this.PrimitiveCollection[e];this._viewer.scene.primitives.remove(t)}this.PrimitiveCollection=[]},oh.prototype.show=function(e){for(var t=0;t<this.PrimitiveCollection.length;t++)this.PrimitiveCollection[t].show=e},oh.prototype.getInstance=function(){let e;e=this.position[0]instanceof Cesium.Cartesian3?this.position:Cesium.Cartesian3.fromDegreesArray(this.position);var t=Array(e.length).fill(this.height),i=Array(e.length).fill(this.minHeight||0),t=new Cesium.WallGeometry({positions:e,maximumHeights:t,minimumHeights:i});this.instances=[new Cesium.GeometryInstance({geometry:t,attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})]},oh.prototype.getInstances=function(){this.instances=[];for(let t=0;t<this.positions.length;t++){let e;e=this.positions[t][0]instanceof Cesium.Cartesian3?this.positions[t]:Cesium.Cartesian3.fromDegreesArray(this.positions[t]);var i=Array(e.length).fill(this.height),o=Array(e.length).fill(this.minHeight||0),i=new Cesium.GeometryInstance({geometry:new Cesium.WallGeometry({positions:e,maximumHeights:i,minimumHeights:o}),attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(i)}},oh.prototype.addWall=async function(){this.instances.forEach(e=>{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)})},oh.prototype.getShader=function(){this.fs=ih.replace("{speed}",this._speed.toFixed(1))},rh.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<i.length;t++){let e=i[t];e.polyline?(r.push(e.polyline.positions.getValue()),o=o.concat(r[r.length-1])):e.polygon&&(r.push(e.polygon.hierarchy.getValue().positions),o=o.concat(r[r.length-1]))}this.boundingSphere=Cesium.BoundingSphere.fromPoints(o),o=null,this.Streamerpath.create({positions:r,...t})}),this.updateLayer=(e={})=>{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},rh.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<i.length;t++){let e=i[t];e.polyline?(r.push(e.polyline.positions.getValue()),o=o.concat(r[r.length-1])):e.polygon&&(r.push(e.polygon.hierarchy.getValue().positions),o=o.concat(r[r.length-1]))}this.boundingSphere=Cesium.BoundingSphere.fromPoints(o),o=null,this.Streamerwall.create({positions:r,...t})}),this.updateLayer=(e={})=>{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},rh.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 c=0;c<t.length;c++){a?(s=t[c],l=e):(l=t[c],s=e);for(var u=this.parabolaEquation({pt1:s,pt2:l,height:o.height,num:o.num}),h=[],m=0;m<u.length;m++)h.push(u[m][0],u[m][1],u[m][2]);n.add(this.getPolylinePrimitive(h,r,o))}this.pathMaterial=r;i={id:this._core.getuid(),name:"新建流动路径",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},rh.prototype.getPolylinePrimitive=function(e,t,i={}){let o=i.clampToGround?Cesium.GroundPolylineGeometry:Cesium.PolylineGeometry;e=new o({positions:"object"==typeof e[0]?e:Cesium.Cartesian3.fromDegreesArrayHeights(e),width:i.width}),e=new Cesium.GeometryInstance({geometry:e,attributes:{distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near,i.far)}});let r=i.clampToGround?Cesium.GroundPolylinePrimitive:Cesium.Primitive;return new r({geometryInstances:e,appearance:new Cesium.PolylineMaterialAppearance({material:t})})},rh.prototype.createFlyingLine=function(e,t={}){var i=this._core.extend({time:3e3,color:"#ffffff",width:1,alpha:0},t,!0),o=ie({lightSpotColor:Cesium.Color.fromCssColorString(i.color),time:i.time,alpha:i.alpha,lightSpot:!0});let r=new Cesium.PrimitiveCollection;this._viewer.scene.primitives.add(r),this._polylines.push(r);let n;e.forEach(e=>{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},rh.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;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));t=this._viewer.scene.primitives.add(this.getPolylinePrimitive(o,t,i)),this._polylines.push(t),i={id:this._core.getuid(),name:"新建流动线",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(i),this._tree.insertGroupId(i,0),this},rh.prototype.createWall=function(e,t){var i={time:9e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.colors3)},t=new te((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time||9e3),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;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:o,material:t,maximumHeights:i.maximumHeights,minimumHeights:i.minimumHeights}}));t={id:this._core.getuid(),name:"新建流动墙",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},rh.prototype.parabolaEquation=function(e,t){var i=this._core.defaultValue(e.height,5e3),o=Math.abs(e.pt1.lon-e.pt2.lon)>Math.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&&50<e.num?e.num:50,n=[],a=o/r,s=e.pt1.height||0,l=e.pt2.height||0;if(Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)){var c=(e.pt2.lat-e.pt1.lat)/r;0<e.pt1.lon-e.pt2.lon&&(a=-a);for(var u=0;u<=r;u++){var h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+a*u,d=e.pt1.lat+c*u;n.push([m,d,h])}}else{var p=(e.pt2.lon-e.pt1.lon)/r;0<e.pt1.lat-e.pt2.lat&&(a=-a);for(u=0;u<=r;u++){h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+p*u,d=e.pt1.lat+a*u;n.push([m,d,h])}}return n},rh.prototype.setThisPosition=function(e,t){var i;this.pathMaterial&&(i=this._cesium.Cartesian3.fromDegrees(e[0].lon,e[0].lat),e=this._cesium.Cartesian3.fromDegrees(e[1].lon,e[1].lat),t=this._cesium.Cartesian3.fromDegrees(t.lon,t.lat),e=this._core.getSpaceDistancem([i,e],this._cesium),i=this._core.getSpaceDistancem([i,t],this._cesium),this.pathMaterial.setScale(i/e))},rh.prototype.clear=function(){if(0<this._polylines.length)for(var e=0;e<this._polylines.length;e++)(this._polylines[e]instanceof Cesium.Entity?this._viewer.entities:this._viewer.scene.primitives).remove(this._polylines[e]);this._polylines=[],this.Streamerpath.removeAll(),this.Streamerwall.removeAll()},rh.prototype.setTreeobj=function(e){this.treeobj=e},rh.prototype.deleteObject=function(){this.clear()},rh.prototype.setVisibility=function(e){if(0<this._polylines.length)for(var t=0;t<this._polylines.length;t++)this._polylines[t].show=e;this.Streamerpath.show(e),this.Streamerwall.show(e)},nh.prototype.createRoad=function(e={}){var t={id:e.id||this._core.getuid(),image:window.SmartEarthRootUrl+I.road,height:1,width:20,alpha:1},t=this._core.extend(t,e,!0);let i=[];e.positions.forEach(e=>{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},nh.prototype.setTreeobj=function(e){this.treeobj=e},nh.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)},nh.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},ah.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=[],c=void 0,u="单击开始绘制";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),V.states=1,this.drawHandler.setInputAction(function(e){u="左键添加点 右键结束";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(u,e.endPosition,!0);var t,i,e=e.endPosition;0<s.length&&(Cesium.defined(c)?(s.pop(),l.pop(),i=n._createGeoPoints(a,[{x:e.x,y:e.y}]),s.push({x:i[0],y:i[1],z:i[2]}),l.push(i),t=n._createBezierPoints(s),i=[],t.forEach(e=>{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),(c=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(c.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,c&&(c.pottingPoint=l),n.drawHandler.destroy(),n._core.CreateTooltip(u,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){V.states=0},100),"cancel"===e?c&&(a.entities.remove(c),n.MilitaryStandardObj.pop()):t&&t(c)},this},K.prototype.createBezierArrow=function(o,t){var r,n=this,a=this._viewer,s="单击开始绘制",l=[],c=[],u=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.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]}),c.push(e)),l.push({x:e[0],y:e[1],z:e[2]}),c.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<l.length&&(Cesium.defined(u)?(l.pop(),c.pop(),i=n._createGeoPoints(a,[{x:e.x,y:e.y}]),l.push({x:i[0],y:i[1],z:i[2]}),c.push(i),t=n._createBezierPoints(l),i=[],t.forEach(e=>{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),(u=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(u.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,u&&(u.pottingPoint=c),n.drawHandler.destroy(),n._core.CreateTooltip(s,void 0,!1),n._core.mouse(n._viewer.container,0),setTimeout(function(){V.states=0},100),"cancel"===e?u&&(a.entities.remove(u),n.MilitaryStandardObj.pop()):t&&t(u)},this},K.prototype.createSwallowtailArrow=function(e,o,t){var r,n=e,a=this,s=this._viewer,l=void 0,c=[],u=[],h="单击开始绘制";return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.states=1,a.drawHandler=new Cesium.ScreenSpaceEventHandler(s.scene.canvas),a.drawHandler.setInputAction(function(e){var e=e.position;h="单击完成绘制",0==u.length?(e=a._createGeoPoints(s,[{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&&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<u.length&&(Cesium.defined(l)?(u.pop(),c.pop(),i=a._createGeoPoints(s,[{x:e.x,y:e.y}]),u.push({x:i[0],y:i[1],z:i[2]}),c.push(i),t=a._computeSwallowtailArrow(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(l=a.plotingSwallowtailArrow(s,u,n,o),t=a._computeSwallowtailArrow(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[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=c),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){V.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=[],c=void 0,u=[],h="单击开始绘制";return V.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]}),u.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<l.length&&(Cesium.defined(c)?(l.pop(),u.pop(),i=a._createGeoPoints(s,[{x:e.x,y:e.y}]),l.push({x:i[0],y:i[1],z:i[2]}),u.push(i),t=a.calculateMorePoints(l),i=[],t.forEach(e=>{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?c=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&&(c=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)"))}})),c.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(r)},!1),c.GeoType="StraightArrow",a.MilitaryStandardObj.push(c.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,c&&(c.pottingPoint=u),a._core.CreateTooltip(h,void 0,!1),a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){V.states=0},100),"cancel"===e?c&&(s.entities.remove(c),a.MilitaryStandardObj.pop()):t&&t(c)},this},K.prototype.createRoundedRectangle=function(e,o,t){var r,n=e,a="单击开始绘制",s=this,l=this._viewer,c=[],u=[],h=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),s._core.mouse(s._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){var e=e.position;a="单击完成绘制",0==c.length?(e=s._createGeoPoints(l,[{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&&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<c.length&&(Cesium.defined(h)?(c.pop(),u.pop(),i=s._createGeoPoints(l,[{x:e.x,y:e.y}]),c.push({x:i[0],y:i[1],z:i[2]}),u.push(i),t=s._computeRoundedRectanglePoints(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[0].z)}),r=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeRoundedRectanglePoints(c),i=[],t.forEach(e=>{i.push(e.x,e.y,c[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=u),s._core.CreateTooltip(a,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){V.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="单击开始绘制",c=this._viewer,u=this,h=[],m=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),u._core.mouse(u._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.states=1,u.drawHandler=new Cesium.ScreenSpaceEventHandler(c.scene.canvas),u.drawHandler.setInputAction(function(e){l="单击添加点";e=e.position,e=u._createGeoPoints(c,[{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&&u.end&&u.end(),2!==m.length||n||(n=c.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(u._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),width:3}}))},Cesium.ScreenSpaceEventType.LEFT_CLICK),u.drawHandler.setInputAction(function(e){u._core.CreateTooltip(l,e.endPosition,!0);var t,i,e=e.endPosition;2===h.length&&(h.pop(),m.pop(),i=u._createGeoPoints(c,[{x:e.x,y:e.y}]),h.push({x:i[0],y:i[1],z:i[2]}),m.push(i)),2<h.length&&(n&&c.entities.remove(n),Cesium.defined(r)?(h.pop(),m.pop(),i=u._createGeoPoints(c,[{x:e.x,y:e.y}]),h.push({x:i[0],y:i[1],z:i[2]}),m.push(i),t=u._computeSectorPoints(h),i=[],t.forEach(e=>{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=u._computeSectorPoints(h),i=[],t.forEach(e=>{i.push(e.x,e.y,h[0].z)}),a=Cesium.Cartesian3.fromDegreesArrayHeights(i),"polygon"==s?r=c.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(u._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:u._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(u._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)"))}}):"box"==s&&(r=c.entities.add({name:"Sector",polygon:{hierarchy:a,material:Cesium.Color.fromCssColorString(u._core.defaultValue(o.color,"rgba(255,0,0,0.6)")),outline:u._core.defaultValue(o.outline,!0),outlineColor:Cesium.Color.fromCssColorString(u._core.defaultValue(o.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:i[2]+u._core.defaultValue(o.extrudedHeight,200),height:i[2]}})),r.polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(a)},!1),r.GeoType="Sector",u.MilitaryStandardObj.push(r.id)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),u.drawHandler.setInputAction(function(e){u.end&&u.end()},Cesium.ScreenSpaceEventType.RIGHT_DOWN),this.end=e=>{this.end=void 0,r&&(r.pottingPoint=m),u._core.CreateTooltip(l,void 0,!1),u.drawHandler.destroy(),u._core.mouse(u._viewer.container,0),n&&c.entities.remove(n),setTimeout(function(){V.states=0},100),"cancel"===e?r&&(c.entities.remove(r),u.MilitaryStandardObj.pop()):t&&t(r)},this},K.prototype.createBow=function(e,r,t){var n,a=e,s=this,l=this._viewer,c="单击开始绘制",u=[],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),V.states=1,s.drawHandler=new Cesium.ScreenSpaceEventHandler(l.scene.canvas),s.drawHandler.setInputAction(function(e){c="单击添加点";e=e.position,e=s._createGeoPoints(l,[{x:e.x,y:e.y}]);0==u.length?(u.push({x:e[0],y:e[1],z:e[2]}),h.push(e)):1==u.length?(u.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==u.length&&s.end&&s.end()},Cesium.ScreenSpaceEventType.LEFT_CLICK),s.drawHandler.setInputAction(function(e){var t,i,o=e.endPosition;s._core.CreateTooltip(c,e.endPosition,!0),2<u.length&&(Cesium.defined(m)?(u.pop(),h.pop(),i=s._createGeoPoints(l,[{x:o.x,y:o.y}]),u.push({x:i[0],y:i[1],z:i[2]}),h.push(i),t=s._computeBowPoints(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[0].z)}),n=Cesium.Cartesian3.fromDegreesArrayHeights(i)):(t=s._computeBowPoints(u),i=[],t.forEach(e=>{i.push(e.x,e.y,u[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(c,void 0,!1),s.drawHandler.destroy(),s._core.mouse(s._viewer.container,0),setTimeout(function(){V.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=[],c=[],u=void 0,h="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),a._core.mouse(a._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.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<l.length?(a._core.CreateTooltip(h,e.position,!1),u.pottingPoint=c,a.drawHandler.destroy(),a._core.mouse(a._viewer.container,0),setTimeout(function(){V.states=0},100),r&&r(u)):(l.push(t),e=a._createGeoPoints(s,[{x:i.x,y:i.y}]),c.push(e)))},Cesium.ScreenSpaceEventType.LEFT_CLICK),a.drawHandler.setInputAction(function(e){var t,i;l.length<2||(a._core.CreateTooltip(h,e.endPosition,!0),(t=a._getPosition.getMousePosition(e))&&2<=l.length&&(Cesium.defined(u)?(l.pop(),c.pop(),l.push(t),i=a._createGeoPoints(s,[e.endPosition]),c.push(i)):(l.push(t),i=a._createGeoPoints(s,[e.endPosition]),c.push(i),(u=a.showArrowOnMap(l,n,o)).GeoType="PincerArrow",a.MilitaryStandardObj.push(u.id))))},Cesium.ScreenSpaceEventType.MOUSE_MOVE)},K.prototype.createAttackArrow=function(e,o,t){var r=e,n=this,a=this._viewer,s=[],l=[],c=void 0,u="单击开始绘制";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),n._core.mouse(n._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.states=1,n.drawHandler=new Cesium.ScreenSpaceEventHandler(a.scene.canvas),n.drawHandler.setInputAction(function(e){var t;u="单击增加点",(t=n._getPosition.getMousePosition(e))&&(s.push(t),t=n._createGeoPoints(a,[e.position]),l.push(t))},Cesium.ScreenSpaceEventType.LEFT_CLICK),n.drawHandler.setInputAction(function(e){1<s.length&&(s.pop(),l.pop())},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n.drawHandler.setInputAction(function(e){var t,i;s.length<2||(n._core.CreateTooltip(u,e.endPosition,!0),(t=n._getPosition.getMousePosition(e))&&2<=s.length&&(Cesium.defined(c)?(s.pop(),l.pop(),s.push(t),i=n._createGeoPoints(a,[e.endPosition]),l.push(i)):(s.push(t),i=n._createGeoPoints(a,[e.endPosition]),l.push(i),(c=n.showAttackArrowOnMap(s,r,o)).GeoType="AttackArrow",n.MilitaryStandardObj.push(c.id))))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.drawHandler.setInputAction(function(e){n._core.CreateTooltip(u,e.position,!1),c.pottingPoint=l,n.drawHandler.destroy(),n._core.mouse(n._viewer.container,0),setTimeout(function(){V.states=0},100),t&&t(c)},Cesium.ScreenSpaceEventType.RIGHT_DOWN)},K.prototype.createHandlerPolygon=function(e,a,i){var s,l=e,c="单击开始绘制",u=this,h=this._viewer,m=[],d=[],p=void 0;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),u._core.mouse(u._viewer.container,1,window.SmartEarthRootUrl+I.draw),V.states=1,u.drawHandler=new Cesium.ScreenSpaceEventHandler(h.scene.canvas),u.drawHandler.setInputAction(function(e){var t,e=e.position;c="单击完成绘制",0==m.length?(t=u._createGeoPoints(h,[{x:e.x,y:e.y}]),m.push({x:t[0],y:t[1],z:t[2]},{x:t[0]+1e-7,y:t[1]+1e-7,z:t[2]}),d.push(t,t)):2==m.length&&(u._core.CreateTooltip(c,e,!1),p.pottingPoint=d,setTimeout(function(){V.states=0},100),u.drawHandler.destroy(),u._core.mouse(u._viewer.container,0),i&&i(p))},Cesium.ScreenSpaceEventType.LEFT_CLICK),u.drawHandler.setInputAction(function(e){var t,i,o,r,n=e.endPosition;u._core.CreateTooltip(c,e.endPosition,!0),1<m.length&&(Cesium.defined(p)?(m.pop(),d.pop(),r=u._createGeoPoints(h,[{x:n.x,y:n.y}]),m.push({x:r[0],y:r[1],z:r[2]}),d.push(r),i=u._computeGatheringPlacePoints(m),o=u.createCloseCardinal(i),r=[],(t=u.calculatePointsFBZ3(o,100)).forEach(e=>{r.push(e.x,e.y,m[0].z)}),s=r):(i=u._computeGatheringPlacePoints(m),o=u.createCloseCardinal(i),t=u.calculatePointsFBZ3(o,100),r=[],t.forEach(e=>{r.push(e.x,e.y,m[0].z)}),s=r,(p=u.plotingGatheringPlace(h,m,l,a)).polygon.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s))},!1),p.GeoType="GatheringPlace",u.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=U.algorithm.doubleArrow(i);let e=[];-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(e=r.polygonalPoint),t=e}else if("AttackArrow"==e.type){r=U.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<t.length;o++){var r=Number(t[o]).toString(16);"0"===(r=1===r.length?"0"+r:r)&&(r+=r),i+=r}return i=7!==i.length?e:i}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e))return e;var n=e.replace(/#/,"").split("");if(6===n.length)return e;if(3===n.length){for(var a="#",o=0;o<n.length;o+=1)a+=n[o]+n[o];return a}},K.prototype.copyJb=function(e){var t;return"StraightArrow"==e.type||"SwallowtailArrow"==e.type||"PincerArrow"==e.type?(t={holes:[],positions:this.szposis(e.pos)},t=this._viewer.entities.add({name:"StraightArrow",polygon:{hierarchy:t,material:Cesium.Color.RED.withAlpha(.5)}})):"BezierArrow"==e.type?t=this._viewer.entities.add({name:"BezierArrow",polyline:{positions:this.szposis(e.pos),width:5,clampToGround:!0,material:new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED)}}):e.img?t=this._viewer.entities.add({position:this.zfsz(e.pos),billboard:{image:e.img,show:!0}}):e.text&&(t=this._viewer.entities.add({position:this.zfsz(e.pos),label:{text:e.text,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,show:!0,showBackground:!1}})),t._id=e.id,that.objectsToExclude.push(t),t},K.prototype.getEntityById=function(e){var t,e=this._viewer.entities.getById(e);return null!=e.polyline&&e.polyline?t={obj:e.polyline,type:e.name,posion:e.polyline.positions.getValue()}:null!=e.polygon&&e.polygon?t={obj:e.polygon,type:e.name,posion:e.polygon.hierarchy.getValue().positions}:null!=e.label&&e.label?t={obj:e.label,type:"lable",text:e.label.text.getValue(),posion:e.position.getValue()}:null!=e.billboard&&e.billboard&&(t={obj:e.billboard,type:"img",img:e.billboard.image.getValue(),posion:e.position.getValue()}),t},K.prototype.szposis=function(e){for(var t=[],i=e.split(",("),o=0;o<i.length;o++){var r=this.zfsz(i[o]);t.push(r)}return t},K.prototype.zfsz=function(e){for(var t=e.split(","),i=0;i<t.length;i++)(-1!=t[i].indexOf("(")||-1!=t[i].indexOf(")"))&&(t[i]=t[i].replace("(",""));return{x:parseFloat(t[0]),y:parseFloat(t[1]),z:parseFloat(t[2])}},K.prototype.showArrowOnMap=function(a,e,t){function i(){if(a.length<3)return null;for(var e=[],t=0;t<a.length;t++){var i=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[t]),o=Cesium.Math.toDegrees(i.latitude),i=Cesium.Math.toDegrees(i.longitude);e.push([i,o])}var r=U.algorithm.doubleArrow(e),n=[];return-1==JSON.stringify(r.polygonalPoint).indexOf("null")&&(n=r.polygonalPoint),new Cesium.PolygonHierarchy(n)}var o,s=this,r=s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[0]).height;return"polygon"==e?o=s._viewer.entities.add({name:"PincerArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(i,!1),show:!0,fill:!0,material:Cesium.Color.fromCssColorString(s._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})}):"box"==e&&(o=s._viewer.entities.add({name:"PincerArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(i,!1),show:!0,fill:!0,material:Cesium.Color.fromCssColorString(s._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:s._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:r+s._core.defaultValue(t.extrudedHeight,200),height:r})})),o},K.prototype.showAttackArrowOnMap=function(n,e,t){var a=this,i=a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n[0]).height;return this._viewer.entities.add({name:"AttackArrow",polygon:new Cesium.PolygonGraphics({hierarchy:new Cesium.CallbackProperty(function(){if(n.length<3)return null;for(var e=[],t=0;t<n.length;t++){var i=a.cartesianToLatlng(n[t]);e.push(i)}var o=U.algorithm.tailedAttackArrow(e),r=[];return-1==JSON.stringify(o.polygonalPoint).indexOf("null")&&(r=o.polygonalPoint),new Cesium.PolygonHierarchy(r)},!1),show:!0,fill:!0,classificationType:Cesium.ClassificationType.TERRAIN,extrudedHeight:"box"===e?a._core.defaultValue(t.extrudedHeight,200)+i:void 0,height:"box"===e?i:void 0,material:Cesium.Color.fromCssColorString(a._core.defaultValue(t.color,"rgba(255,0,0,0.6)")),outline:a._core.defaultValue(t.outline,!0),outlineColor:Cesium.Color.fromCssColorString(a._core.defaultValue(t.outlineColor,"rgba(255,0,0,0.6)"))})})},K.prototype.cartesianToLatlng=function(e){var e=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=Cesium.Math.toDegrees(e.latitude);return[Cesium.Math.toDegrees(e.longitude),t]},K.prototype.getCatesian3FromPX=function(e,t){for(var i,o=this._viewer.scene.drillPick(e),r=(this._viewer.render(),!0),n=0;n<o.length;n++)(o[n]&&o[n].primitive||o[n]instanceof Cesium.Cesium3DTileFeature)&&(r=!0);if(r)i=this._viewer.scene.pickPosition(e);else{e=this._viewer.camera.getPickRay(e);if(!e)return null;i=this._viewer.scene.globe.pick(e,this._viewer.scene)}return i},K.prototype._createGeoPoints=function(e,t){for(var i,o,r,n,a=[],s=0;s<t.length;s++)(i=(n=e.camera.getPickRay(t[s]))?e.scene.globe.pick(n,e.scene):i)&&(n=Cesium.Cartographic.fromCartesian(i),o=Cesium.Math.toDegrees(n.longitude),r=Cesium.Math.toDegrees(n.latitude),n=n.height,a.push(o,r,n));return a},K.prototype._createScreenPoints=function(e,t){for(var i,o=[],r=0;r<t.length;r++)i=e.scene.cartesianToCanvasCoordinates(t[r]),o.push(i);return o},K.prototype._createBezierPoints=function(e){for(var t=[],i=0;i<=100;i++){var o=this._computeBezierPoints(e,i/100);t.push(o)}return t},K.prototype._computeBezierPoints=function(e,t){for(var i=0,o=0,r=this._computeBinomial(e),n=0;n<e.length;n++){var a=e[n];i+=a.x*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*r[n],o+=a.y*Math.pow(1-t,e.length-1-n)*Math.pow(t,n)*r[n]}return{x:i,y:o}},K.prototype._computeBinomial=function(e){var t=e.length,i=[];i.push(1);for(var o=1;o<t-1;o++){for(var r=1,n=1,a=0;a<o;a++)r*=t-1-a,n*=o-a;i.push(r/n)}return i.push(1),i},K.prototype._computeGatheringPlacePoints=function(e){var t,i,o,r,n,a,s=[];return 2==e.length&&(t=e[0],n={x:(e=e[e.length-1]).x-t.x,y:e.y-t.y},a=Math.sqrt(n.x*n.x+n.y*n.y),i=this.calculateVector(n,Math.PI/3,Math.sqrt(3)/12*a)[1],i={x:t.x+i.x,y:t.y+i.y},o={x:(t.x+e.x)/2,y:(t.y+e.y)/2},r=this.calculateVector(n,2*Math.PI/3,Math.sqrt(3)/12*a)[1],r={x:e.x+r.x,y:e.y+r.y},a={x:(n=this.calculateVector(n,Math.PI/2,.5*a)[0]).x+o.x,y:n.y+o.y},s.push(t,i,o,r,e,a)),s},K.prototype.createCloseCardinal=function(e){if(null==e||e.length<3)return e;for(var t=e[0],i=(e.push(t),e),o=[],r=i.length-1,n=0;n<=r-1;n++){d=n==r-1?(a=i[r-1],s=i[0],i[1]):(a=i[n],s=i[n+1],i[n+2]);var a,s,l={x:void 0,y:void 0},c={x:void 0,y:void 0},u=s.x-a.x,h=s.y-a.y,m=d.x-s.x,d=d.y-s.y,p=Math.sqrt(u*u+h*h),g=Math.sqrt(m*m+d*d),u=u/p,h=h/p,m=m/g,d=d/g,f=u+m,_=h+d,C=Math.sqrt(f*f+_*_),f=f/C,_=_/C;Math.abs(1-(u*m+h*d))<.005?(l.x=s.x-m*p*.4,l.y=s.y-d*p*.4,c.x=s.x+u*g*.4,c.y=s.y+h*g*.4):(l.x=s.x-f*p*.4,l.y=s.y-_*p*.4,c.x=s.x+f*g*.4,c.y=s.y+_*g*.4),n==r-1?(o[0]=s,o[1]=c,o[3*(r-2)+2+3]=l,o[3*(r-2)+2+4]=i[r]):(o[3*n+2]=l,o[3*n+2+1]=s,o[3*n+2+2]=c)}return o},K.prototype.calculatePointsFBZ3=function(e,t){var i=[],o=.05;0<(t=t||20)&&(o=1/t);for(var r=0;r<e.length-3;){var n=e[r],a=e[r+1],s=e[r+2],l=e[r+3];i.push(n);for(var c=0;c<1;){var u=(1-c)*(1-c)*(1-c)*n.x+3*c*(1-c)*(1-c)*a.x+3*c*c*(1-c)*s.x+c*c*c*l.x,h=(1-c)*(1-c)*(1-c)*n.y+3*c*(1-c)*(1-c)*a.y+3*c*c*(1-c)*s.y+c*c*c*l.y;i.push({x:u,y:h}),c+=o}(r+=3)>=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,c,u,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<e.x?u=-(c=Math.sqrt(i*i-s*s)):e.x<0&&(c=-(u=Math.sqrt(i*i-s*s))),o={x:s,y:c},r={x:l,y:u}):(a=1+(n=-e.x/e.y)*n,t=(h=i*h*Math.cos(t)/e.y)*h-i*i,c=n*(s=(-(i=2*n*h)-Math.sqrt(i*i-4*a*t))/(2*a))+h,u=n*(l=(-i+Math.sqrt(i*i-4*a*t))/(2*a))+h,0<=e.y?(o={x:s,y:c},r={x:l,y:u}):e.y<0&&(o={x:l,y:u},r={x:s,y:c})),[o,r]},K.prototype.plotingSwallowtailArrow=function(e,t,i,o){var r,n=this._computeSwallowtailArrow(t),a=[];return n.forEach(e=>{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(2<e.length){for(var t,i,o=0,r=0;r<e.length-1;r++)t=e[r],i=e[r+1],o+=Math.sqrt((i.y-t.y)*(i.y-t.y)+(i.x-t.x)*(i.x-t.x));for(var n=o/6,a=[],s=[],l={x:void 0,y:void 0},c={x:void 0,y:void 0},u=0;u<e.length-2;u++){var h,m=e[u],d=e[u+1],p=e[u+2],g={x:d.x-m.x,y:d.y-m.y},p={x:p.x-d.x,y:p.y-d.y},f=this.calculateVector(g,Math.PI/2,n/2),_=f[0],f=f[1],C=this.calculateVector(p,Math.PI/2,n/2),y=C[0],C=C[1],_={x:m.x+_.x,y:m.y+_.y},m={x:m.x+f.x,y:m.y+f.y},f={x:d.x+y.x,y:d.y+y.y},y={x:d.x+C.x,y:d.y+C.y},d=this.calculateIntersection(g,p,_,f),C=this.calculateIntersection(g,p,m,y);p=0==u?(h={x:((l=_).x+d.x)/2,y:(l.y+d.y)/2},{x:((c=m).x+C.x)/2,y:(c.y+C.y)/2}):(f=a[a.length-1],g=s[s.length-1],h={x:(f.x+d.x)/2,y:(f.y+d.y)/2},{x:(g.x+C.x)/2,y:(g.y+C.y)/2}),a.push(h),s.push(p),a.push(d),s.push(C)}for(var v,w,b,T=e[e.length-2],S=e[e.length-1],E={x:S.x-T.x,y:S.y-T.y},P=Math.sqrt(E.x*E.x+E.y*E.y),x=[],D={x:void 0,y:void 0},I={x:void 0,y:void 0},A={x:void 0,y:void 0},L={x:void 0,y:void 0},M={x:void 0,y:void 0},V={x:void 0,y:void 0},R=a[a.length-1],O=s[s.length-1],V=P<=n?(D=(x=this.calculateVector(E,Math.PI/2,n/2))[0],I=x[1],w={x:T.x+D.x,y:T.y+D.y},b={x:T.x+I.x,y:T.y+I.y},A={x:(R.x+w.x)/2,y:(R.y+w.y)/2},L={x:(O.x+b.x)/2,y:(O.y+b.y)/2},a.push(A),s.push(L),M={x:2*w.x-T.x,y:2*w.y-T.y},{x:2*b.x-T.x,y:2*b.y-T.y}):(P=S.x-T.x,T=S.y-T.y,v=Math.sqrt(P*P+T*T),P=S.x-P*n/v,T=S.y-T*n/v,D=(x=this.calculateVector(E,Math.PI/2,n/2))[0],I=x[1],w={x:P+D.x,y:T+D.y},b={x:P+I.x,y:T+I.y},A={x:(R.x+w.x)/2,y:(R.y+w.y)/2},L={x:(O.x+b.x)/2,y:(O.y+b.y)/2},a.push(A),s.push(L),M={x:2*w.x-P,y:2*w.y-T},{x:2*b.x-P,y:2*b.y-T}),B=[],F=[],r=0;r<a.length-2;r++)var H=[],G=[],k=a[r],N=a[r+1],j=a[r+2],U=s[r],z=s[r+1],W=s[r+2],k=(H.push(k,N,j),G.push(U,z,W),this._createBezierPoints(H)),N=this._createBezierPoints(G),B=B.concat(k),F=F.concat(N);(v=(v=[l]).concat(B)).push(w),v.push(M),v.push(S),v.push(V),v.push(b),(v=v.concat(F.reverse())).push(c)}else v=this.calculateTwoPoints(e);return v},K.prototype.calculateIntersection=function(e,t,i,o){var r,e=e.y*t.x-e.x*t.y==0?0<e.x*t.x||0<e.y*t.y?(r=(i.x+o.x)/2,(i.y+o.y)/2):(r=o.x,o.y):(r=(e.x*t.x*(o.y-i.y)+i.x*e.y*t.x-o.x*t.y*e.x)/(e.y*t.x-e.x*t.y),0!=e.x?(r-i.x)*e.y/e.x+i.y:(r-o.x)*t.y/t.x+o.y);return{x:r,y:e}},K.prototype.calculateTwoPoints=function(e){var t=e[0],e=e[1],i=[],o={x:e.x-t.x,y:e.y-t.y},r=Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)),n=t.x+5*(e.x-t.x)/6,a=t.y+5*(e.y-t.y)/6,o=this.calculateVector(o,Math.PI/2,r/6/2),r=o[0],o=o[1],s={x:t.x+r.x,y:t.y+r.y},l={x:n+r.x,y:a+r.y},r={x:n+2*r.x,y:a+2*r.y},e={x:e.x,y:e.y},c={x:n+2*o.x,y:a+2*o.y},n={x:n+o.x,y:a+o.y},a={x:t.x+o.x,y:t.y+o.y};return i.push(s,l,r,e,c,n,a),i},K.prototype._computeRoundedRectanglePoints=function(e){for(var t=(e[0].x+e[1].x)/2,i=(e[0].y+e[1].y)/2,o=Math.abs(e[0].x-e[1].x),e=Math.abs(e[0].y-e[1].y),r=.1*Math.min(o,e),n=t-o/2+r,a=i-e/2+r,s=t+o/2-r,l=i-e/2+r,c=t+o/2-r,u=i+e/2-r,h=t-o/2+r,m=i+e/2-r,d=Math.PI/180,p=[],g=Math.PI,f=1.5*Math.PI,_=g,C=0;C<Math.abs(g-f);C+=d){var y=n+r*Math.cos(_),v=a+r*Math.sin(_),_=(_=(_+=d)<0?2*Math.PI+_:_)>2*Math.PI?2*Math.PI-_:_;p.push({x:y,y:v})}for(var w=p,b=3*Math.PI/2,T=2*Math.PI,S=b,C=0;C<Math.abs(b-T);C+=d){y=s+r*Math.cos(S),v=l+r*Math.sin(S),S=(S=(S+=d)<0?2*Math.PI+S:S)>2*Math.PI?2*Math.PI-S:S;w.push({x:y,y:v})}for(var E=w,P=.5*Math.PI,x=0,C=0;C<Math.abs(0-P);C+=d){y=c+r*Math.cos(x),v=u+r*Math.sin(x),x=(x=(x+=d)<0?2*Math.PI+x:x)>2*Math.PI?2*Math.PI-x:x;E.push({x:y,y:v})}for(var D=E,I=.5*Math.PI,A=Math.PI,L=I,C=0;C<Math.abs(I-A);C+=d){y=h+r*Math.cos(L),v=m+r*Math.sin(L),L=(L=(L+=d)<0?2*Math.PI+L:L)>2*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=(i<t&&(i=2*Math.PI+i),Math.PI/180),r=t,n=[e[0]],a=Math.sqrt((e[1].x-e[0].x)*(e[1].x-e[0].x)+(e[1].y-e[0].y)*(e[1].y-e[0].y)),s=0;s<Math.abs(t-i);s+=o){var l=e[0].x+a*Math.cos(r),c=e[0].y+a*Math.sin(r),r=(r=(r+=o)<0?2*Math.PI+r:r)>2*Math.PI?r-2*Math.PI:r;n.push({x:l,y:c})}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},c=Math.sqrt((e[0].x-s)*(e[0].x-s)+(e[0].y-l)*(e[0].y-l)),u=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(u<o&&o<h||h<o&&o<u){d=u<h?u:h;for(var g=0;g<Math.abs(u-h);g+=m){var f=s+c*Math.cos(d),_=l+c*Math.sin(d),d=(d=(d+=m)<0?2*Math.PI+d:d)>2*Math.PI?2*Math.PI-d:d;p.push({x:f,y:_})}}else{d=h<u?u:h;for(g=0;g<2*Math.PI-Math.abs(u-h);g+=m){f=s+c*Math.cos(d),_=l+c*Math.sin(d);d=(d=(d+=m)<0?2*Math.PI+d:d)>2*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<t.heightpoints.length?"ExtrudedPolygon":"GroundPolygon",fn:{success:function(e,t){i.editPropData.success&&i.editPropData.success(e,t),SmartEarthPopupData.layerIndex=t,SmartEarthPopupData.window=e.find("iframe")[0].contentWindow},end:function(){i.callBack&&i.callBack.end&&i.callBack.end(e),t.endThisEdit&&t.endThisEdit(),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0}}})},K.prototype.defaultEdit=function(){this.openEdit?this.MilitaryStandardObj.length&&!this.editHandler?this.edit(this.openEdit,this.editOption):!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1):this.editHandler&&this.edit(!1)},K.prototype.startEdit=function(t){var i=this._viewer;if(-1!==this.MilitaryStandardObj.indexOf(t.id)){let e=t;t=e.pottingPoint;if(t){this.isEditting=!0;var o,r=t,n={x:0,y:0,z:0};for(o in r){var a,s,l=r[o],c=(n.x+=l[0],n.y+=l[1],n.z+=l[2],Cesium.Cartesian3.fromDegreesArrayHeights(l)),u=i.entities.add({name:"polygon_point",position:c[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});u.pottingPoint=l,V.pointsId.push(u.id),this.objectsToExclude.push(u),e.polygon&&e.polygon.extrudedHeight&&(c=c.x?Cesium.Cartographic.fromCartesian(c):Cesium.Cartographic.fromCartesian(c[0]),s=Cesium.Math.toDegrees(c.longitude),c=Cesium.Math.toDegrees(c.latitude),a=e.polygon.extrudedHeight.getValue(),s=Cesium.Cartesian3.fromDegrees(s,c,a),(c=i.entities.add({name:"box_point",position:s,point:{color:Cesium.Color.YELLOW,pixelSize:12,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})).pottingPoint=l,c.pointid=u.id,this.objectsToExclude.push(c),this.heightpoints.push(c),this.heightpointsId.push(c.id))}return n.x/=r.length,n.y/=r.length,n.z/=r.length,this.movePoint=i.entities.add({name:"move_point",position:Cesium.Cartesian3.fromDegrees(n.x,n.y,n.z),point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),SmartEarthPopupData.editGraphic={entity:e,graphic:e.polygon||e.polyline,heightpoints:this.heightpoints},!0}}},K.prototype.edit=function(e,o){var A=this,L=this._viewer;if(void 0!==(o=o||this.editOption||{}).editProp&&(this.editProp=o.editProp),this.editHandler){for(var t in this.editHandler.destroy(),this.editHandler=void 0,V.pointsId)this._viewer.entities.removeById(V.pointsId[t]);V.pointsId=[]}if(e=void 0===e?!0:e){var M,R=void 0,O=(this.isEditting=!1,void 0),B=void 0;for(t in this.editHandler=new Cesium.ScreenSpaceEventHandler(L.scene.canvas),this.editHandler.setInputAction(e=>{var t;Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)?A.isEditting&&(A.endThisEdit(),A.defaultEvent(!1)):V.editVector||(e=e.position,(e=L.scene.pick(e))&&e.id instanceof Cesium.Entity?(e=e.id,A.isEditting||0!=V.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(!V.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!==V.states||(i.id&&-1<A.MilitaryStandardObj.indexOf(i.id.id)?A.tooltip.showAt(e.endPosition,"点击激活编辑,右键删除"):A.tooltip.show(!1));else 0!=V.states||O||A.tooltip.show(!1);if(A.isEditting&&O){A.tooltip.showAt(e.endPosition,"释放后完成修改");i=e.startPosition;if(C=(i=L.camera.getPickRay(i))?L.scene.globe.pick(i,L.scene):C){var t=void 0;if("polygon_point"==M){for(var r in O.position=C,V.pointsId)if(V.pointsId[r]==O.id){var o=L.entities.getById(A.heightpointsId[r]);if(!o)break;var n=Cesium.Cartographic.fromCartesian(C),a=Cesium.Math.toDegrees(n.longitude),s=Cesium.Math.toDegrees(n.latitude),l=Cesium.Cartographic.fromCartesian(o.position._value),c=n.height+l.height;o.position=Cesium.Cartesian3.fromDegrees(a,s,c)}var u=[],h=[],m=new Cesium.Cartesian3;for(r in V.pointsId){var d=L.entities.getById(V.pointsId[r]).position._value,p=Cesium.Cartographic.fromCartesian(d),p={x:Cesium.Math.toDegrees(p.longitude),y:Cesium.Math.toDegrees(p.latitude),z:p.height};u.push(p),h.push([p.x,p.y,p.z]),m.x+=d.x,m.y+=d.y,m.z+=d.z}if(m.x/=u.length,m.y/=u.length,m.z/=u.length,A.movePoint&&(A.movePoint.position=m),"StraightArrow"==R.GeoType)x=A.calculateMorePoints(u);else if("RoundedRectangle"==R.GeoType)x=A._computeRoundedRectanglePoints(u);else if("Sector"==R.GeoType)x=A._computeSectorPoints(u);else if("Bow"==R.GeoType)x=A._computeBowPoints(u);else if("GatheringPlace"==R.GeoType){var g=A._computeGatheringPlacePoints(u),g=A.createCloseCardinal(g);x=A.calculatePointsFBZ3(g,100)}else if("SwallowtailArrow"==R.GeoType)x=A._computeSwallowtailArrow(u);else if("Bezierline"==R.GeoType)x=A._createBezierPoints(u);else if("BezierArrow"==R.GeoType)x=A._createBezierPoints(u);else if("PincerArrow"==R.GeoType){g=U.algorithm.doubleArrow(h);let e=[];var f=JSON.stringify(g.polygonalPoint).indexOf("null");x=e=-1==f?g.polygonalPoint:e}else if("AttackArrow"==R.GeoType){f=U.algorithm.tailedAttackArrow(h),g=JSON.stringify(f.polygonalPoint).indexOf("null");let e=[];x=e=-1==g?f.polygonalPoint:e}let t;t="AttackArrow"!==R.GeoType&&"PincerArrow"!==R.GeoType?(t=[],x.forEach(e=>{t.push(e.x,e.y,u[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=c=A.Cdcl(w,v,T,b);for(_ in A.heightpointsId){var S=L.entities.getById(A.heightpointsId[_]),E=S.position._value,E=Cesium.Cartographic.fromCartesian(E),P=Cesium.Math.toDegrees(E.longitude),E=Cesium.Math.toDegrees(E.latitude),P=Cesium.Cartesian3.fromDegrees(P,E,t);S.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),u=(O.position=C,[]),h=[];for(r in V.pointsId){let e,t,i=L.entities.getById(V.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),u.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(u);else if("RoundedRectangle"==R.GeoType)x=A._computeRoundedRectanglePoints(u);else if("Sector"==R.GeoType)x=A._computeSectorPoints(u);else if("Bow"==R.GeoType)x=A._computeBowPoints(u);else if("GatheringPlace"==R.GeoType){f=A._computeGatheringPlacePoints(u),e=A.createCloseCardinal(f);x=A.calculatePointsFBZ3(e,100)}else if("SwallowtailArrow"==R.GeoType)x=A._computeSwallowtailArrow(u);else if("Bezierline"==R.GeoType)x=A._createBezierPoints(u);else if("BezierArrow"==R.GeoType)x=A._createBezierPoints(u);else if("PincerArrow"==R.GeoType){i=U.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=U.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,u[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)):V.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)):V.editVector||(t=L.scene.pick(e.position),Cesium.defined(t)&&0==V.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),V.pointsId)L.entities.removeById(V.pointsId[t]);for(t in A.heightpointsId)L.entities.removeById(A.heightpointsId[t]);A.heightpointsId=[],A.heightpoints=[],V.pointsId=[],this.endThisEdit=()=>{for(var e in A.defaultEvent(!0),V.pointsId)L.entities.removeById(V.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,V.pointsId=[],A.heightpointsId=[],A.heightpoints=[],A.delButton(!1)}}},K.prototype.spArray=function(e,t){for(var i=[],o=0;o<t.length;)i.push(t.slice(o,o+=e));return i},K.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;
        `}); 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 u }, set(e) { u = e } }, edgeOnly: { get() { return f }, set(e) { f = e } }, useSingleColor: { get() { return c }, set(e) { c = 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
    }, dr.prototype.createBlurStage = function (e, t, i, o) { const { Cartesian2: r, PostProcessStage: n, PostProcessStageComposite: a, PostProcessStageSampleMode: s } = Cesium; var l = new r(1, 0), c = 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: c }, sampleMode: s.LINEAR }); return new a({ name: e, stages: [l, t], inputPreviousStageTexture: !0 }) }, dr.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 }, dr.prototype.clear = function () { this.postProccessStage && this._viewer.scene.postProcessStages.remove(this.postProccessStage), this.postProccessStage = void 0 }, pr.prototype.draw = function (e = 100, t = {}, i) { if (!this.FlattenIsDraw) { if (this.deepth = e || this.deepth, this.showWall = this._core.defaultValue(t.showWall, !0), this.showBottom = this._core.defaultValue(t.showBottom, !0), t.positions) this.create(t.positions), "function" == typeof i && i(); else { this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = null), this.FlattenIsDraw = !0; var o, r, n = this._viewer, a = this._cesium, s = (this.clear(), []), l = [], c = 0, u = (this.drawHandler = new a.ScreenSpaceEventHandler(n.scene.canvas), this.tooltip); let t; this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this.drawHandler.setInputAction(e => { r = this._getPosition.getMousePosition(e.position); e = this._core.toDegrees(r); s.push(r), l.push(e.lon, e.lat, e.height), 0 === c ? (s.push(r), l.push(e.lon, e.lat, e.height), t = n.entities.add({ name: "临时线", polyline: { positions: new a.CallbackProperty(() => s, !1), clampToGround: !0, material: new a.ColorMaterialProperty(a.Color.YELLOW.withAlpha(.3)), width: 3 } })) : 1 === c && (t && n.entities.remove(t), o = n.entities.add({ name: null, polygon: { hierarchy: new a.CallbackProperty(function () { return new a.PolygonHierarchy(a.Cartesian3.fromDegreesArrayHeights(l)) }, !1), material: a.Color.YELLOW.withAlpha(.3) } })), c++ }, a.ScreenSpaceEventType.LEFT_CLICK), this.drawHandler.setInputAction(e => { 0 === c ? u.showAt(e.endPosition, "左键点击开始绘制点") : (1 === c ? u.showAt(e.endPosition, "点击添加第二个点") : u.showAt(e.endPosition, "右键结束绘制"), r = this._getPosition.getMousePosition(e.endPosition), e = this._core.toDegrees(r), l.splice(l.length - 3, 3), s.splice(s.length - 1, 1), s.push(r), l.push(e.lon, e.lat, e.height)) }, a.ScreenSpaceEventType.MOUSE_MOVE), this.drawHandler.setInputAction(function (e) { this.end && this.end() }.bind(this), a.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { u.show(!1), this._core.mouse(this._viewer.container, 0), this.drawHandler.destroy(), this.drawHandler = null, t && n.entities.remove(t), o && n.entities.remove(o), this.FlattenIsDraw = !1, this.end = void 0, "cancel" === e || s.length < 3 || (c < 2 ? c = 0 : (c = 0, this.create(l), "function" == typeof i && i(l))) } } return this } }, pr.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; e < t.length; e += 3)this.originHeight > t[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 < i.length - 1; e++)o = this._core.toDegrees(i[e]), r = this._core.toDegrees(i[e + 1]), this.calculateWall(o.lon, o.lat, r.lon, r.lat) } this.groundClipping(i) }, pr.prototype.groundClipping = function (e) { var t = this._viewer.scene.globe, i = e.concat(); i.splice(i.length - 1, 1); for (var o = 0; o < i.length - 1; o++)i[o].x === i[o + 1].x && i[o].y === i[o + 1].y && (i.splice(o, 1), o--); for (var r = i.length, n = (this.PolygonIsClockwise(i) && i.reverse(), []), o = 0; o < r; ++o) { var a = (o + 1) % r, s = Cesium.Cartesian3.add(i[o], i[a], new Cesium.Cartesian3), s = Cesium.Cartesian3.multiplyByScalar(s, .5, s), l = Cesium.Cartesian3.normalize(s, new Cesium.Cartesian3), a = Cesium.Cartesian3.subtract(i[a], s, new Cesium.Cartesian3), a = Cesium.Cartesian3.normalize(a, a), a = Cesium.Cartesian3.cross(a, l, new Cesium.Cartesian3), a = Cesium.Cartesian3.normalize(a, a), l = new Cesium.Plane(a, 0), l = Cesium.Plane.getPointDistance(l, s); n.push(new Cesium.ClippingPlane(a, l)) } this.clippingPlane = new Cesium.ClippingPlaneCollection({ planes: n }), t.multiClippingPlanes ? t.multiClippingPlanes.add(this.clippingPlane) : t.multiClippingPlanes = new Cesium.MultiClippingPlaneCollection({ collections: [this.clippingPlane], edgeWidth: 1, edgeColor: Cesium.Color.WHITE }) }, pr.prototype.PolygonIsClockwise = function (e) { if (3 <= e.length) return !(0 < (e[1].x - e[0].x) * (e[2].y - e[1].y) - (e[1].y - e[0].y) * (e[2].x - e[1].x)) }, pr.prototype.calculateWall = function (e, t, i, o) { var r, n, a = Cesium.Math.lerp(e, i, .01) - e, s = Cesium.Math.lerp(t, o, .01) - t, l = [], c = []; l.push(e, t), n = Cesium.Cartesian3.fromDegrees(e, t), c.push(Cesium.Cartographic.fromCartesian(n)); for (var u = 0; u < 100; u++) { var h = e + (u + 1) * a, m = t + (u + 1) * s; l.push(h, m), n = Cesium.Cartesian3.fromDegrees(h, m), c.push(Cesium.Cartographic.fromCartesian(n)) } l.push(i, o), n = Cesium.Cartesian3.fromDegrees(i, o), c.push(Cesium.Cartographic.fromCartesian(n)); var d = []; this._core.getHeightsFromLonLat(this._viewer, c).then(e => { if (e) { for (r = e, u = 0; u < r.length; u++)d.push(this.originHeight - this.deepth); this.createWall(l, r, d) } }) }, pr.prototype.createWall = function (e, t, i) { e = this._viewer.entities.add({ name: "地形开挖岩墙", wall: { positions: Cesium.Cartesian3.fromDegreesArray(e), maximumHeights: t, minimumHeights: i, material: new Cesium.ImageMaterialProperty({ image: this.wallImg, repeat: new Cesium.Cartesian2(1, 1) }) } }); this.wallArr.push(e) }, pr.prototype.setDeepth = function (i) { this.FlattenPolygon[0] && this.FlattenPolygon[0].polygon.height.setValue(this.originHeight - i), this.wallArr.forEach(e => { let t = e.wall.minimumHeights.getValue(); (t = Array(t.length)).fill(this.originHeight - i), e.wall.minimumHeights.setValue(t) }) }, pr.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 }) }, pr.prototype.deleteObject = pr.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 }, gr.prototype.createAnalysis = function () { return this.shadows = !0, this.currentSpeed = 1, this.currentPlayMode = "1", this.Forword(), this }, gr.prototype.setCurrentTime = function (e) { e = new Date(e), e = this._cesium.JulianDate.fromDate(e); this._viewer.clock.currentTime = e.clone() }, gr.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 = 28800 + (i = (i = i.getTime()) / 1e3), 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) }, gr.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) }, gr.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) }, gr.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) }, gr.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) }, gr.prototype.Pause = function () { this._viewer.animation.viewModel.pauseViewModel.command() }, Object.defineProperties(gr.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) } } }), fr.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() }, fr.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: '<img src="' + o + '" style="height:100%;width:100%;">' }) }, _r.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, c; var e = i.limitTime ? i.limitAngel : 360; let u = i.time || 30, h = (e || 360) / u, m = function () { var e = Cesium.JulianDate.secondsDifference(o.clock.currentTime, o.clock.startTime); i.limitTime && e > u ? r.end && r.end() : (e = Cesium.Math.toRadians(e * h) + l, o.scene.camera.setView({ destination: c, 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 => { c = 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: c, 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 }, Cr.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) }, Cr.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), V.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 () { V.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 }, Cr.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), V.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 () { V.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 }, Cr.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, c = 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 u = this._viewer.clock.currentTime.clone(); function h() { var t, e = n.getTime() + 6e4 * o * s, e = new Date(e); a < e ? (l.createPoint(c), l._viewer.clock.currentTime = u, l.isLoading(!1), r && "function" == typeof r && r(c)) : (t = function (e) { var t = e; for (let e = 0; e < c.length; e++)l.Sunshine(c[e], t) ? c[e].through++ : c[e].out++; s++, h() }, l.SetTimeNow(e), setTimeout(() => { var e = l._viewer.scene.context.uniformState.sunPositionWC; t(e) }, 100)) } 1500 < (a - n) / (6e4 * o) * c.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(c) } }) : (l.isLoading(!0), h()) }, Cr.prototype.createPoint = function (e) { this.ResultPoint = this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection); for (var t = 0; t < e.length; t++) { var i = e[t], o = e[t].through + e[t].out, o = e[t].out / o, r = "", o = (.7 <= o ? r = this._cesium.Color.BLUE : o < .7 && .3 <= o ? r = this._cesium.Color.YELLOW : o < .3 && (r = this._cesium.Color.RED), { id: { isshowderData: !0, data: "阴影率:" + 100 * (1 - o) + "%" }, position: this._cesium.Cartesian3.fromDegrees(i.lon, i.lat, i.height), color: r }); this.ResultPoint.add(o) } this.showResultTooltip(!0) }, Cr.prototype.showResultTooltip = function (e) { if (this.ResultTooltipHandler && (this.ResultTooltipHandler.destroy(), this.ResultTooltipHandler = void 0, this.tooltip.show(!1)), e) { let i = this; this.ResultTooltipHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); let e; this.ResultTooltipHandler.setInputAction(function (t) { clearTimeout(e), e = setTimeout(() => { 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) } }, Cr.prototype.getPoint = function (e, t, i, o) { for (var r = [], n = e.polygon.hierarchy.getValue().positions, a = 0; a < n.length; a++) { var s = this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).longitude), l = this._cesium.Math.toDegrees(this._cesium.Cartographic.fromCartesian(n[a]).latitude); r.push(s), r.push(l) } for (var e = this.getTheBottomPoint(r), c = this.scanningPolygon(e, t, t, r), u = [], h = (o - i) / t, m = 0; m < h; m++)for (var d = 0; d < c.length; d++) { var p = c[d], p = { lon: p.lon, lat: p.lat, height: i + t * m, through: 0, out: 0, color: "" }; u.push(p) } return u }, Cr.prototype.getTheBottomPoint = function (e) { for (var t = 90, i = 0, o = 1; o < e.length; o += 2)t = t < e[o] ? t : (i = o) && e[o]; return { lon: e[i - 1], lat: e[i] } }, Cr.prototype.scanningPolygon = function (e, t, i, o) { for (var r, n, a, s = [], l = 180, c = -180, u = -90, h = 0; h < o.length; h += 2)u = u > o[h + 1] ? u : o[h + 1], l = l < o[h] ? l : o[h], c = c > o[h] ? c : 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 <= u; 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 <= c; n.lon += m)this.IsInPolygon(n.lon, n.lat, o) && s.push({ lon: n.lon, lat: n.lat }) } return s }, Cr.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] }, Cr.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 < i.length - 2; l += 2)o = i[l], n = i[l + 1], r = i[l + 2], a = i[l + 3], (n <= t && t < a || a <= t && t < n) && 0 < Math.abs(n - a) && o - (o - r) * (n - t) / (n - a) <= e && s++; return s % 2 != 0 }, Cr.prototype.SetTimeNow = function (e) { e = new this._cesium.JulianDate.fromDate(e); this._viewer.clock.currentTime = e }, Cr.prototype.Sunshine = function (e, t) { e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height); return this.pickFromRay(e, t) }, Cr.prototype.jiance = function (e, t) { var i = !1, e = this._cesium.Cartographic.fromCartesian(e), t = this._cesium.Cartographic.fromCartesian(t), o = {}, r = (o.longitude = e.longitude / Math.PI * 180, o.latitude = e.latitude / Math.PI * 180, o.czheight = e.height, {}); r.longitude = t.longitude / Math.PI * 180, r.latitude = t.latitude / Math.PI * 180, r.czheight = t.height; for (var n = 0; n < 20; n++) { var a = {}, s = (a.longitude = this._cesium.Math.lerp(o.longitude, r.longitude, .01 * (n + 1)), a.latitude = this._cesium.Math.lerp(o.latitude, r.latitude, .01 * (n + 1)), a.czheight = o.czheight - .01 * (o.czheight - r.czheight) * (n + 1), new this._cesium.Cartographic(this._cesium.Math.toRadians(a.longitude), this._cesium.Math.toRadians(a.latitude), 0)), s = this._viewer.scene.sampleHeight(s); this._cesium.Cartesian3.fromDegrees(a.longitude, a.latitude, s), a.zsheight = s, a.zsheight > a.czheight && (i = !0) } return i }, Cr.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 }, Cr.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) }, Cr.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) }, Cr.prototype.isLoading = function (e) { this.loading.style.display = e ? "block" : "none" }, Cr.prototype.removeLoading = function () { this.loading && this.loading.remove(), this.loading = void 0 }; var yr, vr = "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", wr = "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 f, this._tree = V, 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 br(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 f(e), this._getPosition = new y(this._viewer, this._cesium), this._tree = V, 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 f(e), this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._points = [], this._lable = null, this._entity = null, this.polygon1, this.id = "0", this.curCanvas = "a", this._lang = { draw_tip_left: "左键开始绘制!", draw_tip_right: "右键结束绘制!", draw_tip_click: "点击继续绘制!", draw_tip_cancel: "再次点击结束绘制,右键取消!", unit_m: "米", unit_km: "千米" } } function Tr(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 f(e), this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._points = [], this._polylines = [], this._lang = { draw_tip_left: "左键开始绘制!", draw_tip_right: "右键结束绘制!", draw_tip_click: "点击继续绘制!", draw_tip_cancel: "再次点击结束绘制,右键取消!", unit_m: "米", unit_km: "千米" } } function Sr(e) { this._viewer = e, this._scene = e.scene, this._core = new f(e), this._tooltip = this._core.CreateTooltip(), this._getPosition = new y(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 Er(e) { this._viewer = e, this._core = new f, this.measureData = new Map } function Pr(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 xr(e, t, i) { e = Pr(t, e) - Pr(t, i); return e < 0 && (e += 360), e } function Dr(e) { if (!e || e.length < 3) return 0; for (var t = Math.PI / 180, i = 0, o = 0; o < e.length; o++) { var r = (o + 1) % e.length, n = (o + 2) % e.length; i += xr(e[o], e[r], e[n]) } var a = 180 * (e.length - 2), s = i - a; return 420 < s ? s = (i = 360 * e.length - i) - a : 300 < s && s < 420 && (s = Math.abs(360 - s)), s * t * 6371e3 * 6371e3 } function Ir(e, t) { this._viewer = e, this._cesium = t } A.prototype.create3DTilesets = function (e, t, i, o, r, n, a) { var t = { url: t, preferLeaves: !0, skipLevelOfDetail: !0 }, s = ("string" == typeof i.lightColor && (u = i.lightColor.split(","), i.lightColor = new this._cesium.Cartesian3(u[0], u[1], u[2])), o.groundHeight = this._core.defaultValue(i.height, o.groundHeight), this._core.extend(t, i, !0)), l = (s.time && (s.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })]), this.availability = s.availability), s.customShader = this.getCustomShader(o), new this._cesium.Cesium3DTileset(s)), c = ((o.effects || o.snow) && (l.enableModelExperimental = !0), this), u = s.id || c._core.getuid(), t = (l.id = u, l.Level = s.Level, c.item = l, o.flattenPositions && (this.setFlatten(!0, { positions: o.flattenPositions }), void 0 !== o.flattenHeight && (this.flattenHeight = o.flattenHeight)), setTimeout(function () { i.flyTo && c._viewer.flyTo(l); var e = c._viewer.scene.primitives.add(l); null != o.maximumscreenspaceerror && (l.maximumScreenSpaceError = o.maximumscreenspaceerror), null != o.pointcloudshading && (l.pointCloudShading.maximumAttenuation = c.checkZero(o.pointcloudshading.maximumattenuation), l.pointCloudShading.baseResolution = o.pointcloudshading.baseresolution, l.pointCloudShading.geometricErrorScale = o.pointcloudshading.geometricerrorscale, l.pointCloudShading.attenuation = o.pointcloudshading.attenuation, l.pointCloudShading.eyeDomeLighting = o.pointcloudshading.eyedomelighting, l.pointCloudShading.eyeDomeLightingStrength = o.eyeDomeLightingStrength, l.pointCloudShading.eyeDomeLightingRadius = o.eyeDomeLightingRadius); let t = l.readyPromise.then(function (e) { null != s.geometricError && (e._geometricError = s.geometricError), null != o.groundheight && c.setHeight(o.groundheight), null != o.groundHeight && c.setHeight(o.groundHeight), o.groundCenter && c.setPosition(o.groundCenter), c.boundingSphereCenter || (c.getCenter(), e = c._cesium.Cartographic.fromCartesian(c.boundingSphereCenter), c.modelEditData.lon = c._cesium.Math.toDegrees(e.longitude), c.modelEditData.lat = c._cesium.Math.toDegrees(e.latitude), c.modelEditData.height = e.height), (o.heading || o.pitch || o.roll) && c.setEditData({ roll: o.roll, pitch: o.pitch, heading: o.heading }), o.edit && c.setEditData(o.edit), "function" == typeof a && a(c) }); t.catch && t.catch(function (e) { console.log(e) }), t.otherwise && t.otherwise(function (e) { console.log(e) }), l.Level && (c.Level = 0, c._viewer.scene.preRender.addEventListener(function () { c.isShow && (c.Level = c._core.getLevel(c._viewer), c.Level > l.Level && !l.show ? l.show = !0 : c.Level < l.Level && l.show && (l.show = !1)) })), c.sd = e, n ? c.isShow = !0 : c.setVisibility(!1); e = c.setStyle(o); l.style = new c._cesium.Cesium3DTileStyle(e) }), { id: u, name: e = c._core.isnull(e) ? "新建模型" : e, checked: n, pId: c._core.isnull(r) ? 0 : r, type: "3DTilesets", item: c }); return c.setTreeobj(t), c._tree.insertGroupId(t, c._core.isnull(r) ? 0 : r), this }, A.prototype.setVisibility = function (e) { this.isShow = e, this.item.show = e, this.item._availability && !e ? this.item._availability = void 0 : this.availability && e && (this.item._availability = this.availability) }, A.prototype.checkZero = function (e) { e = parseFloat(e); return 0 === e ? void 0 : e }, A.prototype.getVisibility = function () { return this.item.show }, A.prototype.deleteObject = function () { try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e.message) } }, A.prototype.restore = function () { this.modelEditData = { lon: 0, lat: 0, height: 0, scale: 1, heading: 0, pitch: 0, roll: 0, rotate: !1, modelMatrix: this.modelEditData.modelMatrix, rootTransform: this.modelEditData.rootTransform, originalMatrix: this.modelEditData.originalMatrix }; var e = this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter); this.modelEditData.lon = this._cesium.Math.toDegrees(e.longitude), this.modelEditData.lat = this._cesium.Math.toDegrees(e.latitude), this.modelEditData.height = e.height, this.item.modelMatrix = this.modelEditData.modelMatrix.clone(), this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY) ? this.item.modelMatrix = this.modelEditData.originalMatrix.clone() : (this.item._root.transform = this.modelEditData.originalMatrix.clone(), this.modelEditData.rotate = !0), this.moveModelEnd && (this.moveModelEnd(), this.moveModelEnd = void 0), this.rotatePointPosition = void 0, this.moveEndCenter = void 0 }, A.prototype.setHeight = function (e) { var t, i; e = Number(e), isNaN(e) || null != this.item && null != this.item.boundingSphere && (this.boundingSphereCenter || this.getCenter(), i = this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter), this.restore(), this.modelEditData.height = e, t = this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, 0), i = this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, e), e = this._cesium.Cartesian3.subtract(i, t, new this._cesium.Cartesian3), this.item.modelMatrix = this._cesium.Matrix4.fromTranslation(e)) }, A.prototype.setPosition = function (e, t) { null != this.item && null != this.item.boundingSphere && e && (this.boundingSphereCenter || this.getCenter(), this.setEditData({ lon: e[0], lat: e[1], height: t ? this.boundingSphereCenterHeight : e[2] })) }, A.prototype.setEditData = function (e) { var t, i; null != this.item && null != this.item.boundingSphere && (this.boundingSphereCenter || this.getCenter(), e && (this.modelEditData = this._core.extend(this.modelEditData, e, !0)), this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY) ? (e = Cesium.Cartesian3.multiplyByScalar(this.boundingSphereCenter, -1, new Cesium.Cartesian3), e = Cesium.Matrix4.fromTranslation(e), t = this._cesium.Cartesian3.fromDegrees(this.modelEditData.lon, this.modelEditData.lat, this.modelEditData.height), t = Cesium.Matrix4.fromTranslation(t), i = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.modelEditData.heading || 0), Cesium.Math.toRadians(this.modelEditData.pitch || 0), Cesium.Math.toRadians(this.modelEditData.roll || 0)), i = Cesium.Matrix3.fromHeadingPitchRoll(i), i = Cesium.Matrix4.fromRotation(i, new Cesium.Matrix4), Cesium.Matrix4.multiply(i, e, e), Cesium.Matrix4.multiply(t, e, e), this.item.modelMatrix = e) : (i = Cesium.Cartesian3.fromDegrees(this.modelEditData.lon, this.modelEditData.lat, this.modelEditData.height), t = Cesium.Transforms.eastNorthUpToFixedFrame(i), e = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this.modelEditData.heading || 0), Cesium.Math.toRadians(this.modelEditData.pitch || 0), Cesium.Math.toRadians(this.modelEditData.roll || 0)), i = Cesium.Matrix3.fromHeadingPitchRoll(e), Cesium.Matrix4.multiplyByMatrix3(t, i, t), e = Cesium.Matrix4.fromUniformScale(this.modelEditData.scale), Cesium.Matrix4.multiply(t, e, t), this.item._root.transform = t)) }, A.prototype.getCenter = function () { var e; this.boundingSphereCenter || (e = this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center), this.boundingSphereCenter = this.item.boundingSphere.center.clone(), this.boundingSphereCenterHeight = e.height, this.boundingSphereRadius = this.item.boundingSphere.radius, this.modelEditData.rootTransform = this.item._root.transform.clone(), this.modelEditData.modelMatrix = this.item.modelMatrix.clone(), this.modelEditData.rootTransform.equals(Cesium.Matrix4.IDENTITY) ? this.modelEditData.originalMatrix = this.item.modelMatrix.clone() : (this.modelEditData.originalMatrix = this.item._root.transform.clone(), this.modelEditData.rotate = !0)) }, A.prototype.arge = function (e, t, i) { var o = Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)), e = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), t = Math.sqrt(Math.pow(t.x - i.x, 2) + Math.pow(t.y - i.y, 2)), i = (Math.pow(o, 2) + Math.pow(e, 2) - Math.pow(t, 2)) / (2 * o * e); return Math.round(180 * Math.acos(i) / Math.PI) }, A.prototype.editModel = function (e = {}) { this._ModelEdit.start(this, e) }, A.prototype.endEdit = function () { this._ModelEdit.end() }, A.prototype.clippingModel = function (t = {}) { var i, o = this, r = this._viewer, e = (this.moveHandler && (this.moveHandler.destroy(), this.moveHandler = void 0, this._viewer.entities.remove(this.movePoint), this._viewer.entities.remove(this.rotatePoint)), this.clippingHandler && (this.clippingHandler.destroy(), this.clippingHandler = void 0, o.planeEntities && o.planeEntities.forEach(e => { 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 < this.clippingPlanes.length; ++s) { var l = this.clippingPlanes.get(s), l = r.entities.add({ name: "modelClippingPlane", position: n.center, plane: { dimensions: new Cesium.Cartesian2(1.2 * a, 1.2 * a), material: Cesium.Color.WHITE.withAlpha(.1), plane: new Cesium.CallbackProperty(function (e) { return function () { return e.distance = o.targetY, e } }(l), !1), outline: !0, outlineColor: Cesium.Color.WHITE } }); o.planeEntities.push(l) } this.enableModelExperimental = this.item.enableModelExperimental, this.item.enableModelExperimental = !1, this.clippingHandler = new this._cesium.ScreenSpaceEventHandler(r.scene.canvas); var c = o._core.CreateTooltip(); this.clippingHandler.setInputAction(function (e) { e = r.scene.pick(e.position); o._cesium.defined(e) && e.id && "modelClippingPlane" === e.id.name && ((i = e.id.plane).material = o._cesium.Color.WHITE.withAlpha(.05), i.outlineColor = o._cesium.Color.WHITE, r.scene.screenSpaceCameraController.enableInputs = !1) }, this._cesium.ScreenSpaceEventType.LEFT_DOWN), this.clippingHandler.setInputAction(e => { var t; Cesium.defined(i) ? (t = e.startPosition.y - e.endPosition.y, this.targetY += t * a * .001, c.showAt(e.endPosition, "移动鼠标平移裁切面")) : c.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(), c.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, u = {}) { if (this.flatten = e, this.updateModelExperimental(), e) { let t = u.positions || []; if (t[0] && t[0].lon && t[0].lat) for (let e = 0; e < t.length; e++)t[e] = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat); let i, o; t.length && (i = u.fid || this._core.getuid(), this.flattenData.set(i, { id: i, modelId: this.item.id, name: u.name || "新建压平", show: this._core.defaultValue(u.show, !0), boundingSphere: Cesium.BoundingSphere.fromPoints(t), positions: t, setVisibility: 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"), c = (e.width = 1024, e.height = 1024, e.getContext("2d")); c.fillStyle = "#000", c.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]) }), c.moveTo(t[0][0], t[0][1]); for (let e = 0; e < t.length; e++)c.lineTo(t[e][0], t[e][1]); c.fillStyle = "#f00", c.fill() } return this.flattenTexture = new Cesium.TextureUniform({ url: e.toDataURL("image/png") }), i && this.flattenData.get(i) } }, A.prototype.setFlattenByGeojson = function (n, t) { if (t) { let e = Cesium.GeoJsonDataSource.load(t); return e.then(e => { var o = e.entities.values; let r = []; for (let i = 0; i < o.length; i++) { let e = o[i], t; e.polyline ? t = e.polyline.positions.getValue() : e.polygon && (t = e.polygon.hierarchy.getValue().positions), t && r.push(this.setFlatten(n, { fid: e.id, name: e.name, positions: t })) } return r }) } this.flatten = !!n, this.updateModelExperimental() }, A.prototype.removeFlattenById = function (e) { this.flattenData.delete(e), this.flatten = !!this.flattenData.size, this.setFlatten(this.flatten) }, A.prototype.showFlattenById = function (e, t) { let i = this.flattenData.get(e); i && (i.show = t), this.setFlatten(this.flatten) }, A.prototype.removeFlattenAll = function () { this.flattenData.clear(), this.flattenRectangle = new Cesium.Rectangle, this._flattenRectangle = void 0, this.flatten = !1, this.flattenTexture = new Cesium.TextureUniform({ url: "" }), this.updateModelExperimental() }, A.prototype.updateModelExperimental = function () { this.effects || this.flatten || this.snow ? this.item && (this.item.enableModelExperimental = !0) : this.item && (this.item.enableModelExperimental = !1) }, A.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(A.prototype, { style: { get: function () { return this.item.style } } }), A.prototype.export = function () { var e = this.item.url, t = this.item.show, i = this.item.shadows; return { type: "3DTilesets", treeobj: { name: this.treeobj.name }, style: { url: e, show: t, shadows: i } } }, A.prototype.setTreeobj = function (e) { this.treeobj = e }, A.prototype.setItem = function (e) { this.item = e }, A.prototype.setShowStyle = function (e) { this.item.style, this.item.style = new this._cesium.Cesium3DTileStyle({ show: !0 }) }, A.prototype.setStyle = function (e) { var t = [], i = { color: void 0, show: !0 }, o = !0; if (e.colors instanceof Array) { for (var r = 0; r < e.colors.length; r++) { var n = [], a = e.colors[r].color, s = e.colors[r].condition; /^\[/.test(s) && (s = s.replace(/^\[/, "${").replace(/\]/, "}")), a = this._core.isHtmlColor(a) ? this._color.colorFromHtmlColor(a) : (1 < (a = /^rgb/.test(a) ? this._color.rgbaStringToRgbaObj(a) : a).r && (a.r = a.r / 255), 1 < a.g && (a.g = a.g / 255), 1 < a.b && (a.b = a.b / 255), 1 < a.a && (a.a = a.a / 255), this._color.createColor(a.r, a.g, a.b, a.a)), n.push(s), n.push(a), t.push(n) } i.color = {}, i.color.conditions = t } else e.colors && (i.color = `color("${e.colors}")`); return e.show && /\[/.test(e.show) ? o = e.show.replace(/^\[/, "${").replace(/\]/, "}") : e.show && (o = e.show), i.show = o, i }, Object.defineProperties(A.prototype, { luminanceAtZenith: { get: function () { return this.item.luminanceAtZenith }, set: function (e) { this.item.luminanceAtZenith = e } }, groundHeight: { get: function () { return null != this.item && null != this.item.boundingSphere ? this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center).altitude : 0 }, set: function (e) { this.setHeight(e) } }, lon: { get: function () { return this.modelEditData.lon }, set: function (e) { this.modelEditData.lon = e, this.setEditData() } }, lat: { get: function () { return this.modelEditData.lat }, set: function (e) { this.modelEditData.lat = e, this.setEditData() } }, height: { get: function () { return this.modelEditData.height }, set: function (e) { this.modelEditData.height = e, this.setEditData() } }, scale: { get: function () { return this.modelEditData.scale }, set: function (e) { this.modelEditData.scale = e, this.setEditData() } }, material: { set: function (e) { this._core.isHtmlColor(e) || (e = "rgba(" + (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r + "," + e.g + "," + e.b + "," + e.a + ")"), this.item.style = new this._cesium.Cesium3DTileStyle({ color: "color('" + e + "')" }) } }, dynamicScreenSpaceErrorDensity: { get: function () { return this.item.dynamicScreenSpaceErrorDensity }, set: function (e) { this.item.dynamicScreenSpaceErrorDensity = e } }, shadows: { get: function () { return this.item.shadows }, set: function (e) { this.item.shadows = e } }, classificationType: { get: function () { return this.item.classificationType }, set: function (e) { this.item.classificationType = e } }, dynamicScreenSpaceErrorHeightFalloff: { get: function () { return this.item.dynamicScreenSpaceErrorHeightFalloff }, set: function (e) { this.item.dynamicScreenSpaceErrorHeightFalloff = e } }, dynamicScreenSpaceErrorFactor: { get: function () { return this.item.dynamicScreenSpaceErrorFactor }, set: function (e) { this.item.dynamicScreenSpaceErrorFactor = e } }, imageBasedLightingFactor_x: { get: function () { return null == this.item.imageBasedLightingFactor ? 0 : this.item.imageBasedLightingFactor.x }, set: function (e) { this.item.imageBasedLightingFactor = new this._cesium.Cartesian2(e, this.item.imageBasedLightingFactor_y) } }, imageBasedLightingFactor_y: { get: function () { return null == this.item.imageBasedLightingFactor ? 0 : this.item.imageBasedLightingFactor.y }, set: function (e) { this.item.imageBasedLightingFactor = new this._cesium.Cartesian2(e, this.item.imageBasedLightingFactor_y) } }, effects: { get: function () { return this.item.customShader.uniforms.u_effects.value }, set: function (e) { this.item.customShader.setUniform("u_effects", e), this.item.customShader.lightingModel = e ? 0 : void 0, this.updateModelExperimental() } }, effectsMaxHeight: { get: function () { return this.item.customShader.uniforms.u_effectsMaxHeight.value }, set: function (e) { this.item.customShader.setUniform("u_effectsMaxHeight", e) } }, snow: { get: function () { return this.item.customShader.uniforms.u_snow.value }, set: function (e) { this.item.customShader.setUniform("u_snow", e), this.updateModelExperimental() } }, snowAlpha: { get: function () { return this.item.customShader.uniforms.u_snowAlpha.value }, set: function (e) { this.item.customShader.setUniform("u_snowAlpha", e) } }, snowDirection: { get: function () { return this.item.customShader.uniforms.u_snowDirection.value }, set: function (e) { this.item.customShader.setUniform("u_snowDirection", e) } }, flatten: { get: function () { return this.item.customShader.uniforms.u_flatten.value }, set: function (e) { this.item.customShader.setUniform("u_flatten", e), this.updateModelExperimental() } }, flattenHeight: { get: function () { return this.item.customShader.uniforms.u_flattenHeight.value }, set: function (e) { this.item.customShader.setUniform("u_flattenHeight", e) } }, flattenRectangle: { get: function () { return this._flattenRectangle }, set: function (e) { this._flattenRectangle = e, this.item.customShader.setUniform("u_flattenSouthWest", Cesium.Cartesian3.fromRadians(e.west, e.south)), this.item.customShader.setUniform("u_flattenNorthEast", Cesium.Cartesian3.fromRadians(e.east, e.north)) } }, flattenTexture: { get: function () { return this.item.customShader.uniforms.u_flattenTexture.value }, set: function (e) { this.item.customShader.setUniform("u_flattenTexture", e) } } }), A.prototype.getCustomShader = function (e) { return Cesium.CustomShader && new Cesium.CustomShader({ mode: Cesium.CustomShaderMode.MODIFY_MATERIAL, lightingModel: e.effects || e.removeLighting ? Cesium.LightingModel.UNLIT : void 0, uniforms: { u_flatten: { type: Cesium.UniformType.BOOL, value: !1 }, u_flattenHeight: { type: Cesium.UniformType.FLOAT, value: 0 }, u_flattenNorthEast: { type: Cesium.UniformType.VEC3, value: new Cesium.Cartesian3 }, u_flattenSouthWest: { type: Cesium.UniformType.VEC3, value: new Cesium.Cartesian3 }, u_flattenTexture: { type: Cesium.UniformType.SAMPLER_2D, value: new Cesium.TextureUniform({ url: "" }) }, u_effects: { type: Cesium.UniformType.BOOL, value: e.effects || !1 }, u_effectsMaxHeight: { type: Cesium.UniformType.FLOAT, value: e.effectsMaxHeight || 150 }, u_snow: { type: Cesium.UniformType.BOOL, value: e.snow || !1 }, u_snowAlpha: { type: Cesium.UniformType.FLOAT, value: e.snowAlpha || .8 }, u_snowDirection: { type: Cesium.UniformType.VEC3, value: e.snowDirection || new Cesium.Cartesian3(1, 1, 0) } }, vertexShaderText: this.getFlattenShader(), fragmentShaderText: this.getEffectsShader() }) }, A.prototype.getFlattenShader = function () { return wr }, A.prototype.getEffectsShader = function () { return vr }, A.prototype.getType = function () { return { label: "模型", value: "3DTileset" } }, br.prototype.play = function (t, i = {}) { this.start = i.start, this.end = i.end, this.attr = i.attr, this.attrType = i.attrType, this.palyType = i.type || "progress", this.startPosition = i.startPosition, this.endPosition = i.endPosition, this.colors = i.colors || ["rgb(255,0,0)", "rgb(255,152,0)", "rgb(0,255,0)", "rgb(0,0,255)"]; let o; if (this._useColor = i.useColor, this.getCurrentProgressStyle(0), "string" == typeof t) { o = new A(this._viewer), this.tiltModel.start = o.create3DTilesets("拆迁模型", t, {}, { groundCenter: this.startPosition }, "0", !0, e => { 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 }, br.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 }, br.prototype.useColor = function (e = !1) { this._useColor = e, this.currentProgress(this.progress) }, br.prototype.getCurrentProgressStyle = function (e) { this.progress = e, "time" === this.palyType && (e = parseInt(e * this.time + this.start), this.setTime(e)) }, br.prototype.setModelProgressStyle = function (e, t) { let i, o; i = .5 < this.progress ? "start" === e ? this._useColor ? [["true", this.colors[3]]] : [["true", "rgba(255, 255, 255, 0)"]] : (o = parseInt(2 * (this.progress - .5) * t.allTime + t.startTime), this._useColor ? [["${" + this.attr[0] + "} > " + 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 } }) }, br.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 } }) }, br.prototype.currentProgress = function (e) { this.getCurrentProgressStyle(e), this.setModelStyle("start", this.tiltModel.start), this.tiltModel.end.forEach(e => { this.setModelStyle("end", e) }) }, br.prototype.currentTime = function (e) { this.setTime(e), this.setModelStyle("start", this.tiltModel.start), this.tiltModel.end.forEach(e => { this.setModelStyle("end", e) }) }, br.prototype.setModelStyle = function (e, t) { t && ("time" === this.palyType ? t.item.style = "start" === e ? this.startStyle : this.endStyle : this.setModelProgressStyle(e, t)) }, br.prototype.setVisibility = function (t) { this.tiltModel.start && this.tiltModel.start.setVisibility(t), this.tiltModel.end.forEach(e => { e.setVisibility(t) }) }, br.prototype.deleteObject = function () { this.tiltModel.start && this.tiltModel.start.deleteObject(), this.tiltModel.end.forEach(e => { e.deleteObject() }) }, Object.defineProperties(br.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 < i.g && (i.g = i.g / 255), 1 < i.b && (i.b = i.b / 255), 1 < i.a && (i.a = i.a / 255), i.r && (i = this._color.createColor(i.r, i.g, i.b, i.a))), a.color = i), this._position = t, this.item = this._viewer.entities.add({ name: e, position: this._cesium.Cartesian3.fromDegrees(t[0], t[1], t[2] || 0), point: a }), { id: this.item.id, name: e, pId: this._core.isnull(r) ? 0 : r, type: "Point", item: this }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(r) ? 0 : r), this }, L.prototype.getstyles = function () { var e = {}; return e.show = !this.item.point.show || this.item.point.show._value, e.pixelSize = this.item.point.pixelSize ? this.item.point.pixelSize.toString() : null, e.heightReference = this.item.point.heightReference && this.item.point.heightReference._value ? this.item.point.heightReference.toString() : null, e.color = this.item.point.color && this.item.point.color._value ? "rgba" + this.item.point.color.toString() : null, e.outlineColor = this.item.point.outlineColor && this.item.point.outlineColor._value ? "rgba" + this.item.point.outlineColor.toString() : null, e.outlineWidth = this.item.point.outlineWidth && this.item.point.outlineWidth._value ? this.item.point.outlineWidth.toString() : null, e.near = this.item.point.distanceDisplayCondition ? this.item.point.distanceDisplayCondition._value.near : null, e.far = this.item.point.distanceDisplayCondition ? this.item.point.distanceDisplayCondition._value.far : null, e.position = this.item.position.getValue().toString(), e }, L.prototype.createLonlat = function (o) { var r = this, t = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); t.setInputAction(function (e) { var e = r._viewer.camera.pickEllipsoid(e.position, r._viewer.scene.globe.ellipsoid), e = r._cesium.Cartographic.fromCartesian(e, r._viewer.scene.globe.ellipsoid, new r._cesium.Cartographic), t = r._cesium.Math.toDegrees(e.latitude), i = r._cesium.Math.toDegrees(e.longitude), e = e.height; "function" == typeof o && o({ lng: i, lat: t, height: e }) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), t.setInputAction(function (e) { t.destroy() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK) }, L.prototype.createRichTextPoint = function (t, i, o = {}) { var m, d, p, g, f, r = this, n = this._core.getuid(), e = o.GroupID, a = (void 0 !== i.length ? 2 === i.length ? a = this._cesium.Cartesian3.fromDegrees(i[0], i[1]) : 3 === i.length && (a = this._cesium.Cartesian3.fromDegrees(i[0], i[1], i[2])) : a = i.z ? this._cesium.Cartesian3.fromDegrees(i.x, i.y, i.z) : this._cesium.Cartesian3.fromDegrees(i.x, i.y), this._position = a, { horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.BOTTOM, show: !0, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(r._core.defaultValue(o.near, 0), r._core.defaultValue(o.far, Number.MAX_VALUE)) }), s = this._core.extend(a, o, !0), a = "", l = 15, l = (o && o.fontColor && (a = o.fontColor), o && o.fontSize && (l = o.fontSize), m = t, d = l, p = a, g = function (e) { s.image = e, r.item = r._viewer.entities.add({ id: n, name: t, position: r._position, billboard: s }), r.item.degrees = i, r.item.type = "RichPoint", r.item.data = o.data }, (f = document.createElement("img")).src = r._core.defaultValue(s.url, window.SmartEarthRootUrl + I.richtextpoint), d = parseFloat(d), f.crossOrigin = "Anonymous", f.onload = function () { var e, t, i, o, r, n, a, s, l = document.createElement("canvas"), c = l.getContext("2d"), u = f.width, h = f.height; l.width = u, l.height = h, c.drawImage(f, 0, 0, u, h), c.shadowOffsetX = 1, c.shadowOffsetY = 0, c.shadowColor = "#fff", c.shadowBlur = 1, /^\</.test(m) && /\>$/.test(m) ? (a = '<svg xmlns="http://www.w3.org/2000/svg" width="' + u + '" height="60"><foreignObject width="100%" height="100%">' + m + "</foreignObject></svg>", 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 () { c.drawImage(t, 0, 0, t.width, t.height), e.revokeObjectURL(i) }) : (c.fillStyle = p || "#fff", c.font = d + "px Calibri,sans-serif", m.length * d > u ? (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 = (u - a.length * d) / 2, c.fillText(a, n, s), c.fillText(o, n, r)) : (a = (h - 100 - d) / 2, s = (u - m.length * d) / 2, c.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 < i.length) { for (var s = 0; s < n.length; s++)if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && this._cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, L.prototype.forbidDrawWorld = function (e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene.screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController.enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, L.prototype.altitude = L.prototype.executePoint = function (o, e) { let t; "object" != typeof o && "function" != typeof e || (t = e, e = o, o = t), t = null, this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw); var r = this, n = (this._tree.starttemporaryItem(this._viewer), { point: r._cesium.Color.RED }); 0 < Object.keys(e).length && "" != e.point && null != e.point && (n.point = e.point), this._tree.removeHandler(); let a = this._core.CreateTooltip(); return this._tree.handler = new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas), this._tree.handler.setInputAction(function (e) { var e = r._getPosition.getMousePosition(e), t = r._core.toDegrees(e), t = 1e3 <= t.height ? (t.height / 1e3).toFixed(2) + "千米" : t.height.toFixed(2) + "米", i = r._core.getPointToCameraDistance(r._viewer, e), e = r._viewer.entities.add({ name: "高度", position: e, point: { color: n.point.withAlpha(.5), pixelSize: 5, outlineColor: r._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: r._cesium.HeightReference.none, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * i), disableDepthTestDistance: Number.POSITIVE_INFINITY }, label: { text: "海拔高度:" + t, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * i), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), i = (r._tree.temporaryItem.obj.push(e), { point: e, height: t }); r._tree.endtemporaryItem(), r._core.mouse(r._viewer.container, 0, "0"), r._tree.handler.destroy(), a.show(!1), "function" == typeof o && o(i), r.item = e }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { a.showAt(e.endPosition, "点击拾取高度!") }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, L.prototype.executePointp = function (t, e) { this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw); var i = this, o = (this._tree.starttemporaryItem(this._viewer), { point: i._cesium.Color.RED }); return 0 < Object.keys(e).length && "" != e.point && null != e.point && (o.point = e.point), this._tree.removeHandler(), this._tree.handler = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas), this._tree.handler.setInputAction(function (e) { var e = i._getPosition.getMousePosition(e); e && (e = i._viewer.entities.add({ name: "高度", position: e, point: { color: o.point.withAlpha(.5), pixelSize: 5, outlineColor: i._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: i._cesium.HeightReference.none } }), i._tree.temporaryItem.obj.push(e), i._tree.endtemporaryItem(), i._core.mouse(i._viewer.container, 0, "0"), i._tree.handler.destroy(), "function" == typeof t && t(e), i.item = e) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), this }, L.prototype.deleteObject = function () { try { if (this._viewer.entities.remove(this.item), 0 < this._points.length) for (var e = 0; e < this._points.length; e++)this._viewer.entities.remove(this._points[e]) } catch (e) { } }, L.prototype.setVisibility = function (e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++)this._points[t].show = e; this.item.show = e }, L.prototype.getVisibility = function () { return this.item.show }, L.prototype.setPointAlpha = function (e) { try { this.item._point.material._value.alpha = e } catch (e) { console.log(e) } return this }, L.prototype.export = function () { var e = null == this.item.point.show ? void 0 : this.item.point.show._value, t = null == this.item.point.pixelSize ? void 0 : this.item.point.pixelSize._value, i = null == this.item.point.color ? void 0 : "rgba(" + this.item.point.color._value.red + "," + this.item.point.color._value.green + "," + this.item.point.color._value.blue + "," + this.item.point.color._value.alpha + ")", o = null == this.item.point.outlineColor ? void 0 : "rgba(" + this.item.point.outlineColor._value.red + "," + this.item.point.outlineColor._value.green + "," + this.item.point.outlineColor._value.blue + "," + this.item.point.outlineColor._value.alpha + ")", r = null == this.item.point.outlineWidth ? void 0 : this.item.point.outlineWidth._value, n = this.item.point.distanceDisplayCondition, a = null == n ? void 0 : n._value.near, n = null == n ? void 0 : n._value.far, s = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "point", position: { x: this._cesium.Math.toDegrees(s.longitude), y: this._cesium.Math.toDegrees(s.latitude), z: this._cesium.Math.toDegrees(s.height) }, treeobj: { name: this.treeobj.name }, style: { show: e, pixelSize: t, color: i, outlineColor: o, outlineWidth: r, near: a, far: n } } }, L.prototype.setTreeobj = function (e) { this.treeobj = e }, L.prototype.setPointColor = function (e) { try { this.item._point.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item.fillColor = this.item._point.color } catch (e) { console.log(e) } return this }, L.prototype.setRadius = function (e) { try { this.item.ellipse = new this._cesium.EllipseGraphics({ semiMinorAxis: e, semiMajorAxis: e, material: this._cesium.Color.RED.withAlpha(.4) }) } catch (e) { console.log(e) } return this }, L.prototype.setOutlineColor = function (e) { try { this.item._point.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, Object.defineProperties(L.prototype, { HighLight: { set: function (e) { e && (this.item.fillColor = this.item.point._color), e ? this.item._point.color = new m(this._viewer, this._cesium).colorFromHtmlColor(this._core.selectedColor) : this.item.point._color = this.item.fillColor } } }), Object.defineProperties(L.prototype, { pointColor: { get: function () { if (this.item.point._color._value) return this._color.toHtmlColor("rgb(" + 255 * this.item.point._color._value.red + "," + 255 * this.item.point._color._value.green + "," + 255 * this.item.point._color._value.blue + "," + 255 * this.item.point._color._value.alpha + ")") }, set: function (e) { try { /^rgb/.test(e) ? (1 < (e = this._color.rgbaStringToRgbaObj(e)).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), e = this._color.createColor(e.r, e.g, e.b, e.a), this.item._point.color = e) : this.item._point.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item.fillColor = this.item._point.color } catch (e) { } } }, pointOutlineColor: { get: function () { if (null != this.item._point._outlineColor) return this._color.toHtmlColor("rgb(" + 255 * this.item._point.outlineColor._value.red + "," + 255 * this.item._point.outlineColor._value.green + "," + 255 * this.item._point.outlineColor._value.blue + "," + 255 * this.item._point.outlineColor._value.alpha + ")") }, set: function (e) { try { /^rgb/.test(e) ? (1 < (e = this._color.rgbaStringToRgbaObj(e)).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), e = this._color.createColor(e.r, e.g, e.b, e.a), this.item._point.outlineColor = e) : this.item._point.outlineColor = this._color.colorFromHtmlColor(e) } catch (e) { console.log(e) } } }, pointOutlineWidth: { get: function () { if (null != this.item.point.outlineWidth) return this.item.point.outlineWidth._value }, set: function (e) { this.item.point.outlineWidth = e } }, pointAlpha: { get: function () { if (null != this.item._point._color) return this.item._point._color._value.alpha }, set: function (e) { this.item._point._color._value.alpha = e } }, pointOutlineAlpha: { get: function () { if (null != this.item._point.outlineColor) return this.item._point.outlineColor._value.alpha }, set: function (e) { try { this.item._point.outlineColor._value.alpha = e } catch (e) { } } }, pointHeight: { set: function (e) { e = parseFloat(e); var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), t = this._cesium.Math.toDegrees(t.latitude), i = this._cesium.Cartesian3.fromDegrees(i, t, e); this.item.position._value = i }, get: function () { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.height) } }, pointX: { set: function (e) { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t.latitude)), t = this._cesium.Math.toDegrees(t.height), e = this._cesium.Cartesian3.fromDegrees(e, i, t); this.item.position.position = e }, get: function () { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.longitude) } }, pointY: { set: function (e) { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), t = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t.height)), i = this._cesium.Cartesian3.fromDegrees(i, e, t); this.item.position.position = i }, get: function () { var e = this._cesium.Cartographic.fromCartesian(this.item.position._value); return this._cesium.Math.toDegrees(e.latitude) } } }), Object.defineProperties(L.prototype, { pixelSize: { get: function () { return this.item.point.pixelSize._value }, set: function (e) { this.item.point.pixelSize = e } } }), Object.defineProperties(L.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), L.prototype.setItem = function (e) { this.item = e }, Object.defineProperties(L.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), Object.defineProperties(L.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(L.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(L.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(L.prototype, { position: { get: function () { return this._position || this.item.position } } }), Object.defineProperties(L.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), Object.defineProperties(L.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(L.prototype, { pointTempOptions: { get: function () { return { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: m.BLACK, outlineWidth: 0, show: !0, scaleByDistance: null, translucencyByDistance: null, heightReference: null, distanceDisplayCondition: null, disableDepthTestDistance: null } } } }), M.prototype.createPolygon = function (e, t, i, o, r) { var n, a = []; if (Array.isArray(e)) { if (e[0] instanceof Array) { if (2 === e[0].length) { for (var s = 0; s < e.length; s++)a.push(e[s][0], e[s][1]); n = this._cesium.Cartesian3.fromDegreesArray(a) } else if (3 === e[0].length) { for (s = 0; s < e.length; s++)a.push(e[s][0], e[s][1], e[s][2]); n = this._cesium.Cartesian3.fromDegreesArrayHeights(a) } } else if (e[0].z) { for (s = 0; s < e.length; s++)a.push(e[s].x, e[s].y, e[s].z); n = this._cesium.Cartesian3.fromDegreesArrayHeights(a) } else { for (s = 0; s < e.length; s++)a.push(e[s].x, e[s].y); n = this._cesium.Cartesian3.fromDegreesArray(a) } "string" == typeof t && (t = { fillColor: t }), this.item = this._viewer.entities.add({ name: r, polygon: { hierarchy: new this._cesium.PolygonHierarchy(n), material: new m(this._viewer, this._cesium).colorFromHtmlColor(t.fillColor), heightReference: this._core.defaultValue(i, 1), perPositionHeight: 1 !== i, outline: !0, outlineWidth: this._core.defaultValue(t.outlineWidth, 1), outlineColor: new m(this._viewer, this._cesium).colorFromHtmlColor(this._core.defaultValue(t.outlineColor, t.fillColor)) } }) } else "object" == typeof e && (e.points.forEach(e => { 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, u, 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, c = i, i = r(t), t = Math.sin(i), i = Math.cos(i), e = (1 - o) * Math.tan(r(e)), u = 1 / Math.sqrt(1 + e * e), h = e * u, m = Math.atan2(e, i), e = u * 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 = c / (s * p), _ = 2 * Math.PI; for (; 1e-12 < Math.abs(f - _);) { var C = Math.cos(2 * m + f), y = Math.sin(f), v = Math.cos(f); _ = f, f = c / (s * p) + g * y * (C + g / 4 * (v * (2 * C * C - 1) - g / 6 * C * (4 * y * y - 3) * (4 * C * C - 3))) } a = h * y - u * v * i, a = Math.atan2(h * v + u * y * i, (1 - o) * Math.sqrt(e * e + a * a)), t = Math.atan2(y * t, u * v - h * y * i), u = o / 16 * d * (4 + o * (4 - 3 * d)); return { lon: l + n(t - (1 - u) * o * e * (f + u * y * (C + u * v * (2 * C * C - 1)))), lat: n(a) } }(e, i, Math.cos(o) * t), o = { lon: e.lon, lat: e.lat, height: e.height }, t = { lon: i.lon, lat: i.lat, height: e.height + n }, l = 6378137, c = 6356725, h = this, i = function (e, t) { var i = [], o = 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)))) * l, a = Math.round(1e4 * a) / 1e4, { anglew: h._core.TwoPointAzimuth(t, e, o, i), distance: a } }(e.lat, e.lon, t.lat, t.lon), r = o.anglew, n = o.distance; i.push(e.lon, e.lat, e.height); for (var a = r - u / 2, s = null; a < r + u / 2; a++)s = function (e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = c + (l - c) * (90 - e) / 90, n = o * Math.cos(e * Math.PI / 180), r = 180 * (r / n + t * Math.PI / 180) / Math.PI, n = 180 * (i / o + e * Math.PI / 180) / Math.PI; return [r, n] }(e.lat, e.lon, n, a), i.push(s[0], s[1], t.height + 10 * a); return i }(o, t), e = document.createElement("canvas"), n = (e.id = "0-a", e.width = 800, e.height = 800, document.body.appendChild(e), document.createElement("canvas")), m = (n.id = "0-b", n.width = 800, n.height = 800, "a"), d = (document.body.appendChild(n), 1), o = new Cesium.CallbackProperty(function (e, t) { var i = document.getElementById("0-" + m), o = i.getContext("2d"); function r(e, t, i) { o.beginPath(), o.arc(400, 800, i, n(e), n(t), !1), o.stroke() } function n(e) { return (e -= 90) * Math.PI / 180 } o.strokeStyle = "red", o.lineWidth = 15, o.clearRect(0, 0, 800, 800); var a, s, l, c = o.createLinearGradient(0, 800, 0, 0); return c.addColorStop(0, "rgba(255,0,0,0.6)"), c.addColorStop(1, "rgba(255,0,0,0)"), a = -u / 2, s = u / 2, l = d + 600, o.beginPath(), o.arc(400, 800, l, n(a), n(s), !1), o.stroke(), o.lineTo(400, 800), o.closePath(), o.fillStyle = c, o.fill(), r(-u / 2, u / 2, d + 100), r(-u / 2, u / 2, d + 200), r(-u / 2, u / 2, d + 300), r(-u / 2, u / 2, d + 400), r(-u / 2, u / 2, d + 500), r(-u / 2, u / 2, d + 600), d < 100 ? d += 1 : d = 1, m = "a" === m ? "b" : "a", i }, !1); function p(e) { return e * Math.PI / 180 } return this.item = this._viewer.entities.add({ polygon: { hierarchy: new this._cesium.PolygonHierarchy(this._cesium.Cartesian3.fromDegreesArrayHeights(i)), material: new this._cesium.ImageMaterialProperty({ image: o, transparent: !0 }), perPositionHeight: !0, outlineColor: r.outlineColor } }), this }, M.prototype.setImageMaterialProperty = function () { var r = this, e = document.createElement("canvas"), t = (e.id = "0-a", e.width = 700, e.height = 100, document.createElement("canvas")), e = (t.id = "0-b", t.width = 700, t.height = 100, document.body.appendChild(e), document.body.appendChild(t), new r._cesium.CallbackProperty(function (e, t) { var i = document.getElementById("0-" + r.curCanvas), o = i.getContext("2d"); return i.strokeStyle = "1px solid red", o.strokeStyle = "red", o.fillStyle = "red", o.save(), o.translate(100, 100), o.arc(0, 0, 100, 0, 180 * Math.PI / 180), o.restore(), o.stroke(), r.curCanvas = "a" === r.curCanvas ? "b" : "a", i }, !1)); return new r._cesium.ImageMaterialProperty({ image: e, transparent: !0 }) }, M.prototype.executeSector = function (t, e) { var i, o, n, a, l = this, r = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), this._viewer), s = 0, c = { fillColor: l._cesium.Color.YELLOW.withAlpha(.5), outlineColor: l._cesium.Color.YELLOW }, u = (e && e.fillColor && (c.fillColor = e.fillColor), e && e.outlineColor && (c.outlineColor = e.outlineColor), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), []), h = this._core.CreateTooltip(), m = (this.item = void 0, this.end = e => { 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(u))), "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), u = 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 + 30; o++)r = function (e, t, i, o) { var r = i * Math.sin(o * Math.PI / 180), i = i * Math.cos(o * Math.PI / 180), o = d + (m - d) * (90 - e) / 90, n = o * Math.cos(e * Math.PI / 180), r = 180 * (r / n + t * Math.PI / 180) / Math.PI, n = 180 * (i / o + e * Math.PI / 180) / Math.PI; return [r, n] }(e.lat, e.lon, a, o), i.push(r[0], r[1]); return i }(i, o), l.item || (l.item = r.entities.add({ polygon: { hierarchy: new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(u)), material: new l._cesium.ColorMaterialProperty(c.fillColor), outlineColor: c.outlineColor, fill: !0 } }), l.item.polygon.hierarchy = new l._cesium.CallbackProperty(function () { return new l._cesium.PolygonHierarchy(l._cesium.Cartesian3.fromDegreesArray(u)) }, !1))) }, l._cesium.ScreenSpaceEventType.MOUSE_MOVE), 6378137), d = 6356725; function p(e) { return e * Math.PI / 180 } return this }, M.prototype.executePolygon = function (t, s) { this._lang = this._core.extend(this._lang, language._lang); var l = this, i = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), e.prototype._init = function () { var e = this; this.options.polygon.hierarchy = new l._cesium.CallbackProperty(function () { return e.hierarchy }, !1), this.polygon = l._viewer.entities.add(this.options), l.item = this.polygon, l._tree.temporaryItem.obj.push(this.polygon) }, e); function e(e) { this.options = { name: "", polygon: { hierarchy: [], heightReference: l._core.defaultValue(t.heightReference, 1), perPositionHeight: 0 === t.heightReference, material: l._core.defaultValue(t.material, l._cesium.Color.YELLOW.withAlpha(.5)) } }, this.hierarchy = e, this._init() } this._tree.handler = new this._cesium.ScreenSpaceEventHandler(l._viewer.scene.canvas); var c = [], o = {}, u = void 0, h = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._core.CreateTooltip()); return this._tree.handler.setInputAction(function (e) { e = l._getPosition.getMousePosition(e); 0 == c.length && c.push(e.clone()), c.push(e), o = new l._cesium.PolygonHierarchy(c) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { 0 === c.length ? h.showAt(e.endPosition, l._lang.draw_tip_left) : c.length <= 2 ? h.showAt(e.endPosition, l._lang.draw_tip_click) : h.showAt(e.endPosition, l._lang.draw_tip_right); e = l._getPosition.getMousePosition(e); 2 <= c.length && (l._cesium.defined(u) ? null != e && (c.pop(), e.y += 1 + Math.random(), c.push(e), o = new l._cesium.PolygonHierarchy(c)) : (o = new l._cesium.PolygonHierarchy(c), u = new i(o))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { l._tree.endtemporaryItem(), l._tree.handler.destroy(), h.show(!1); for (var t = { polygon: {}, positions: [], area: [] }, i = (t.polygon = u, []), o = 0; o < c.length; o++) { var r = l._cesium.Cartographic.fromCartesian(c[o]), n = l._cesium.Math.toDegrees(r.longitude), a = l._cesium.Math.toDegrees(r.latitude), r = r.height; i.push({ lon: n, lat: a, hei: r }) } t.positions = i, l._core.mouse(l._viewer.container, 0, "0"), "function" == typeof s && s(t) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, M.prototype.executePolygonvideo = function (a, t) { this._lang = this._core.extend(this._lang, language._lang); var s = this, i = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), e.prototype._init = function () { var e = this; this.options.polygon.hierarchy = new s._cesium.CallbackProperty(function () { return e.hierarchy }, !1), this.polygon = s._viewer.entities.add(this.options), m.style.transform = "rotate(" + t.angle + "deg)", this.polygon.polygon.stRotation = s._cesium.Math.toRadians(t.angle), s.item = this.polygon, s._tree.temporaryItem.obj.push(this.polygon) }, e); function e(e) { this.options = { name: "", polygon: { hierarchy: [], heightReference: s._cesium.HeightReference.CLAMP_TO_GROUND, classificationType: s._cesium.ClassificationType.BOTH, material: s._cesium.Color.YELLOW.withAlpha(.5) } }, this.hierarchy = e, this._init() } this._tree.handler = new this._cesium.ScreenSpaceEventHandler(s._viewer.scene.canvas); var l = [], o = {}, r = void 0, c = this._core.CreateTooltip(), u = s._core.getuid(), n = document.getElementById("videoToolbar"), h = (n || ($(".cesium-viewer").append('<div id="videoToolbar"></div>'), n = document.getElementById("videoToolbar")), '<video id="video' + u + '"  style="display: none;" muted autoplay loop crossorigin controls><source src="' + t.url + '" type="video/mp4"></video>'), m = ($(n).append(h), document.getElementById("video" + u)); 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); 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 ? (d && s._viewer.entities.remove(d), o = new s._cesium.PolygonHierarchy(l), r = new i(o)) : o = new s._cesium.PolygonHierarchy(l) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { 0 === l.length ? c.showAt(e.endPosition, s._lang.draw_tip_left) : l.length <= 2 ? c.showAt(e.endPosition, s._lang.draw_tip_click) : c.showAt(e.endPosition, s._lang.draw_tip_right), 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(), c.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 < l.length; i++) { var o = s._cesium.Cartographic.fromCartesian(l[i]), r = s._cesium.Math.toDegrees(o.longitude), n = s._cesium.Math.toDegrees(o.latitude), o = o.height; t.push({ lon: r, lat: n, hei: o }) } e.positions = t, e.id = u, "function" == typeof a && a(e) } }, this }, M.prototype.addVideoPolygon = function (e, t) { var i, o = []; if (e[0] instanceof Array) { if (2 === e[0].length) { for (var r = 0; r < e.length; r++)o.push(e[r][0], e[r][1]); i = this._cesium.Cartesian3.fromDegreesArray(o) } else if (3 === e[0].length) { for (r = 0; r < e.length; r++)o.push(e[r][0], e[r][1], e[r][2]); i = this._cesium.Cartesian3.fromDegreesArrayHeights(o) } } else if (e[0].z) if (e[0].x < 180 && -180 < e[0].x && e[0].y < 90 && -90 < e[0].y) { for (r = 0; r < e.length; r++)o.push(e[r].x, e[r].y, e[r].z); i = this._cesium.Cartesian3.fromDegreesArrayHeights(o) } else i = e; else { for (r = 0; r < e.length; r++)o.push(e[r].x, e[r].y); i = this._cesium.Cartesian3.fromDegreesArray(o) } var n = document.getElementById("videoToolbar"), a = (n || ($(".cesium-viewer").append('<div id="videoToolbar"></div>'), n = document.getElementById("videoToolbar")), this._core.getuid()), s = '<video id="video' + a + '"  style="display: none;" muted autoplay loop crossorigin controls><source src="' + t.url + '" type="video/mp4"></video>', 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('<div id="videoToolbar"></div>'), e = document.getElementById("videoToolbar")), this._core.getuid()), r = '<video id="video' + o + '"  style="display: none;" muted autoplay loop crossorigin controls><source src="' + t.url + '" type="video/mp4"></video>', 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 < this._points.length) { for (var e = 0; e < this._points.length; e++)this._viewer.entities.remove(this._points[e]); this._points = [] } try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e) } this.item = void 0 }, M.prototype.planeArea = M.prototype.executePolygoncl = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); let i; "object" != typeof t && "function" != typeof e || (i = e, e = t, t = i), i = null, this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer); var o, r, n = this, a = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this._core.CreateTooltip()), s = [], l = {}, c = [], u = null, h = null, m = { point: n._cesium.Color.RED, polyline: n._cesium.Color.YELLOW, polygon: n._cesium.Color.YELLOW.withAlpha(.5) }, d = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (m.point = e.point), "" != e.polyline && null != e.polyline && (m.polyline = e.polyline), "" != e.polygon && null != e.polygon && (m.polygon = e.polygon)), { mj: 0, label: [], polygon: [] }); let p, g; this._tree.handler.setInputAction(function (e) { var t, i; 0 === s.length ? a.showAt(e.endPosition, n._lang.draw_tip_left) : s.length <= 3 ? a.showAt(e.endPosition, n._lang.draw_tip_click) : a.showAt(e.endPosition, n._lang.draw_tip_right), (h = n._getPosition.getMousePosition(e)) && (e = n._cesium.Cartographic.fromCartesian(h), t = n._cesium.Math.toDegrees(e.longitude), i = n._cesium.Math.toDegrees(e.latitude), e.height, 2 <= s.length && (n._cesium.defined(u) ? (s.pop(), s.push(h), l = new n._cesium.PolygonHierarchy(s), c.pop(), c.push([t, i])) : (l = new n._cesium.PolygonHierarchy(s), u = new f(l)), e = n._core.getArea(c, s), 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, 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(c, 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()), c.push([t, i])), s.push(h), c.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(u) || (l = new n._cesium.PolygonHierarchy(s), u = 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(c, 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), c.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(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id), t = { id: t = o._core.getuid(), name: "新建面" + t, pId: o._core.isnull(e) ? 0 : e, type: "polygon", item: o }, o.setTreeobj(t), V.insertGroupId(t, o._core.isnull(e) ? 0 : e), c); function c(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, S = !1, E = []; 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 < T && (b += t, _.item._polygon.extrudedHeight.setValue(b), T <= b && (clearInterval(_.waterTimer), _.waterTimer = void 0, b = T, _._viewer.entities.remove(_.item), _.polygon1 = new _._cesium.PolygonGeometry({ polygonHierarchy: new _._cesium.PolygonHierarchy(v), extrudedHeight: T, height: 0, vertexFormat: _._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT }), e = new _._cesium.Primitive({ geometryInstances: new _._cesium.GeometryInstance({ geometry: _.polygon1 }), appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: f.watherColor || Cesium.Color.SKYBLUE.withAlpha(.6), blendColor: f.watherColor || Cesium.Color.SKYBLUE.withAlpha(.6), normalMap: f.url, frequency: f.frequency || 1e3, animationSpeed: f.watherSpeed || .01, amplitude: f.amplitude || 10 } } }) }), show: !0 }), _._viewer.scene.primitives.add(e), _.item = e, "" != i && null != i && "function" == typeof i && i(b), _._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (o = V.selectedItem.id), e = { id: e = _._core.getuid(), name: "新建淹没分析" + e, pId: _._core.isnull(o) ? 0 : o, type: "polygon", item: _ }, _.setTreeobj(e), V.insertGroupId(e, _._core.isnull(o) ? 0 : o))) }, 50) } this._tree.handler.setInputAction(function (e) { if (S) void 0 === b ? C.showAt(e.endPosition, "点击拾取初始水面高度") : void 0 === T && C.showAt(e.endPosition, "点击拾取最大淹没高度"); else { 4 <= v.length ? C.showAt(e.endPosition, "右键结束绘制") : C.showAt(e.endPosition, "点击左键绘制淹没区域"); e = _._viewer.camera.getPickRay(e.endPosition); if (h = _._viewer.scene.globe.pick(e, _._viewer.scene), 2 <= v.length) { if (_._cesium.defined(w)) if (f.rectangle) x = _._core.toDegrees(h), 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; else { for (var e = v[0], e = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), t = Cesium.Math.toDegrees(e.latitude), e = Cesium.Math.toDegrees(e.longitude), i = v[v.length - 2], i = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(i), o = Cesium.Math.toDegrees(i.latitude), i = Cesium.Math.toDegrees(i.longitude), r = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(h), n = Cesium.Math.toDegrees(r.latitude), r = Cesium.Math.toDegrees(r.longitude), a = Cesium_turf.lineString([[e, t], [r, n]]), s = Cesium_turf.lineString([[i, o], [r, n]]), l = !0, c = 0; c < E.length && 2 <= E.length; c++) { var u = E[c]; if (0 == c) { if (Cesium_turf.lineIntersect(s, u).features.length) { l = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; break } } else if (c == E.length - 1) { if (Cesium_turf.lineIntersect(a, u).features.length) { l = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; break } } else { if (Cesium_turf.lineIntersect(a, u).features.length) return l = !1, void (C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'); if (Cesium_turf.lineIntersect(s, u).features.length) { l = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; 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 (S) { var t = _._cesium.Cartographic.fromCartesian(e); if (void 0 === b) b = t.height; else if (void 0 === T) { if ((T = t.height) < b) return window.layuiLayer && window.layuiLayer.msg("最大淹没高度小于初始水面高度,请重新拾取"), void (b = T = void 0); D() } } else { if (0 == v.length && (v.push(e.clone()), y = new _._cesium.PolygonHierarchy(v)), 2 <= v.length) { if (0 == E.length) var i = v[0], o = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(i), r = Cesium.Math.toDegrees(o.latitude), n = Cesium.Math.toDegrees(o.longitude), a = v[1], s = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(a), l = Cesium.Math.toDegrees(s.latitude), c = Cesium.Math.toDegrees(s.longitude), u = Cesium_turf.lineString([[n, r], [c, l]]); else { if (2 <= E.length) { for (var i = v[0], o = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(i), r = Cesium.Math.toDegrees(o.latitude), n = Cesium.Math.toDegrees(o.longitude), a = v[v.length - 2], s = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(a), l = Cesium.Math.toDegrees(s.latitude), c = Cesium.Math.toDegrees(s.longitude), t = _._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), a = Cesium.Math.toDegrees(t.latitude), t = Cesium.Math.toDegrees(t.longitude), h = Cesium_turf.lineString([[n, r], [t, a]]), m = Cesium_turf.lineString([[c, l], [t, a]]), d = !0, p = 0; p < E.length && 2 <= E.length; p++) { var g = E[p]; if (0 == p) { if (Cesium_turf.lineIntersect(m, g).features.length) { d = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; break } } else if (p == E.length - 1) { if (Cesium_turf.lineIntersect(h, g).features.length) { d = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; break } } else { if (Cesium_turf.lineIntersect(h, g).features.length) return d = !1, void (C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'); if (Cesium_turf.lineIntersect(m, g).features.length) { d = !1, C.innerHTML = '<span style="font-family:黑体;color:white;font-weight: bolder;font-size: 14px">不允许出现交叉面!</span>'; 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), c = Cesium.Math.toDegrees(s.longitude), u = Cesium_turf.lineString([[n, r], [c, l]]) } E.push(u) } 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 ? S = !(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) { S || v.length <= 3 || (C.show(!1), v.pop(), y = new _._cesium.PolygonHierarchy(v), f.pointSelect ? S = !(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 < this._points.length)) { for (var t = 0; t < this._points.length; t++)this._viewer.entities.remove(this._points[t]); this._points = [] } }; e.prototype._init = function () { var e = this, t = (this.options.polygon.hierarchy = new _._cesium.CallbackProperty(function () { return e.hierarchy }, !1), _._viewer.entities.add(this.options)); _.item = t, _._tree.temporaryItem.obj.push(t); try { null != f && "" != f && (0 < f.waterHeight && (b = f.waterHeight), 0 < f.targetHeight && (T = f.targetHeight), 0 < f.spood && (r = f.spood), "" != f.GroupID && null != f.GroupID && (o = f.GroupID)) } catch (e) { console.log(e) } }; var d = e; function e(e) { this.options = { name: "多边形", polygon: { hierarchy: [], material: _._cesium.Color.SKYBLUE.withAlpha(.5), heightReference: _._cesium.HeightReference.NONE, extrudedHeight: 0 } }, this.hierarchy = e, this._init() } return this }, M.prototype.endWater = function () { this.end && this.end(), this.waterTimer && clearInterval(this.waterTimer), this._tree.endtemporaryItem(), this.deleteObject() }, M.prototype.executePolygonymsdtt = function (o, e) { this._tree.removeHandler(); var r = this, n = (this._tree.starttemporaryItem(this._viewer), this._tree.handler = new r._cesium.ScreenSpaceEventHandler(r._viewer.scene.canvas), []), t = null, i = null, a = (this._tree.handler.setInputAction(function (e) { e = r._viewer.camera.getPickRay(e.endPosition); i = r._viewer.scene.globe.pick(e, r._viewer.scene), 2 <= n.length && (r._cesium.defined(t) ? (n.pop(), n.push(i)) : t = new a(n), new r._cesium.PolygonHierarchy(n)) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { e = r._viewer.camera.getPickRay(e.position), i = r._viewer.scene.globe.pick(e, r._viewer.scene), 0 == n.length && (n.push(i.clone()), new r._cesium.PolygonHierarchy(n)), n.push(i), new r._cesium.PolygonHierarchy(n), e = r._cesium.Cartographic.fromCartesian(n[n.length - 1]), r._cesium.Math.toDegrees(e.longitude), r._cesium.Math.toDegrees(e.latitude), e.height, e = r._viewer.entities.add({ name: "多边形面积", position: n[n.length - 1], point: { pixelSize: 5, color: r._cesium.Color.RED.withAlpha(.5), outlineColor: r._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: r._cesium.HeightReference.CLAMP_TO_GROUND } }); r._tree.temporaryItem.obj.push(e), r._points.push(e) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { r._tree.handler.destroy(), r._viewer.entities.remove(r.item), r.polygon1 = new r._cesium.PolygonGeometry({ polygonHierarchy: new r._cesium.PolygonHierarchy(n), extrudedHeight: 0, height: 0, vertexFormat: r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT }); var t = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: r.polygon1 }), appearance: new r._cesium.EllipsoidSurfaceAppearance({ aboveGround: !0 }), show: !0 }), i = new r._cesium.Material({ fabric: { type: "Water", uniforms: { normalMap: o.url, frequency: 100, animationSpeed: .01, amplitude: 10 } } }), i = (t.appearance.material = i, r._viewer.scene); r.polygon1 = i.primitives.add(t), r._tree.endtemporaryItem(), n.pop(), new r._cesium.PolygonHierarchy(n) }, r._cesium.ScreenSpaceEventType.RIGHT_CLICK), s.prototype._init = function () { var e = this, t = (this.options.polygon.hierarchy = new r._cesium.CallbackProperty(function () { return e.hierarchy }, !1), r._viewer.entities.add(this.options)), t = (r.item = t, r._tree.temporaryItem.obj.push(t), 0), i = (r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), r._core.getuid()), i = { id: i, name: "新建水面" + i, pId: r._core.isnull(t) ? 0 : t, type: "polyline", item: r }; r.setTreeobj(i), V.insertGroupId(i, r._core.isnull(t) ? 0 : t) }, s); function s(e) { this.options = { name: "多边形", polygon: { hierarchy: [], material: r._cesium.Color.SKYBLUE.withAlpha(.4), heightReference: r._cesium.HeightReference.NONE, extrudedHeight: 0 } }, this.hierarchy = e, this._init() } return this }, M.prototype.executePolygontdmj = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); var i, o, r = this, n = (this._tree.starttemporaryItem(this._viewer), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.removeHandler(), { mj: 0, label: [], polygon: [] }), a = !0, s = [], l = void 0, c = this._viewer.scene, u = c.globe.ellipsoid, h = { point: r._cesium.Color.RED, polyline: r._cesium.Color.YELLOW, polygon: r._cesium.Color.YELLOW.withAlpha(.5) }, m = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (h.point = e.point), "" != e.polyline && null != e.polyline && (h.polyline = e.polyline), "" != e.polygon && null != e.polygon && (h.polygon = e.polygon)), this._core.CreateTooltip()), d = (this._tree.handler = new r._cesium.ScreenSpaceEventHandler(c.canvas), 0); let p; this._tree.handler.setInputAction(function (e) { 0 === s.length ? m.showAt(e.endPosition, r._lang.draw_tip_left) : s.length <= 2 ? m.showAt(e.endPosition, r._lang.draw_tip_click) : m.showAt(e.endPosition, r._lang.draw_tip_right), o && (r._viewer.entities.remove(o), o = void 0); var e = r._getPosition.getMousePosition(e, [n.polygon, n.label]); e && r._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) && a && (s.pop(), s.push(e), 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.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 < e.length; i++)t[i] = _(u.cartesianToCartographic(e[i])); for (var o = 0, i = 0; i < t.length; i++)o += t[i].longitude; o /= t.length; for (i = 0; i < t.length; i++)t[i] = r._core.Gauss_to_XY(t[i].longitude, t[i].latitude, o, r._cesium); return Math.abs(C(t)) }, _ = function (e) { return e.longitude = e.longitude / Math.PI * 180, e.latitude = e.latitude / Math.PI * 180, e }, C = function (e) { for (var t = 0, i = 0; i < e.length; i++) { var o = e[i], r = i < e.length - 1 ? e[i + 1] : e[0]; t += o.x * r.y - r.x * o.y } return t / 2 }, y = (v.prototype._init = function (e) { var t = this; this.options.polygon.hierarchy = new r._cesium.CallbackProperty(function () { return t.path }, !1), this.polygonEntity = r._viewer.entities.add(this.options), r.item = this.polygonEntity, r._tree.temporaryItem.obj.push(this.polygonEntity), n.polygon = this.polygonEntity, r._entity = this.polygonEntity }, v); function v(e, t) { if (!r._cesium.defined(e)) throw new r._cesium.DeveloperError("positions is required!"); if (e.length < 3) throw new r._cesium.DeveloperError("positions 的长度必须大于等于3"); this.options = { polygon: { show: !0, hierarchy: void 0, classificationType: r._cesium.ClassificationType.BOTH, material: h.polygon } }, this.path = e, this._init(t) } return this }, M.prototype.surfaceArea = function (r = {}, n) { this._lang = this._core.extend(this._lang, language._lang); var i, o = this, a = (this._tree.removeHandler(), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), { mj: 0, label: void 0, polygon: void 0 }), s = [], l = [], c = void 0, e = this._viewer.scene, u = { point: r.point || Cesium.Color.RED, polyline: r.polyline || Cesium.Color.YELLOW, polygon: r.polygon || Cesium.Color.YELLOW.withAlpha(.5) }, t = this._core.CreateTooltip(); this._tree.handler = new o._cesium.ScreenSpaceEventHandler(e.canvas); let h = !1, m; this._tree.handler.setInputAction(e => { 0 === s.length ? t.showAt(e.endPosition, o._lang.draw_tip_left) : s.length <= 2 ? t.showAt(e.endPosition, o._lang.draw_tip_click) : t.showAt(e.endPosition, o._lang.draw_tip_right), !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: u.polygon, width: 3 } })), 3 <= s.length && !Cesium.defined(c) && (d && this._viewer.entities.remove(d), c = 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 < l.length) { i = Cesium.BoundingSphere.fromPoints(s); let e = this._core.getSpaceArea(this._viewer, l, { onlyTerrain: r.onlyTerrain, distance: r.distance || i.radius / 20 }), t = e => { 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: u.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: u.polygon } }, this.path = e, this._init() } return this }, M.prototype.setVisibility = function (e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++)this._points[t].show = e; this._lable && (this._lable.show = e), this.item && (this.item.show = e) }, M.prototype.getVisibility = function () { return this.item.show }, M.prototype.setRadius = function (e) { try { for (var t = [], i = this.item._polygon.hierarchy.getValue(), o = this._viewer.scene.globe.ellipsoid, r = 0; r < i.length; r++) { var n = new this._cesium.Cartesian3(i[r].x, i[r].y, i[r].z), a = o.cartesianToCartographic(n), s = this._cesium.Math.toDegrees(a.latitude), l = this._cesium.Math.toDegrees(a.longitude); t.push(l), t.push(s) } var c = new this._cesium.Cartesian3(i[0].x, i[0].y, i[0].z), u = o.cartesianToCartographic(c), s = this._cesium.Math.toDegrees(u.latitude), l = this._cesium.Math.toDegrees(u.longitude); t.push(l), t.push(s), t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.corridor = new this._cesium.CorridorGraphics({ positions: t, width: e, material: this._cesium.Color.RED.withAlpha(.4) }) } catch (e) { console.log(e) } return this }, M.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show._value, t = this.item.polygon.hierarchy.getValue(), i = null == this.item.polygon.height ? void 0 : this.item.polygon.height._value, o = null == this.item.polygon.extrudedHeight ? void 0 : this.item.polygon.extrudedHeight._value, r = null == this.item.polygon.stRotation ? void 0 : this.item.polygon.stRotation._value, n = null == this.item.polygon.fill ? void 0 : this.item.polygon.fill._value, a = this.item.polygon.material, s = (null != a && (a = { color: null == a.color ? void 0 : "rgba(" + a.color._value.red + "," + a.color._value.green + "," + a.color._value.blue + "," + a.color._value.alpha + ")", image: null == a.image ? void 0 : a.image._value, diffusemap: null == a.diffusemap ? void 0 : a.diffusemap._value, alphamap: null == a.alphamap ? void 0 : a.alphamap._value }), null == this.item.polygon.outline ? void 0 : this.item.polygon.outline._value), l = null == this.item.polygon.outlineColor ? void 0 : "rgba(" + this.item.polygon.outlineColor._value.red + "," + this.item.polygon.outlineColor._value.green + "," + this.item.polygon.outlineColor._value.blue + "," + this.item.polygon.outlineColor._value.alpha + ")", c = null == this.item.polygon.outlineWidth ? void 0 : this.item.polygon.outlineWidth._value, u = null == this.item.polygon.perPositionHeight ? void 0 : this.item.polygon.perPositionHeight._value, h = null == this.item.polygon.closeTop ? void 0 : this.item.polygon.closeTop._value, m = null == this.item.polygon.closeBottom ? void 0 : this.item.polygon.closeBottom._value, d = this.item.polygon.distanceDisplayCondition, p = null == d ? void 0 : d._value.near, d = null == d ? void 0 : d._value.far; return { type: "polygon", treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, hierarchy: t, height: i, extrudedHeight: o, stRotation: r, fill: n, material: a, outline: s, outlineColor: l, outlineWidth: c, perPositionHeight: u, closeTop: h, closeBottom: m, near: p, far: d } } }, M.prototype.setTreeobj = function (e) { this.treeobj = e }, M.prototype.setDistanceDisplayCondition = function (e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polygon.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, M.prototype.setPolygonAlpha = function (e) { try { this.item._polygon.material.color._value.alpha = e } catch (e) { console.log(e) } return this }, M.prototype.setPolygonColor = function (e) { try { this.item._polygon.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, M.prototype.setDistanceDisplayCondition = function (e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polygon.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, M.prototype.setPolygonImage = function (e) { try { this.item._polygon.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, M.prototype.setPolygonRepeat = function (e, t) { try { this.item._polygon.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, M.prototype.setOutlineColor = function (e) { try { this.item._polygon.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, M.prototype.setOutline = function (e) { try { this.item._polygon.outline = e } catch (e) { console.log(e) } return this }, M.prototype.setExtrudedHeight = function (e) { try { this.item._polygon.extrudedHeight = e } catch (e) { console.log(e) } return this }, M.prototype.setHeight = function (e) { try { this.item._polygon.height = e } catch (e) { console.log(e) } return this }, M.prototype.setHeightType = function (e) { try { 1 == e ? this.item._polygon.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._polygon.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item._polygon.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, Object.defineProperties(M.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), Object.defineProperties(M.prototype, { HighLight: { set: function (e) { e && (this.item.material = this.item.polygon.material), this.item.polygon.material = e ? new m(this._viewer, this._cesium).colorFromHtmlColor(this._core.selectedColor) : this.item.material } }, polygonShow: { set: C.debounce(function (e) { this.item.polygon.show = e }, 500), get: function () { return this.item.polygon.b } }, polygonHeight: { set: C.debounce(function (e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.height = e) }, 500), get: function () { var e = this.item.polygon.height; if (e) return e._value } }, polygonHeightReference: { set: C.debounce(function (e) { this._core.isnull(e) || (this.item.polygon.heightReference = e) }, 500), get: function () { var e = this.item.polygon.heightReference; if (e) return e._value } }, polygonExtrudedHeight: { set: C.debounce(function (e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.extrudedHeight = e) }, 500), get: function () { var e = this.item.polygon.extrudedHeight; if (e) return e._value } }, polygonExtrudedHeightReference: { set: C.debounce(function (e) { this._core.isnull(e) || (this.item.polygon.extrudedHeightReference = e) }, 500), get: function () { var e = this.item.polygon.extrudedHeightReference; if (e) return e._value } }, polygonFill: { set: C.debounce(function (e) { this.item.polygon.fill = e }, 500), get: function () { var e = this.item.polygon.fill; if (e) return e._value } }, polygonMaterial: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polygon.material = e, this.item.material = this.item.polygon.material) }, 500), get: function () { var e = this.item.polygon.material; try { return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } }, polygonMaterialAlpha: { set: C.debounce(function (e) { this._core.isnull(e) || (this.item.polygon.material.color.alpha = e) }, 500), get: function () { this.item.polygon.material; try { return this.item.polygon.material.color.alpha } catch (e) { } } }, polygonOutline: { set: C.debounce(function (e) { this._core.isnull(e) || (this.item.polygon.outline = e) }, 500), get: function () { var e = this.item.polygon.outline; if (e) return e._value } }, polygonOutlineColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polygon.outlineColor = e) }, 500), get: function () { var e = this.item.polygon.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, polygonOutlineWidth: { set: C.debounce(function (e) { this._core.isnull(e) || (/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, "")), this.item.polygon.outlineWidth = e) }, 500), get: function () { var e = this.item.polygon.outlineWidth; if (e) return e._value } } }), M.prototype.setItem = function (e) { this.item = e }, Object.defineProperties(M.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), Object.defineProperties(M.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(M.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(M.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(M.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), Object.defineProperties(M.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(M.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 } } } }), Object.defineProperties(M.prototype, { Visibility: { get: function () { return this.item.show } }, PolygonColor: { get: function () { var e = this.item._polygon.material.color._value; if (e) return new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")") } }, PolygonAlpha: { get: function () { if (this.item._polygon.material.color) return this.item._polygon.material.color._value.alpha || 1 } }, Outline: { get: function () { if (this.item._polygon.outline) return this.item._polygon.outline._value } }, OutlineColor: { get: function () { var e = this.item._polygon.outlineColor; if (this.item._polygon.outlineColor) return e = e._value, new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")") } }, ExtrudedHeight: { get: function () { if (this.item._polygon.extrudedHeight) return this.item._polygon.extrudedHeight._value } }, Height: { get: function () { return this.item._polygon.height } }, PolygonImage: { get: function () { if (this.item._polygon.material.uniforms) return this.item._polygon.material.uniforms.image } }, PolygonRepeat: { get: function () { if (this.item._polygon.material.uniforms) return this.item._polygon.material.repeat } } }), M.prototype.forceEndHanlder = function () { this._tree.handler && (this._tree.handler.destroy(), this._tree.handler = void 0) }, R.prototype.createPolyline = function (e, t, i, o, r) { var n = []; if (Array.isArray(e)) { if (e[0].x || e[0].y) if (void 0 !== e[0].z) for (a = 0; a < e.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y, e[a].z)); else for (a = 0; a < e.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y)); else if (2 === e[0].length) for (var a = 0; a < e.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1])); else if (3 === e[0].length) for (var a = 0; a < e.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1], e[a][2])); i = 2 === i ? !1 : !0; this.item = this._viewer.entities.add({ polyline: { positions: n, width: 10, material: new this._cesium.PolylineGlowMaterialProperty({ outlineColor: this._cesium.Color.BLACK, color: new m(this._viewer, this._cesium).colorFromHtmlColor(t) }), clampToGround: i } }) } else "object" == typeof e && (t = this._core.defaultValue(e.alpha, .6), e.points.forEach(e => { 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 = [], c = (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].y < l[1].y ? t = 0 <= e ? -t : t : l[0].x < l[1].x && l[0].y <= l[1].y ? (o = 0 != e ? -o : o, t = 0 < e ? -t : t) : l[0].x < l[1].x && l[0].y > l[1].y && (t = e < 0 ? -t : t, o = -o), a = new Cesium.HeadingPitchRoll(0, o, t)), s[0]), u = (this.item = this._viewer.entities.add({ position: new this._cesium.CallbackProperty(function () { return c }, !1), orientation: i.cylinder ? new this._cesium.CallbackProperty(function () { return Cesium.Transforms.headingPitchRollQuaternion(c, 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 / u) - l[0].x, m = this._cesium.Math.lerp(l[0].y, l[1].y, 1 / u) - l[0].y, d = this._cesium.Math.lerp(l[0].z, l[1].z, 1 / u) - l[0].z, p = []; p.push(s[0]); for (let e = 0; e < u; e++) { var g = l[0].x + (e + 1) * h, f = l[0].y + (e + 1) * m, _ = l[0].z + (e + 1) * d; p.push(this._cesium.Cartesian3.fromDegrees(g, f, _)) } p.push(s[1]); var C = this._core.defaultValue(i.speed, 1), y = 0, v = (this._viewer.clock.onTick.addEventListener(function () { y += C, ((y = parseInt(y)) >= p.length - 1 && 0 < C || y <= 0 && C < 0) && (C = -C), c = p[y] }), { id: this.item.id, name: "新建链路", pId: 0, type: "polyline", item: this }); return this.setTreeobj(v), this._tree.insertGroupId(v, 0), this }, R.prototype.createLinkPros = function (o) { this._lang = this._core.extend(this._lang, language._lang); this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); var r = [], n = null, t = "0米", i = null, a = this, s = "", l = this._core.CreateTooltip(), c = { point: a._cesium.Color.RED, polyline: a._cesium.Color.BLUE }, u = (this._tree.handler.setInputAction(function (e) { (i = a._getPosition.getMousePosition(e)) && (0 === r.length ? l.showAt(e.endPosition, a._lang.draw_tip_left) : l.showAt(e.endPosition, a._lang.draw_tip_right), 2 <= r.length && (a._cesium.defined(n) ? (r.length > a._points.length && r.pop(), r.push(i)) : n = new u(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 u(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: c.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) { this._lang = this._core.extend(this._lang, language._lang); var c = this, i = (e.prototype._init = function () { var e = this; this.options.polyline.positions = new c._cesium.CallbackProperty(function () { return e.positions }, !1), this.polyline = c._viewer.entities.add(this.options), c.item = this.polyline }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: new c._cesium.PolylineOutlineMaterialProperty({ color: c._core.defaultValue(t.color, c._cesium.Color.YELLOW) }), clampToGround: c._core.defaultValue(t.clampToGround, !0), width: c._core.defaultValue(t.width, 3) } }, this.positions = e, this._init() } var u = new c._cesium.ScreenSpaceEventHandler(c._viewer.scene.canvas), h = [], m = void 0, d = this._core.CreateTooltip(); return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), u.setInputAction(function (e) { e = c._getPosition.getMousePosition(e); 0 == h.length && h.push(e.clone()), h.push(e) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), u.setInputAction(function (e) { 0 === h.length ? d.showAt(e.endPosition, c._lang.draw_tip_left) : d.showAt(e.endPosition, c._lang.draw_tip_right); e = c._getPosition.getMousePosition(e); 2 <= h.length && (c._cesium.defined(m) ? null != e && (h.pop(), e.y += 1 + Math.random(), h.push(e)) : m = new i(h)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), u.setInputAction(function (e) { d.show(!1); var t = { polyline: {}, positions: [], positionsp: [], distance: [], setDistance: function () { alert("qq") } }; u.destroy(), t.polyline = m; for (var i = [], o = 0; o < h.length; o++) { var r = c._cesium.Cartographic.fromCartesian(h[o]), n = c._cesium.Math.toDegrees(r.longitude), a = c._cesium.Math.toDegrees(r.latitude), r = r.height; i.push({ lon: n, lat: a, hei: r }) } t.positions = i; for (var s = 1; s < h.length; s++)t.distance[s - 1] = Tr(h[s - 1].y, h[s - 1].x, h[s].y, h[s].x); t.positionsp = h, c._core.mouse(c._viewer.container, 0, "0"), "function" == typeof l && l(t) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, R.prototype.spaceDistance = R.prototype.executePolyline1 = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); let i; "object" != typeof t && "function" != typeof e || (i = e, e = t, t = i), i = null; this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); var o, r, n = [], a = null, s = "0米", l = null, c = this, u = "", h = this._core.CreateTooltip(), m = { name: "", spot: [], distance: [], label: [], ployline: [] }, d = { point: c._cesium.Color.RED, polyline: c._cesium.Color.YELLOW }; 0 < Object.keys(e).length && ("" != e.point && null != e.point && (d.point = e.point), "" != e.polyline && null != e.polyline && (d.polyline = e.polyline)); let p; this._tree.handler.setInputAction(function (e) { (l = c._getPosition.getMousePosition(e)) && (0 === n.length ? h.showAt(e.endPosition, c._lang.draw_tip_left) : h.showAt(e.endPosition, c._lang.draw_tip_right), 2 <= n.length && (c._cesium.defined(a) ? (n.length > c._points.length && n.pop(), n.push(l)) : a = new g(n), s = c._core.getSpaceDistance(n, c._cesium)), r && (c._viewer.entities.remove(r), r = void 0), r = c._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 } }), c._tree.temporaryItem.obj.push(r)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { c._viewer.camera.getPickRay(e.position), (l = c._getPosition.getMousePosition(e)) && (p = p || c._core.getPointToCameraDistance(c._viewer, l), 0 != n.length && n.length > c._points.length ? (n.pop(), n.push(l)) : n.push(l, l), 2 <= n.length && (c._cesium.defined(a) || (a = new g(n)), s = c._core.getSpaceDistance(n, c._cesium)), r && (c._viewer.entities.remove(r), r = void 0), u = "总长:" + (e = s), o = c._viewer.entities.add({ name: "空间直线距离", position: n[n.length - 1], point: { pixelSize: 5, color: d.point.withAlpha(.5), outlineColor: c._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 } }), c._tree.temporaryItem.obj.push(o), c._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) { c.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function (e) { h.show(!1), c._tree && c._tree.endtemporaryItem(), c.end = void 0, r && (c._viewer.entities.remove(r), r = void 0, n.pop()), c._points[c._points.length - 1] && (c._points[c._points.length - 1].label.text = u), c._tree && c._tree.handler.destroy(), c._core.mouse(c._viewer.container, 0, "0"), "cancel" === e ? c.deleteObject() : (n.length < 2 && c.deleteObject(), "" != t && null != t && "function" == typeof t && t(m)) }; f.prototype._init = function () { var e = this, t = (this.options.polyline.positions = new c._cesium.CallbackProperty(function () { return e.positions }, !1), c._viewer.entities.add(this.options)), t = (c.item = t, c._tree.temporaryItem.obj.push(t), m.ployline.push(t), c._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) { this._lang = this._core.extend(this._lang, language._lang); var i, o, u = 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, u = this, l = "", c = this._core.CreateTooltip(), h = { spot: [], distance: [], label: [], ployline: [] }, m = { point: u._cesium.Color.RED, polyline: u._cesium.Color.YELLOW }; 0 < Object.keys(e).length && ("" != e.point && null != e.point && (m.point = e.point), "" != e.polyline && null != e.polyline && (m.polyline = e.polyline)); let d; this._tree.handler.setInputAction(function (e) { (s = u._getPosition.getMousePosition(e)) && (0 === r.length ? c.showAt(e.endPosition, u._lang.draw_tip_left) : c.showAt(e.endPosition, u._lang.draw_tip_right), 2 <= r.length && (u._cesium.defined(n) ? (r.pop(), r.push(s)) : n = new g(r), a = u._core.getSpaceDistance(r, u._cesium)), u._viewer.entities.remove(o), o = u._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], label: { text: "总长:" + a, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * d), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), u._tree.temporaryItem.obj.push(o)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { u._viewer.camera.getPickRay(e.position), (s = u._getPosition.getMousePosition(e)) && (d = d || u._core.getPointToCameraDistance(u._viewer, s), p(s), 0 == r.length && r.push(s.clone()), r.push(s), l = "总长:" + (e = a), i = u._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], point: { pixelSize: 5, color: m.point.withAlpha(.5), outlineColor: u._cesium.Color.WHITE.withAlpha(.5), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * d), 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 * d), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), u._tree.temporaryItem.obj.push(i), u._points.push(i), h.spot.push(s), h.distance.push(a), h.label.push(i)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK); var p = function (e) { polylineCartographic.push(e); var t = []; if (1 < polylineCartographic.length) { var i = polylineCartographic[polylineCartographic.length - 2], o = polylineCartographic[polylineCartographic.length - 1], r = 1e7 * Math.abs(i.longitude - o.longitude), n = 1e7 * Math.abs(i.latitude - o.latitude), a = (n < r && (n = r), parseInt(n / 10)); (a = 1e3 < a ? 1e3 : a) < 2 && (a = 2); for (var s = 0; s < a; ++s)t.push(new u._cesium.Cartographic(u._cesium.Math.lerp(i.longitude, o.longitude, s / (a - 1)), u._cesium.Math.lerp(i.latitude, o.latitude, s / (a - 1)))) } else t = polylineCartographic; if (0 < t.length) for (var l = 0; l < t.length; l++) { var e = t[l], c = u._viewer.scene.globe.getHeight(e); u._cesium.Cartesian3.fromDegrees(e.longitude / Math.PI * 180, e.latitude / Math.PI * 180, c) } }, g = (this._tree.handler.setInputAction(function (e) { c.show(!1), u._tree.endtemporaryItem(), u._viewer.entities.remove(o), u._points[u._points.length - 1].label.text = l, u._tree.handler.destroy(), r.pop(), "" != t && null != t && "function" == typeof t && t(h) }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), 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)); u.item = t, u._tree.temporaryItem.obj.push(t), h.ployline.push(t) }, f); function f(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: m.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * d), width: 3, clampToGround: !1 } }, this.positions = e, this._init() } return this }, R.prototype.horizontalDistance = R.prototype.executeHorizontals = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); let i; "object" != typeof t && "function" != typeof e || (i = e, e = t, t = i), i = null, this._tree.removeHandler(), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.starttemporaryItem(this._viewer); var h, m = this, d = [], p = "", g = [], f = void 0, o = m._viewer.scene, l = o.globe.ellipsoid, _ = { name: "", spot: [], distance: [], label: [], polyline: [] }, C = { point: m._cesium.Color.RED, polyline: m._cesium.Color.YELLOW }, e = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (C.point = e.point), "" != e.polyline && null != e.polyline && (C.polyline = e.polyline)), new m._cesium.BillboardCollection), c = (o.primitives.add(e), new m._cesium.WebMercatorProjection), r = (this._tree.handler = new m._cesium.ScreenSpaceEventHandler(o.canvas), this._core.CreateTooltip()), y = []; let v; this._tree.handler.setInputAction(function (e) { 0 === d.length ? r.showAt(e.endPosition, m._lang.draw_tip_left) : r.showAt(e.endPosition, m._lang.draw_tip_right), (e = m._getPosition.getMousePosition(e, _.polyline.concat(_.label))) && m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) && (e = e, d.length < 1 || (m._cesium.defined(f) ? (f.path.pop(), f.path.push(e), y.pop(), y.push(e)) : f = new b(d, m._cesium), e = w(y), h && (m._viewer.entities.remove(h), h = void 0), h = m._viewer.entities.add({ name: "空间直线距离", position: f.path[f.path.length - 1], 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 * v), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }))) }, m._cesium.ScreenSpaceEventType.MOUSE_MOVE); this._tree.handler.setInputAction(function (e) { e = m._getPosition.getMousePosition(e, _.polyline.concat(_.label)); if (n = e ? m._cesium.Ellipsoid.WGS84.cartesianToCartographic(e) : n) { v = v || m._core.getPointToCameraDistance(m._viewer, e); 0 < y.length && y.pop(); var t = n, i = (g.push(t), []); if (1 < g.length) { var o = g[g.length - 2], r = g[g.length - 1], n = 1e7 * Math.abs(o.longitude - r.longitude), a = 1e7 * Math.abs(o.latitude - r.latitude), s = (a < n && (a = n), parseInt(a / 10)); (s = 1e3 < s ? 1e3 : s) < 2 && (s = 2); for (var l = 0; l < s; ++l)i.push(new m._cesium.Cartographic(m._cesium.Math.lerp(o.longitude, r.longitude, l / (s - 1)), m._cesium.Math.lerp(o.latitude, r.latitude, l / (s - 1)))); i.push(r.clone()) } else i = g; if (0 < i.length) for (var c = 0; c < i.length; c++) { var t = i[c], u = m._viewer.scene.globe.getHeight(t), u = m._cesium.Cartesian3.fromRadians(t.longitude, t.latitude, u); y.push(u) } 0 === d.length ? d.push(e, e) : d.push(e), m._cesium.defined(f) || (f = new b(d, m._cesium)), h && (m._viewer.entities.remove(h), h = void 0); n = "0米", a = (f && (n = w(y)), y.push(e), p = "总长:" + n, _.spot.push(e), _.distance.push(n), m._viewer.entities.add({ position: e, point: { pixelSize: 5, color: C.point.withAlpha(.5), outlineColor: m._cesium.Color.WHITE.withAlpha(.5), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * v), outlineWidth: 1, clampToGround: !0 }, label: { text: n, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * v), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } })); _.label.push(a), m._points.push(a) } }, m._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function () { m.end() }, m._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function (e) { m._tre && m._tree.endtemporaryItem(), h && m._viewer.entities.remove(h), m._points[m._points.length - 1] && (m._points[m._points.length - 1].label.text = p), m._tree && m._tree.handler.destroy(), m.end = void 0, m._core.mouse(m._viewer.container, 0, "0"), d.pop(), r.show(!1), "cancel" === e ? m.deleteObject() : (d.length < 2 && m.deleteObject(), "" != t && null != t && "function" == typeof t && t(_)) }; var w = function (e) { for (var t, i, o, r, n = 0, a = 0 + m._lang.unit_m, s = 0; s < e.length - 1; s++)o = l.cartesianToCartographic(e[s]), t = (r = c.project(o)).x, i = r.y, o = l.cartesianToCartographic(e[s + 1]), o = (r = c.project(o)).x, r = r.y, n += Math.sqrt((t - o) * (t - o) + (i - r) * (i - r)); return 0 < n && (a = n.toFixed(2) + m._lang.unit_m), a = 1 <= n / 1e3 ? (n / 1e3).toFixed(2) + m._lang.unit_km : a }, b = (n.prototype._init = function (e) { var t = this, i = (this.options.polyline.positions = new m._cesium.CallbackProperty(function () { return t.path }, !1), this.lineEntity = m._viewer.entities.add(this.options), m.item = this.lineEntity, _.polyline.push(this.lineEntity), m._core.getuid()); _.name = "新建水平距离" + i }, n); function n(e, t) { if (!m._cesium.defined(e)) throw new m._cesium.DeveloperError("positions is required!"); if (e.length < 2) throw new m._cesium.DeveloperError("positions 的长度必须大于等于2"); m._cesium.Material.fromType(m._cesium.Material.ColorType).uniforms.color = new m._cesium.Color(1, 1, 0, .5), this.options = { name: "直线", polyline: { show: !0, positions: [], material: C.polyline, width: 3, clampToGround: !0 } }, this.path = e, this._init(m._cesium) } return this }, R.prototype.getHeight = function (e) { var t = this._cesium.Cartographic.fromCartesian(e[0]), e = this._cesium.Cartographic.fromCartesian(e[1]).height - t.height; return e = e < 1e3 ? e.toFixed(2) + this._lang.unit_m : (e /= 1e3).toFixed(2) + this._lang.unit_km }, R.prototype.executeHeight = function (t) { this._lang = this._core.extend(this._lang, language._lang); var r = this, n = (this._tree.starttemporaryItem(this._viewer), this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), i = null, a = 0, o = this._core.CreateTooltip(), s = null; let l; this._tree.handler.setInputAction(function (e) { (s = r._getPosition.getMousePosition(e)) && (0 === n.length ? o.showAt(e.endPosition, r._lang.draw_tip_left) : o.showAt(e.endPosition, r._lang.draw_tip_right), 2 <= n.length && (r._cesium.defined(i) ? (n.pop(), n.push(s)) : i = new c(n), 1 < n.lenght && (a = r._core.getHeight(n, r._cesium)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { (s = r._getPosition.getMousePosition(e)) && (l = l || r._core.getPointToCameraDistance(r._viewer, s), e = a + "米", 0 == n.length ? (n.push(s.clone()), n.push(s), e = r._viewer.entities.add({ name: "高度", position: n[0], point: { pixelSize: 5, color: r._cesium.Color.RED.withAlpha(.5), outlineColor: r._cesium.Color.WHITE.withAlpha(.5), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * l), outlineWidth: 2, clampToGround: !0, heightReference: r._cesium.HeightReference.none }, label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * l), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(e), r._points.push(e)) : 1 <= n.length && (r._tree.endtemporaryItem(), "" != t && null != t && "function" == typeof t && t(n))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { r._tree.handler.destroy(); var t = a + "米", i = r._cesium.Cartographic.fromCartesian(n[0]), o = r._cesium.Cartographic.fromCartesian(n[1]), i = r._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(i.longitude), r._cesium.Math.toDegrees(i.latitude), o.height), o = r._viewer.entities.add({ name: "直线距离", position: i, point: { pixelSize: 5, color: r._cesium.Color.RED.withAlpha(.5), outlineColor: r._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, clampToGround: !0, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * l), heightReference: r._cesium.HeightReference.none }, label: { text: t, font: "16px 宋体", distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * l), fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); r._tree.temporaryItem.obj.push(o), r._points.push(o) }, this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); e.prototype._init3 = function () { var o = this, e = (this.options.polyline.positions = new r._cesium.CallbackProperty(function () { var e = [], t = (e.push(o.positions[0]), r._cesium.Cartographic.fromCartesian(o.positions[0])); try { var i = r._cesium.Cartographic.fromCartesian(o.positions[1]) } catch (e) { return } t = r._cesium.Cartesian3.fromDegrees(r._cesium.Math.toDegrees(t.longitude), r._cesium.Math.toDegrees(t.latitude), i.height); return e.push(t), e }, !1), r._viewer.entities.add(this.options)); r.item = e, r._tree.temporaryItem.obj.push(e) }; var c = e; function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: r._cesium.Color.YELLOW, clampToGround: !0, width: 3 }, ellipse: { show: !1, material: r._cesium.Color.GREEN.withAlpha(.5), clampToGround: !0, outline: !0 } }, this.positions = e, this._init3() } return this }, R.prototype.verticalHeight = R.prototype.executeHeightTe = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); let i; "object" != typeof t && "function" != typeof e || (i = e, e = t, t = i), i = null; var r, o = { point: Cesium.Color.RED, polyline: Cesium.Color.YELLOW }, n = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (o.point = e.point), "" != e.polyline && null != e.polyline && (o.polyline = e.polyline)), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), a = null, s = null, l = this, c = { name: "", spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [] }, u = this._core.CreateTooltip(); let h; function m(e) { var t, i, o = l._cesium.Cartographic.fromCartesian(e[0]), r = l._cesium.Cartographic.fromCartesian(e[1]); return r.height, r.height, o.height, r = 0 < r.height - o.height ? (t = l._cesium.Cartesian3.fromDegrees(l._cesium.Math.toDegrees(o.longitude), l._cesium.Math.toDegrees(o.latitude), r.height), i = [e[1], t], [e[0], t]) : (t = l._cesium.Cartesian3.fromDegrees(l._cesium.Math.toDegrees(r.longitude), l._cesium.Math.toDegrees(r.latitude), o.height), i = [e[0], t], [e[1], t]), { new: t, eq_height: i, eq_lon_lat: r } } this._tree.handler.setInputAction(function (e) { 0 === n.length ? u.showAt(e.endPosition, l._lang.draw_tip_left) : u.showAt(e.endPosition, "右键结束!"), (s = l._getPosition.getMousePosition(e, c.polyline.concat(c.point))) && 2 <= n.length && (l._cesium.defined(a) ? (n.pop(), n.push(s.clone()), r = m(n)) : (a = new d(n), e = l._viewer.entities.add({ name: "高度测量", position: new l._cesium.CallbackProperty(function () { return n[1] }, !1), point: { pixelSize: 5, color: o.point.withAlpha(.5), outlineColor: l._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), heightReference: l._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l._tree.temporaryItem.obj.push(e), c.point.push(e), l._points.push(e), r = m(n), e = l._viewer.entities.add({ position: new l._cesium.CallbackProperty(function () { return l._cesium.Cartesian3.midpoint(r.eq_lon_lat[0], r.eq_lon_lat[1], new l._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new l._cesium.CallbackProperty(function () { return r.eq_lon_lat }, !1), material: o.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), width: 2 }, label: { text: new l._cesium.CallbackProperty(function () { var e = l.getHeight(r.eq_lon_lat), t = l._lang.unit_m, i = e; i = -1 !== e.indexOf("千米") ? (t = l._lang.unit_km, e.replace("千米", "")) : e.replace("米", ""); e = (i = parseFloat(i)) < 0 ? (i = Math.abs(i)) + t : i + t; return c.gddistance = e = "高度:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c.polyline.push(e), l._polylines.push(e), e = l._viewer.entities.add({ position: new l._cesium.CallbackProperty(function () { return l._cesium.Cartesian3.midpoint(r.eq_height[0], r.eq_height[1], new l._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new l._cesium.CallbackProperty(function () { return r.eq_height }, !1), material: o.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), width: 2 }, label: { text: new l._cesium.CallbackProperty(function () { var e = l._core.getHorizontalDistance(r.eq_height, l._cesium); return c.spdistance = "水平距离:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c.polyline.push(e), l._polylines.push(e))) }, l._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { (s = l._getPosition.getMousePosition(e, c.polyline.concat(c.point))) && (h = h || l._core.getPointToCameraDistance(l._viewer, s), 0 == n.length ? (n.push(s.clone()), n.push(s.clone()), r = m(n), e = l._viewer.entities.add({ name: "高度测量", position: n[0], point: { pixelSize: 5, color: o.point.withAlpha(.5), outlineColor: l._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), heightReference: l._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l._tree.temporaryItem.obj.push(e), c.point.push(e), l._points.push(e)) : 2 <= n.length && (l._cesium.defined(a) ? (n.pop(), n.push(s.clone()), r = m(n)) : (a = new d(n), e = l._viewer.entities.add({ name: "高度测量", position: new l._cesium.CallbackProperty(function () { return n[1] }, !1), point: { pixelSize: 5, color: o.point.withAlpha(.5), outlineColor: l._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), heightReference: l._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l._tree.temporaryItem.obj.push(e), c.point.push(e), l._points.push(e), r = m(n), e = l._viewer.entities.add({ position: new l._cesium.CallbackProperty(function () { return l._cesium.Cartesian3.midpoint(r.eq_lon_lat[0], r.eq_lon_lat[1], new l._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new l._cesium.CallbackProperty(function () { return r.eq_lon_lat }, !1), material: o.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), width: 2 }, label: { text: new l._cesium.CallbackProperty(function () { var e = l.getHeight(r.eq_lon_lat), t = l._lang.unit_m, i = e; i = -1 !== e.indexOf("千米") ? (t = l._lang.unit_km, e.replace("千米", "")) : e.replace("米", ""); e = (i = parseFloat(i)) < 0 ? (i = Math.abs(i)) + t : i + t; return c.gddistance = e = "高度:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c.polyline.push(e), l._polylines.push(e), e = l._viewer.entities.add({ position: new l._cesium.CallbackProperty(function () { return l._cesium.Cartesian3.midpoint(r.eq_height[0], r.eq_height[1], new l._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new l._cesium.CallbackProperty(function () { return r.eq_height }, !1), material: o.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), width: 2 }, label: { text: new l._cesium.CallbackProperty(function () { var e = l._core.getHorizontalDistance(r.eq_height, l._cesium); return c.spdistance = "水平距离:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), c.polyline.push(e), l._polylines.push(e)))) }, l._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { l.end() }, l._cesium.ScreenSpaceEventType.RIGHT_CLICK), this._tree.handler.setInputAction(function (e) { l.end() }, l._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.end = function (e) { l._tree.handler.destroy(), u.show(!1), l.end = void 0, l._tree.endtemporaryItem(), l._core.mouse(l._viewer.container, 0, "0"), "cancel" === e ? l.deleteObject() : "" != t && null != t && "function" == typeof t && t(c) }; p.prototype._init = function () { var o = this, e = (this.options.polyline.positions = new l._cesium.CallbackProperty(function () { return o.positions }, !1), this.options.position = new l._cesium.CallbackProperty(function () { return l._cesium.Cartesian3.midpoint(r.eq_height[0], r.eq_height[1], new l._cesium.Cartesian3) }, !1), this.options.label.text = new l._cesium.CallbackProperty(function () { i = o.positions, e = l._cesium.Cartographic.fromCartesian(i[0]), i = l._cesium.Cartographic.fromCartesian(i[1]), (t = new l._cesium.EllipsoidGeodesic).setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e.height, 2))) ? (t / 1e3).toFixed(2) + l._lang.unit_km : t.toFixed(2) + l._lang.unit_m; return c.kjdistance = "空间距离:" + i }, !1), l._viewer.entities.add(this.options)), e = (l.item = e, l._tree.temporaryItem.obj.push(e), c.polyline.push(e), l._core.getuid()); c.name = "新建垂直高度" + e }; var d = p; function p(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: o.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * h), pixelOffset: new Cesium.Cartesian2(20, 20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, R.prototype.executeHeightTe1 = function (t) { this._lang = this._core.extend(this._lang, language._lang), this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); var i = [], o = null, r = null, n = null, a = null, s = this, l = { spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [] }, c = this._core.CreateTooltip(); function u(e) { var t = s._cesium.Cartographic.fromCartesian(e[0]), e = s._cesium.Cartographic.fromCartesian(e[1]); e.height, e.height, t.height, s._cesium.Cartesian3.fromDegrees(s._cesium.Math.toDegrees(t.longitude), s._cesium.Math.toDegrees(t.latitude), e.height) } this._tree.handler.setInputAction(function (e) { 0 === i.length ? c.showAt(e.endPosition, s._lang.draw_tip_left) : c.showAt(e.endPosition, s._lang.draw_tip_right), (a = s._getPosition.getMousePosition(e)) && 2 <= i.length && (s._cesium.defined(o) ? (i.pop(), i.push(a.clone()), u(i)) : o = new h(i), s._cesium.define(r) || (r = new m(i)), s._cesium.define(n) || (n = new p(i))) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { 0 == i.length && (a = s._getPosition.getMousePosition(e)) && (i.push(a.clone()), i.push(a.clone()), u(i), e = s._viewer.entities.add({ name: "高度测量", position: i[0], point: { pixelSize: 5, color: s._cesium.Color.RED.withAlpha(.5), outlineColor: s._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: s._cesium.HeightReference.none } }), s._tree.temporaryItem.obj.push(e), l.point.push(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { s._tree.handler.destroy(), c.show(!1), s._tree.endtemporaryItem(), "" != t && null != t && "function" == typeof t && t(l) }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK); e.prototype._init = function () { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function () { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function () { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function () { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium.Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic).setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e.height, 2))) ? (t / 1e3).toFixed(2) + s._lang.unit_km : t.toFixed(2) + s._lang.unit_m; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var h = e; function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } d.prototype._init = function () { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function () { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function () { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function () { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium.Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic).setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e.height, 2))) ? (t / 1e3).toFixed(2) + s._lang.unit_km : t.toFixed(2) + s._lang.unit_m; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var m = d; function d(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } g.prototype._init = function () { var o = this, e = (this.options.polyline.positions = new s._cesium.CallbackProperty(function () { return o.positions }, !1), this.options.position = new s._cesium.CallbackProperty(function () { return o.positions[1].clone() }, !1), this.options.label.text = new s._cesium.CallbackProperty(function () { i = o.positions, e = s._cesium.Cartographic.fromCartesian(i[0]), i = s._cesium.Cartographic.fromCartesian(i[1]), (t = new s._cesium.EllipsoidGeodesic).setEndPoints(e, i), t = t.surfaceDistance; var e, t, i = t = 1e3 <= (t = Math.sqrt(Math.pow(t, 2) + Math.pow(i.height - e.height, 2))) ? (t / 1e3).toFixed(2) + s._lang.unit_km : t.toFixed(2) + s._lang.unit_m; return l.kjdistance = "空间距离:" + i }, !1), s._viewer.entities.add(this.options)); s._tree.temporaryItem.obj.push(e), l.polyline.push(e) }; var p = g; function g(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, R.prototype.measureAngle = R.prototype.executeAngle = function (t, e) { this._lang = this._core.extend(this._lang, language._lang); let i; "object" != typeof t && "function" != typeof e || (i = e, e = t, t = i), i = null; var o, r, n, a, s = { point: Cesium.Color.RED, polyline: Cesium.Color.YELLOW }, l = (0 < Object.keys(e).length && ("" != e.point && null != e.point && (s.point = e.point), "" != e.polyline && null != e.polyline && (s.polyline = e.polyline)), this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), c = null, u = null, h = this, m = { name: "", spot: [], kjdistance: "", spdistance: "", gddistance: "", point: [], polyline: [], labels: [] }, d = this._core.CreateTooltip(); let p; function g(e) { var t, i, o = h._cesium.Cartographic.fromCartesian(e[0]), r = h._cesium.Cartographic.fromCartesian(e[1]); return r.height, r.height, o.height, r = 0 < r.height - o.height ? (t = h._cesium.Cartesian3.fromDegrees(h._cesium.Math.toDegrees(o.longitude), h._cesium.Math.toDegrees(o.latitude), r.height), i = [e[1], t], [e[0], t]) : (t = h._cesium.Cartesian3.fromDegrees(h._cesium.Math.toDegrees(r.longitude), h._cesium.Math.toDegrees(r.latitude), o.height), i = [e[0], t], [e[1], t]), { new: t, eq_height: i, eq_lon_lat: r } } this._tree.handler.setInputAction(function (e) { var t, i; 0 === l.length ? d.showAt(e.endPosition, h._lang.draw_tip_left) : d.showAt(e.endPosition, "右键结束!"), (u = h._getPosition.getMousePosition(e, m.polyline.concat(m.point))) && 2 <= l.length && (e = h._core.ElevationAngle(n, u, h._cesium), i = t = "", i = n.z <= u.z ? (t = "角度:" + (90 - Math.abs(e)).toFixed(2), "角度:" + Math.abs(e).toFixed(2)) : (t = "角度:" + Math.abs(e).toFixed(2), "角度:" + (90 - Math.abs(e)).toFixed(2)), r.label.text = t, h._cesium.defined(c) ? (a.position.setValue(u), a.label.text = i) : (a = h._viewer.entities.add({ position: u, name: "等经纬度", label: { text: i, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), m.labels.push(a), h._points.push(a)), h._cesium.defined(c) ? (l.pop(), l.push(u.clone()), o = g(l)) : (c = new f(l), e = h._viewer.entities.add({ name: "角度测量", position: new h._cesium.CallbackProperty(function () { return l[1] }, !1), point: { pixelSize: 5, color: s.point.withAlpha(.5), outlineColor: h._cesium.Color.WHITE.withAlpha(.5), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), outlineWidth: 2, heightReference: h._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h._tree.temporaryItem.obj.push(e), m.point.push(e), h._points.push(e), o = g(l), t = h._viewer.entities.add({ position: new h._cesium.CallbackProperty(function () { return l[0] }, !1), name: "等经纬度", polyline: { show: !0, positions: new h._cesium.CallbackProperty(function () { return o.eq_lon_lat }, !1), material: s.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), width: 2 } }), m.polyline.push(t), h._polylines.push(t), i = h._viewer.entities.add({ position: new h._cesium.CallbackProperty(function () { return l[1] }, !1), name: "等高度直线", polyline: { show: !0, positions: new h._cesium.CallbackProperty(function () { return o.eq_height }, !1), material: s.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), width: 2 } }), m.polyline.push(i), h._polylines.push(i))) }, h._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { var t; (u = h._getPosition.getMousePosition(e, m.polyline.concat(m.point))) && (p = p || h._core.getPointToCameraDistance(h._viewer, u), 0 == l.length ? (n = u, r = h._viewer.entities.add({ position: u, name: "等经纬度", label: { text: "0", 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 } }), m.labels.push(r), t = h._viewer.entities.add({ position: new h._cesium.CallbackProperty(function () { return h._cesium.Cartesian3.midpoint(o.eq_lon_lat[0], o.eq_lon_lat[1], new h._cesium.Cartesian3) }, !1), label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), l.push(u.clone()), l.push(u.clone()), o = g(l), e = h._viewer.entities.add({ name: "高度测量", position: l[0], point: { pixelSize: 5, color: s.point.withAlpha(.5), outlineColor: h._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: h._cesium.HeightReference.none, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h._tree.temporaryItem.obj.push(e), m.point.push(e), h._points.push(r, e)) : 2 <= l.length && (h._cesium.defined(c) ? (l.pop(), l.push(u.clone()), o = g(l)) : (c = new f(l), e = h._viewer.entities.add({ name: "高度测量", position: new h._cesium.CallbackProperty(function () { return l[1] }, !1), point: { pixelSize: 5, color: s.point.withAlpha(.5), outlineColor: h._cesium.Color.WHITE.withAlpha(.5), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), outlineWidth: 2, heightReference: h._cesium.HeightReference.none, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), h._tree.temporaryItem.obj.push(e), m.point.push(e), h._points.push(e), o = g(l), t = h._viewer.entities.add({ position: new h._cesium.CallbackProperty(function () { return h._cesium.Cartesian3.midpoint(o.eq_lon_lat[0], o.eq_lon_lat[1], new h._cesium.Cartesian3) }, !1), name: "等经纬度", polyline: { show: !0, positions: new h._cesium.CallbackProperty(function () { return o.eq_lon_lat }, !1), material: s.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), width: 2 }, label: { text: new h._cesium.CallbackProperty(function () { var e = h.getHeight(o.eq_lon_lat), t = h._lang.unit_m, i = e; i = -1 !== e.indexOf("千米") ? (t = h._lang.unit_km, e.replace("千米", "")) : e.replace("米", ""); e = (i = parseFloat(i)) < 0 ? (i = Math.abs(i)) + t : i + t; return m.gddistance = e = "高度:" + e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), m.polyline.push(t), h._polylines.push(t), e = h._viewer.entities.add({ position: new h._cesium.CallbackProperty(function () { return h._cesium.Cartesian3.midpoint(o.eq_height[0], o.eq_height[1], new h._cesium.Cartesian3) }, !1), name: "等高度直线", polyline: { show: !0, positions: new h._cesium.CallbackProperty(function () { return o.eq_height }, !1), material: s.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), width: 2 }, label: { text: new h._cesium.CallbackProperty(function () { var e = "角度:" + (e = h._core.ElevationAngle(firtP, u, h._cesium)).toFixed(2); return m.spdistance = e }, !1), font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(60, -20), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), m.polyline.push(e), h._polylines.push(e)))) }, h._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { h.end() }, h._cesium.ScreenSpaceEventType.RIGHT_CLICK), this._tree.handler.setInputAction(function (e) { h.end() }, h._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), this.end = function (e) { h._tree.handler.destroy(), d.show(!1), h._tree.endtemporaryItem(), h.end = void 0, h._core.mouse(h._viewer.container, 0, "0"), "cancel" === e ? h.deleteObject() : "" != t && null != t && "function" == typeof t && (this.labels = m.labels, t(m)) }; _.prototype._init = function () { var e = this, t = (this.options.polyline.positions = new h._cesium.CallbackProperty(function () { return e.positions }, !1), this.options.position = new h._cesium.CallbackProperty(function () { return h._cesium.Cartesian3.midpoint(e.positions[0], e.positions[1], new h._cesium.Cartesian3) }, !1), h._viewer.entities.add(this.options)), t = (h.item = t, h._tree.temporaryItem.obj.push(t), m.polyline.push(t), h._core.getuid()); m.name = "新建垂直高度" + t }; var f = _; function _(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: s.polyline, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * p), pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } return this }, R.prototype.executeHeightDg = function (e) { this._tree.removeHandler(); var r, n = this, a = (this._tree.handler = new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas), []), t = null, i = null, o = (this._tree.handler.setInputAction(function (e) { (i = n._getPosition.getMousePosition(e)) && 2 <= a.length && (n._cesium.defined(t) ? (a.pop(), a.push(i.clone()), r = point_conf(a)) : t = new o(a)) }, n._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { 0 == a.length && (i = n._getPosition.getMousePosition(e)) && (a.push(i.clone()), a.push(i.clone()), n._viewer.entities.add({ parent: measure_entities, name: "多边形面积", position: a[0], point: { pixelSize: 5, color: n._cesium.Color.RED.withAlpha(.5), outlineColor: n._cesium.Color.WHITE.withAlpha(.5), outlineWidth: 2, heightReference: n._cesium.HeightReference.none } })) }, n._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { n._tree.handler.destroy(); var t = [], i = [], o = (t.push(a[0].clone()), t.push(r.clone()), n.getHeight(t)); n._viewer.entities.add({ parent: measure_entities, name: "等经纬度", position: t[0].clone(), polyline: { show: !0, clampToGround: !0, positions: t, material: new n._cesium.PolylineDashMaterialProperty({ color: n._cesium.Color.RED }), width: 2 }, label: { text: o, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), i.push(r.clone()), i.push(a[1].clone()), o = getDistance(i) + n._lang.unit_km, n._viewer.entities.add({ parent: measure_entities, name: "等高度直线", position: i[0].clone(), polyline: { show: !0, positions: i, clampToGround: !0, material: new n._cesium.PolylineDashMaterialProperty({ color: n._cesium.Color.RED }), width: 2 }, label: { text: o, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(60, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) }, n._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), s.prototype._init = function () { var e = this; this.options.polyline.positions = new n._cesium.CallbackProperty(function () { return e.positions }, !1), this.options.position = new n._cesium.CallbackProperty(function () { return e.positions[1].clone() }, !1), this.options.label.text = new n._cesium.CallbackProperty(function () { return getSpaceDistance(e.positions) }, !1), n._viewer.entities.add(this.options) }, s); function s(e) { this.options = { parent: measure_entities, name: "直线", polyline: { show: !0, positions: [], clampToGround: !0, material: n._cesium.Color.GOLD, width: 2 }, label: { font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -40), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }, this.positions = e, this._init() } }, R.prototype.executeAnge = function (t) { var i, o = this, r = (this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), n = null, a = "", s = null, l = 0, c = { spot: [], distance: 0, label: {}, angle: 0 }, u = (this._tree.handler.setInputAction(function (e) { o._viewer.camera.getPickRay(e.endPosition), (s = o._getPosition.getMousePosition(e)) && (2 <= r.length && (o._cesium.defined(n) ? (r.pop(), r.push(s)) : n = new h(r), a = o._core.getSpaceDistance(r, o._cesium)), e = a, o._viewer.entities.remove(i), 1 < r.length && (l = (180 * Math.atan2(r[1].y - r[0].y, r[1].x - r[0].x) / Math.PI).toFixed(0), i = o._viewer.entities.add({ name: "空间直线距离", position: r[r.length - 1], label: { text: e + ";" + l + "度", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }))) }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), h = (this._tree.handler.setInputAction(function (e) { 0 < u && (o._tree.handler.destroy(), r.pop()), o._viewer.camera.getPickRay(e.position), (s = o._getPosition.getMousePosition(e)) && (0 == r.length && r.push(s.clone()), r.push(s), c.spot.push(s), c.distance = a, c.label = i, o._points.push(i), c.angle = l, 1 == u && "" != t && null != t && "function" == typeof t && t(c), u += 1) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), e.prototype._init6 = function () { var e = this, t = (this.options.polyline.positions = new o._cesium.CallbackProperty(function () { return e.positions }, !1), o._viewer.entities.add(this.options)); o.item = t }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: o._cesium.Color.YELLOW, width: 3, clampToGround: !0 } }, this.positions = e, this._init6() } return this }, R.prototype.executeProfile = function (e, i) { this._lang = this._core.extend(this._lang, language._lang); var o, r = this, n = (this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), a = [], s = null, l = e.parameterd, c = e.objid, u = e.cyjj, a = [], h = 0, m = this._core.CreateTooltip(), d = null, p = { spot: [], min: 0, max: 0, distance: 0, label: {}, cys: 0, gcs: [] }, g = (this._tree.handler.setInputAction(function (e) { 0 === n.length ? m.showAt(e.endPosition, r._lang.draw_tip_left) : m.showAt(e.endPosition, "再次点击结束绘制!"); var t = r._viewer.camera.getPickRay(e.endPosition); d = r._viewer.scene.globe.pick(t, r._viewer.scene), r._viewer.scene.pick(e.endPosition) && (t = r._viewer.scene.pickPosition(e.endPosition)) && (d = t), d && (2 <= n.length && (r._cesium.defined(s) ? (n.pop(), n.push(d)) : s = new f(n), h = r._core.getSpaceDistance(n, r._cesium)), e = h, r._viewer.entities.remove(o), 1 < n.length && ((180 * Math.atan2(n[1].y - n[0].y, n[1].x - n[0].x) / Math.PI).toFixed(0), o = r._viewer.entities.add({ name: "空间直线距离", position: n[n.length - 1], label: { text: e, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), r._tree.temporaryItem.obj.push(o), r._points.push(o))) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), f = (this._tree.handler.setInputAction(function (e) { 0 < g && (r._tree.handler.destroy(), n.pop(), m.show(!1)); var t = r._viewer.camera.getPickRay(e.position); d = r._viewer.scene.globe.pick(t, r._viewer.scene), r._viewer.scene.pick(e.position) && (t = r._viewer.scene.pickPosition(e.position)) && (d = t), d && (0 == n.length && n.push(d.clone()), a.push(d), n.push(d), p.spot.push(d), p.label = o, 1 == g ? (r._tree.endtemporaryItem(), r._core.getPmfx(a, l, u, r._cesium, r._viewer, function (e) { p.distance = e.juli, p.gcs = e.gcs, p.gcs = e.gcs, p.cys = e.cys, p.max = e.max, p.min = e.min, p.obj = r, m.show(!1), "" != i && null != i && "function" == typeof i && i(p) })) : (e.position.x, e.position.y), g += 1) }, r._cesium.ScreenSpaceEventType.LEFT_CLICK), t.prototype._init10 = function () { var e = this, t = (this.options.polyline.positions = new r._cesium.CallbackProperty(function () { return e.positions }, !1), r._viewer.entities.add(this.options)), t = (r.item = t, r._tree.temporaryItem.obj.push(t), r._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || V.selectedItem.id, r._core.getuid()), t = { id: t, name: "新建剖面分析" + t, pId: r._core.isnull(c) ? 0 : c, type: "polyline", item: r }; r.setTreeobj(t), V.insertGroupId(t, r._core.isnull(c) ? 0 : c) }, t); function t(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: r._cesium.Color.YELLOW, width: 2, clampToGround: !0 } }, this.positions = e, this._init10() } return this }, R.prototype.executeProfilePro = function (e, t) { var i = this, o = (this._tree.removeHandler(), this._tree.starttemporaryItem(this._viewer), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), r = null, n = e.parameterd, a = e.objid, s = e.cyjj, l = this._core.CreateTooltip(), c = null, u = { spot: [], min: 0, max: 0, distance: 0, label: {}, cys: 0, gcs: [] }, h = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this._tree.handler.setInputAction(function (e) { 3 <= o.length ? l.showAt(e.endPosition, "右键结束绘制") : l.showAt(e.endPosition, "点击绘制剖面点"); var t = i._viewer.camera.getPickRay(e.endPosition); c = i._viewer.scene.globe.pick(t, i._viewer.scene), i._viewer.scene.pick(e.endPosition) && (t = i._viewer.scene.pickPosition(e.endPosition)) && (c = t), c && 2 <= o.length && (i._cesium.defined(r) ? (o.pop(), o.push(c)) : r = new h(o)) }, i._cesium.ScreenSpaceEventType.MOUSE_MOVE), this._tree.handler.setInputAction(function (e) { i.end() }, i._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function (e) { i._tree.handler.destroy(), i._core.mouse(i._viewer.container, 0), i._tree.endtemporaryItem(), "pc" == i._core.getBrowser().pc && o.pop(), l.show(!1), i.end = void 0, "cancel" === e ? i.item && i._viewer.entities.remove(i.item) : o.length <= 1 ? window.layuiLayer && window.layuiLayer.msg("剖面点小于两点,请重新绘制") : (u.spot = o, i._core.getPmfxPro(o, n, s, i._cesium, i._viewer, function (e) { u.distance = e.juli, u.gcs = e.gcs, u.cys = e.cys, u.max = e.max, u.min = e.min, u.allPoint = e.allPoint, "" != t && null != t && "function" == typeof t && t(u) })) }, this._tree.handler.setInputAction(function (e) { var t = i._viewer.camera.getPickRay(e.position); c = i._viewer.scene.globe.pick(t, i._viewer.scene), i._viewer.scene.pick(e.position) && (t = i._viewer.scene.pickPosition(e.position)) && (c = t), c && (0 === o.length && o.push(c.clone()), o.push(c), 2 < o.length && (i._cesium.defined(r) || (r = new h(o)))) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), m.prototype._init10 = function () { var e = this, t = (this.options.polyline.positions = new i._cesium.CallbackProperty(function () { return e.positions }, !1), i._viewer.entities.add(this.options)), t = (i.item = t, i._tree.temporaryItem.obj.push(t), i._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || V.selectedItem.id, i._core.getuid()), t = { id: t, name: "新建剖面分析" + t, pId: i._core.isnull(a) ? 0 : a, type: "polyline", item: i }; i.setTreeobj(t), V.insertGroupId(t, i._core.isnull(a) ? 0 : a) }, m); function m(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: i._cesium.Color.YELLOW, width: 2, clampToGround: !0 } }, this.positions = e, this._init10() } return this }, R.prototype.executeAngeSdcs = function (o) { this._lang = this._core.extend(this._lang, language._lang); var r, n = this, a = (this._tree.removeHandler(), this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), []), s = null, l = [], c = this._core.CreateTooltip(), u = "", h = null, m = 0, d = { spot: [], distance: 0, label: {}, angle: 0 }, p = (this._tree.handler.setInputAction(function (e) { var t, i; 0 === a.length ? c.showAt(e.endPosition, n._lang.draw_tip_left) : c.showAt(e.endPosition, "再次点击结束绘制!"), n._viewer.camera.getPickRay(e.endPosition), (h = n._getPosition.getMousePosition(e)) && 2 <= a.length && (n._cesium.defined(s) ? (a.pop(), a.push(h)) : s = new g(a), u = n._core.getSpaceDistance(a, n._cesium), 2 <= p && (n._viewer.entities.remove(r), e = n._cesium.Cartographic.fromCartesian(a[a.length - 1]), t = n._cesium.Math.toDegrees(e.longitude), i = n._cesium.Math.toDegrees(e.latitude), e = e.height, l[2] = { lon: t, lat: i, hei: e }, m = n._core.Angle(l[0], l[1], l[2]).toFixed(1), r = n._viewer.entities.add({ name: "三点角度测量", position: a[a.length - 1], label: { text: m + "度", font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._points.push(r))) }, n._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), g = (this._tree.handler.setInputAction(function (e) { var t, i; 1 < p && (n._tree.handler.destroy(), a.pop()), n._viewer.camera.getPickRay(e.position), (h = n._getPosition.getMousePosition(e)) && (0 == a.length && a.push(h.clone()), a.push(h), e = n._cesium.Cartographic.fromCartesian(a[a.length - 1]), t = n._cesium.Math.toDegrees(e.longitude), i = n._cesium.Math.toDegrees(e.latitude), e = e.height, l.push({ lon: t, lat: i, hei: e }), d.spot.push(h), d.distance = u, 2 == p && (c.show(!1), d.label = r, d.angle = m, "" != o && null != o && "function" == typeof o && o(d)), p += 1) }, n._cesium.ScreenSpaceEventType.LEFT_CLICK), e.prototype._init6 = function () { var e = this, t = (this.options.polyline.positions = new n._cesium.CallbackProperty(function () { return e.positions }, !1), n._viewer.entities.add(this.options)); n.item = t }, e); function e(e) { this.options = { name: "直线", polyline: { show: !0, positions: [], material: n._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positions = e, this._init6() } return this }, R.prototype.executeAngeSd = function (o) { this._lang = this._core.extend(this._lang, language._lang), this._tree.removeHandler(); var r = [], n = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), this), a = [], s = void 0, l = [], c = [], u = (this._tree.starttemporaryItem(this._viewer), this._core.CreateTooltip()), h = (e.prototype._init = function () { var e = this; this.options.polyline.positions = new n._cesium.CallbackProperty(function () { return e.positionsp }, !1), this.polyline = n._viewer.entities.add(this.options), n._tree.temporaryItem.obj.push(this.polyline), n.item = this.polyline }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: n._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positionsp = e, this._init() } this._tree.handler = new n._cesium.ScreenSpaceEventHandler(n._viewer.scene.canvas); var m = [], d = void 0; if (0 < this._points.length) for (var t = 0; t < this._points.length; t++)this._viewer.entities.remove(this._points[t]); return this._tree.handler.setInputAction(function (e) { var t, i, e = n._getPosition.getMousePosition(e); e && (l.push(e), n._cesium.Cartographic.fromCartesian(e), 0 == m.length ? (m.push(e.clone()), m.push(e.clone()), s = e.clone()) : (e = n._core.ElevationAngle(s, e, n._cesium), 1 == r.length ? c.push("俯仰角1 " + e.toFixed(2)) : c.push("俯仰角2 " + e.toFixed(2)), d = void 0, (m = []).push(s.clone()), m.push(s.clone()), d = new h(m), r.push(d.polyline)), 2 <= c.length && (u.show(!1), e = n._core.ThreePointAzimuth(l[0], l[1], l[2], n._cesium), c.push("水平角 " + e.toFixed(2)), e = n._viewer.entities.add({ name: "三点角度测量", position: l[1], label: { text: c[0], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(e), t = n._viewer.entities.add({ name: "三点角度测量", position: l[2], label: { text: c[1], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(t), i = n._viewer.entities.add({ name: "三点角度测量", position: l[0], label: { text: c[2], font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, pixelOffset: new Cesium.Cartesian2(20, -20), showBackground: !0, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), n._tree.temporaryItem.obj.push(i), a.push(e), a.push(t), a.push(i), m.pop(), n._tree.handler.destroy(), n._core.mouse(n._viewer.container, 0, "0"), n._tree.endtemporaryItem(), n._points = a, n._polylines = r, n._polylines1 = r, "" != o && null != o && "function" == typeof o && o({ polylines: r, labels: a, angles: c }))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { var t = n._getPosition.getMousePosition(e); t && (0 === m.length ? u.showAt(e.endPosition, n._lang.draw_tip_left) : m.length <= 3 ? u.showAt(e.endPosition, "点击绘制目标点!") : u.showAt(e.endPosition, "再次点击结束绘制!"), 2 <= m.length && (n._cesium.defined(d) ? null != t && (m.pop(), t.y += 1 + Math.random(), m.push(t)) : (d = new h(m), r.push(d.polyline)))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, R.prototype.deleteObject = function () { if (this.item && this.item.item ? this._viewer.entities.remove(this.item.item) : this._viewer.entities.remove(this.item), this._points && 0 < this._points.length) { for (var e = 0; e < this._points.length; e++)this._viewer.entities.remove(this._points[e]); this._points = [] } if (this._polylines && 0 < this._polylines.length) { for (e = 0; e < this._polylines.length; e++)this._viewer.entities.remove(this._polylines[e]); this._polylines = [] } if (this.labels && 0 < this.labels.length) { for (e = 0; e < this.labels.length; e++)this._viewer.entities.remove(this.labels[e]); this.labels = [] } if (this.item && this.item._points && 0 < this.item._points.length) { for (e = 0; e < this.item._points.length; e++)this._viewer.entities.remove(this.item._points[e]); this.item._points = [] } if (this.item && this.item._polylines && 0 < this.item._polylines.length) { for (e = 0; e < this.item._polylines.length; e++)this._viewer.entities.remove(this.item._polylines[e]); this.item._polylines = [] } }, R.prototype.setHeightType = function (e) { try { 1 == e ? this.item._polyline.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._polyline.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item._polyline.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, R.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show._value, t = this.item.polyline.positions.getValue(), i = null == this.item.polyline.width ? void 0 : this.item.polyline.width._value, o = this.item.polyline.material, r = (null != o && (o = { color: null == o.color ? 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.polyline.clampToGround ? void 0 : this.item.polyline.clampToGround._value), n = this.item.polyline.distanceDisplayCondition, a = null == n ? void 0 : n._value.near, n = null == n ? void 0 : n._value.far; return { type: "polyline", treeobj: { name: this.treeobj.name }, style: { show: e, positions: t, width: i, material: o, clampToGround: r, near: a, far: n } } }, R.prototype.setVisibility = function (e) { if (this.item && this.item.item ? this.item.item.show = e : this.item.show = e, this.item && this.item._points && 0 < this.item._points.length) for (var t = 0; t < this.item._points.length; t++)this.item._points[t].show = e; if (this._polylines && 0 < this._polylines.length) for (t = 0; t < this._polylines.length; t++)this._polylines[t].show = e; if (this._points && 0 < this._points.length) for (t = 0; t < this._points.length; t++)this._points[t].show = e; if (this.item && this.item._polylines && 0 < this.item._polylines.length) for (t = 0; t < this.item._polylines.length; t++)this.item._polylines[t].show = e }, R.prototype.getVisibility = function () { return this.item.show }, R.prototype.setOutlinewidth = function (e) { this.item._polyline.material.outlineWidth = e }, R.prototype.setMaterial = function (e) { try { this._core.extend({ outlineWidth: 3 }, e, !0); this.item._polyline.material = new this._cesium.PolylineGlowMaterialProperty(e), this.item.material = this.item._polyline.material } catch (e) { console.log(e) } return this }, R.prototype.setPolylineWall = function (e) { try { for (var t = [], i = [], o = this.item._polyline.positions.getValue(), r = this._viewer.scene.globe.ellipsoid, n = 0; n < o.length; n++) { var a = new this._cesium.Cartesian3(o[n].x, o[n].y, o[n].z), s = r.cartesianToCartographic(a), l = this._cesium.Math.toDegrees(s.latitude), c = this._cesium.Math.toDegrees(s.longitude); t.push(c), t.push(l), i.push(e) } t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.wall = new this._cesium.WallGraphics({ positions: t, minimumHeights: i, material: this.item._polyline.material.color._value }) } catch (e) { console.log(e) } return this }, R.prototype.setRadius = function (e) { try { for (var t = [], i = this.item._polyline.positions.getValue(), o = this._viewer.scene.globe.ellipsoid, r = 0; r < i.length; r++) { var n = new this._cesium.Cartesian3(i[r].x, i[r].y, i[r].z), a = o.cartesianToCartographic(n), s = this._cesium.Math.toDegrees(a.latitude), l = this._cesium.Math.toDegrees(a.longitude); t.push(l), t.push(s) } t = this._cesium.Cartesian3.fromDegreesArray(t), this.item.corridor = new this._cesium.CorridorGraphics({ positions: t, width: e, show: !0, outline: !0, material: this._cesium.Color.RED.withAlpha(.4), heightReference: this._cesium.HeightReference.none }) } catch (e) { console.log(e) } return this }, R.prototype.setGlow = function (e) { try { this.item._polyline.material = e ? new this._cesium.PolylineGlowMaterialProperty({ glowPower: .2, taperPower: .5, color: this.item._polyline.material.color }) : new this._cesium.PolylineOutlineMaterialProperty({ color: this.item._polyline.material.color, outlineWidth: this.item._polyline.material.outlineWidth, outlineColor: this.item._polyline.material.outlineColor }), this.item.material = this.item._polyline.material } catch (e) { console.log(e) } return this }, R.prototype.setMaterialAlpha = function (e) { try { this.item._polyline.material.color._value.alpha = e, this.item.material = this.item._polyline.material } catch (e) { console.log(e) } return this }, R.prototype.setType = function (e) { try { "PolylineDashMaterialProperty" == e ? this.item._polyline.material = new this._cesium.PolylineDashMaterialProperty({ color: this.item._polyline.material.color }) : "PolylineArrowMaterialProperty" == e ? this.item._polyline.material = new this._cesium.PolylineArrowMaterialProperty({ color: this.item._polyline.material.color }) : "PolylineOutlineMaterialProperty" == e && (this.item._polyline.material = new this._cesium.PolylineOutlineMaterialProperty({ color: this.item._polyline.material.color })) } catch (e) { console.log(e) } return this }, R.prototype.setMaterialColor = function (e) { try { this.item._polyline.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, R.prototype.setOutlineColor = function (e) { try { this.item._polyline.material.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, R.prototype.setClampToGround = function (e) { try { this.item._polyline.clampToGround = e } catch (e) { console.log(e) } return this }, R.prototype.setWidth = function (e) { try { this.item._polyline.width = e } catch (e) { console.log(e) } return this }, R.prototype.setDistanceDisplayCondition = function (e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._polyline.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, Object.defineProperties(R.prototype, { HighLight: { set: function (e) { e && (this.item.material = this.item.polyline.material), this.item.polyline.material = e ? new this._cesium.PolylineGlowMaterialProperty({ glowPower: .8, color: this._cesium.Color.ORANGERED.withAlpha(.9) }) : this.item.material } }, polylinemMterial: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.polyline.material = e, this.item.material = this.item.polyline.material) }, 500), get: function () { var e = this.item.polyline.material; if (e) try { return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } }, polylinemArcType: { set: C.debounce(function (e) { this._core.isnull(e) || (this.item.polyline.arcType = e) }, 500), get: function () { var e = this.item.polyline.arcType; if (e) return e._value } }, polylineWidth: { set: C.debounce(function (e) { this._core.isnull(e) || (e = parseFloat(e), this.item.polyline.width = e) }, 500), get: function () { var e = this.item.polyline.width; if (e) return e._value } } }), Object.defineProperties(R.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), Object.defineProperties(R.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), Object.defineProperties(R.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(R.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(R.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(R.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), R.prototype.setItem = function (e) { this.item = e }, R.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(R.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(R.prototype, { polylineTempOptions: { get: function () { return { positions: [], arcType: ArcType.GEODESIC, clampToGround: !1, width: 1, show: !0, material: this._cesium.Color.WHITE } } } }), Object.defineProperties(R.prototype, { MaterialColor: { get: function () { return new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * this.item._polyline.material.color._value.red + "," + 255 * this.item._polyline.material.color._value.green + "," + 255 * this.item._polyline.material.color._value.blue + ")") } }, Height: { get: function () { return this.item._polyline.height } }, Visibility: { get: function () { return this.item.show } }, Outlinewidth: { get: function () { return this.item._polyline.material.outlineWidth._value } }, OutlineColor: { get: function () { var e = this.item._polyline.material.outlineColor; return e ? (e = e._value, new m(this._viewer, this._cesium).toHtmlColor("rgb(" + 255 * e.red + "," + 255 * e.green + "," + 255 * e.blue + ")")) : "#ff0000" } }, ClampToGround: { get: function () { return this.item._polyline.clampToGround } }, Width: { get: function () { return this.item._polyline.width._value } }, Type: { get: function () { return this.item._polyline.material instanceof this._cesium.PolylineDashMaterialProperty ? "PolylineDashMaterialProperty" : this.item._polyline.material instanceof this._cesium.PolylineArrowMaterialProperty ? "PolylineArrowMaterialProperty" : "PolylineOutlineMaterialProperty" } }, Glow: { get: function () { return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty } }, MaterialAlpha: { get: function () { return 100 * this.item._polyline.material.color._value.alpha } } }), R.prototype.CreatePolyline = function (e, t, i, o, r) { this._Geometry = e; for (var i = { color: this._cesium.Color.YELLOW, outlineColor: this._cesium.Color.BLACK, width: 10, show: !0, AltitudeType: this._cesium.defaultValue(i, 999) }, n = (t && "" !== t && (i.color = new m(this._viewer, this._cesium).colorFromHtmlColor(t)), []), a = 0; a < e.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y)); this.item = this._viewer.entities.add({ name: r, polyline: { positions: n, width: i.width, material: new this._cesium.PolylineGlowMaterialProperty({ outlineColor: i.outlineColor, color: i.color }) } }); t = { id: this.item.id, name: r, pId: this._core.isnull(o) ? 0 : o, type: "polyline", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, R.prototype.forceEndHanlder = function () { this.handler && (this.handler.destroy(), this.handler = void 0), this._tree.handler && (this._tree.handler.destroy(), this._tree.handler = void 0) }, Sr.prototype.deleteObject = Sr.prototype.cleanUp = function () { void 0 !== this._prevEntity && (this._viewer.entities.remove(this._prevEntity), this._prevEntity = void 0), void 0 !== this._prevEntity1 && (this._viewer.entities.remove(this._prevEntity1), this._prevEntity1 = 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.addPointHandle && (this.addPointHandle.destroy(), this.addPointHandle = void 0), this.Triangulation = [], this.tinData = void 0, this._tooltip.show(!1) }, Sr.prototype.startDrawing = function (e = {}, t = "auto", a) { var s, i = this._scene, r = this._tooltip, l = [], c = [], u = [], h = (this._positions = c, this._degreesArr = u, 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), u.push([o, i]), c.push(t), s = t), 4 <= c.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), c.pop(), void this.stopDrawing(a) } } l.push(o, i), u.push([o, i]), c.push(t), 2 !== c.length || m || (m = this._viewer.entities.add({ name: "临时线", polyline: { positions: new Cesium.CallbackProperty(function () { return c }, !1), clampToGround: !0, material: h._drawColor.polygon, width: 3 } })), 3 === c.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 === c.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), u.pop(), c.pop(), l.push(t, i), u.push([t, i]), c.push(e), r.showAt(o, "右键结束绘制"), 3 <= c.length && 4 <= c.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, c.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 }, Sr.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) }, Sr.prototype.computeCentroidOfPolygon = function (e) { for (var t = [], i = [], o = 0, r = 0, n = 0; n < e.length; n++) { var a = Cesium.Cartographic.fromCartesian(e[n]); o += a.longitude, r += a.latitude, t.push(a.longitude), i.push(a.latitude) } var s = o / e.length, l = r / e.length; return new Cesium.Cartographic(s, l) }, Sr.prototype.computeCutVolume = function (c, e) { var u = 15e3, h = -15e3, t = Cesium.BoundingSphere.fromPoints(this._positions); this.viewDistance = 1.5 * this._core.getPointToCameraDistance(this._viewer, t.center), "auto" === c && (c = t.radius / 20); let m = this._core.getPointsInPolygon(this._degreesArr, c, !0), d = Cesium_turf.polygon([this._degreesArr]), i = () => { 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 - u + r - u + n - u) / 3) ? i.dig = i.dig + s * a * l.dig : i.fill = i.fill - s * a * l.fill, 1e10 < i.dig && "立方米" === o.dig && (i.dig = i.dig / 1e9, o.dig = "立方千米", l.dig = 1e-9), 1e10 < i.fill && "立方米" === o.fill && (i.fill = i.fill / 1e9, o.fill = "立方千米", l.fill = 1e-9)) }), this.computeCentroidOfPolygon(this._positions)); return this._volumeLabel = this._viewer.entities.add({ position: Cesium.Cartesian3.fromRadians(t.longitude, t.latitude, h), label: { text: "挖方体积:" + i.dig.toFixed(4) + o.dig, pixelOffset: { x: 0, y: -30 }, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, showBackground: !0, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * this.viewDistance), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this._volumeLabel1 = this._viewer.entities.add({ position: Cesium.Cartesian3.fromRadians(t.longitude, t.latitude, h), label: { text: "填方体积:" + i.fill.toFixed(4) + o.fill, pixelOffset: { x: 0, y: -70 }, font: "16px 宋体", fillColor: Cesium.Color.GOLD, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, showBackground: !0, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1.5 * this.viewDistance), disableDepthTestDistance: Number.POSITIVE_INFINITY } }), this.isLoading(!1), { maxHeight: h, minHeight: u, volume: i, unit: o, spacing: c } }; if (e) { let t = []; return m.features.forEach(e => { 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, h < i[2] && (h = i[2]), u > i[2] && (u = 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, h < t[2] && (h = t[2]), u > t[2] && (u = t[2]) }), i() }, 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 }, Sr.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) } }, Sr.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)) }) }, Sr.prototype.setDatum = function (t, e) { var i, o, r, n, a; this.Triangulation && 0 < this.Triangulation.length && (r = { fill: 0, dig: 0 }, n = { fill: "立方米", dig: "立方米" }, a = { fill: 1, dig: 1 }, this.Triangulation.forEach(function (e) { i = e.bottomArea, o = e.height, 0 < (o = (o[0] - t + o[1] - t + o[2] - t) / 3) ? r.dig = r.dig + i * o * a.dig : r.fill = r.fill - i * o * a.fill, 1e10 < r.dig && "立方米" === n.dig && (r.dig = r.dig / 1e9, n.dig = "立方千米", a.dig = 1e-9), 1e10 < r.fill && "立方米" === n.fill && (r.fill = r.fill / 1e9, n.fill = "立方千米", a.fill = 1e-9) }), this._volumeLabel.label.text = "挖方体积:" + r.dig.toFixed(4) + n.dig, this._volumeLabel1.label.text = "填方体积:" + r.fill.toFixed(4) + n.fill, this._prevEntity.polygon.height = t, e && "function" == typeof e && e({ volume: r, unit: n })) }, Er.prototype.clearMeasure = function (t) { if (t) { let e = this.measureData.get(t); e && e.deleteObject && e.deleteObject(), e && e.cleanUp && e.cleanUp(), this.measureData.delete(t) } else this.measureData.forEach(e => { e.deleteObject && e.deleteObject(), e.cleanUp && e.cleanUp() }), this.measureData.clear() }, Er.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) }) }, Er.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) }) }, Er.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) }) }, Er.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) }) }, Er.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) }) }, Er.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) }) }, Er.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) }) }, Er.prototype.analysisVolume = function (e = {}, t) { let i = new Sr(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}<br>挖方:` + (e.volume.dig.toFixed(4) + e.unit.dig), t && "function" == typeof t && t(e) }) }, Object.defineProperties(Er.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) } } }), Ir.prototype.createTerrainProfile = function (e) { for (var t = [], i = 0; i < e.length; i++) { var o = this._cesium.Ellipsoid.WGS84.cartesianToCartographic(e[i]); t.push(o.height) } return t }, Ir.prototype.measureTerrainArea = function (e) { return Dr(e).toFixed(1) }, Ir.prototype.measureTerrainHeight = function (e) { var t = e[e.length - 2], e = e[e.length - 1]; return Math.abs(t.x - e.x), Math.abs(t.y - e.y), t.hit, e.hit, Math.abs(t.z - e.z) }, Ir.prototype.measureTerrainkPerimeter = function (e) { var t = e[e.length - 2], e = e[e.length - 1], i = (Math.abs(t.x - e.x), Math.abs(t.y - e.y), Math.abs(t.z - e.z)), t = Tr(t.y, t.z, e.y, e.z); return Math.sqrt(i * i + t * t) }, Ir.prototype.measureTerrainPerimeter = function (e) { var t = e[e.length - 2], e = e[e.length - 1]; return Math.abs(t.x - e.x), Math.abs(t.y - e.y), Tr(t.y, t.x, e.y, e.x) }; var Ar, Lr = 1e-5 * Math.PI / 180; function Mr(e, t) { yr = t, this._cesium = t, this._viewer = e, this._core = new f, this._polylines = [], this._points = [], this._tree = V, this._interval = 20 } function Rr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._indoormode = new Eo(e), this._model = null, this._relativeHeight = -100, this._groundHeightAtCameraPosition = 0, this._startMousePosition, this._mousePosition, this._cameraHeight, this._originalOption, this._alpha = .5, this._brightness = .3, this._depth = 300, this._canvas = null, this.isIndoor = !1, this.isUndergroundMode = !1, this._flags = { move: !1, vertical: !1, horizontally: !1, rotate: !1 }, this.moveSpeed = 1 } function Or(e) { var t = e._viewer.scene; e._viewer.canvas, e._tree && e._tree.handler && (e._tree.handler.destroy(), e._tree.handler = null), t.screenSpaceCameraController.enableRotate = !0, t.screenSpaceCameraController.enableTranslate = !0, t.screenSpaceCameraController.enableZoom = !0, t.screenSpaceCameraController.enableTilt = !0, t.screenSpaceCameraController.enableLook = !0 } function O(e, t) { this._viewer = e, this._cesium = t, this._elevationContour = new Yt(this._viewer, this._cesium), this._createcurtaincontrast = new wo(this._viewer, this._cesium), this._createindoormode = new Eo(this._viewer, this._cesium), this._createWeather = new Po(this._viewer, this._cesium), this._UndergroundGrid = new Do(this._viewer), this._StreetView = new Io(this._viewer, this._cesium), this._StreetViewYZ = new Bo(this._viewer, this._cesium), this._depthTestAgainstTerrain = new Qo(this._viewer, this._cesium), this._create3DViewshed = new Zo(this._viewer, this._cesium), this._skylineAnalysis = new lr(this._viewer, this._cesium), this._EdgeStage = new dr(this._viewer, this._cesium), this._bufferAnalysis = new Ai(this._viewer, this._cesium), this._shadowsAnalysis = new gr(this._viewer, this._cesium), this._screenshot = new fr(this._viewer, this._cesium), this._PointFly = new _r(this._viewer, this._cesium), this._SunshineAnalysis = new Cr(this._viewer, this._cesium), this._measure = new Er(this._viewer), this._Deprecated = new Ir(this._viewer, this._cesium), this._UndergroundMode = new Rr(this._viewer, this._cesium) } function Br(e, t) { this._viewer = e, this._cesium = t } function Vr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function B(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Fr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function F(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._viewEvent = null, this.positions = [], this._getPosition = new y(this._viewer, this._cesium), this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this.gonRectangleArr = [] } function H(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._postion = { Altitude: 0, AltitudeType: 0, Cartesian: !0, Distance: 0, Pitch: 0, Roll: 0, X: 0, Y: 0, Yaw: 0 }, this.positions = [], this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this.gonCircleArr = [], this.radius = 0 } function G(e, t) { this._viewer = e, this._cesium = t, this._tree = V, this._core = new f, this._Color = new m(this._viewer, this._cesium), this._postion = { Altitude: 0, AltitudeType: 0, Cartesian: !0, Distance: 0, Pitch: 0, Roll: 0, X: 0, Y: 0, Yaw: 0 } } function k(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._entityFly = null } Mr.prototype.createlineOfSight = function (n, r) { var a = this, s = (this._tree.starttemporaryItem(this._viewer), []), l = [], c = { polyline: [] }, u = (this._tree.removeHandler(), this._core.CreateTooltip()), h = (a.objectsToExclude = null, void 0), m = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), e.prototype._init = function () { var e = this; this.options.polyline.positions = new a._cesium.CallbackProperty(function () { return e.positionsp }, !1), this.polyline = a._viewer.entities.add(this.options), a.item = this.polyline, a._tree.temporaryItem.obj.push(this.polyline), l.push(this.polyline) }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: a._cesium.Color.YELLOW, width: 3, clampToGround: !1 } }, this.positionsp = e, this._init() } this._tree.handler = new a._cesium.ScreenSpaceEventHandler(a._viewer.scene.canvas); var d = [], p = void 0; if (0 < this._points.length) for (var t = 0; t < this._points.length; t++)this._viewer.entities.remove(this._points[t]); var g = [], f = (this._tree.handler.setInputAction(function (e) { var t, i, o, r = a._viewer.camera.getPickRay(e.position), r = a._viewer.scene.globe.pick(r, a._viewer.scene); a._viewer.scene.pick(e.position) && (i = a._viewer.scene.pickPosition(e.position)) && (r = i), r && (0 === d.length ? (d.push(r.clone(), r.clone()), t = { leftX: e.position.x, leftY: e.position.y }, g.push(t), h = r.clone()) : (t = { rightX: e.position.x, rightY: e.position.y }, g.push(t), i = { postion: d, entity: l, cartesian: g }, s.push(i), g = [], p = void 0, d = [], r = h.clone(), null != n.height && (e = ellipsoid.cartesianToCartographic(h.clone()), t = yr.Math.toDegrees(cartograhphic.latitude), i = yr.Math.toDegrees(cartograhpinc.longitude), o = n.height, e = yr.Cartographic.fromDegrees(i, t, o), r = ellipsoid.cartographicToCartesian(e)), d.push(r), d.push(r), p = new m(d))) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this._tree.handler.setInputAction(function (e) { var t, i = a._viewer.camera.getPickRay(e.endPosition), i = a._viewer.scene.globe.pick(i, a._viewer.scene); a._viewer.scene.pick(e.endPosition) && (t = a._viewer.scene.pickPosition(e.endPosition)) && (i = t), i && (0 === d.length ? u.showAt(e.endPosition, "点击添加视点") : u.showAt(e.endPosition, "点击添加目标视点,右键结束"), 2 <= d.length && (a._cesium.defined(p) ? null != i && (d.pop(), d.push(i)) : p = new m(d))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), 0), _ = 0; return this._tree.handler.setInputAction(function (e) { a.end && a.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = e => { if (u.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; t < l.length; t++)a._viewer.entities.remove(l[t]); else { for (var i, o = 0; o < s.length; o++)i = (0 == o ? (f = s[o].cartesian[0].leftX, _ = s[o].cartesian[0].leftY, a.tsjx(s[o].postion, f, _, s[o].cartesian[1].rightX, s[o].cartesian[1].rightY, 50, l, a._cesium, a._viewer)) : a.tsjx(s[o].postion, f, _, s[o].cartesian[0].rightX, s[o].cartesian[0].rightY, 50, l, a._cesium, a._viewer)) ? a._viewer.entities.add({ name: "polyline1", polyline: { positions: s[o].postion, width: 3, material: a._cesium.Color.GREEN } }) : a._viewer.entities.add({ name: "polyline1", polyline: { positions: s[o].postion, width: 3, material: a._cesium.Color.RED } }), c.polyline.push(i); d.pop(), a._polylines = c.polyline, a._tree.handler.destroy(); for (t = 0; t < l.length; t++)a._viewer.entities.remove(l[t]); "" != r && null != r && "function" == typeof r && r(c) } }, this }, Mr.prototype.tsjx = function (e, t, i, o, r, n, a, s, l) { for (var c = this._core.getSpaceDistancem(e, s), c = (c <= 100 && 10 <= c ? n = parseInt(c / 2) : c < 10 && 0 < c ? n = parseInt(+c) : 100 < c && (n = parseInt(c / 10)), e[0]), e = e[e.length - 1], c = s.Cartographic.fromCartesian(c), u = s.Math.toDegrees(c.longitude), h = s.Math.toDegrees(c.latitude), m = (c.height, c.height), c = s.Cartographic.fromCartesian(e), e = s.Math.toDegrees(c.longitude), d = s.Math.toDegrees(c.latitude), c = (c.height, c.height), p = n, g = s.Math.lerp(u, e, 1 / p) - u, f = s.Math.lerp(h, d, 1 / p) - h, _ = s.Math.lerp(m, c, 1 / p) - m, C = (s.Math.lerp(t, o, 1 / p), s.Math.lerp(i, r, 1 / p), !0), y = 0; y < p - 2; y++) { var v = m + (y + 1) * _, w = s.Cartesian3.fromDegrees(u + (y + 1) * g, h + (y + 1) * f, v), w = s.Cartographic.fromCartesian(w), b = l.scene.globe.getHeight(w), w = l.scene.sampleHeight(w, a); if (w && (b = w), b = parseFloat(b.toFixed(1)), (v = parseFloat(v.toFixed(1))) < b) return C = !1 } return C }, Mr.prototype.deleteObject = function () { if (0 < this._points.length) { this.objectsToExclude = null; for (var e = 0; e < this._points.length; e++)this._viewer.entities.remove(this._points[e]) } }, Mr.prototype.InterpolateLineCartographic = function (e, t, i) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var o = [], r = (o.push(new yr.Cartographic(e.longitude, e.latitude)), Math.sqrt(Math.pow(t.longitude - e.longitude, 2) + Math.pow(t.latitude - e.latitude, 2))), i = i && "number" == typeof i ? i : Lr; if (r <= i) o.push(new yr.Cartographic(t.longitude, t.latitude)); else { for (var n = r / i, a = (t.longitude - e.longitude) / n, s = (t.latitude - e.latitude) / n, l = 0; l < n; l++) { var c = e.longitude + (l + 1) * a, u = e.latitude + (l + 1) * s; o.push(new yr.Cartographic(c, u)) } o.push(new yr.Cartographic(t.longitude, t.latitude, t.height)) } return o }, Mr.prototype.InterpolateLineCartographicxp = function (e, t, i) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var o = [], r = (o.push(new yr.Cartographic(e.longitude, e.latitude)), Math.sqrt(Math.pow(t.longitude - e.longitude, 2) + Math.pow(t.latitude - e.latitude, 2))), i = i && "number" == typeof i ? i : Lr; if (r <= i) o.push(new yr.Cartographic(t.longitude, t.latitude)); else { for (var n = r / i, a = (t.longitude - e.longitude) / n, s = (t.latitude - e.latitude) / n, l = (t.height - e.height) / n, c = 0; c < n; c++) { var u = e.longitude + (c + 1) * a, h = e.latitude + (c + 1) * s, m = e.height + l * (c + 1); o.push(new yr.Cartographic(u, h, m)) } o.push(new yr.Cartographic(t.longitude, t.latitude, t.height)) } return o }, Mr.prototype.InterpolateLineHeightCartographic = function (e, t) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; var i = [], o = (i.push(new yr.Cartographic(e.longitude, e.latitude, e.height)), Math.sqrt(Math.pow(t.longitude - e.longitude, 2) + Math.pow(t.latitude - e.latitude, 2))); if (!(o <= Lr)) for (var r = o / Lr, n = (t.longitude - e.longitude) / r, a = (t.latitude - e.latitude) / r, s = (t.height - e.height) / r, l = 0; l < r; l++) { var c = e.longitude + (l + 1) * n, u = e.latitude + (l + 1) * a, h = e.height + (l + 1) * s; i.push(new yr.Cartographic(c, u, h)) } return i.push(new yr.Cartographic(t.longitude, t.latitude, t.height)), i }, Mr.prototype.InterpolateIndexLineHeightCartographic = function (e, t, i, o) { var r, n; return e && t && e.longitude && e.latitude && t.longitude && t.latitude ? (r = (t.longitude - e.longitude) / i, n = (t.latitude - e.latitude) / i, t = (t.height - e.height) / i, i = e.longitude + o * r, r = e.latitude + o * n, n = e.height + o * t, new yr.Cartographic(i, r, n)) : null }, Mr.prototype.InterpolateIndexLineHeightCartographicxp = function (e, t, i, o) { var r, n; return e && t && e.longitude && e.latitude && t.longitude && t.latitude ? (r = (t.longitude - e.longitude) / i, n = (t.latitude - e.latitude) / i, t = (t.height - e.height) / i, i = e.longitude + o * r, r = e.latitude + o * n, n = e.height + o * t, new yr.Cartographic(i, r, n)) : null }, Mr.prototype.Interpolate2IndexLineHeightCartographic = function (e, t, i, o) { if (!e || !t) return null; if (!(e.longitude && e.latitude && t.longitude && t.latitude)) return null; for (var r = [], n = (r.push(new yr.Cartographic(e.longitude, e.latitude, e.height)), (t.longitude - e.longitude) / i), a = (t.latitude - e.latitude) / i, s = (t.height - e.height) / i, l = 0; l < o; l++) { var c = e.longitude + (l + 1) * n, u = e.latitude + (l + 1) * a, h = e.height + (l + 1) * s; r.push(new yr.Cartographic(c, u, h)) } return r }, Mr.prototype.CartographicPointsTerrainData = function (e, t) { e.length && 0 < e.length && (e = yr.sampleTerrain(this._viewer.terrainProvider, 11, e), yr.when(e, function (e) { t(e) })) }, Mr.prototype.setVisibility = function (e) { if (0 < this._polylines.length) for (var t = 0; t < this._polylines.length; t++)this._polylines[t].show = e }, Mr.prototype.deleteObject = function () { if (0 < this._polylines.length) for (var e = 0; e < this._polylines.length; e++)this._viewer.entities.remove(this._polylines[e]) }, Object.defineProperties(Mr.prototype, { sight: { get: function () { return this.item.sight }, set: function (e) { this.item.sight = sight } } }), Rr.prototype.refreshGridLines = function () { var e, t = this._relativeHeight < 0, i = this._viewer.camera, i = new this._cesium.Cartographic(i.positionCartographic.longitude, i.positionCartographic.latitude, -this._depth); this._model ? (e = this.UndergroundGridLines(i, t), this._viewer.scene.primitives.remove(this._model), this._model = e) : this._model = this.UndergroundGridLines(i, t) }, Rr.prototype.UndergroundModelOpen = function (e, t) { var i, o, r; if (!this._model) return this._getOriginalOption(), o = this._viewer.camera, r = new this._cesium.Cartographic(o.positionCartographic.longitude, o.positionCartographic.latitude, -this._depth), i = new this._cesium.Cartographic(o.positionCartographic.longitude, o.positionCartographic.latitude, o.positionCartographic.height), this.destination = i, this.orientation = { heading: o.heading, pitch: o.pitch, roll: 0 }, this._cesium.ExpandBySmartEarth && (this._cesium.ExpandBySmartEarth.underEarth.cullFace = !1, this._cesium.ExpandBySmartEarth.underEarth.enable = !0, this._cesium.ExpandBySmartEarth.underEarth.enableDepth = this._depth, this._cesium.ExpandBySmartEarth.underEarth.enableSkirt = !0), this._viewer.scene.globe.baseColor = this._cesium.Color.WHITE.withAlpha(0), i = e ? (this._depth = this._cesium.defaultValue(e.depth, 300), this._alpha = this._cesium.defaultValue(e.alpha, .5), this._brightness = this._cesium.defaultValue(e.brightness, .3), this.isEnterUnderground = this._cesium.defaultValue(e.isEnterUnderground, !0), this.isFlyToSky = this._cesium.defaultValue(e.isFlyToSky, !0), this._cesium.defaultValue(e.height, -100)) : (this._depth = 300, this._alpha = .5, this._brightness = .3, this.isEnterUnderground = !0, this.isFlyToSky = !0, -100), this.setLayerAlpha(this._alpha, this._brightness), this._viewer.scene.globe.depthTestAgainstTerrain = !0, this._viewer.scene.highDynamicRange = !1, this._viewer.scene.skyAtmosphere.show = !1, this._viewer.scene.skyBox.show = !1, this._viewer.scene.fog.enabled = !1, this._viewer.scene.backgroundColor = new this._cesium.Color(0, 0, 0, 1), this._viewer.container.style.backgroundImage = "unset", this.isUndergroundMode = !0, t ? (this.isIndoor = !0, this._indoormode.createIndoormode({ undergroundMode: this })) : this.isIndoor = !1, o = this._viewer.camera, r = new this._cesium.Cartographic(o.positionCartographic.longitude, o.positionCartographic.latitude, -this._depth), this._model = this.UndergroundGridLines(r, !0), this._viewer.scene.preRender.addEventListener(this.getRelativeHeight, this), this.getRelativeHeight(), 0 < this._relativeHeight && this.isEnterUnderground && this.enterUnderground(i), this }, Rr.prototype.close = function () { this._model && (this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight, this), this.setLayerAlpha(this._originalOption.alpha, this._originalOption.brightness), this._viewer.scene.primitives.remove(this._model), this._cesium.ExpandBySmartEarth && (this._cesium.ExpandBySmartEarth.underEarth.cullFace = void 0, this._cesium.ExpandBySmartEarth.underEarth.enable = !1, this._cesium.ExpandBySmartEarth.underEarth.enableDepth = 0, this._cesium.ExpandBySmartEarth.underEarth.enableSkirt = !1), this._viewer.scene.globe.baseColor = this._cesium.Color.WHITE.withAlpha(1), this._viewer.scene.globe.depthTestAgainstTerrain = this._originalOption.depthTest, this._viewer.scene.skyBox && (this._viewer.scene.skyBox.show = this._originalOption.skyBoxShow), this._viewer.scene.highDynamicRange = this._originalOption.highDynamicRange, this._viewer.scene.skyAtmosphere.show = this._originalOption.skyShow, this._viewer.scene.backgroundColor = this._originalOption.backgroundColor, this._viewer.container.style.backgroundImage = this._originalOption.backgroundImage, this._viewer.scene.fog.enabled = this._originalOption.fog, this.isUndergroundMode = !1, this._model = null, Ar = void 0, this._viewer.camera.positionCartographic, Or(this), !this.isFlyToSky || 500 < this._relativeHeight || this.flyToSky()) }, Rr.prototype._getOriginalOption = function () { var e = { alpha: this._cesium.clone(this._viewer.imageryLayers._layers[0] && this._viewer.imageryLayers._layers[0].alpha), brightness: this._cesium.clone(this._viewer.imageryLayers._layers[0] && this._viewer.imageryLayers._layers[0].brightness), highDynamicRange: this._cesium.clone(this._viewer.scene.highDynamicRange), skyShow: this._cesium.clone(this._viewer.scene.skyAtmosphere.show), skyBoxShow: this._cesium.clone(this._viewer.scene.skyBox && this._viewer.scene.skyBox.show), depthTest: this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain), backgroundColor: this._viewer.scene.backgroundColor.clone(), backgroundImage: this._viewer.container.style.backgroundImage, fog: this._viewer.scene.fog.enabled }; this._viewer.scene.globe._surface && this._viewer.scene.globe._surface._tileProvider && this._viewer.scene.globe._surface._tileProvider._renderState && (e.blending = this._cesium.clone(this._viewer.scene.globe._surface._tileProvider._renderState.blending)), this._originalOption = e }, Rr.prototype.enterUnderground = function (e) { var t = this._viewer.camera, i = new this._cesium.Cartographic(t.positionCartographic.longitude, t.positionCartographic.latitude, -this._depth); t.positionCartographic.height <= 10 || t.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude, e || -this._depth / 3), orientation: { heading: this._cesium.Math.toRadians(0), pitch: this._cesium.Math.toRadians(0), roll: 0 }, complete: function () { } }) }, Rr.prototype.flyToSky = function () { var e = this._viewer.camera; this._viewer.camera.positionCartographic, 10 <= e.positionCartographic.height || this._viewer.camera.flyTo({ destination: new this._cesium.Cartesian3.fromRadians(this.destination.longitude, this.destination.latitude, this.destination.height), orientation: { heading: this.orientation.heading, pitch: this.orientation.pitch, roll: 0 } }) }, Rr.prototype.setLayerAlpha = function (e, t) { for (var i = this._viewer.imageryLayers.length, o = 0; o < i; o++)this._viewer.imageryLayers.get(o).alpha = e, void 0 !== t && (this._viewer.imageryLayers.get(o).brightness = t); this._alpha = e, void 0 !== t && (this._brightness = t) }, Rr.prototype.UndergroundGridLines = function (e, t) { var i = e, e = (e instanceof this._cesium.Cartesian3 && (i = this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e)), new this._cesium.GeometryInstance({ geometry: new this._cesium.EllipseGeometry({ center: this._cesium.Cartesian3.fromRadians(i.longitude, i.latitude), height: i.height, semiMinorAxis: 2e4, semiMajorAxis: 2e4, vertexFormat: this._cesium.VertexFormat.POSITION_AND_ST }), id: "undergroundSurface" })), i = this._cesium.Material.fromType("Grid"), e = (i.uniforms.color = this._cesium.Color.WHITE.withAlpha(.3), i.uniforms.cellAlpha = .01, i.uniforms.lineCount = new this._cesium.Cartesian2(200, 200), i.uniforms.lineThickness = new this._cesium.Cartesian2(1, 1), this._viewer.scene.primitives.add(new this._cesium.Primitive({ geometryInstances: e, appearance: new this._cesium.EllipsoidSurfaceAppearance({ material: i }) }))); return e.appearance.renderState.depthTest.enabled = !0, e.show = t, e }, Rr.prototype.attachMouseEvent = function () { var o = this, e = this._viewer.scene; this._canvas = this._viewer.canvas, this._tree.handler = new this._cesium.ScreenSpaceEventHandler(this._canvas), this._canvas.setAttribute("tabindex", "0"), this._canvas.onclick = function () { o._canvas.focus() }, e.screenSpaceCameraController.enableRotate = !1, e.screenSpaceCameraController.enableTranslate = !1, e.screenSpaceCameraController.enableZoom = !1, e.screenSpaceCameraController.enableTilt = !1, e.screenSpaceCameraController.enableLook = !1, this._tree.handler.setInputAction(function (e) { o._flags.move = !0, o._viewer.camera.pitch > o._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 < t.positionCartographic.height ? t.positionCartographic.height / 1e3 : .1; t.pitch < 0 && t.positionCartographic.height < -200 && 0 < e || 0 < t.pitch && t.positionCartographic.height < -200 && e < 0 || t.zoomIn(e * i) }, this._cesium.ScreenSpaceEventType.WHEEL) }, Rr.prototype.mouseMoveEvent = function () { var e, t, i, o = 200 * this.moveSpeed, r = this._viewer.camera; this._flags.move && (this._canvas.clientWidth, e = this._canvas.clientHeight, t = this._mousePosition.x - this._startMousePosition.x, i = -(this._mousePosition.y - this._startMousePosition.y), this._flags.horizontally && (r.moveLeft(2 * t), r.moveBackward(2 * i), r.setView({ destination: this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude, r.positionCartographic.latitude, this._cameraHeight), orientation: { heading: r.heading, pitch: r.pitch, roll: r.roll } })), this._flags.vertical && r.setView({ destination: this._cesium.Cartesian3.fromRadians(r.positionCartographic.longitude, r.positionCartographic.latitude, this._cameraHeight - (i /= e) * o), orientation: { heading: r.heading, pitch: r.pitch, roll: r.roll } }), this._flags.rotate && ((!r.roll && r.pitch < 0 && i < 0 || !r.roll && 0 < r.pitch && 0 < i) && (i = 0), r.rotate(r.position, .001 * t), r.lookUp(.001 * i))) }, Rr.prototype.getRelativeHeight = function () { var e = this._viewer.camera, t = this._viewer.scene.globe.getHeight(e.positionCartographic); this._groundHeightAtCameraPosition = t || this._groundHeightAtCameraPosition, this._relativeHeight = e.positionCartographic.height - this._groundHeightAtCameraPosition, this._relativeHeight < 1 ? (this._tree.handler || this.isIndoor || this.attachMouseEvent(), t = Math.abs(this._relativeHeight), this.moveSpeed = t < 50 ? .25 : t < 100 ? .5 : t < 150 ? .75 : 1) : this._tree.handler && !this.isIndoor && Or(this), Ar = Ar || e.position.clone(), 1e4 < this._core.getSpaceDistancem([Ar, e.position], this._cesium) && (Ar = e.position.clone(), this.refreshGridLines()), this._relativeHeight < 0 ? this._model && (this._model.show = !0) : this._model && (this._model.show = !1) }, Rr.prototype.isHaveTerrain = function () { return !!(this._viewer.scene && this._viewer.scene.terrainProvider && this._viewer.scene.terrainProvider._layers) }, Rr.prototype.setCesiumFov = function (e) { this._viewer.camera.frustum.fov = this._cesium.Math.toRadians(e) }, O.prototype.clearMeasure = function (e) { this._measure.clearMeasure(e) }, O.prototype.horizontalDistance = function (e, t) { this._measure.horizontalDistance(e, t) }, O.prototype.spaceDistance = function (e, t) { this._measure.spaceDistance(e, t) }, O.prototype.altitude = function (e, t) { this._measure.altitude(e, t) }, O.prototype.verticalHeight = function (e, t) { this._measure.verticalHeight(e, t) }, O.prototype.surfaceArea = function (e, t) { this._measure.surfaceArea(e, t) }, O.prototype.planeArea = function (e, t) { this._measure.planeArea(e, t) }, O.prototype.measureAngle = function (e, t) { this._measure.measureAngle(e, t) }, O.prototype.analysisVolume = function (e, t) { this._measure.analysisVolume(e, t) }, O.prototype.measureTerrainPerimeter = function (e) { return this._Deprecated.measureTerrainPerimeter(e) }, O.prototype.depthTestAgainstTerrain = function (e) { return this._depthTestAgainstTerrain.depthTestAgainstTerrain(e) }, O.prototype.DrawPointBuffer = function (e, t, i) { return this._bufferAnalysis.DrawPoint(e, t, i) }, O.prototype.DrawPolylineBuffer = function (e, t, i) { return this._bufferAnalysis.DrawPolyline(e, t, i) }, O.prototype.DrawPolygonBuffer = function (e, t, i) { return this._bufferAnalysis.DrawPolygon(e, t, i) }, O.prototype.TerrainExcavation = function (e = 100, t, i) { let o = new pr(this._viewer, this._cesium); return o.draw(e, t, i) }, O.prototype.ShadowsAnalysis = function () { return this._shadowsAnalysis.createAnalysis() }, O.prototype.createSkylineAnalysis = function (e) { return this._skylineAnalysis.createSkylineAnalysis(e) }, O.prototype.createEdgeStage = function (e) { return this._EdgeStage.createEdgeStage(e) }, O.prototype.clearSkylineAnalysis = function () { return this._skylineAnalysis.clear() }, O.prototype.createScreenshot = function (e) { return this._screenshot.createScreenshot(e) }, O.prototype.ScreenshotCompared = function (e) { return this._screenshot.createScreenshotCompared(e) }, O.prototype.setPointFly = function (e) { return this._PointFly.setPointFly(e) }, O.prototype.createCircleScan = function (e, t, i, o, r) { return new Ko(this._viewer, this._cesium).createCircleScan(e, t, i, o, r) }, O.prototype.createMultiCircleScan = function (e, t, i, o, r) { return new Ko(this._viewer, this._cesium).createMultiCircleScan(e, t, i, o, r) }, O.prototype.createSectorScan = function (e, t, i, o, r, n, a) { return new Ko(this._viewer, this._cesium).createSectorScan(e, t, i, o, r, n, a) }, O.prototype.createRadarScan = function (e, t, i, o, r) { return new Ko(this._viewer, this._cesium).createRadarScan(e, t, i, o, r) }, O.prototype.UndergroundModelOpen = function (e, t) { return this._UndergroundMode.UndergroundModelOpen(e, t) }, O.prototype.UndergroundModelClose = function () { return this._UndergroundMode.close() }, O.prototype.UndergroundMode = function (e, o) { if (e) { this._viewer.scene.globe.translucency.enabled || (this._viewer.scene.globe.translucency.enabled = !0, this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = !1, this._viewer.scene.globe.translucency.backFaceAlpha = 0, this.undergroundValue("set")), this._viewer.scene.globe.translucency.frontFaceAlpha = void 0 !== o ? o : .5; let t = this._viewer, i = this._UndergroundGrid; return i.show && i.add(), { get alpha() { return t.scene.globe.translucency.frontFaceAlpha }, set alpha(e) { t.scene.globe.translucency.frontFaceAlpha = e }, get grid() { return i.show }, set grid(e) { (i.show = e) ? i.add() : i.destroy() }, get depth() { return i._depth }, set depth(e) { i._depth = e, i.show && i.refreshGridLines() } } } this._viewer.scene.globe.translucency.enabled && (this._viewer.scene.globe.translucency.enabled = !1, this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = !0, this._viewer.scene.globe.translucency.backFaceAlpha = 1, this._UndergroundGrid.destroy(), this.undergroundValue("get")) }, O.prototype.undergroundValue = function (e) { "set" === e ? (this.defaultUnderground = { highDynamicRange: this._viewer.scene.highDynamicRange, skyBox: this._viewer.scene.skyBox.show, fog: this._viewer.scene.fog.enabled, undergroundColor: this._viewer.scene.globe.undergroundColor }, this._viewer.scene.highDynamicRange = !1, this._viewer.scene.skyBox.show = !1, this._viewer.scene.fog.enabled = !1, this._viewer.scene.globe.undergroundColor = void 0) : (this._viewer.scene.highDynamicRange = this.defaultUnderground.highDynamicRange, this._viewer.scene.skyBox.show = this.defaultUnderground.skyBox, this._viewer.scene.fog.enabled = this.defaultUnderground.fog, this._viewer.scene.globe.undergroundColor = this.defaultUnderground.undergroundColor) }, O.prototype.StreetViewOpen = function (e, t, i) { return this._StreetView.StreetViewOpen(e, t, i) }, O.prototype.ExitStreetView = function () { return this._StreetView.exit() }, O.prototype.StreetViewOpenYZ = function (e, t, i) { return this._StreetViewYZ.StreetViewOpenYZ(e, t, i) }, O.prototype.ExitStreetViewYZ = function () { return this._StreetViewYZ.exit() }, O.prototype.createWeather = function (e, t, i) { return this._createWeather.createWeather(e, t, i) }, O.prototype.createParticleEffect = function (e, t, i, o) { let r = new xo(this._viewer, this._cesium); return this._Particle || (this._Particle = {}), this._Particle[e] || (this._Particle[e] = []), this._Particle[e].push(r), r.createParticleEffect(e, t, i, o) }, O.prototype.removeParticleEffect = function (e) { this._Particle && (this._Particle[e] && this._Particle[e].forEach(e => { e.deleteObject() }), this._Particle[e] = []) }, O.prototype.demolition = function (e, t) { let i = new br(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 sr(this._viewer, this._cesium); return t.createViewshed(e) }, O.prototype.add3DViewshedPoss = function (e) { let t = new sr(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 Mr(this._viewer, this._cesium).createlineOfSight(e, t) }, O.prototype.createSightLine = function (e) { let t = new yo(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) }, Br.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])) }, Vr.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 }, Vr.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 }, Vr.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 }, Vr.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 }, Vr.prototype.AddSectorScanPostStage = function (e, t, i, o, r, n) { var a = this._viewer, s = this._cesium, l = s.Cartographic.toCartesian(e), c = 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), u = 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, c, h) }, u_scanPlaneNormalEC: function () { var e = s.Matrix4.multiplyByVector(a.camera._viewMatrix, c, h), t = s.Matrix4.multiplyByVector(a.camera._viewMatrix, u, 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) }, Vr.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), c = (new Date).getTime(), u = 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, u) }, u_scanPlaneNormalEC: function () { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, u), 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() - c) % o) / o }, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Vr.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), c = (new Date).getTime(), u = 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, u) }, u_scanPlaneNormalEC: function () { var e = n.Matrix4.multiplyByVector(r.camera._viewMatrix, s, u), 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() - c) % o) / o; return e < t / 3 && 0 === p && 0 === d ? g = e : t / 3 <= e && e < 2 * t / 3 && 0 === d ? p = (g = e) - t / 3 : 2 * t / 3 <= e ? (p = (g = e) - t / 3, d = g - 2 * t / 3) : e < t / 3 && 0 !== p && 0 !== d ? (p = (d = e) + t / 3, g = e + 2 * t / 3) : t / 3 <= e && e < 2 * t / 3 && 0 !== d && (d = e - t / 3, g = (p = e) + t / 3), g }, u_maxRadius: t, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Vr.prototype.AddRadarScanPostStage = 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), a = n.Cartographic.toCartesian(a), l = new n.Cartesian4(a.x, a.y, a.z, 1), a = new n.Cartographic(e.longitude + n.Math.toRadians(.001), e.latitude, e.height), e = n.Cartographic.toCartesian(a), c = new n.Cartesian4(e.x, e.y, e.z, 1), u = new n.Quaternion, h = new n.Matrix3, m = (new Date).getTime(), d = new n.Cartesian4, p = new n.Cartesian4, g = new n.Cartesian4, f = new n.Cartesian3, _ = 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 vec3 u_scanLineNormalEC;\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 }\nbool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)\n{\nvec3 v01 = testPt - ptOnLine;\nnormalize(v01);\nvec3 temp = cross(v01, lineNormal);\nfloat d = dot(temp, u_scanPlaneNormalEC);\nreturn d > 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, c, 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, u), n.Matrix3.fromQuaternion(u, h), n.Matrix3.multiplyByVector(h, _, _), n.Cartesian3.normalize(_, _), _ }, u_scanColor: i } }); return r.scene.postProcessStages.add(a) }, Vr.prototype.remove = function () { this._viewer.scene.postProcessStages.remove(this.item) }, Vr.prototype.setTreeobj = function (e) { this.treeobj = e }, Vr.prototype.deleteObject = function () { this.item && this._viewer.scene.postProcessStages.remove(this.item) }, Vr.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(V.selectedItem) || "group" != V.selectedItem.type || (t = V.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(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id), n._core.getuid()), i = { id: t, name: "新建立方体" + t, pId: n._core.isnull(e) ? 0 : e, type: "box", item: n }; n.setTreeobj(i), V.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, c = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "box", position: { x: this._cesium.Math.toDegrees(c.longitude), y: this._cesium.Math.toDegrees(c.latitude), z: this._cesium.Math.toDegrees(c.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) } } } } }), Fr.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 }, Fr.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 }, Fr.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 = Tr(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(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), r._core.getuid()), i = { id: e, name: "新建球" + e, pId: r._core.isnull(t) ? 0 : t, type: "ellipsoid", item: r }; r.setTreeobj(i), V.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 = Tr(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 }, Fr.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 }, Fr.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, c = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "ellipsoid", position: { x: this._cesium.Math.toDegrees(c.longitude), y: this._cesium.Math.toDegrees(c.latitude), z: this._cesium.Math.toDegrees(c.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 } } }, Fr.prototype.setTreeobj = function (e) { this.treeobj = e }, Fr.prototype.setVisibility = function (e) { this.item.show = e }, Fr.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, Fr.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 }, Fr.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 }, Fr.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 }, Fr.prototype.setEllipsoidImage = function (e) { try { this.item._ellipsoid.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, Fr.prototype.setEllipsoidRepeat = function (e, t) { try { this.item._ellipsoid.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, Fr.prototype.setMaterial = function (e) { try { this.item._ellipsoid.show = e } catch (e) { console.log(e) } return this }, Fr.prototype.setRadii = function (e) { try { this.item._ellipsoid.radii = new this._cesium.Cartesian3(e, e, e) } catch (e) { console.log(e) } return this }, Fr.prototype.setItem = function (e) { this.item = e }, Fr.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(Fr.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) } } } } }), F.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 }), c = (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: c, 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)) : c = 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(V.selectedItem) || "group" != V.selectedItem.type || (e = V.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), V.insertGroupId(t, s._core.isnull(e) ? 0 : e), this }, F.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 }, F.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(V.selectedItem) || "group" != V.selectedItem.type || (e = V.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), V.insertGroupId(t, a._core.isnull(e) ? 0 : e), this }, F.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; e < r.gonRectangleArr.length; e++) { var t = r.gonRectangleArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function (e) { e = r._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (r.modifyPoint = e.id, o = "释放后完成修改"), r.forbidDrawWorld(!0); else { for (var t = 0; t < r.gonRectangleArr.length; t++) { var i = r.gonRectangleArr[t]; i && (i.show = !1) } r.modifyHandler && (r.modifyHandler.destroy(), r.modifyHandler = null) } }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function (e) { var t, i = r._viewer.scene.pick(e.endPosition); r._core.CreateTooltip(o, e.endPosition, !1), r.modifyPoint ? r.positions.length < 1 || !r.modifyPoint || ((t = r.getCatesian3FromPX(e.endPosition, r._viewer, [r.shape.entity, r.modifyPoint])) && (r.modifyPoint.position.setValue(t), r.shape.points[r.modifyPoint.wz] = r._viewer.scene.globe.ellipsoid.cartesianToCartographic(t), r.shape.rect = r._cesium.Rectangle.fromCartographicArray(r.shape.points), r.shape.rect.east += 1e-6, r.shape.rect.north += 1e-6), r._core.CreateTooltip(o, e.endPosition, !0)) : r._cesium.defined(i) && i.id && i.id.objId && r._core.CreateTooltip("拖动修改位置", e.endPosition, !0) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function (e) { r.forbidDrawWorld(!1), r.modifyPoint && (e = r.getCatesian3FromPX(e.position, r._viewer, [r.shape.entity, r.modifyPoint]), r.modifyPoint.position.setValue(e), r.shape.points[r.modifyPoint.wz] = r._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), r.shape.rect = r._cesium.Rectangle.fromCartographicArray(r.shape.points), r.shape.rect.east += 1e-6, r.shape.rect.north += 1e-6, r.modifyPoint = null, r.forbidDrawWorld(!1), o = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, F.prototype.createPoint = function (e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, F.prototype.getCatesian3FromPX = function (e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++)if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && this._cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, F.prototype.forbidDrawWorld = function (e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene.screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController.enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, F.prototype.CreateRectangle = function (e, t, i, o, r) { var n = this._core.getuid(), a = { outlineColor: this._cesium.Color.RED, material: this._cesium.Color.YELLOW.withAlpha(.5) }, i = (i && i.fillColor && (a.material = new m(this._viewer, this._cesium).colorFromHtmlColor(i.fillColor)), i && i.outlineColor && (a.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(i.outlineColor)), (a = this._core.extend(a, i, !1)).coordinates = this.getCoordinates(t), this.item = this._viewer.entities.add({ id: n, name: e || "新建矩形", rectangle: a }), "function" == typeof r && r(this.item), this._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (o = V.selectedItem.id), { id: n, name: "新建矩形" + n, pId: this._core.isnull(o) ? 0 : o, type: "rectangle", item: this.item }); return this.setTreeobj(i), V.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, F.prototype.getCoordinates = function (e) { var t, i, o = (e[0].lon > e[1].lon ? (t = e[1].lon, e[0]) : (t = e[0].lon, e[1])).lon, e = (e[0].lat > e[1].lat ? (i = e[0].lat, e[1]) : (i = e[1].lat, e[0])).lat; return new this._cesium.Rectangle.fromDegrees(t, e, o, i) }, F.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(V.selectedItem) || "group" != V.selectedItem.type || V.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), V.insertGroupId(e, a._core.isnull(t) ? 0 : t), this }, F.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), c = 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 + ")", u = 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: c, outlineWidth: u, near: m, far: h } } }, F.prototype.setTreeobj = function (e) { this.treeobj = e }, F.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; s < n.length; s++)o = this._cesium.Cartographic.fromCartesian(n[s]), i = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), 0 === s ? (a.west = i, a.north = o, a.east = i, a.south = o) : (i > a.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, c = this._viewer.camera.pitch, u = this._viewer.camera.roll, h = this._viewer.camera.position.clone(), m = { orientation: { heading: l, pitch: c, roll: u }, 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, c = d._viewer.camera.pitch, u = d._viewer.camera.roll, h = d._viewer.camera.position.clone(), m = { orientation: { heading: l, pitch: c, roll: u }, position: h }) }, this._viewer.scene.camera.percentageChanged = .001, this._viewer.scene.camera.changed.addEventListener(d.flyListener) }, F.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") }, F.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 }, F.prototype.isInArea = function (e, t) { var i = !1; return i = e.south > t.south && e.east < t.east && e.north < t.north && e.west > t.west ? !0 : i }, F.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 c(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 = c(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 = c(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 }, F.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(V.selectedItem) || "group" != V.selectedItem.type || (t = V.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), V.insertGroupId(s, r._core.isnull(t) ? 0 : t), "function" == typeof e && e(ploylinejl), this }, F.prototype.deleteObject = function () { this._viewer.entities.remove(this.item), null != this._viewEvent && (this._tree.handler.destroy(), this._viewer.scene.camera.changed.removeEventListener(this._viewEvent)) }, F.prototype.setVisibility = function (e) { this.item.show = e }, F.prototype.getVisibility = function () { return this.item.show }, F.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 }, F.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 }, F.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 }, F.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 }, F.prototype.setPolygonImage = function (e) { try { this.item._rectangle.material = new this._cesium.ImageMaterialProperty({ image: e }) } catch (e) { console.log(e) } return this }, F.prototype.setRectangleRepeat = function (e, t) { try { this.item._rectangle.material.repeat = new this._cesium.Cartesian2(e, t) } catch (e) { console.log(e) } return this }, F.prototype.setOutlineColor = function (e) { try { this.item._rectangle.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, F.prototype.setOutline = function (e) { try { this.item._rectangle.outline = e } catch (e) { console.log(e) } return this }, F.prototype.setExtrudedHeight = function (e) { try { this.item._rectangle.extrudedHeight = e } catch (e) { console.log(e) } return this }, F.prototype.setHeight = function (e) { try { this.item._rectangle.height = e } catch (e) { console.log(e) } return this }, Object.defineProperties(F.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), F.prototype.setItem = function (e) { this.item = e }, Object.defineProperties(F.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), Object.defineProperties(F.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(F.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(F.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(F.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), Object.defineProperties(F.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(F.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 } } } }), H.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 }, H.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 }, H.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 < s.gonCircleArr.length && (s.positions.pop(), s.state = 1, s.handler.destroy()), e.wz = s.gonCircleArr.length, s.gonCircleArr.push(e) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(function (e) { var t, i, o, r, n, a; s.positions.length < 1 || (e = s.getCatesian3FromPX(e.endPosition, s._viewer, [s.circle]), 2 != s.positions.length || s._cesium.defined(s.circle) || (t = s._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium.Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r.longitude), a = s._cesium.Math.toDegrees(r.latitude), s.radius = Tr(o, i, a, n), s.circle = s.createCircle(s.style), s.circle.objId = s.objId), s.circle && (s.positions.pop(), s.positions.push(e), t = s._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium.Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r.longitude), a = s._cesium.Math.toDegrees(r.latitude), s.radius = Tr(o, i, a, n))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE) }, H.prototype.startModify = function () { var n = "拖动修改位置"; if (2 == this.state || 1 == this.state) { this.modifyHandler || (this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas)); for (var a = this, e = 0; e < a.gonCircleArr.length; e++) { var t = a.gonCircleArr[e]; t && (t.show = !0) } this.modifyHandler.setInputAction(function (e) { e = a._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (a.modifyPoint = e.id, n = "释放后完成修改"), a.forbidDrawWorld(!0); else { for (var t = 0; t < a.gonCircleArr.length; t++) { var i = a.gonCircleArr[t]; i && (i.show = !1) } a.modifyHandler && (a.modifyHandler.destroy(), a.modifyHandler = null) } a.state = 2 }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function (e) { var t, i, o, r = a._viewer.scene.pick(e.endPosition); a._core.CreateTooltip(n, e.endPosition, !1), Cesium.defined(r) && r.id && (r.id.objId || a._core.CreateTooltip(n, e.endPosition, !0)), a.positions.length < 1 || !a.modifyPoint || ((r = a.getCatesian3FromPX(e.endPosition, a._viewer, [a.circle, a.modifyPoint])) && (a.modifyPoint.position.setValue(r), a.positions[a.modifyPoint.wz] = r, 0 == a.modifyPoint.wz ? a.gonCircleArr[1].position = { x: a.positions[0].x + a.radius, y: a.positions[0].y, z: a.positions[0].z } : (r = a._cesium.Cartographic.fromCartesian(a.positions[0]), t = a._cesium.Math.toDegrees(r.longitude), r = a._cesium.Math.toDegrees(r.latitude), o = a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]), i = a._cesium.Math.toDegrees(o.longitude), o = a._cesium.Math.toDegrees(o.latitude), a.radius = Tr(r, t, o, i))), a._core.CreateTooltip(n, e.endPosition, !0)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function (e) { var t, i, o; a.modifyPoint && (e = a.getCatesian3FromPX(e.position, a._viewer, [a.circle, a.modifyPoint]), a.modifyPoint.position.setValue(e), a.positions[a.modifyPoint.wz] = e, 0 == a.modifyPoint.wz ? a.gonCircleArr[1].position = { x: a.positions[0].x + a.radius, y: a.positions[0].y, z: a.positions[0].z } : (e = a._cesium.Cartographic.fromCartesian(a.positions[0]), t = a._cesium.Math.toDegrees(e.longitude), e = a._cesium.Math.toDegrees(e.latitude), o = a._cesium.Cartographic.fromCartesian(a.positions[a.modifyPoint.wz]), i = a._cesium.Math.toDegrees(o.longitude), o = a._cesium.Math.toDegrees(o.latitude), a.radius = Tr(e, t, o, i)), a.modifyPoint = null, a.forbidDrawWorld(!1), n = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, H.prototype.forbidDrawWorld = function (e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene.screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController.enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, H.prototype.getCatesian3FromPX = function (e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++)if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, H.prototype.createCircle = function (e) { var t = this; return this._viewer.entities.add({ position: new t._cesium.CallbackProperty(function () { return t.positions[0] }, !1), ellipse: { semiMinorAxis: new t._cesium.CallbackProperty(function () { return t.radius }, !1), semiMajorAxis: new t._cesium.CallbackProperty(function () { return t.radius }, !1), material: t._cesium.Color.BLUE.withAlpha(.5), outline: e.outline || !0 } }) }, H.prototype.createPoint = function (e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, H.prototype.executeClircle = function (e) { var i = [], o = this, r = (this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), new this._cesium.ScreenSpaceEventHandler(o._viewer.scene.canvas)); function n() { return Tr(i[0].lat, i[0].lon, i[1].lat, i[1].lon) } return r.setInputAction(function (e) { var t, e = o._getPosition.getMousePosition(e, [o.item]); e && (e = o._cesium.Cartographic.fromCartesian(e), t = o._cesium.Math.toDegrees(e.longitude), e = o._cesium.Math.toDegrees(e.latitude), i.push({ lon: t, lat: e }), 1 == i.length ? (i.push({ lon: t, lat: e }), (t = o._viewer.entities.add({ position: o._cesium.Cartesian3.fromDegrees(i[0].lon, i[0].lat), ellipse: { semiMinorAxis: 0, semiMajorAxis: 0, material: o._cesium.Color.fromRandom({ alpha: .8 }) } })).ellipse.semiMinorAxis = new o._cesium.CallbackProperty(n, !1), t.ellipse.semiMajorAxis = new o._cesium.CallbackProperty(n, !1), o.item = t) : (e = n(), o._core.mouse(o._viewer.container, 0, "0"), o.item.ellipse.semiMinorAxis = e, o.item.ellipse.semiMajorAxis = e, r.destroy(), r = void 0, i = [])) }, o._cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function (e) { var t; !i.length || (e = o._getPosition.getMousePosition(e, [o.item])) && (e = o._cesium.Cartographic.fromCartesian(e), t = o._cesium.Math.toDegrees(e.longitude), e = o._cesium.Math.toDegrees(e.latitude), i[1] = { lon: t, lat: e }) }, o._cesium.ScreenSpaceEventType.MOUSE_MOVE), this }, H.prototype.executeClirclews = function (e) { var r = this, t = (this._cesium.Material.fromType(this._cesium.Material.ColorType).uniforms.color = new this._cesium.Color(1, 1, 0, .5), this._cesium.Ellipsoid.WGS84), i = this, o = this._viewer.scene, n = this._viewer.scene.primitives, a = null, s = new this._cesium.ScreenSpaceEventHandler(o.canvas), l = (s.setInputAction(function (e) { null != e.position && (e = o.camera.pickEllipsoid(e.position, t)) && (null == a ? (a = new l({ center: e, radius: 0, asynchronous: !1, material: r._cesium.Color.RED }), n.add(a)) : i.stopDrawing()) }, r._cesium.ScreenSpaceEventType.LEFT_DOWN), s.setInputAction(function (e) { var e = e.endPosition; null != e && null != a && (e = o.camera.pickEllipsoid(e, t)) && a.setRadius(r._cesium.Cartesian3.distance(a.getCenter(), e)) }, r._cesium.ScreenSpaceEventType.MOUSE_MOVE), function () { function e(e) { if (!r._cesium.defined(e.center) || !r._cesium.defined(e.radius)) throw new r._cesium.DeveloperError("Center and radius are required"); e = copyOptions(e, defaultSurfaceOptions), this.initialiseOptions(e), this.setRadius(e.radius) } return (e.prototype = new c).setCenter = function (e) { this.setAttribute("center", e) }, e.prototype.setRadius = function (e) { this.setAttribute("radius", Math.max(.1, e)) }, e.prototype.getCenter = function () { return this.getAttribute("center") }, e.prototype.getRadius = function () { return this.getAttribute("radius") }, e.prototype.getGeometry = function () { if (r._cesium.defined(this.center) && r._cesium.defined(this.radius)) return new r._cesium.CircleGeometry({ center: this.center, radius: this.radius, height: this.height, vertexFormat: r._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, stRotation: this.textureRotationAngle, ellipsoid: this.ellipsoid, granularity: this.granularity }) }, e.prototype.getOutlineGeometry = function () { return new r._cesium.CircleOutlineGeometry({ center: this.getCenter(), radius: this.getRadius() }) }, e }), c = (u.prototype.initialiseOptions = function (e) { fillOptions(this, e), this._ellipsoid = void 0, this._granularity = void 0, this._height = void 0, this._textureRotationAngle = void 0, this._id = void 0, this._createPrimitive = !0, this._primitive = void 0, this._outlinePolygon = void 0 }, u.prototype.setAttribute = function (e, t) { this[e] = t, this._createPrimitive = !0 }, u.prototype.getAttribute = function (e) { return this[e] }, u.prototype.update = function (e, t, i) { if (!r._cesium.defined(this.ellipsoid)) throw new r._cesium.DeveloperError("this.ellipsoid must be defined."); if (!r._cesium.defined(this.appearance)) throw new r._cesium.DeveloperError("this.material must be defined."); if (this.granularity < 0) throw new r._cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero."); if (this.show && (this._createPrimitive || r._cesium.defined(this._primitive))) { if (this._createPrimitive || this._ellipsoid !== this.ellipsoid || this._granularity !== this.granularity || this._height !== this.height || this._textureRotationAngle !== this.textureRotationAngle || this._id !== this.id) { var o = this.getGeometry(); if (!o) return; this._createPrimitive = !1, this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._textureRotationAngle = this.textureRotationAngle, this._id = this.id, this._primitive = this._primitive && this._primitive.destroy(), this._primitive = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: o, id: this.id, pickPrimitive: this }), appearance: this.appearance, asynchronous: this.asynchronous }), this._outlinePolygon = this._outlinePolygon && this._outlinePolygon.destroy(), this.strokeColor && this.getOutlineGeometry && (this._outlinePolygon = new r._cesium.Primitive({ geometryInstances: new r._cesium.GeometryInstance({ geometry: this.getOutlineGeometry(), attributes: { color: r._cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor) } }), appearance: new r._cesium.PerInstanceColorAppearance({ flat: !0, renderState: { depthTest: { enabled: !0 }, lineWidth: Math.min(this.strokeWidth) } }) })) } o = this._primitive; o.appearance.material = this.material, o.debugShowBoundingVolume = this.debugShowBoundingVolume, o.update(e, t, i), this._outlinePolygon && this._outlinePolygon.update(e, t, i) } }, u.prototype.isDestroyed = function () { return !1 }, u.prototype.destroy = function () { return this._primitive = this._primitive && this._primitive.destroy(), r._cesium.destroyObject(this) }, u.prototype.setStrokeStyle = function (e, t) { this.strokeColor && this.strokeColor.equals(e) && this.strokeWidth == t || (this._createPrimitive = !0, this.strokeColor = e, this.strokeWidth = t) }, u); function u() { } }, H.prototype.setSemiMajorAxis = function (e) { try { this.item._ellipse.semiMajorAxis = e } catch (e) { console.log(e) } return this }, H.prototype.setSemiMinorAxis = function (e) { try { this.item._ellipse.semiMinorAxis = e } catch (e) { console.log(e) } return this }, H.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show._value, t = null == this.item.ellipse.semiMajorAxis ? void 0 : this.item.ellipse.semiMajorAxis._value, i = null == this.item.ellipse.semiMinorAxis ? void 0 : this.item.ellipse.semiMinorAxis._value, o = (null == this.item.ellipse.height || this.item.ellipse.height._value, null == this.item.ellipse.extrudedHeight ? void 0 : this.item.ellipse.extrudedHeight._value), r = null == this.item.ellipse.rotation ? void 0 : this.item.ellipse.rotation._value, n = null == this.item.ellipse.stRotation ? void 0 : this.item.ellipse.stRotation._value, a = null == this.item.ellipse.fill ? void 0 : this.item.ellipse.fill._value, s = this.item.ellipse.material, l = (null != s && (s = { color: null == s.color ? 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.ellipse.outline ? void 0 : this.item.ellipse.outline._value), c = null == this.item.ellipse.outlineColor ? void 0 : "rgba(" + this.item.ellipse.outlineColor._value.red + "," + this.item.ellipse.outlineColor._value.green + "," + this.item.ellipse.outlineColor._value.blue + "," + this.item.ellipse.outlineColor._value.alpha + ")", u = null == this.item.ellipse.outlineWidth ? void 0 : this.item.ellipse.outlineWidth._value, h = null == this.item.ellipse.numberOfVerticalLines ? void 0 : this.item.ellipse.numberOfVerticalLines._value, m = this.item.ellipse.distanceDisplayCondition, d = null == m ? void 0 : m._value.near, m = null == m ? void 0 : m._value.far, p = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "circle", position: { x: this._cesium.Math.toDegrees(p.longitude), y: this._cesium.Math.toDegrees(p.latitude), z: p = this._cesium.Math.toDegrees(p.height) }, treeobj: { name: this.treeobj.name }, style: { show: e, semiMajorAxis: t, semiMinorAxis: i, height: p, extrudedHeight: o, rotation: r, stRotation: n, fill: a, material: s, outline: l, outlineColor: c, outlineWidth: u, numberOfVerticalLines: h, near: d, far: m } } }, H.prototype.setTreeobj = function (e) { this.treeobj = e }, H.prototype.setHeight = function (e) { try { this.item._ellipse.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND, this.item._ellipse.height = e } catch (e) { console.log(e) } return this }, H.prototype.setHeightType = function (e) { try { 1 == e ? this.item._ellipse.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._ellipse.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item._ellipse.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, H.prototype.setDistanceDisplayCondition = function (e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._ellipse.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, H.prototype.setEllipseImage = function (e) { try { this.item._ellipse.material.uniforms.image = e } catch (e) { console.log(e) } return this }, H.prototype.setOutlineColor = function (e) { try { this.item._ellipse.outlineWidth = 5, this.item._ellipse.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, H.prototype.setMaterial = function (e) { try { this.item._ellipse.material.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e) } catch (e) { console.log(e) } return this }, H.prototype.setMaterialAlpha = function (e) { try { this.item._ellipse.material.color._value.alpha = e, this.item._ellipse.show = !0 } catch (e) { console.log(e) } return this }, H.prototype.setItem = function (e) { this.item = e }, H.prototype.setExtrudedHeight = function (e) { try { this.item._ellipse.extrudedHeight = e } catch (e) { console.log(e) } return this }, H.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, H.prototype.CreateCircle = function (e, t, i, o, r, n) { this._postion = e; var a, t = { semiMinorAxis: this._cesium.defaultValue(t, 3e5), semiMajorAxis: this._cesium.defaultValue(t, 3e5), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.WHITE }, i = (i && "" !== i && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(i)), o && "" !== o && (t.material = new m(this._viewer, this._cesium).colorFromHtmlColor(o)), (e.Yaw || e.Pitch || e.Roll) && (a = 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: n, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), ellipse: t, orientation: a }), { id: this.item.id, name: n, pId: this._core.isnull(r) ? 0 : r, type: "circle", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(r) ? 0 : r), this }, H.prototype.CreateEllipse = function (e, t, i, o, r, n, a, s) { this._postion = e; var l, t = { semiMinorAxis: this._cesium.defaultValue(t, 3e5), semiMajorAxis: this._cesium.defaultValue(i, 1e5), numberOfVerticalLines: this._cesium.defaultValue(n, 16), material: this._cesium.Color.YELLOW, outline: !0, outlineColor: this._cesium.Color.WHITE }, i = (o && "" !== o && (t.outlineColor = new m(this._viewer, this._cesium).colorFromHtmlColor(o)), 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), ellipse: t, orientation: l }), { id: this.item.id, name: s, pId: this._core.isnull(a) ? 0 : a, type: "ellipse", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(a) ? 0 : a), this }, Object.defineProperties(H.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) } } } } }), G.prototype.createLabel = function (e, t, i, o, r) { var n = { id: this._core.getuid(), text: "default text", backgroundColor: new m(this._viewer, this._cesium).createColor(.165, .165, .165, 1), fillColor: new m(this._viewer, this._cesium).createColor(.9411764705882353, .9725490196078431, 1, 1), font: "30px sans-serif", horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, show: !0, scale: 1, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(0, Number.MAX_VALUE) }, n = this._core.extend(n, i, !0), i = (this._core.isnull(t) || (n.text = t), !n.fillColor || this._core.isnull(n) || this._core.isnull(n.fillColor) || "[" == n.fillColor.toString().charAt(0) && "]" == n.fillColor.toString().charAt(n.fillColor.length - 1) || (this._core.isHtmlColor(n.fillColor) && /^#/.test(n.fillColor.toString()) ? n.fillColor = this._Color.colorFromHtmlColor(n.fillColor) : (/^rgb/.test(n.fillColor) && (n.fillColor = this._Color.rgbaStringToRgbaObj(n.fillColor)), 1 < n.fillColor.r && (n.fillColor.r = n.fillColor.r / 255), 1 < n.fillColor.g && (n.fillColor.g = n.fillColor.g / 255), 1 < n.fillColor.b && (n.fillColor.b = n.fillColor.b / 255), 1 < n.fillColor.a && (n.fillColor.a = n.fillColor.a / 255), n.fillColor.r && (n.fillColor = this._Color.createColor(n.fillColor.r, n.fillColor.g, n.fillColor.b, n.fillColor.a)))), !n.backgroundColor || this._core.isnull(n) || this._core.isnull(n.backgroundColor) || "[" == n.backgroundColor.toString().charAt(0) && "]" == n.backgroundColor.toString().charAt(n.backgroundColor.length - 1) || (this._core.isHtmlColor(n.backgroundColor) && /^#/.test(n.backgroundColor.toString()) ? n.backgroundColor = this._Color.colorFromHtmlColor(n.backgroundColor) : (/^rgb/.test(n.backgroundColor) && (n.backgroundColor = this._Color.rgbaStringToRgbaObj(n.backgroundColor)), 1 < n.backgroundColor.r && (n.backgroundColor.r = n.backgroundColor.r / 255), 1 < n.backgroundColor.g && (n.backgroundColor.g = n.backgroundColor.g / 255), 1 < n.backgroundColor.b && (n.backgroundColor.b = n.backgroundColor.b / 255), 1 < n.backgroundColor.a && (n.backgroundColor.a = n.backgroundColor.a / 255), n.backgroundColor.r && (n.backgroundColor = this._Color.createColor(n.backgroundColor.r, n.backgroundColor.g, n.backgroundColor.b, n.backgroundColor.a)))), !n.outlineColor || this._core.isnull(n) || this._core.isnull(n.outlineColor) || "[" == n.outlineColor.toString().charAt(0) && "]" == n.outlineColor.toString().charAt(n.outlineColor.length - 1) || (this._core.isHtmlColor(n.outlineColor) && /^#/.test(n.outlineColor.toString()) ? n.outlineColor = this._Color.colorFromHtmlColor(n.outlineColor) : (/^rgb/.test(n.outlineColor) && (n.outlineColor = this._Color.rgbaStringToRgbaObj(n.outlineColor)), 1 < n.outlineColor.r && (n.outlineColor.r = n.outlineColor.r / 255), 1 < n.outlineColor.g && (n.outlineColor.g = n.outlineColor.g / 255), 1 < n.outlineColor.b && (n.outlineColor.b = n.outlineColor.b / 255), 1 < n.outlineColor.a && (n.outlineColor.a = n.outlineColor.a / 255), n.outlineColor.r && (n.outlineColor = this._Color.createColor(n.outlineColor.r, n.outlineColor.g, n.outlineColor.b, n.outlineColor.a)))), n.near && n.far && (n.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(n.near, n.far)), this.item = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), label: n }), { id: this.item.id, name: n.text, pId: this._core.isnull(o) ? 0 : o, type: "label", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, G.prototype.getstyles = function () { var e = {}; return e.backgroundColor = "rgba" + this.item.label._backgroundColor.toString(), e.fillColor = "rgba" + this.item.label._fillColor.toString(), e.text = this.item.label.text.toString(), e.show = !this.item.label.show || this.item.label.show._value, e.font = this.item.label.font ? this.item.label.font.toString() : null, e.style = !this.item.label.style || "null" == this.item.label.style.toString() ? null : this.item.label.style.toString(), e.scale = this.item.label.scale ? this.item.label.scale.toString() : null, e.showBackground = this.item.label.showBackground ? this.item.label.showBackground._value : null, e.horizontalOrigin = this.item.label.horizontalOrigin ? this.item.label.horizontalOrigin.toString() : null, e.verticalOrigin = this.item.label.verticalOrigin ? this.item.label.verticalOrigin.toString() : null, e.heightReference = this.item.label.heightReference ? this.item.label.heightReference.toString() : null, e.outlineColor = this.item.label.outlineColor ? "rgba" + this.item.label.outlineColor.toString() : null, e.outlineWidth = this.item.label.outlineWidth ? this.item.label.outlineWidth._value : null, e.near = this.item.label.distanceDisplayCondition ? this.item.label.distanceDisplayCondition._value.near : null, e.far = this.item.label.distanceDisplayCondition ? this.item.label.distanceDisplayCondition._value.far : null, e.position = this.item.position.getValue().toString(), e }, G.prototype.executeLabel = function (e) { var i = this, t = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas); return t.setInputAction(function (e) { e = i._viewer.scene.camera.pickEllipsoid(e.position, i._viewer.scene.globe.ellipsoid), e = i._viewer.entities.add({ position: e, label: { id: i._core.getuid(), text: "", font: "30px sans-serif", horizontalOrigin: i._cesium.HorizontalOrigin.CENTER, verticalOrigin: i._cesium.VerticalOrigin.CENTER, show: !0, showBackground: !0 } }), i.item = e, e = 0; i._core.isnull(V.selectedItem) || "group" != V.selectedItem.type || (e = V.selectedItem.id); var t = { id: i._core.getuid(), name: "", pId: i._core.isnull(e) ? 0 : e, type: "Point", item: i }; i.setTreeobj(t), i._tree.insertGroupId(t, i._core.isnull(e) ? 0 : e) }, i._cesium.ScreenSpaceEventType.LEFT_CLICK), t.setInputAction(function (e) { t.destroy() }, i._cesium.ScreenSpaceEventType.RIGHT_CLICK), this }, G.prototype.deleteObject = function () { try { var e; "DivPoint" === this.item.type ? (this.pointPrimitive.remove(this.item), (e = document.getElementById(this.item.id)) && e.remove()) : this._viewer.entities.remove(this.item) } catch (e) { } }, G.prototype.setVisibility = function (e) { this.item.show = e }, G.prototype.setRichtext = function (e) { var o, r, n, t = this._core.getuid(), i = (null != this.item.position._value ? this._position = this.item.position._value : this._position = this.item.position, this.treeobj.pId), t = (this.deleteObject(), this.pointPrimitive || (this.pointPrimitive = this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection), (n = this).pointPrimitive.update = function () { for (var e, t, i = 0; i < n.pointPrimitive.length; i++) { if (e = n.pointPrimitive.get(i), r = e.position, !(r = n._viewer.scene.cartesianToCanvasCoordinates(r))) return; o = document.getElementById(e.id), e.name || (e.name = "泰瑞"), o = o || (t = e.description ? '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div>\n                   <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">' + e.description + "</div> \n           </div>" : '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint1 + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + e.name + "</div>\n           </div>", $(".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 < a.fillColor.r && (a.fillColor.r = a.fillColor.r / 255), 1 < a.fillColor.g && (a.fillColor.g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor.b = a.fillColor.b / 255), 1 < a.fillColor.a && (a.fillColor.a = a.fillColor.a / 255), a.fillColor = this._Color.createColor(a.fillColor.r, a.fillColor.g, a.fillColor.b, a.fillColor.a))), this._core.isnull(o) || this._core.isnull(o.LineColor) || "[" == o.LineColor.toString().charAt(0) && "]" == o.LineColor.toString().charAt(o.LineColor.length - 1) || (this._core.isHtmlColor(o.LineColor) ? a.outlineColor = this._Color.colorFromHtmlColor(o.LineColor) : (/^rgb/.test(o.LineColor) && (a.outlineColor = this._Color.rgbaStringToRgbaObj(o.LineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = this._Color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), a = this._core.extend(a, o, !0), { position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), label: a }), i = (i && "" !== i && (e.label.pixelOffset = this._cesium.defaultValue(o.pixelOffset, { x: 30 * (t.length / 2 + 1), y: -30 }), t = { image: i, horizontalOrigin: this._cesium.defaultValue(o.ImageHorizontal, this._cesium.HorizontalOrigin.CENTER), verticalOrigin: this._cesium.defaultValue(o.ImageVertical, this._cesium.VerticalOrigin.BOTTOM), show: !0, scale: o.ImageScale || 1, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(o.ImageMinViewingHeight || 0, o.ImageMaxViewingHeight || 99999999999999) }, o.pixelOffset = { x: 0, y: 0 }, t = this._core.extend(t, o, !1), e.billboard = t), this.item = this._viewer.entities.add(e), { id: this.item.id, name: a.text, pId: this._core.isnull(r) ? 0 : r, type: "label", item: this }); return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(r) ? 0 : r), this }, G.prototype.export = function () { var e = null == this.item.label.show ? void 0 : this.item.label.show._value, t = null == this.item.label.text ? void 0 : this.item.label.text._value, i = null == this.item.label.font ? void 0 : this.item.label.font._value, o = null == this.item.label.style ? void 0 : this.item.label.style._value, r = null == this.item.label.scale ? void 0 : this.item.label.scale._value, n = null == this.item.label.showBackground ? void 0 : this.item.label.showBackground._value, a = null == this.item.label.backgroundColor ? void 0 : "rgba(" + this.item.label.backgroundColor._value.red + "," + this.item.label.backgroundColor._value.green + "," + this.item.label.backgroundColor._value.blue + "," + this.item.label.backgroundColor._value.alpha + ")", s = null == this.item.label.horizontalOrigin ? void 0 : this.item.label.horizontalOrigin._value, l = null == this.item.label.verticalOrigin ? void 0 : this.item.label.verticalOrigin._value, c = null == this.item.label.heightReference ? void 0 : this.item.label.heightReference._value, u = null == this.item.label.fillColor ? void 0 : "rgba(" + this.item.label.fillColor._value.red + "," + this.item.label.fillColor._value.green + "," + this.item.label.fillColor._value.blue + "," + this.item.label.fillColor._value.alpha + ")", h = null == this.item.label.outlineColor ? void 0 : "rgba(" + this.item.label.outlineColor._value.red + "," + this.item.label.outlineColor._value.green + "," + this.item.label.outlineColor._value.blue + "," + this.item.label.outlineColor._value.alpha + ")", m = null == this.item.label.outlineWidth ? void 0 : this.item.label.outlineWidth._value, d = this.item.label.distanceDisplayCondition, p = null == d ? void 0 : d._value.near, d = null == d ? void 0 : d._value.far, g = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "label", position: { x: this._cesium.Math.toDegrees(g.longitude), y: this._cesium.Math.toDegrees(g.latitude), z: this._cesium.Math.toDegrees(g.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, text: t, font: i, style: o, scale: r, showBackground: n, backgroundColor: a, horizontalOrigin: s, verticalOrigin: l, heightReference: c, fillColor: u, outlineColor: h, outlineWidth: m, near: p, far: d } } }, G.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(G.prototype, { position: { Altitude: { get: function () { return this._postion.Altitude }, set: function (e) { try { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = this._cesium.Math.toDegrees(t.latitude), r = (this._cesium.Math.toDegrees(t.height), this._cesium.Cartesian3.fromDegrees(i, o, e)); this.item.position.position = r, this._postion.Altitude = e } 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 } catch (e) { console.log(e) } } }, Roll: { get: function () { return this._postion.Roll }, set: function (e) { try { this._postion.Roll = e } catch (e) { console.log(e) } } }, X: { get: function () { return this._postion.X }, set: function (e) { try { this._postion.X = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t.latitude)), o = this._cesium.Math.toDegrees(t.height), r = this._cesium.Cartesian3.fromDegrees(e, i, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Y: { get: function () { return this._postion.Y }, set: function (e) { try { this._postion.Y = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t.height)), r = this._cesium.Cartesian3.fromDegrees(i, e, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Yaw: { get: function () { return this._postion.Yaw }, set: function (e) { try { this._postion.Yaw = e } catch (e) { console.log(e) } } } }, LabelStyle: { BackgroundColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.backgroundColor = e, this.item.backgroundColor = e) }, 500), get: function () { var e = this.item.label.backgroundColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Bold: { get: function () { return -1 != this.item._label.font.getValue().indexOf("bold") }, set: function () { var e = "bold " + this.item._label.font.getValue(); this.item._label.font.setValue(e) } }, FontName: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if ("bold" != e[t] && -1 == e[t].indexOf("px") && -1 == e[t].indexOf("PX")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)"bold" != t[o] && -1 == t[o].indexOf("px") && -1 == t[o].indexOf("PX") || (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FontSize: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if (-1 != e[t].indexOf("px")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)-1 != t[o].indexOf("px") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FrameFileName: { get: function () { return "" }, set: function (e) { } }, IconColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function () { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if (-1 != e[t].indexOf("italic")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)-1 != t[o].indexOf("italic") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, LimitScreenSize: { get: function () { return "" }, set: function (e) { } }, LineColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.outlineColor = e) }, 500), get: function () { var e = this.item.label.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, LineToGround: { get: function () { return "" }, set: function (e) { } }, LockMode: { get: function () { return "" }, set: function (e) { } }, MaxImageSize: { get: function () { return "" }, set: function (e) { } }, MaxViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.far }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.near), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.near }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.far), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function () { return "" }, set: function (e) { } }, PivotAlignment: { get: function () { return "" }, set: function (e) { } }, Scale: { get: function () { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function (e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function () { return "" }, set: function (e) { } }, TextColor: { get: function () { return "" }, set: function (e) { } }, TextOnImage: { get: function () { return "" }, set: function (e) { } }, Underline: { get: function () { return "" }, set: function (e) { } } } }), k.prototype.executeFlycesium = function (t) { var i = this, o = (e.prototype._init = function () { var e = this; this.options.polyline.positions = new i._cesium.CallbackProperty(function () { return e.positions }, !1), this.flycesium = i._viewer.entities.add(this.options), i.item = this.flycesium }, e); function e(e) { this.options = { polyline: { show: !0, positions: [], material: new i._cesium.PolylineGlowMaterialProperty({ glowPower: .1, color: i._cesium.Color.YELLOW }), width: 10, clampToGround: !0 } }, this.positions = e, this._init() } var r = this.handler = new i._cesium.ScreenSpaceEventHandler(i._viewer.scene.canvas), n = [], a = 0, s = void 0, l = { polyline: {}, cameraRoll: null, cameraPitch: null, cameraPosition: null, cameraHeading: null, positions: [], distance: [], Totaltime: "" }, c = this._core.CreateTooltip(); return this._core.mouse(this._viewer.container, 1, window.SmartEarthRootUrl + I.draw), r.setInputAction(function (e) { e = i._getPosition.getMousePosition(e); "pc" === i._core.getBrowser().pc && 0 == n.length && n.push(e.clone()), n.push(e), 2 <= n.length && (i._cesium.defined(s) || (s = new o(n)), a = i._core.getSpaceDistancem(n, i._cesium)) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), r.setInputAction(function (e) { c.showAt(e.endPosition, "左键开始,右键结束!"); e = i._getPosition.getMousePosition(e); 2 <= n.length && (i._cesium.defined(s) ? e && (n.pop(), n.push(e)) : s = new o(n), a = i._core.getSpaceDistancem(n, i._cesium)) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE), r.setInputAction(function (e) { i.end() }, this._cesium.ScreenSpaceEventType.RIGHT_CLICK), this.end = function (e) { r.destroy(), c.show(!1), i._core.mouse(i._viewer.container, 0), i.end = void 0, i._viewer.entities.remove(i.item), "cancel" === e || n.length < 2 || (a = i._core.getSpaceDistancem(n, i._cesium), l.polyline = s, l.positions = n, l.distance = parseFloat(a), i.setFlycesium(l, function (e) { i.flyceium = e, i.ploylinejl = l, "function" == typeof t && t(e) })) }, this }, k.prototype.getFlyData = function (e, t) { let i = []; "object" == typeof e[0] ? e.forEach(e => { 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 < e.positions.length; o++) { var r = this._cesium.Cartographic.fromCartesian(e.positions[o]), r = [r.longitude / Math.PI * 180, r.latitude / Math.PI * 180, r.height]; i.push(r) } var n = (e.distance / 50.5).toFixed(1), n = { id: this._core.getuid(), name: "新建路线", distance: e.distance, showPoint: !1, showLine: !0, showModel: !0, isLoop: !1, Totaltime: Math.round(n), speed: 50.5, height: 10, perPositionHeight: !1, pitch: -20, range: 100, mode: 0, url: window.SmartEarthRootUrl + I.testModel, geojson: { geometry: { type: "LineString", coordinates: i } } }; return t && t(n), n }, k.prototype.Start = function (e, t, i) { var o = this; return e.geojson, e.Totaltime || (e.Totaltime = 3e3), o._entityFly && o.exit(), Jr = i, setTimeout(function () { o.executeFly3D(e, t) }, 200), this }; var Hr, Gr, kr, Nr, jr, Ur, zr, Wr = null, Yr = null, Jr = null, N = { start: null, time: null, longitude: 0, latitude: 0, cameraHeight: 10, speed: 50.5, multiplier: 1, position: 0 }, Kr = 0, Qr = (k.prototype.executeFly3D = function (e, t) { var l = this, i = e.geojson; if (Hr = new l._cesium.Cartesian3, Nr = new l._cesium.SampledProperty(Number), jr = new l._cesium.SampledPositionProperty, i && i.geometry) { var o = i.geometry.coordinates, r = [], n = []; if (0 < o.length) { for (var a = 0; a < o.length; a++) { var s = o[a][0], c = o[a][1], u = o[a][2]; void 0 === e.lineHeight || e.perPositionHeight || (u = e.lineHeight), n.push(s, c, u), r.push({ x: s, y: c, z: u }) } l._viewer.clock.clockRange = e.isLoop ? l._cesium.ClockRange.LOOP_STOP : l._cesium.ClockRange.CLAMPED, l._viewer.clock.multiplier = e.multiplier || 1, l._viewer.clock.canAnimate = !1, l._viewer.clock.shouldAnimate = !0, N.distance = e.distance, N.cameraHeight = this._core.defaultValue(e.height, 10), N.lineHeight = e.lineHeight, N.perPositionHeight = e.perPositionHeight, N.pitch = e.pitch, N.range = e.range, N.speed = e.speed || 50.5, N.Totaltime = e.distance / N.speed, N.start = l._cesium.JulianDate.fromDate(new Date), N.stop = l._cesium.JulianDate.addSeconds(N.start, N.Totaltime, new l._cesium.JulianDate), l._viewer.clock.startTime = N.start.clone(), l._viewer.clock.stopTime = N.stop.clone(), l._viewer.clock.currentTime = N.start.clone(); var i = l.computeCirclularFlight(r), h = (N.position = i, N.degrees = r, kr = new l._cesium.VelocityOrientationProperty(i), {}), h = "" !== t ? { show: l._cesium.defaultValue(e.showModel, !0), scale: l._cesium.defaultValue(e.modelScale, 1), uri: t } : { show: l._cesium.defaultValue(e.showModel, !0), scale: l._cesium.defaultValue(e.modelScale, 1) }; e.modelData && (h = l._core.extend(h, e.modelData)), zr = function () { }, Wr = l._viewer.entities.add({ availability: new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({ start: N.start, stop: N.stop })]), position: i, polyline: { clampToGround: void 0 === N.lineHeight && !N.perPositionHeight, positions: Cesium.Cartesian3.fromDegreesArrayHeights(n), show: l._cesium.defaultValue(e.showLine, !0), material: new l._cesium.PolylineGlowMaterialProperty({ glowPower: .1, color: l._cesium.Color.YELLOW }), width: 10 }, label: { text: new l._cesium.CallbackProperty(function (e, t) { if (l._viewer.camera, 2 === l._viewer.clock.clockRange || !Cesium.JulianDate.equals(l._viewer.clock.currentTime, l._viewer.clock.stopTime)) { try { var i, o, r = Qr.position.getValue(l._viewer.clock.currentTime), n = l._cesium.Cartographic.fromCartesian(r); N.longitude = l._cesium.Math.toDegrees(n.longitude), N.latitude = l._cesium.Math.toDegrees(n.latitude), void 0 !== N.lineHeight || N.perPositionHeight || (i = l._viewer.scene.sampleHeight(n, [Yr, Qr]), o = l._viewer.scene.globe.getHeight(n), Yr.position = l._cesium.Cartesian3.fromRadians(n.longitude, n.latitude, i < o ? o : i)) } catch (e) { } try { Gr.getValue(e, Hr), zr(e); var a = l._cesium.Cartesian3.magnitude(Hr), s = Math.round(3.6 * a); s += " km/h", N.time = l._cesium.JulianDate.secondsDifference(e, N.start), N.ratio = N.time / N.Totaltime, N.distanceTraveled = N.ratio * N.distance, N.speed = s, N.height = n.height, N.globeHeight = l._viewer.scene.globe.getHeight(n), null != Jr && "function" == typeof Jr && Jr(N) } catch (e) { } return "" } Wr.label.text = "", N.time = N.Totaltime, N.ratio = 1, N.distanceTraveled = N.distance, l.exit(), null != Jr && "function" == typeof Jr && Jr(N, "end"), zr = function () { } }, !1), font: "20px sans-serif", showBackground: !1, distanceDisplayCondition: new l._cesium.DistanceDisplayCondition(0, 100), eyeOffset: new l._cesium.Cartesian3(0, 3.5, 0) } }), Yr = l._viewer.entities.add({ availability: new l._cesium.TimeIntervalCollection([new l._cesium.TimeInterval({ start: N.start, stop: N.stop })]), position: i, orientation: kr, point: { show: l._cesium.defaultValue(e.showPoint, !1), color: l._cesium.Color.RED, outlineColor: l._cesium.Color.WHITE, outlineWidth: 2, pixelSize: 10 }, model: h, billboard: e.image, viewFrom: e.viewFrom || new l._cesium.Cartesian3(500, 500, 500) }), Qr = Wr, l._viewer.trackedEntity = Yr, l._entityFly = Wr, e.mode && l.changeFlyMode(e.mode) } } }, null); function qr(e) { Kr = Nr.getValue(e), N.heading = Kr } function Xr(e) { var e = Cesium.Cartographic.fromCartesian(e), t = Cesium.Math.toDegrees(e.longitude), i = Cesium.Math.toDegrees(e.latitude); return Cesium.Cartesian3.fromDegrees(t, i, e.height + N.cameraHeight) } function j(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this.positions = [], this.objId = Number((new Date).getTime() + "" + Number(1e3 * Math.random()).toFixed(0)), this.handler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.modifyHandler = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.style = null, this.state = 0, this.gonCircleArr = [], this.gonPointStretchingArr = [], this.topRadius = 0, this.bottomRadius = 0, this.length = 50 } function Zr(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._polyline = void 0, this._polygon = void 0, this._box = new B(e, t), this._ellipsoid = new Fr(e, t), this._rectangle = new F(e, t), this._circle = new H(e, t), this._point = void 0, this._label = new G(e, t), this._dynamicObject = new k(e, t), this._elevationContour = new Yt(e, t), this._cone = new j(e, t) } function $r(e, t) { this._viewer = e, this._cesium = t, this._execute = new Zr(this._viewer, this._cesium) } k.prototype.showPoint = function (e) { Yr && Yr.point && (Yr.point.show = e) }, k.prototype.showLine = function (e) { Wr && Wr.polyline && (Wr.polyline.show = e) }, k.prototype.showModel = function (e) { Yr && Yr.model && (Yr.model.show = e) }, k.prototype.setFlyHeight = function (e) { N.cameraHeight = e }, k.prototype.setFlyDistance = function (e) { N.range = e }, k.prototype.setFlyPitch = function (e) { N.pitch = e }, k.prototype.changeFlyMode = function (e) { var t = this; switch (e) { case 0: zr = function () { }, t.BindingModel(!0); break; case 1: this.BindingModel(!1), zr = function (e) { qr(e), t.exeuteVisualAngle(t._cesium.Math.toRadians(N.heading), t._cesium.Math.toRadians(N.pitch), N.range) }; break; case 2: this.BindingModel(!1), zr = function (e) { qr(e), (Ur = t._entityFly.position.getValue(t._viewer.clock.currentTime)) && (Ur = Xr(Ur), t._viewer.camera.setView({ destination: Ur, orientation: { heading: t._cesium.Math.toRadians(N.heading), pitch: t._cesium.Math.toRadians(-90), roll: 0 } })) } } }, k.prototype.faster = function () { this._viewer.animation.viewModel.faster() }, k.prototype.slower = function () { this._viewer.animation.viewModel.slower() }, k.prototype.setMultiplier = function (e) { this._viewer.clock.multiplier = parseFloat(e) }, k.prototype.isPause = function (e) { this._viewer.clockViewModel.shouldAnimate = !e }, k.prototype.exit = function () { this.isPause(!0), this._viewer.clock.multiplier = 1, this.executeSignout(), this.BindingModel(!1), this._viewer.entities.remove(Wr), this._viewer.entities.remove(Yr), Yr = Wr = null, this._entityFly = null }, k.prototype.updateSpeedLabel = function (e, t) { }, k.prototype.computeCirclularFlight = function (e) { var t = this; Gr = new t._cesium.VelocityVectorProperty(jr, !1); for (var i, o, r, n, a, s = 0; s < e.length; s++) { 0 === s && (n = t._cesium.JulianDate.addSeconds(N.start, 0, new t._cesium.JulianDate), i = t._cesium.Cartesian3.fromDegrees(e[0].x, e[0].y, t._cesium.defaultValue(N.lineHeight, e[s].z)), jr.addSample(n, i), Kr = t._core.TwoPointAzimuth(e[0].x, e[0].y, e[1].x, e[1].y), Nr.addSample(n, Kr)); try { 0 < s && (i = new t._cesium.Cartesian3(jr._property._values[3 * s - 3], jr._property._values[3 * s - 2], jr._property._values[3 * s - 1]), o = t._cesium.Cartesian3.fromDegrees(e[s].x, e[s].y, t._cesium.defaultValue(N.lineHeight, e[s].z)), r = Cesium.Cartesian3.distance(i, o), n = t._cesium.JulianDate.addSeconds(jr._property._times[s - 1], .5, new t._cesium.JulianDate), a = t._cesium.JulianDate.addSeconds(jr._property._times[s - 1], r / N.speed, new t._cesium.JulianDate), jr.addSample(a, o), Kr = t._core.TwoPointAzimuth(e[s - 1].x, e[s - 1].y, e[s].x, e[s].y), Nr.addSample(n, Kr), Nr.addSample(a, Kr)) } catch (e) { console.log(e) } } return jr }, k.prototype.executePauseFly3DPaths = function () { var e = this._viewer.clockViewModel; e.shouldAnimate ? e.shouldAnimate = !1 : this._viewer.clockViewModel.canAnimate && (e.shouldAnimate = !0) }, k.prototype.changeModel = function (e) { Yr.model.uri = e }, k.prototype.PointView = function () { return { position: Viewer.camera.position.clone(), orientation: { heading: Viewer.camera.heading, pitch: Viewer.camera.pitch, roll: Viewer.camera.roll } } }, k.prototype.PlayPaths = function (e) { var t = this; setInterval(function () { viewer.camera.setView({ destination: t._cesium.Cartesian3.fromDegrees(117.48, 30.67, 15e3), orientation: { heading: t._cesium.Math.toRadians(90, 0), pitch: t._cesium.Math.toRadians(-90), roll: 0 } }) }, 2e3) }, k.prototype.BindingModel = function (e) { e ? this._viewer.trackedEntity = Yr : (this._viewer.trackedEntity = void 0, this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)) }, k.prototype.exeuteVisualAngle = function (e, t, i) { var o = { heading: null, pitch: null, range: null }, e = (o.heading = e || this._cesium.Math.toRadians(90), o.pitch = t || this._cesium.Math.toRadians(0), o.range = i || 1e3, this._entityFly.position.getValue(this._viewer.clock.currentTime)); e && (e = Xr(e), t = new this._cesium.HeadingPitchRange(o.heading, o.pitch, o.range), this._viewer.camera.lookAt(e, t)) }, k.prototype.Pathshow = function (e) { this._entityFly.polyline.show = e }, k.prototype.Pointshow = function (e) { Yr._point.show = e }, k.prototype.Modelshow = function (e) { Yr._model.show = e }, k.prototype.executePlayForwardFly3DPaths = function () { var e = this._viewer.clockViewModel, t = e.multiplier; t < 0 && (e.multiplier = -t), e.shouldAnimate = !0 }, k.prototype.executePlayReverseFly3DPaths = function () { var e = this._viewer.clockViewModel, t = e.multiplier; 0 < t && (e.multiplier = -t), e.shouldAnimate = !0 }, k.prototype.executeSignout = function () { var e = this._cesium.JulianDate.fromDate(new Date), e = (this._viewer.clock.startTime = e.clone(), this._cesium.JulianDate.addSeconds(e, 86400, new this._cesium.JulianDate)); this._viewer.clock.stopTime = e.clone() }, k.prototype.forceEndHanlder = function () { this.handler && (this.handler.destroy(), this.handler = void 0) }, j.prototype.createCone = function (e, t, i, o) { var r = { length: 4e5, topRadius: 0, bottomRadius: 2e5, material: this._cesium.Color.GREEN }, 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]), cylinder: r }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "cylinder", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, j.prototype.getstyles = function () { var e = {}; return e.show = !this.item.cylinder.show || this.item.cylinder.show._value, e.length = this.item.cylinder.length ? this.item.cylinder.length.getValue() : void 0, e.topRadius = this.item.cylinder.topRadius ? this.item.cylinder.topRadius.getValue() : void 0, e.bottomRadius = this.item.cylinder.bottomRadius ? this.item.cylinder.bottomRadius.getValue() : void 0, e.heightReference = this.item.cylinder.heightReference && this.item.cylinder.heightReference._value ? this.item.cylinder.heightReference._value : void 0, e.fill = this.item.cylinder.fill && this.item.cylinder.fill._value ? this.item.cylinder.fill._value : void 0, e.material = {}, e.material.color = this.item.cylinder.material && this.item.cylinder.material.color && this.item.cylinder.material.color._value ? "rgba" + this.item.cylinder.material.color.toString() : void 0, e.material.image = this.item.cylinder.material && this.item.cylinder.material.image && this.item.cylinder.material.image._value ? this.item.cylinder.material.image._value : void 0, e.material.repeat = this.item.cylinder.material && this.item.cylinder.material.repeat && this.item.cylinder.material.repeat._value ? this.item.cylinder.material.repeat._value : void 0, e.outline = this.item.cylinder.outline ? this.item.cylinder.outline._value : void 0, e.outlineWidth = this.item.cylinder.outlineWidth && this.item.cylinder.outlineWidth._value ? this.item.cylinder.outlineWidth._value : void 0, e.outlineColor = this.item.cylinder.outlineColor && this.item.cylinder.outlineColor && this.item.cylinder.outlineColor._value ? "rgba" + this.item.cylinder.outlineColor.toString() : void 0, e.near = this.item.cylinder.distanceDisplayCondition ? this.item.cylinder.distanceDisplayCondition._value.near : void 0, e.far = this.item.cylinder.distanceDisplayCondition ? this.item.cylinder.distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, j.prototype.createRectangularSensor = function (e, t, i, o) { var r, n = this, a = this._core.defaultValue((t = t || {}).radius, 100), s = { radii: new this._cesium.Cartesian3(a, a, a), maximumCone: this._cesium.Math.toRadians(90), material: this._cesium.Color.AQUAMARINE.withAlpha(.3), outline: !0, outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(.5), outlineWidth: 1 }, l = this._core.extend(s, t, !0), c = ("string" == typeof t.color && (l.material = this._cesium.Color.fromCssColorString(t.color)), "string" == typeof t.outlineColor && (l.outlineColor = this._cesium.Color.fromCssColorString(t.outlineColor)), 0), u = this.calcPoints(e[0], e[1], e[2], a, c), s = (this.wall = [], this._viewer.entities.add({ polygon: { hierarchy: new this._cesium.CallbackProperty(function () { return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3.fromDegreesArrayHeights(u)) }, !1), perPositionHeight: !0, material: this._core.defaultValue(t.wallColor && this._cesium.Color.fromCssColorString(t.wallColor), this._cesium.Color.AQUAMARINE.withAlpha(.5)), outline: !0, outlineColor: this._core.defaultValue(t.wallOutlineColor && this._cesium.Color.fromCssColorString(t.wallOutlineColor), this._cesium.Color.RED.withAlpha(.5)) } })), h = (this.wall.push(s), l.angle && (r = this.calcPoints(e[0], e[1], e[2], a, c + l.angle), s = this._viewer.entities.add({ polygon: { hierarchy: new this._cesium.CallbackProperty(function () { return new n._cesium.PolygonHierarchy(n._cesium.Cartesian3.fromDegreesArrayHeights(r)) }, !1), perPositionHeight: !0, material: this._core.defaultValue(t.wallColor && this._cesium.Color.fromCssColorString(t.wallColor), this._cesium.Color.AQUAMARINE.withAlpha(.5)), outline: !0, outlineColor: this._core.defaultValue(t.wallOutlineColor && this._cesium.Color.fromCssColorString(t.wallOutlineColor), this._cesium.Color.RED.withAlpha(.5)) } }), this.wall.push(s), s = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), ellipsoid: { radii: l.radii, minimumClock: this._cesium.Math.toRadians(0), maximumClock: this._cesium.Math.toRadians(l.angle), maximumCone: this._cesium.Math.toRadians(90), material: this._core.defaultValue(t.surfaceColor && this._cesium.Color.fromCssColorString(t.surfaceColor), this._cesium.Color.RED.withAlpha(.5)) }, orientation: new n._cesium.CallbackProperty(function () { return n._cesium.Transforms.headingPitchRollQuaternion(n._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), new n._cesium.HeadingPitchRoll(n._cesium.Math.toRadians(-c), 0, 0)) }, !1) }), this.wall.push(s)), this.item = this._viewer.entities.add({ position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), ellipsoid: l }), this._core.defaultValue(l.speed, 1)), t = (this._viewer.clock.onTick.addEventListener(function () { c += .1 * h, u = n.calcPoints(e[0], e[1], e[2], a, c), r = r && n.calcPoints(e[0], e[1], e[2], a, c + l.angle) }), { id: this.item.id, name: i, pId: this._core.isnull(o) ? 0 : o, type: "cylinder", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, j.prototype.computeCirclularFlight = function (e, t, i, o, r, n, a) { for (var s = [], l = (s.push(e), s.push(t), s.push(r), this._cesium.Cartesian3.distance(this._cesium.Cartesian3.fromDegrees(e, t, r), this._cesium.Cartesian3.fromDegrees(i, o, r))), c = n; c <= n + a; c++) { var u = l * Math.sin(c * Math.PI / 180), h = Math.cos(c * Math.PI / 180), m = (o - t) * h + t; s.push((i - e) * h + e), s.push(m), s.push(u + r) } return s }, j.prototype.calcPoints = function (e, t, i, o, r) { var n = this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(e, t, i)), a = o * Math.cos(r * Math.PI / 180), o = o * Math.sin(r * Math.PI / 180), r = this._cesium.Cartesian3.fromElements(a, o, 0), a = this._cesium.Matrix4.multiplyByPoint(n, r, new this._cesium.Cartesian3), o = this._cesium.Cartographic.fromCartesian(a), n = this._cesium.Math.toDegrees(o.longitude), r = this._cesium.Math.toDegrees(o.latitude); return this.computeCirclularFlight(e, t, n, r, i, 0, 90) }, j.prototype.createRadarMaskScan = function (e, t, a, i) { var o = this, s = (a = a || {}, this._core.defaultValue(a.radius, 100)), r = this._core.defaultValue(a.yaw, 0), n = this._core.defaultValue(a.angle, 60), l = a.innerOutline, c = { subdivisions: 6, stackPartitions: 30, slicePartitions: 30, innerRadii: new this._cesium.Cartesian3(.5, .5, .5), radii: new Cesium.CallbackProperty(function () { return new Cesium.Cartesian3(s, s, s) }, !1), maximumCone: this._cesium.Math.toRadians(this._core.defaultValue(a.maxLat, 105)), minimumCone: this._cesium.Math.toRadians(this._core.defaultValue(a.minLat, 75)), minimumClock: new Cesium.CallbackProperty(function () { return Cesium.Math.toRadians(r) }, !1), maximumClock: new Cesium.CallbackProperty(function () { return Cesium.Math.toRadians(r + n) }, !1), material: this._cesium.Color.AQUAMARINE.withAlpha(.3), outline: !l, outlineColor: this._cesium.Color.AQUAMARINE.withAlpha(.5), outlineWidth: 1 }, c = this._core.extend(c, a, !0); "string" == typeof a.color && (c.material = this._cesium.Color.fromCssColorString(a.color)), "string" == typeof a.outlineColor && (c.outlineColor = this._cesium.Color.fromCssColorString(a.outlineColor)); let u, h, m = t instanceof Cesium.Entity ? t : void 0; if (m ? (u = new Cesium.CallbackProperty(() => { 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)) : u = Cesium.Cartesian3.fromDegrees(t[0], t[1], t[2]), a.trackedEntity) { let e, t, i, o, r, n = (c.maximumCone - c.minimumCone) / 2; h = new Cesium.CallbackProperty(() => (t = a.trackedEntity.position.getValue(this._viewer.clock.currentTime.clone()), e = u.getValue ? u.getValue() : u, 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: u, orientation: h, ellipsoid: { ...c, 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: u, orientation: h, ellipsoid: c }), this._core.defaultValue(c.speed, 1)); function f() { (d += .1 * g) <= 0 && g < 0 ? (d = 0, g = -g) : n - p <= d && 0 < g && (d = n - p, g = -g) } this._viewer.clock.onTick.addEventListener(f), this.setRadarMaskValue = (e, t) => { "yaw" === e ? r = t : "angle" === e ? n = 360 < t ? 360 : t : "radius" === e ? s = t : "scanAngle" === e ? p = n < t ? n : t : "speed" === e && (g = t) }, this.deleteObject = () => { 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, c, u = 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, c = Math.acos((s.height - a.height) / o), c = Cesium.Math.toDegrees(c), this.item.orientation = Cesium.Transforms.headingPitchRollQuaternion(t, new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(this._core.defaultValue(l, 0)), Cesium.Math.toRadians(this._core.defaultValue(c, 0)), Cesium.Math.toRadians(this._core.defaultValue(u, 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.lat < o[1] + .005 ? r.lat += 1e-5 : r.lat > o[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 < s.gonCircleArr.length && (s.positions.pop(), s.state = 1, s.handler.destroy()), s.createPointStretching(e, !1)); e.wq = s.gonCircleArr.length, s.gonPointStretchingArr.push(e), t.wz = s.gonCircleArr.length, s.gonCircleArr.push(t) }, this._cesium.ScreenSpaceEventType.LEFT_CLICK), this.handler.setInputAction(function (e) { var t, i, o, r, n, a; s.positions.length < 1 || (e = s.getCatesian3FromPX(e.endPosition, s._viewer, [s.circle]), 2 != s.positions.length || s._cesium.defined(s.circle) || (t = s._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium.Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r.longitude), a = s._cesium.Math.toDegrees(r.latitude), s.topRadius = Tr(o, i, a, n), s.bottomRadius = Tr(o, i, a, n), s.circle = s.createCylinder(s.style), s.circle.objId = s.objId), s.circle && (s.positions.pop(), s.positions.push(e), t = s._cesium.Cartographic.fromCartesian(s.positions[0]), i = s._cesium.Math.toDegrees(t.longitude), o = s._cesium.Math.toDegrees(t.latitude), r = s._cesium.Cartographic.fromCartesian(s.positions[1]), n = s._cesium.Math.toDegrees(r.longitude), a = s._cesium.Math.toDegrees(r.latitude), s.topRadius = Tr(o, i, a, n), s.bottomRadius = Tr(o, i, a, n))) }, this._cesium.ScreenSpaceEventType.MOUSE_MOVE) }, j.prototype.startModify = function () { var m = "拖动修改位置"; if (2 == this.state || 1 == this.state) { this.modifyHandler || (this.modifyHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas)); for (var d = this, e = 0; e < d.gonCircleArr.length; e++)(t = d.gonCircleArr[e]) && (t.show = !0); if (0 < d.gonPointStretchingArr.length) for (var t, e = 0; e < d.gonPointStretchingArr.length; e++)(t = d.gonPointStretchingArr[e]) && (t.show = !0); this.modifyHandler.setInputAction(function (e) { e = d._viewer.scene.pick(e.position); if (Cesium.defined(e) && e.id) e.id.objId || (d.modifyPoint = e.id, m = "释放后完成修改"), d.forbidDrawWorld(!0); else { for (var t = 0; t < d.gonCircleArr.length; t++)(i = d.gonCircleArr[t]) && (i.show = !1); if (0 < d.gonPointStretchingArr.length) for (var i, t = 0; t < d.gonPointStretchingArr.length; t++)(i = d.gonPointStretchingArr[t]) && (i.show = !1); d.modifyHandler && (d.modifyHandler.destroy(), d.modifyHandler = null) } d.state = 2 }, Cesium.ScreenSpaceEventType.LEFT_DOWN), this.modifyHandler.setInputAction(function (e) { var t, i, o, r, n, a, s, l, c, u, h = d._viewer.scene.pick(e.endPosition); d._core.CreateTooltip(m, e.endPosition, !1), Cesium.defined(h) && h.id && (h.id.objId || d._core.CreateTooltip(m, e.endPosition, !0)), d.positions.length < 1 || !d.modifyPoint || ((h = d.getCatesian3FromPX(e.endPosition, d._viewer, [d.circle, d.modifyPoint])) && (null != d.modifyPoint.wq ? (r = { x: h.x, y: h.y, z: h.z + +d.length }, d.positions[d.modifyPoint.wq] = h, 0 == d.modifyPoint.wq ? (d.modifyPoint.position.setValue(r), d.gonCircleArr[d.modifyPoint.wq].position = h) : (r = d._viewer.scene.pickPosition(e.endPosition), n = d._cesium.Cartographic.fromCartesian(r), a = d._cesium.Math.toDegrees(n.longitude), s = d._cesium.Math.toDegrees(n.latitude), l = d._cesium.Cartographic.fromCartesian(d.positions[1]), c = d._cesium.Math.toDegrees(l.longitude), u = d._cesium.Math.toDegrees(l.latitude), d.length = Tr(s, a, u, c), r = d._cesium.Cartographic.fromCartesian(d.gonCircleArr[0].position.getValue()), t = d._cesium.Math.toDegrees(r.longitude), o = d._cesium.Math.toDegrees(r.latitude), r = r.height + d.length, t = d._cesium.Cartesian3.fromDegrees(t, o, r), o = d._cesium.Cartographic.fromCartesian(d.gonCircleArr[1].position.getValue()), r = d._cesium.Math.toDegrees(o.longitude), i = d._cesium.Math.toDegrees(o.latitude), o = o.height + d.length, r = d._cesium.Cartesian3.fromDegrees(r, i, o), d.gonPointStretchingArr[0].position.setValue(t), d.gonPointStretchingArr[1].position.setValue(r))) : (d.modifyPoint.position.setValue(h), d.positions[d.modifyPoint.wz] = h, d.gonPointStretchingArr[d.modifyPoint.wz].position = { x: h.x, y: h.y, z: h.z + d.length }, d.modifyPoint.wz && 0 == d.modifyPoint.wz ? (d.gonCircleArr[1].position = { x: d.positions[0].x + d.topRadius, y: d.positions[0].y, z: d.positions[0].z }, d.gonPointStretchingArr[1].position = { x: d.positions[0].x + d.topRadius, y: d.positions[0].y, z: d.positions[0].z + d.length }) : (n = d._cesium.Cartographic.fromCartesian(d.positions[0]), a = d._cesium.Math.toDegrees(n.longitude), s = d._cesium.Math.toDegrees(n.latitude), l = d._cesium.Cartographic.fromCartesian(d.positions[d.modifyPoint.wz]), c = d._cesium.Math.toDegrees(l.longitude), u = d._cesium.Math.toDegrees(l.latitude), d.topRadius = Tr(s, a, u, c), d.bottomRadius = Tr(s, a, u, c)))), d._core.CreateTooltip(m, e.endPosition, !0)) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), this.modifyHandler.setInputAction(function (e) { d.modifyPoint && (d.modifyPoint = null, d.forbidDrawWorld(!1), m = "拖动修改位置") }, Cesium.ScreenSpaceEventType.LEFT_UP) } }, j.prototype.forbidDrawWorld = function (e) { this._viewer.scene.screenSpaceCameraController.enableRotate = !e, this._viewer.scene.screenSpaceCameraController.enableTilt = !e, this._viewer.scene.screenSpaceCameraController.enableTranslate = !e, this._viewer.scene.screenSpaceCameraController.enableInputs = !e }, j.prototype.getCatesian3FromPX = function (e, t, i) { var o, r = t.scene.pick(e), n = t.scene.drillPick(e), a = null; if (i) { for (var s = 0; s < n.length; s++)if (n[s].id._id != i[0].id && n[s].id._id != i[1].id) { a = n[s].id; break } } else a = r; if (t.scene.pickPositionSupported && Cesium.defined(a)) o = t.scene.pickPosition(e); else { r = t.camera.getPickRay(e); if (!r) return; o = t.scene.globe.pick(r, t.scene) } return o }, j.prototype.createCylinder = function (e) { var t = this; return e.length && (t.length = e.length), this._viewer.entities.add({ position: new t._cesium.CallbackProperty(function () { return t.positions[0] }, !1), cylinder: { topRadius: new t._cesium.CallbackProperty(function () { return t.topRadius }, !1), bottomRadius: new t._cesium.CallbackProperty(function () { return t.bottomRadius }, !1), length: new t._cesium.CallbackProperty(function () { return t.length }, !1), material: e.material || Cesium.Color.WHITE } }) }, j.prototype.createPoint = function (e, t) { if (e) return this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: this._cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, j.prototype.createPointStretching = function (e, t) { var i, o, r; if (e) return r = Cesium.Cartographic.fromCartesian(e), i = Cesium.Math.toDegrees(r.longitude), o = Cesium.Math.toDegrees(r.latitude), r = r.height + this.length, e = Cesium.Cartesian3.fromDegrees(i, o, r), this._viewer.entities.add({ position: e, point: { pixelSize: 10, color: Cesium.Color.fromAlpha(Cesium.Color.FUCHSIA, .5), outlineWidth: 2, outlineColor: Cesium.Color.fromAlpha(Cesium.Color.WHITE, .5), heightReference: Cesium.HeightReference.NONE, disableDepthTestDistance: Number.POSITIVE_INFINITY }, show: t }) }, j.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = null == this.item.cylinder.length ? void 0 : this.item.cylinder.length.getValue(), i = null == this.item.cylinder.topRadius ? void 0 : this.item.cylinder.topRadius.getValue(), o = null == this.item.cylinder.bottomRadius ? void 0 : this.item.cylinder.bottomRadius.getValue(), r = null == this.item.cylinder.fill ? void 0 : this.item.cylinder.fill.getValue(), n = this.item.cylinder.material, a = (null != n && (n = { color: null == n.color ? void 0 : "rgba(" + n.color._value.red + "," + n.color._value.green + "," + n.color._value.blue + "," + n.color._value.alpha + ")", image: null == n.image ? void 0 : n.image._value, diffusemap: null == n.diffusemap ? void 0 : n.diffusemap._value, alphamap: null == n.alphamap ? void 0 : n.alphamap._value }), null == this.item.cylinder.outline ? void 0 : this.item.cylinder.outline._value), s = null == this.item.cylinder.outlineColor ? void 0 : "rgba(" + this.item.cylinder.outlineColor._value.red + "," + this.item.cylinder.outlineColor._value.green + "," + this.item.cylinder.outlineColor._value.blue + "," + this.item.cylinder.outlineColor._value.alpha + ")", l = null == this.item.cylinder.outlineWidth ? void 0 : this.item.cylinder.outlineWidth._value, c = null == this.item.cylinder.numberOfVerticalLines ? void 0 : this.item.cylinder.numberOfVerticalLines._value, u = null == this.item.cylinder.slices ? void 0 : this.item.cylinder.slices._value, h = this.item.cylinder.distanceDisplayCondition, m = null == h ? void 0 : h._value.near, h = null == h ? void 0 : h._value.far, d = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "cylinder", position: { x: this._cesium.Math.toDegrees(d.longitude), y: this._cesium.Math.toDegrees(d.latitude), z: this._cesium.Math.toDegrees(d.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, length: t, topRadius: i, bottomRadius: o, fill: r, material: n, outline: a, outlineColor: s, outlineWidth: l, numberOfVerticalLines: c, slices: u, near: m, far: h } } }, j.prototype.setTreeobj = function (e) { this.treeobj = e }, j.prototype.setVisibility = function (t) { this.item.show = t, this._scan && (this._scan.show = t), this.wall && this.wall.forEach(e => { 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 = Tr(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(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), i = { id: e = r._core.getuid(), name: "新建圆锥" + e, pId: r._core.isnull(t) ? 0 : t, type: "cylinder", item: r }, this.setTreeobj(i), V.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 = Tr(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(V.selectedItem) || "group" != V.selectedItem.type || (t = V.selectedItem.id), i = { id: e = r._core.getuid(), name: "新建圆柱" + e, pId: r._core.isnull(t) ? 0 : t, type: "cylinder", item: r }, r.setTreeobj(i), V.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) } } } } }), Zr.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 } } } }, $r.prototype.execute = function (e, t, i, o) { return this._execute.execute(e, t, i, o) }; var en = 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 tn(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 && -1 < t.type.indexOf("3D"), this.is3D && (this._3DOption = { width: t.TIN_X || 200, height: t.TIN_Y || 200, grid: this.defaultValue(t.showTIN, !1), scale: this.defaultValue(t.colorScale, 1), z: this.defaultValue(t.minHeight, 100) }), this.minOpacity = this.defaultValue(t.minOpacity, .1), this.maxOpacity = this.defaultValue(t.maxOpacity, .8), this.gradient = this.defaultValue(t.gradient, { ".3": "blue", ".5": "green", ".7": "yellow", ".95": "red" }), this.flyTo = this.defaultValue(t.flyTo, !0), t.dynamic && !this.is3D && this.dynamicAdjust(!0), this._core = new f, this.tooltip = this._core.CreateTooltip(), t.tooltip && this.showTooltip(!0) } function on(e, t = {}) { this._viewer = e, this.radius = this.defaultValue(t.radius, 50), this.alpha = this.defaultValue(t.alpha, 1), this.rectangleHeight = t.height, this.minRadius = this.defaultValue(t.minRadius, 1), this.maxRadius = this.defaultValue(t.maxRadius, 50), this.flyTo = this.defaultValue(t.flyTo, !0), this.datas = [], t.dynamic && this.dynamicAdjust(!0) } tn.prototype.defaultValue = function (e, t) { return Cesium.defaultValue(e, t) }, tn.prototype.create = function (e) { this.setData(e), this.flyTo && this.flyToBounding() }, tn.prototype.setData = function (e) { let o = 1e3, r = -1e3, n = 1e3, a = -1e3, s = -1 / 0, l = 1 / 0; e.forEach(function (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 c = { xMin: o - t / 10, yMin: n - i / 10, xMax: r + t / 10, yMax: a + i / 10 }, u = parseInt(1e3 / (c.xMax - c.xMin) * (c.yMax - c.yMin)); if (this.heatmapInstance) this.heatmapInstance._renderer.canvas.setAttribute("style", "width:1000px;height:" + u + "px;"); else { let e = document.createElement("div"); e.setAttribute("style", "width:1000px;height:" + u + "px;display:none;"), document.body.appendChild(e), this.heatmapInstance = h337.create({ container: e, maxOpacity: this.maxOpacity, minOpacity: this.minOpacity, blur: this.blur, radius: this.radius, gradient: this.gradient }) } let h = []; e.forEach(function (e) { var t = (e.x - c.xMin) / (c.xMax - c.xMin) * 1e3, i = (-(e.y - c.yMin) / (c.yMax - c.yMin) + 1) * u, t = { x: Math.round(t), y: Math.round(i), value: e.value }; h.push(t) }), this.datas = { max: s, min: l, data: h }, this.heatmapInstance.setData(this.datas), this.heatmapcanvas = this.heatmapInstance._renderer.canvas, this.drawHeatmapRect(this.heatmapcanvas, c), this.rectangle = Cesium.Rectangle.fromDegrees(c.xMin, c.yMin, c.xMax, c.yMax); t = Cesium.BoundingSphere.fromRectangle3D(this.rectangle); this.boundingRadius = t.radius, this.extent = c }, tn.prototype.flyToBounding = function () { this._viewer.camera.flyTo({ destination: this.rectangle }) }, tn.prototype.destroy = function () { this.dynamicAdjust(!1), this._viewer.scene.primitives.remove(this._worldRectangle), this.heatmapcanvas.remove(), this.showTooltip(!1) }, tn.prototype.dynamicAdjust = function (e) { e ? this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent, this) : this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent, this) }, tn.prototype.dynamicAdjustEvent = function () { if (this.heatmapInstance && 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.minRadius : e) !== this.radius && e <= this.maxRadius && e >= this.minRadius && this.changeRadius(e) } }, tn.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() }, tn.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) } }, tn.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) } }, tn.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) }) }, tn.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 c = [], u = [], h = []; for (let t = 0; t < l; t++)for (let e = 0; e < s; e++) { var m = i.xMin + n * e, d = i.yMin + a * t, m = Cesium.Cartesian3.fromDegrees(m, d, (this.getValueFromDegrees({ lon: m, lat: d }) || 0) * i.scale + i.z); c.push(m.x, m.y, m.z), u.push(n * e / o, a * t / r), 0 != t && 0 != e && (h.push((t - 1) * s + (e - 1), (t - 1) * s + e, t * s + e - 1), h.push((t - 1) * s + e, t * s + e, t * s + e - 1)) } return { positions: c, st: u, indexs: h } }, tn.prototype.get3DShader = function () { return "uniform sampler2D image;\n            czm_material czm_getMaterial(czm_materialInput materialInput)\n            {\n                vec2 repeat = vec2(1.0,1.0);\n                czm_material material = czm_getDefaultMaterial(materialInput);\n                vec4 j_color = texture2D(image, fract(repeat * materialInput.st)).rgba; \n                material.diffuse = j_color.rgb; \n                material.alpha = j_color.a;\n                return material;\n            }\n        " }, tn.prototype.getValueFromDegrees = function (e) { if (this.heatmapInstance && this.extent && e) { var t = (e.lon - this.extent.xMin) / (this.extent.xMax - this.extent.xMin) * this.heatmapcanvas.width, e = (-(e.lat - this.extent.yMin) / (this.extent.yMax - this.extent.yMin) + 1) * this.heatmapcanvas.height; if (t <= this.heatmapcanvas.width && 0 <= t & e <= this.heatmapcanvas.height && 0 <= e) return this.heatmapInstance.getValueAt({ x: Math.round(t), y: Math.round(e) }) } }, tn.prototype.showTooltip = function (e) { e ? (this.tooltipHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas), this.tooltipHandler.setInputAction(e => { 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) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE)) : (this.tooltip.show(!1), this.tooltipHandler && this.tooltipHandler.destroy(), this.tooltipHandler = void 0) }, tn.prototype.updateHeatmap = function () { this.heatmapcanvas = this.heatmapInstance._renderer.canvas; var e = this.convertCanvasToImage(this.heatmapcanvas); this._worldRectangle.appearance.material.uniforms.image = e.src }, tn.prototype.show = function (e) { this._worldRectangle && (this._worldRectangle.show = e) }, tn.prototype.setAlpha = function (e) { this._worldRectangle && (this._worldRectangle.appearance.material.uniforms.color.alpha = e) }, tn.prototype.config = function (e) { this.heatmapInstance.configure(e), this.updateHeatmap() }, tn.prototype.convertCanvasToImage = function (e) { let t = new Image; return t.src = e.toDataURL("image/png"), t }, on.prototype.defaultValue = function (e, t) { return Cesium.defaultValue(e, t) }, on.prototype.create = function (e) { this.setData(e), this.flyTo && this.flyToBounding() }, on.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 c = { xMin: o - t / 10, yMin: n - i / 10, xMax: r + t / 10, yMax: a + i / 10 }, u; if (this._heatmap) u = this._heatmap.canvas, this._heatmap.clear(); else { u = document.createElement("canvas"), document.body.appendChild(u), u.width = 1e3, u.height = parseInt(1e3 / (c.xMax - c.xMin) * (c.yMax - c.yMin)); try { this._heatmap = createWebGLHeatmap({ canvas: u, intensityToAlpha: !0 }) } catch (e) { console.error(e) } } this.datas = []; let h = s - l; e.forEach(e => { var t = (e.x - c.xMin) / (c.xMax - c.xMin) * u.clientWidth, i = (-(e.y - c.yMin) / (c.yMax - c.yMin) + 1) * u.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(u, c), this.rectangle = Cesium.Rectangle.fromDegrees(c.xMin, c.yMin, c.xMax, c.yMax); t = Cesium.BoundingSphere.fromRectangle3D(this.rectangle); this.boundingRadius = t.radius }, on.prototype.flyToBounding = function () { this._viewer.camera.flyTo({ destination: this.rectangle }) }, on.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) }, on.prototype.destroy = function () { this.dynamicAdjust(!1), this._viewer.scene.primitives.remove(this._worldRectangle), this._heatmap.clear(), this._heatmap.canvas.remove() }, on.prototype.dynamicAdjust = function (e) { e ? this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent, this) : this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent, this) }, on.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.minRadius : e) !== this.radius && e <= this.maxRadius && e >= this.minRadius && this.changeRadius(e) } }, on.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 }, on.prototype.multiply = function (e) { this._heatmap.multiply(e), this.updateHeatmap() }, on.prototype.changeRadius = function (t) { this.radius = t, this.datas.forEach(e => { e.size = t }), this._heatmap.clear(), this._heatmap.addPoints(this.datas), this.updateHeatmap() }, on.prototype.clamp = function (e, t) { this._heatmap.clamp(e, t), this.updateHeatmap() }, on.prototype.blur = function () { this._heatmap.blur(), this.updateHeatmap() }, on.prototype.show = function (e) { this._worldRectangle && (this._worldRectangle.show = e) }, on.prototype.setAlpha = function (e) { this._worldRectangle && (this._worldRectangle.appearance.material.uniforms.color.alpha = e) }, on.prototype.convertCanvasToImage = function (e) { var t = new Image; return t.src = e.toDataURL("image/png"), t }; const rn = 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 nn(e) { return e >> 1 ^ -(1 & e) } function an(e, t, i, o, r = !0) { let n; if (n = new (2 === o ? Uint16Array : Uint32Array)(e, t, i), r) { let t = 0; for (let e = 0; e < n.length; ++e) { var a = n[e]; n[e] = t - a, 0 === a && ++t } } return n } function sn(e, t) { const i = {}; if (e.byteLength <= t) return { extensions: i, extensionsEndPosition: t }; let o = t; for (; o < e.byteLength;) { var r = e.getUint8(o, !0), n = (o += Uint8Array.BYTES_PER_ELEMENT, e.getUint32(o, !0)), a = (o += Uint32Array.BYTES_PER_ELEMENT, new DataView(e.buffer, o, n)); switch (r) { case 1: i.vertexNormals = new Uint8Array(a.buffer, a.byteOffset, a.byteLength); break; case 2: i.waterMask = a.buffer.slice(a.byteOffset, a.byteOffset + a.byteLength); break; default: console.warn("Unknown extension with id " + r) }o += n } return { extensions: i, extensionsEndPosition: o } } const ln = { header: 0, vertices: 1, triangleIndices: 2, edgeIndices: 3, extensions: 4 }, cn = { maxDecodingStep: ln.extensions }; function un(e, t) { var i, o, r, n, a, s, l, c, t = Object.assign({}, cn, t), e = new DataView(e), { header: u, headerEndPosition: h } = function (e) { let t = 0; const i = {}; for (var [o, r] of rn) { const n = 8 === r ? e.getFloat64 : e.getFloat32; i[o] = n.call(e, t, !0), t += r } return { header: i, headerEndPosition: t } }(e); return t.maxDecodingStep < ln.vertices ? { header: u } : ({ vertexData: h, vertexDataEndPosition: i } = function (t, e) { var i = t.getUint32(e, !0); const o = new Uint16Array(3 * i); e += Uint32Array.BYTES_PER_ELEMENT; var r = Uint16Array.BYTES_PER_ELEMENT, n = i * r, a = e, s = a + n, l = s + n; let c = 0, u = 0, h = 0; for (let e = 0; e < i; e++)c += nn(t.getUint16(a + r * e, !0)), u += nn(t.getUint16(s + r * e, !0)), h += nn(t.getUint16(l + r * e, !0)), o[e] = c, o[e + i] = u, o[e + 2 * i] = h; return e += 3 * n, { vertexData: o, vertexDataEndPosition: e } }(e, h), t.maxDecodingStep < ln.triangleIndices ? { header: u, vertexData: h } : ({ triangleIndices: i, triangleIndicesEndPosition: n } = function (e, t, i) { let o = i; return i = (65536 < t.length / 3 ? Uint32Array : Uint16Array).BYTES_PER_ELEMENT, o % i != 0 && (o += i - o % i), t = e.getUint32(o, !0), o += Uint32Array.BYTES_PER_ELEMENT, t *= 3, e = an(e.buffer, o, t, i), { triangleIndicesEndPosition: o += t * i, triangleIndices: e } }(e, h, i), t.maxDecodingStep < ln.edgeIndices ? { header: u, vertexData: h, triangleIndices: i } : ({ westIndices: a, southIndices: r, eastIndices: n, northIndices: s, edgeIndicesEndPosition: l } = (o = e, n = n, r = (65536 < (r = h).length / 3 ? Uint32Array : Uint16Array).BYTES_PER_ELEMENT, a = o.getUint32(n, !0), n += Uint32Array.BYTES_PER_ELEMENT, s = an(o.buffer, n, a, r, !1), a = o.getUint32(n += a * r, !0), n += Uint32Array.BYTES_PER_ELEMENT, l = an(o.buffer, n, a, r, !1), a = o.getUint32(n += a * r, !0), n += Uint32Array.BYTES_PER_ELEMENT, c = an(o.buffer, n, a, r, !1), a = o.getUint32(n += a * r, !0), n += Uint32Array.BYTES_PER_ELEMENT, o = an(o.buffer, n, a, r, !1), { edgeIndicesEndPosition: n += a * r, westIndices: s, southIndices: l, eastIndices: c, northIndices: o }), t.maxDecodingStep < ln.extensions ? { header: u, vertexData: h, triangleIndices: i, westIndices: a, northIndices: s, eastIndices: n, southIndices: r } : (c = sn(e, l)["extensions"], { header: u, vertexData: h, triangleIndices: i, westIndices: a, northIndices: s, eastIndices: n, southIndices: r, extensions: c })))) } function hn(e, t = {}) { this.sgworld = e, this.contourUniforms = void 0, this.shadingUniforms = void 0, this.min = { elevation: 10, slope: 0 }, this.max = { elevation: 2e3, slope: 70 }, this.width = t.width || 2, this.spacing = t.spacing || 150, this.tf = !1, this.contourColor = t.contourColor || "#ff0000", this.type = "none", this.Contour = void 0, this.startColor = t.startColor || "#0055ff", this.endColor = t.endColor || "#ff0000", this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.changeSlopeColor = void 0 !== t.changeSlopeColor && t.changeSlopeColor } hn.prototype.render = function () { "slope" === this.type ? (Cesium.ExpandBySmartEarth.displaySlopeMap = !0, this.changeSlopeColor && this.setShopeColor()) : Cesium.ExpandBySmartEarth.displaySlopeMap = !1, this.Contour = this.sgworld.Analysis.createElevationContour(this.tf, "slope" === this.type ? "none" : this.type, { colorArr: this.colorArr, min: this.min[this.type], max: this.max[this.type], width: this.width, spacing: this.spacing, lineColor: this.contourColor }), this.shadingUniforms = this.Contour.item.shadingUniforms, this.contourUniforms = this.Contour.item.contourUniforms }, hn.prototype.setContourColor = function (e) { this.contourColor = e, this.Contour && this.Contour.setMaterialColor(this.contourColor) }, hn.prototype.setShopeColor = function () { let i = [], o = [0, 6, 17, 31, 45, 70, 90]; this.colorArr.forEach((e, t) => { i.unshift({ val: 100 * Math.cos(Cesium.Math.toRadians(o[t])), color: e }) }), Cesium.ExpandBySmartEarth.SlopeMapPallete = i, Cesium.ExpandBySmartEarth.isSlopeDirty = !0 }, hn.prototype.setWidth = function (e) { this.width = e, this.Contour && this.Contour.setWidth(this.width) }, hn.prototype.setSpacing = function (e) { this.spacing = e, this.Contour && this.Contour.setSpacing(this.spacing) }, hn.prototype.setStartColor = function (e) { this.startColor = e, this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.render() }, hn.prototype.setEndColor = function (e) { this.endColor = e, this.colorArr = this.sgworld.Core.gradientColor(this.startColor, this.endColor, 7), this.render() }, hn.prototype.setMin = function (e) { this.min[this.type] = e, "elevation" === this.type ? this.shadingUniforms.minimumHeight = this.min[this.type] : this.render() }, hn.prototype.setMax = function (e) { this.max[this.type] = e, "elevation" === this.type ? this.shadingUniforms.maximumHeight = this.max[this.type] : this.render() }, hn.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 U = { version: "1.0.0" }, mn = "doublearrow", dn = .25, pn = .3, gn = .85, fn = .15, _n = { headHeightFactor: .18, headWidthFactor: .3, neckHeightFactor: .85, neckWidthFactor: .15, tailWidthFactor: .1, headTailFactor: .8, swallowTailFactor: 1 }, Cn = { tailWidthFactor: .15, neckWidthFactor: .2, headWidthFactor: .25, headAngle: Math.PI / 8.5, neckAngle: Math.PI / 13 }, z = (U.algorithm = {}, U.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 ? U.algorithm.getTempPoint4(i, o, r) : this.points[3], this.connPoint = 3 == n || 4 == n ? z.PlotUtils.mid(i, o) : this.points[4], e = z.PlotUtils.isClockWise(i, o, r) ? (c = U.algorithm.getArrowPoints(i, this.connPoint, this.tempPoint4, !1), U.algorithm.getArrowPoints(this.connPoint, o, r, !0)) : (c = U.algorithm.getArrowPoints(o, this.connPoint, r, !1), U.algorithm.getArrowPoints(this.connPoint, i, this.tempPoint4, !0)), c.length), a = (n - 5) / 2, s = c.slice(0, a), l = c.slice(a, 5 + a), c = c.slice(5 + a, n), u = e.slice(0, a), h = e.slice(a, 5 + a), e = e.slice(5 + a, n), u = z.PlotUtils.getBezierPoints(u), a = z.PlotUtils.getBezierPoints(e.concat(s.slice(1))), c = z.PlotUtils.getBezierPoints(c), n = u.concat(h, a, l, c), e = U.algorithm.array2Dto1D(n); t.controlPoint = [i, o, r, this.tempPoint4, this.connPoint], t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(e) } return t }, U.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 = U.algorithm.getTempPoint4(i, o, r), this.tempPoint5 = z.PlotUtils.mid(r, this.tempPoint4)) : (this.tempPoint4 = this.points[3], this.tempPoint5 = this.points[4]), this.connPoint = n < 6 ? z.PlotUtils.mid(i, o) : this.points[5], e = z.PlotUtils.isClockWise(i, o, r) ? (c = U.algorithm.getArrowPoints(i, this.connPoint, this.tempPoint4, !1), U.algorithm.getArrowPoints(this.connPoint, o, r, !0)) : (c = U.algorithm.getArrowPoints(o, this.connPoint, r, !1), U.algorithm.getArrowPoints(this.connPoint, i, this.tempPoint4, !0)), c.length), a = (n - 5) / 2, s = c.slice(0, a), l = c.slice(a, 5 + a), c = c.slice(5 + a, n), u = e.slice(0, a), h = e.slice(a, 5 + a), e = e.slice(5 + a, n), u = z.PlotUtils.getBezierPoints(u), a = z.PlotUtils.getBezierPoints(e.concat(s.slice(1))), c = z.PlotUtils.getBezierPoints(c), n = u.concat(h, a, l, c), e = U.algorithm.array2Dto1D(n); t.controlPoint = [i, o, r, this.tempPoint4, this.tempPoint5, this.connPoint], t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(e) } return t }, U.algorithm.array2Dto1D = function (e) { var t = []; return e.forEach(function (e) { t.push(e[0]), t.push(e[1]) }), t }, U.algorithm.getArrowPoints = function (e, t, i, o) { this.type = mn, this.headHeightFactor = dn, this.headWidthFactor = pn, this.neckHeightFactor = gn, this.neckWidthFactor = fn; var r = z.PlotUtils.mid(e, t), n = z.PlotUtils.distance(r, i), a = z.PlotUtils.getThirdPoint(i, r, 0, .3 * n, !0), s = z.PlotUtils.getThirdPoint(i, r, 0, .5 * n, !0), a = [r, z.PlotUtils.getThirdPoint(r, a, z.Constants.HALF_PI, n / 5, o), z.PlotUtils.getThirdPoint(r, s, z.Constants.HALF_PI, n / 4, o), i], r = U.algorithm.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor), s = r[0], n = r[4], o = z.PlotUtils.distance(e, t) / z.PlotUtils.getBaseLength(a) / 2, i = U.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) }, U.algorithm.getArrowHeadPoints = function (e, t, i) { this.type = mn, this.headHeightFactor = dn, this.headWidthFactor = pn, this.neckHeightFactor = gn, this.neckWidthFactor = fn; var o = z.PlotUtils.getBaseLength(e) * this.headHeightFactor, r = e[e.length - 1], t = (z.PlotUtils.distance(t, i), o * this.headWidthFactor), i = o * this.neckWidthFactor, n = o * this.neckHeightFactor, o = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), e = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), n = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, t, !1), o = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, t, !0); return [z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, i, !1), n, r, o, z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, i, !0)] }, U.algorithm.getArrowBodyPoints = function (e, t, i, o) { for (var r = z.PlotUtils.wholeDistance(e), n = z.PlotUtils.getBaseLength(e) * o, a = (n - z.PlotUtils.distance(t, i)) / 2, s = 0, l = [], c = [], u = 1; u < e.length - 1; u++) { var h = z.PlotUtils.getAngleOfThreePoints(e[u - 1], e[u], e[u + 1]) / 2, m = (n / 2 - (s += z.PlotUtils.distance(e[u - 1], e[u])) / r * a) / Math.sin(h), d = z.PlotUtils.getThirdPoint(e[u - 1], e[u], Math.PI - h, m, !0), h = z.PlotUtils.getThirdPoint(e[u - 1], e[u], h, m, !1); l.push(d), c.push(h) } return l.concat(c) }, U.algorithm.getTempPoint4 = function (e, t, i) { var o, r, n, t = z.PlotUtils.mid(e, t), a = z.PlotUtils.distance(t, i), i = z.PlotUtils.getAngleOfThreePoints(e, t, i), a = i < z.Constants.HALF_PI ? (o = a * Math.sin(i), r = a * Math.cos(i), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, !1), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !0)) : i >= z.Constants.HALF_PI && i < Math.PI ? (o = a * Math.sin(Math.PI - i), r = a * Math.cos(Math.PI - i), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, !1), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !1)) : i >= Math.PI && i < 1.5 * Math.PI ? (o = a * Math.sin(i - Math.PI), r = a * Math.cos(i - Math.PI), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, !0), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !0)) : (o = a * Math.sin(2 * Math.PI - i), r = a * Math.cos(2 * Math.PI - i), n = z.PlotUtils.getThirdPoint(e, t, z.Constants.HALF_PI, o, !0), z.PlotUtils.getThirdPoint(t, n, z.Constants.HALF_PI, r, !1)); return a }, U.algorithm.tailedAttackArrow = function (e) { e = U.algorithm.dereplication(e), this.tailWidthFactor = _n.tailWidthFactor, this.swallowTailFactor = _n.swallowTailFactor, this.swallowTailPnt = _n.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]; z.PlotUtils.isClockWise(e[0], e[1], e[2]) && (i = e[1], o = e[0]); var e = [z.PlotUtils.mid(i, o)].concat(e.slice(2)), r = U.algorithm.getAttackArrowHeadPoints(e, i, o, _n), n = r[0], a = r[4], s = z.PlotUtils.distance(i, o), l = z.PlotUtils.getBaseLength(e), c = l * this.tailWidthFactor * this.swallowTailFactor; this.swallowTailPnt = z.PlotUtils.getThirdPoint(e[1], e[0], 0, c, !0); c = U.algorithm.getAttackArrowBodyPoints(e, n, a, s / l), e = c.length, s = [i].concat(c.slice(0, e / 2)), l = (s.push(n), [o].concat(c.slice(e / 2, e))); l.push(a), s = z.PlotUtils.getQBSplinePoints(s), l = z.PlotUtils.getQBSplinePoints(l), i = U.algorithm.array2Dto1D(s.concat(r, l.reverse(), [this.swallowTailPnt, s[0]])), t.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(i) } return t }, U.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 = z.PlotUtils.getBaseLength(e) * this.headHeightFactor, r = e[e.length - 1], n = z.PlotUtils.distance(r, e[e.length - 2]), t = z.PlotUtils.distance(t, i), i = (o = o > t * this.headTailFactor ? t * this.headTailFactor : o) * this.headWidthFactor, t = o * this.neckWidthFactor, n = (o = n < o ? n : o) * this.neckHeightFactor, o = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, o, !0), e = z.PlotUtils.getThirdPoint(e[e.length - 2], r, 0, n, !0), n = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, i, !1), o = z.PlotUtils.getThirdPoint(r, o, z.Constants.HALF_PI, i, !0); return [z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, t, !1), n, r, o, z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, t, !0)] }, U.algorithm.getAttackArrowBodyPoints = function (e, t, i, o) { for (var r = z.PlotUtils.wholeDistance(e), n = z.PlotUtils.getBaseLength(e) * o, a = (n - z.PlotUtils.distance(t, i)) / 2, s = 0, l = [], c = [], u = 1; u < e.length - 1; u++) { var h = z.PlotUtils.getAngleOfThreePoints(e[u - 1], e[u], e[u + 1]) / 2, m = (n / 2 - (s += z.PlotUtils.distance(e[u - 1], e[u])) / r * a) / Math.sin(h), d = z.PlotUtils.getThirdPoint(e[u - 1], e[u], Math.PI - h, m, !0), h = z.PlotUtils.getThirdPoint(e[u - 1], e[u], h, m, !1); l.push(d), c.push(h) } return l.concat(c) }, U.algorithm.dereplication = function (e) { var t = e[e.length - 1], i = !1, o = [], o = e.filter(function (e) { if (e[0] != t[0] && e[1] != t[1]) return e; i = !0 }); return i && o.push(t), o }, U.algorithm.fineArrow = function (t, o) { var m, f, _, C, y, v; if (!(t.length < 2 || o.length < 2)) return m = Cn.tailWidthFactor, f = Cn.neckWidthFactor, _ = Cn.headWidthFactor, C = Cn.headAngle, y = Cn.neckAngle, (v = [])[0] = t, v[1] = o, e = v[0], r = v[1], n = z.PlotUtils.getBaseLength(v), g = n * m, i = n * f, s = n * _, a = z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, g, !0), l = z.PlotUtils.getThirdPoint(r, e, z.Constants.HALF_PI, g, !1), u = z.PlotUtils.getThirdPoint(e, r, C, s, !1), c = z.PlotUtils.getThirdPoint(e, r, C, s, !0), p = z.PlotUtils.getThirdPoint(e, r, y, i, !1), h = z.PlotUtils.getThirdPoint(e, r, y, i, !0), (d = []).push(a[0], a[1], p[0], p[1], u[0], u[1], r[0], r[1], c[0], c[1], h[0], h[1], l[0], l[1], e[0], e[1]), Cesium.Cartesian3.fromDegreesArray(d) }, { version: "1.0.0" }); function yn(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 vn(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 wn(t = 8, i = 16) { var o = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); let r = []; if (i = i || o.length, t) for (let e = 0; e < t; e++)r[e] = o[0 | Math.random() * i]; else { r[8] = r[13] = r[18] = r[23] = "-", r[14] = "4"; for (let e = 0, t; e < 36; e++)r[e] || (t = 0 | 16 * Math.random(), r[e] = o[19 == e ? 3 & t | 8 : t]) } return r.join("") } function bn(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 Tn() { this._core = new f, 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, Tn.prototype.ready || Object.defineProperties(Tn.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 < this._numTilesInLevel[t] && e < t && (e = t); return e } } }) } function Sn(i, e, o) { $.each(e._primitives, function (e, t) { if (t instanceof Cesium.BillboardCollection) return e = Ln.indexOf(t = t), t._parentCollection._primitiveOld = o, -1 !== e ? (i.scene.primitives.remove(Ln[e]._parentCollection), Ln[e] = t) : Ln.push(t), !1 }) } function En(e, t, i) { e.scene.primitives.remove(i), t._onDestroyTilePrimitive = function () { e.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function Pn(e, t, i, o) { Cesium.when.all(t, function () { e.scene.primitives.remove(o) }), i._onDestroyTilePrimitive = function () { e.scene.primitives.remove(o), this._onDestroyTilePrimitive = void 0 } } function xn(e, t, i) { Pn(e, $.map(t._primitives, function (e) { return e.readyPromise }), t, i) } function Dn(e, t, i) { Pn(e, $.map(t._primitives[0]._primitives, function (e) { return e.readyPromise }), t, i) } function In(e, t, i) { e.scene.primitives.remove(i) } function An(e, t, i) { Pn(e, [t.readyPromise], t, i) } z.PlotUtils = {}, z.PlotUtils.distance = function (e, t) { return Math.sqrt(Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2)) }, z.PlotUtils.wholeDistance = function (e) { for (var t = 0, i = 0; i < e.length - 1; i++)t += z.PlotUtils.distance(e[i], e[i + 1]); return t }, z.PlotUtils.getBaseLength = function (e) { return Math.pow(z.PlotUtils.wholeDistance(e), .99) }, z.PlotUtils.mid = function (e, t) { return [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2] }, z.PlotUtils.getCircleCenterOfThreePoints = function (e, t, i) { var o = [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2], t = [o[0] - e[1] + t[1], o[1] + e[0] - t[0]], r = [(e[0] + i[0]) / 2, (e[1] + i[1]) / 2], e = [r[0] - e[1] + i[1], r[1] + e[0] - i[0]]; return z.PlotUtils.getIntersectPoint(o, t, r, e) }, z.PlotUtils.getIntersectPoint = function (e, t, i, o) { var r, n, a; return e[1] == t[1] ? [(r = (o[0] - i[0]) / (o[1] - i[1])) * (e[1] - i[1]) + i[0], a = e[1]] : i[1] == o[1] ? [(n = (t[0] - e[0]) / (t[1] - e[1])) * (i[1] - e[1]) + e[0], a = i[1]] : (n = (t[0] - e[0]) / (t[1] - e[1]), r = (o[0] - i[0]) / (o[1] - i[1]), [n * (a = (n * e[1] - e[0] - r * i[1] + i[0]) / (n - r)) - n * e[1] + e[0], a]) }, z.PlotUtils.getAzimuth = function (e, t) { var i, o = Math.asin(Math.abs(t[1] - e[1]) / z.PlotUtils.distance(e, t)); return t[1] >= e[1] && t[0] >= e[0] ? i = o + Math.PI : t[1] >= e[1] && t[0] < e[0] ? i = z.Constants.TWO_PI - o : t[1] < e[1] && t[0] < e[0] ? i = o : t[1] < e[1] && t[0] >= e[0] && (i = Math.PI - o), i }, z.PlotUtils.getAngleOfThreePoints = function (e, t, i) { e = z.PlotUtils.getAzimuth(t, e) - z.PlotUtils.getAzimuth(t, i); return e < 0 ? e + z.Constants.TWO_PI : e }, z.PlotUtils.isClockWise = function (e, t, i) { return (i[1] - e[1]) * (t[0] - e[0]) > (t[1] - e[1]) * (i[0] - e[0]) }, z.PlotUtils.getPointOnLine = function (e, t, i) { return [t[0] + e * (i[0] - t[0]), t[1] + e * (i[1] - t[1])] }, z.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, c = l * n; return [c * t[0] + 3 * l * e * i[0] + 3 * n * a * o[0] + s * r[0], c * t[1] + 3 * l * e * i[1] + 3 * n * a * o[1] + s * r[1]] }, z.PlotUtils.getThirdPoint = function (e, t, i, o, r) { e = z.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] }, z.PlotUtils.getArcPoints = function (e, t, i, o) { for (var r = [], n = (n = o - i) < 0 ? n + z.Constants.TWO_PI : n, a = 0; a <= z.Constants.FITTING_COUNT; a++) { var s = i + n * a / z.Constants.FITTING_COUNT, l = e[0] + t * Math.cos(s), s = e[1] + t * Math.sin(s); r.push([l, s]) } return r }, z.PlotUtils.getBisectorNormals = function (e, t, i, o) { var r, n, a = z.PlotUtils.getNormal(t, i, o), s = Math.sqrt(a[0] * a[0] + a[1] * a[1]), l = a[0] / s, a = a[1] / s, c = z.PlotUtils.distance(t, i), u = z.PlotUtils.distance(i, o), s = s > z.Constants.ZERO_TOLERANCE ? z.PlotUtils.isClockWise(t, i, o) ? (r = [i[0] - (n = e * c) * a, i[1] + n * l], [i[0] + (n = e * u) * a, i[1] - n * l]) : (r = [i[0] + (n = e * c) * a, i[1] - n * l], [i[0] - (n = e * u) * 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] }, z.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)] }, z.PlotUtils.getCurvePoints = function (e, t) { for (var i = [z.PlotUtils.getLeftMostControlPoint(t)], o = 0; o < t.length - 2; o++)var r = t[o], n = t[o + 1], a = t[o + 2], a = z.PlotUtils.getBisectorNormals(e, r, n, a), i = i.concat(a); for (var s = z.PlotUtils.getRightMostControlPoint(t), l = (i.push(s), []), o = 0; o < t.length - 1; o++) { r = t[o], n = t[o + 1], l.push(r); for (e = 0; e < z.Constants.FITTING_COUNT; e++) { var c = z.PlotUtils.getCubicValue(e / z.Constants.FITTING_COUNT, r, i[2 * o], i[2 * o + 1], n); l.push(c) } l.push(n) } return l }, z.PlotUtils.getLeftMostControlPoint = function (e) { var i, o, r, n, a, s = e[0], l = e[1], e = e[2], c = z.PlotUtils.getBisectorNormals(0, s, l, e)[0], e = z.PlotUtils.getNormal(s, l, e), e = Math.sqrt(e[0] * e[0] + e[1] * e[1]) > z.Constants.ZERO_TOLERANCE ? (e = z.PlotUtils.mid(s, l), r = s[0] - e[0], i = s[1] - e[1], o = z.PlotUtils.distance(s, l), n = c[0] - e[0], c = c[1] - e[1], a = e[0] + ((i = -(o = 2 / o) * i) * i - (o = o * r) * o) * n + (r = 2 * i * o) * c, e[1] + r * n + (o * o - i * i) * c) : (a = s[0] + t * (l[0] - s[0]), s[1] + t * (l[1] - s[1])); return [a, e] }, z.PlotUtils.getRightMostControlPoint = function (e) { var i, o, r, n, a, s = e.length, l = e[s - 3], c = e[s - 2], e = e[s - 1], s = z.PlotUtils.getBisectorNormals(0, l, c, e)[1], l = z.PlotUtils.getNormal(l, c, e), l = Math.sqrt(l[0] * l[0] + l[1] * l[1]) > z.Constants.ZERO_TOLERANCE ? (l = z.PlotUtils.mid(c, e), r = e[0] - l[0], i = e[1] - l[1], o = z.PlotUtils.distance(c, 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 * (c[0] - e[0]), e[1] + t * (c[1] - e[1])); return [a, l] }, z.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 = z.PlotUtils.getBinomialFactor(i, a), l = Math.pow(o, a), c = Math.pow(1 - o, i - a); r += s * l * c * e[a][0], n += s * l * c * e[a][1] } t.push([r, n]) } return t.push(e[i]), t }, z.PlotUtils.getBinomialFactor = function (e, t) { return z.PlotUtils.getFactorial(e) / (z.PlotUtils.getFactorial(t) * z.PlotUtils.getFactorial(e - t)) }, z.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 }, z.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 = z.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 }, z.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 }, z.Constants = { TWO_PI: 2 * Math.PI, HALF_PI: Math.PI / 2, FITTING_COUNT: 100, ZERO_TOLERANCE: 1e-4 }, Object.defineProperties(vn.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 } } }), vn.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(bn.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 } } }), bn.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 < l; ++s)n = (r = a[s]).prefix ? r.prefix + ":" + i : i, "*" != i && n != r.nodeName || "*" != t && t != r.namespaceURI || o.push(r); return o }, bn.prototype.read = function (e) { for (var t = this.getElementsByTagNameNS(e.documentElement, this._gmlns, this.featureName), i = [], o = 0; o < t.length; o++) { var r = this.parseFeature(t[o]); r && i.push(r) } return i }, bn.prototype.parseFeature = function (e) { for (var t, i, o, r, n = ["MultiPolygon", "Polygon", "MultiLineString", "LineString", "MultiPoint", "Point", "Envelope"], a = 0; a < n.length; ++a)if (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, t = n[a])).length) { (r = this.parseGeometry[t.toLowerCase()]) ? o = r.apply(this, [i[0]]) : console.log("unsupportedGeometryType:" + t); break } for (var s, l = this.getElementsByTagNameNS(e, this._gmlns, "Box"), a = 0; a < l.length; ++a) { var c = l[a], u = this.parseGeometry.box.apply(this, [c]), c = c.parentNode; "boundedBy" === (c.localName || c.nodeName.split(":").pop()) ? s = u : o = u.toGeometry() } this.extractAttributes && (m = this.parseAttributes(e)); for (var h, m = { geometryType: t.toLowerCase(), positions: o, attributes: m }, d = (m.bounds = s, e.firstChild); d && (1 != d.nodeType || !(h = d.getAttribute("fid") || d.getAttribute("id")));)d = d.nextSibling; return m.fid = h, m }, bn.prototype.parseGeometry = { point: function (e) { var t = [], i = this.getElementsByTagNameNS(e, this._gmlns, "pos"); return 0 == (t = 0 < i.length ? i[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : t).length && (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length && (t = i[0].firstChild.nodeValue.replace(this._regExes.removeSpace, "").split(","))), 0 == t.length && 0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coord")).length && (e = this.getElementsByTagNameNS(i[0], this._gmlns, "X"), i = this.getElementsByTagNameNS(i[0], this._gmlns, "Y"), 0 < e.length && 0 < i.length && (t = [e[0].firstChild.nodeValue, i[0].firstChild.nodeValue])), 2 == t.length && (t[2] = null), this.xy ? [parseFloat(t[0]), parseFloat(t[1]), parseFloat(t[2])] : [parseFloat(t[1]), parseFloat(t[0]), parseFloat(t[2])] }, multipoint: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Point"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.point.apply(this, [t[r]])) && i.push(o); return i }, linestring: function (e, t) { var i = [], o = [], r = this.getElementsByTagNameNS(e, this._gmlns, "posList"); if (0 < r.length) for (var n, a, s, i = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace), l = parseInt(r[0].getAttribute("dimension")), c = 0; c < i.length / l; ++c)s = c * l, n = parseFloat(i[s]), a = parseFloat(i[1 + s]), s = 2 == l ? null : parseFloat(i[2 + s]), this.xy ? o.push(n, a, s) : o.push(a, n, s); if (0 == i.length && 0 < (r = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length) for (var u = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").replace(this._regExes.trimComma, ",").split(this._regExes.splitSpace), c = 0; c < u.length; ++c)2 == (i = u[c].split(",")).length && (i[2] = null), this.xy ? o.push(parseFloat(i[0]), parseFloat(i[1]), parseFloat(i[2])) : o.push(parseFloat(i[1]), parseFloat(i[0]), parseFloat(i[2])); return o }, multilinestring: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LineString"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r]])) && i.push(o); return i }, polygon: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LinearRing"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r], !0])) && i.push(o); return i }, multipolygon: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Polygon"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.polygon.apply(this, [t[r]])) && i.push(o); return i }, envelope: function (e) { var t, i, o, r, n = [], a = this.getElementsByTagNameNS(e, this._gmlns, "lowerCorner"), a = (0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), i = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), this.getElementsByTagNameNS(e, this._gmlns, "upperCorner")); return 0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), r = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), i && r && (n.push([i.x, i.y, null]), n.push([r.x, i.y, null]), n.push([r.x, r.y, null]), n.push([i.x, r.y, null]), n.push([i.x, i.y, null]), t = new OpenLayers_Geometry_Polygon([[n]])), t }, box: function (e) { var e = this.getElementsByTagNameNS(e, this._gmlns, "coordinates"), t = null, i = null; if (0 < e.length && (2 == (e = e[0].firstChild.nodeValue.split(" ")).length && (t = e[0].split(","), i = e[1].split(","))), null !== t && null !== i) return [parseFloat(t[0]), parseFloat(t[1]), null, parseFloat(i[0]), parseFloat(i[1]), null] } }, bn.prototype.parseAttributes = function (e) { for (var t, i, o, r, n, a = {}, s = e.firstChild; s;) { if (1 == s.nodeType) { for (t = s.childNodes, i = 0; i < t.length; ++i)1 == (o = t[i]).nodeType && (1 == (n = o.childNodes).length ? 3 != (n = n[0]).nodeType && 4 != n.nodeType || (r = o.prefix ? o.nodeName.split(":")[1] : o.nodeName, n = n.nodeValue.replace(this._regExes.trimSpace, ""), a[r] = n) : a[o.nodeName.split(":").pop()] = null); break } s = s.nextSibling } return a }, bn.prototype.getChildValue = function (e, t) { var i = t || ""; if (e) for (var o = e.firstChild; o; o = o.nextSibling)switch (o.nodeType) { case 3: case 4: i += o.nodeValue }return i }, Tn.prototype.streamSpeedFactor = function () { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var Ln = [], Mn = 0, Rn = (Tn.prototype.onPreFrame = function (e, t) { if (Mn++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && Mn % this.streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this.STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives.add(i)); $.each(Ln, function (e, t) { t.ready && this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }, Tn.prototype.updateForPick = function (e) { }, Math.PI, Tn.prototype.placeHolder = function (e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: this.viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, Tn.prototype.getTile = function (e) { return this._tileCache[e] }, Tn.prototype.getAllTiles = function () { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, Tn.prototype.addToScene = function (e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, Tn.prototype.removeFromScene = function (e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != t ? (this._primitivesWaitingToBeAddedToTheScene[t].destroy(), this._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : this.viewer.scene.primitives.remove(e) }, Tn.prototype.replaceInScene = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), null != e._replacmentPrimitive && this.viewer.scene.primitives.remove(e._replacmentPrimitive), e._replacmentPrimitive = t, this.viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": Sn(this.viewer, t, e); break; case "labels": En(this.viewer, t, e); break; case "polygons": xn(this.viewer, t, e); break; case "models": Dn(this.viewer, t, e); break; case "polylines": An(this.viewer, t, e); break; case "points": In(this.viewer, 0, e); break; default: console.log("Error updating layer"), this.viewer.scene.primitives.remove(e) } }, { billboards: Sn, labels: En, polygons: xn, models: Dn, polylines: An, points: In }), On = (Tn.prototype.replaceInSceneNew = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != i ? this._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = Rn[i]) ? i(t, e) : (console.log("Error updating layer"), this.viewer.scene.primitives.remove(e))) }, !(Tn.prototype.update = function (e) { this.level = this._core.getLevel(this.viewer); let t = this.getAllTiles(), i, o; t.forEach(e => { 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 Bn() { } function Vn(e) { return "string" == typeof e ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") : e } function Fn(t, e) { for (var i = !1, o = 0, r = "", n = 0; n < e.length; n++)!i && /['"`]/.test(e[n]) ? i = e[n] : i && e[n] == i ? i = !1 : i || "(" != e[n] ? i || ")" != e[n] || o-- : o++, e[n] == t && (0 < o || i) ? r += "######" : r += e[n]; return e = (e = (e = r).split(t)).map(function (e) { return Vn(e.replace(new RegExp("######", "g"), t)) }) } function Hn(e) { for (var t = "#", i = e.length, o = 0; o < i; o++)t += e[o] + "#"; return t } function Gn(e) { for (var t = "", i = e.length, o = 1; o < i; o += 2)t += e[o]; return t } function kn(e) { this.source = e, this.cursor = 0, this.currentChar = "", this.readNextChar() } function Nn(e) { this.lexer = new kn(e), this.currentToken = "", this.readNextToken() } function ll(e, t) { var i = ""; return void 0 !== e.logic ? (i = (i = e.terms.map(function (e) { return ll(e, !0) })).join(" " + e.logic + " "), void 0 !== t && (i = "(" + i + ")")) : void 0 !== e.left ? (i = e.left, void 0 !== e.operator && (i += " " + e.operator, void 0 !== e.right && ("IN" === e.operator ? i += " (" + e.right + ")" : i += " " + e.right))) : i = e, i } function cl(e) { var t, i = 0; if (0 !== e.length) for (t = 0; t < e.length; t++)i = (i << 5) - i + e.charCodeAt(t), i |= 0; return i } function ul(e, t) { this._style = e || {}, this._core = new f, this._bufferAnalysis = new Ai(t, Cesium), t.scene.onHoverShowTextArray = {}, t.scene._lastObjectShowOnText = null, this.setEyeOffset = function (e, t) { void 0 === t && (t = 0), e.eyeOffset = Cesium.DynamicEyeOffset(t) }, this.viewer = t } function hl(e, t) { for (var i = e.length, o = 0; o < i; o++) { var r = t(e[o]); if ("polygon" == e[o].geometryType || "multipolygon" == e[o].geometryType) { for (var n = e[o], a = n.positions.length, s = 0; s < a; s++) { for (var l = n.positions[s], c = 2; c < l.length; c += 3)l[c] = r; n.positions[s] = l } e[o] = n } else { for (var u = e[o], h = u.positions.length, s = 2; s < h; s += 3)u.positions[s] = r; e[o] = u } } return e } function ml(e, t) { if (null == e.isQuery) if (null == e.originalInstanceIds) { if (e.parentLayer.isExistRenderedFeatureId(t)) return } else if (-1 == e.originalInstanceIds.indexOf(t)) return; return 1 } function dl(t) { return function (e) { e = Number(t.applyConditionalClassification(t._style.altitudeOffset || t._style.height, e.attributes)); return e = isNaN(e) ? 0 : e } } function pl(e) { if ("string" != typeof e) return e; var t = Number(e); if (isNaN(t)) return e; var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;)i = "0" + i, o++; e = Cesium.Color.fromCssColorString("#" + i); return null != e && (t = e.red, e.red = e.blue, e.blue = t), e } function gl(e) { if (null != e) { var t = parseInt(e); if (null != e.alpha || isNaN(t)) return e; t < 0 && (t &= 16777215); var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;)i = "0" + i, o++; var e = (e = "#" + i).substring(0, 7), t = Cesium.Color.fromCssColorString(e); return null != t && (e = t.red, t.red = t.blue, t.blue = e), t } } function fl(e) { return isNaN(e) ? e : parseFloat(e) } function _l(e, i) { var t, o = []; return $.each(e.attributeNames, function (e, t) { o.push(fl(i[t])) }), 1 === o.length ? t = e.func(o[0]) : 2 === e.attributeNames.length ? t = e.func(o[0], o[1]) : 3 === e.attributeNames.length ? t = e.func(o[0], o[1], o[2]) : 4 === e.attributeNames.length && (t = e.func(o[0], o[1], o[2], o[3])), t } function Cl(e, t, i) { return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), i) } Tn.prototype.initialize = function (e) { On || (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), On = !0) }, Tn.prototype.beginUpdate = function (e) { this.quadtree.beginFrame(e) }, Tn.prototype.endUpdate = function (e) { var t = this; e.afterRender.push(function () { t.quadtree.endFrame(e) }) }, Tn.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumError / (1 << e) }, Tn.prototype.loadTile = function (e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function () { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, Tn.prototype.computeTileVisibility = function (e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility.NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch).longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode.SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE } s = r.computeVisibility(n); return s !== Cesium.Intersect.OUTSIDE && (e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum, t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i.ellipsoid.isScaledSpacePointVisible(a)) ? s : Cesium.Visibility.NONE }, Tn.prototype.canRefine = function (e, t, i) { return e.level < 16 }, Tn.prototype.showTileThisFrame = function (e, t, i, o) { e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o) }, Tn.prototype.computeDistanceToTile = function (e, t) { s = e, this.terrainProvider, void 0 === (r = void 0 === (r = s.data) ? s.data = new Cesium.GlobeSurfaceTile : r).tileBoundingRegion && (r.tileBoundingRegion = new Cesium.TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: 0, maximumHeight: 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (s = e.rectangle) && s.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium.OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e.tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, u = r.orientedBoundingBox.center, l = e.rectangle, c = n.maximumHeight, i = r.occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3], Cesium.Cartesian3.fromRadians(l.west, l.south, c, a, o[0]), Cesium.Cartesian3.fromRadians(l.east, l.south, c, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l.north, c, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, c, a, o[3]), s.computeHorizonCullingPoint(u, o, i)))); var a, s, l = n.minimumHeight, c = n.maximumHeight, u = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - c) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n.minimumHeight = c, n.maximumHeight = c)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = c, u }, Tn.prototype.isDestroyed = function () { return !1 }, Tn.prototype.destroy = function () { return Cesium.destroyObject(this) }, Tn.prototype.remove = function () { this.destroy() }, Tn.prototype.getInstance = function (e) { var t; return 0 == Cesium.defined(e.TileManager) && (t = new Tn, (e.TileManager = t).viewer = e, t = new Cesium.QuadtreePrimitive({ tileProvider: e.TileManager, maximumScreenSpaceError: 2 }), e.scene.primitives.add(t)), e.TileManager }, Bn.sql2ast = function (r, e) { function n(e, t) { return t } null == e && (e = !0); var t = "###semi-colon###", i = (r = (r = (r = (r = r.replace(/[("'`].*;.*[)"'`]/g, function (e) { return e.replace(/;/g, t) })).replace(/;/g, "###EOR###")).split("###EOR###")[0]).replace(new RegExp(t, "g"), ";"), ["SELECT", "FROM", "DELETE FROM", "INSERT INTO", "UPDATE", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "ORDER BY", "GROUP BY", "HAVING", "WHERE", "LIMIT", "VALUES", "SET"]), o = i.map(function (e) { return e + " " }), a = (o = (o = o.concat(i.map(function (e) { return e + "(" }))).concat(o.map(function (e) { return e.toLowerCase() }))).map(function (e) { return e.replace("(", "[\\(]") }), s = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(a.join("|"), "gi"), Hn) }), []), l = (o.forEach(function (e) { var t, i, o = 0; do { } while (-1 != (i = r.indexOf(e, o)) && (t = e.replace(/^((\w|\s)+?)\s?\(?$/i, n), o = i + (s[i] = t).length), -1 != i) }), 0), c = (s.forEach(function (e, t) { t < l ? delete s[t] : (l = parseInt(t, 10) + e.length, "JOIN" == e && (s[t] = "INNER JOIN")) }), a.slice(0)), u = (c = (c = c.map(Hn)).join("|"), r.split(new RegExp(a.join("|"), "i"))), h = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(c, "gi"), Gn) }), u = u.map(function (e) { return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(c, "gi"), Gn) }) }), []), m = (h.SELECT = function (e) { return Fn(",", e).filter(function (e) { return "" !== e }).map(function (e) { return { name: e } }) }, h.SET = function (e) { return Fn(",", e).filter(function (e) { return "" !== e }).map(function (e) { return { expression: e } }) }, h.FROM = h["DELETE FROM"] = h.UPDATE = function (e) { var i = e.split(","); return (i = i.map(Vn)).forEach(function (e, t) { "" === e && i.splice(t) }), i = i.map(function (e) { var e = e.split(" AS "), t = e[1] || ""; return 0 === t.indexOf('"') && t.lastIndexOf('"') == t.length - 1 && (t = t.substring(1, t.length - 1)), { table: e[0], as: t } }) }, h["LEFT JOIN"] = h.JOIN = h["INNER JOIN"] = h["RIGHT JOIN"] = function (e) { var t = (e = e.split(" ON "))[0].split(" AS "), i = {}; return i.table = Vn(t[0]), i.as = Vn(t[1]) || "", i.cond = Vn(e[1]), i }, h.WHERE = Vn, h["ORDER BY"] = function (e) { e = e.split(","); var o = []; return e.forEach(function (e, t) { var i = /([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi; null !== (i = i.exec(e)) && ((e = {}).column = Vn(i[1]), e.order = Vn(i[2]), void 0 === i[2] && (e.order = "ASC"), o.push(e)) }), o }, h["GROUP BY"] = function (e) { e = e.split(","); var o = []; return e.forEach(function (e, t) { var i = /([A-Za-z0-9_\.]+)/gi; null !== (i = i.exec(e)) && ((e = {}).column = Vn(i[1]), o.push(e)) }), o }, h.LIMIT = function (e) { var t = /((\d+)\s*,\s*)?(\d+)/gi, e = (void 0 === (t = t.exec(e))[2] && (t[2] = 0), {}); return e.nb = parseInt(Vn(t[3]), 10), e.from = parseInt(Vn(t[2]), 10), e }, h["INSERT INTO"] = function (e) { var t = (t = /([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e), e = {}; return e.table = Vn(t[1]), void 0 !== t[3] && (e.columns = t[3].split(","), e.columns = e.columns.map(Vn)), e }, h.VALUES = function (e) { var e = Fn(",", e = "(" != (e = Vn(e))[0] ? "(" + e : e), t = []; return e.forEach(function (e) { e = Fn(",", e = e.replace(/^\(/g, "").replace(/\)$/g, "")), t.push(e) }), t }, {}), d = 0; return s.forEach(function (e, t) { var i, o; e = e.toUpperCase(), d++, void 0 !== h[e] ? (i = h[e](u[d]), void 0 !== m[e] ? ("string" != typeof m[e] && void 0 !== m[e][0] || (o = m[e], m[e] = [], m[e].push(o)), m[e].push(i)) : m[e] = i) : console.log("Can't analyze statement \"" + e + '"') }), void 0 !== m["LEFT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["LEFT JOIN"][0] ? m["LEFT JOIN"].forEach(function (e) { e.type = "left", m.JOIN.push(e) }) : (m["LEFT JOIN"].type = "left", m.JOIN.push(m["LEFT JOIN"])), delete m["LEFT JOIN"]), void 0 !== m["INNER JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["INNER JOIN"][0] ? m["INNER JOIN"].forEach(function (e) { e.type = "inner", m.JOIN.push(e) }) : (m["INNER JOIN"].type = "inner", m.JOIN.push(m["INNER JOIN"])), delete m["INNER JOIN"]), void 0 !== m["RIGHT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["RIGHT JOIN"][0] ? m["RIGHT JOIN"].forEach(function (e) { e.type = "right", m.JOIN.push(e) }) : (m["RIGHT JOIN"].type = "right", m.JOIN.push(m["RIGHT JOIN"])), delete m["RIGHT JOIN"]), e && ("string" == typeof m.WHERE && (m.WHERE = Nn.parse(m.WHERE)), void 0 !== m.JOIN && m.JOIN.forEach(function (e, t) { m.JOIN[t].cond = Nn.parse(e.cond) })), m }, kn.prototype = { constructor: kn, readNextChar: function () { "string" != typeof this.source ? this.currentChar = "" : this.currentChar = this.source[this.cursor++] || "" }, readNextToken: function () { return /\w|[-]/.test(this.currentChar) ? this.readWord() : /["'`]/.test(this.currentChar) ? this.readString() : /[()]/.test(this.currentChar) ? this.readGroupSymbol() : /[!=<>]/.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 } } }, kn.tokenize = function (e) { var t = new kn(e), i = []; do { var o = t.readNextToken() } while ("empty" != o.type && i.push(o), t.currentChar); return i }, Nn.prototype = { constructor: Nn, 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 } }, Nn.parse = function (e) { return new Nn(e).parseExpressionsRecursively() }, Bn.ast2sql = function (e) { function t(e) { return void 0 !== e.WHERE ? " WHERE " + ll(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 " + ll(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 < parseInt(a.LIMIT.nb, 10) ? (r = " LIMIT ", void 0 !== a.LIMIT.from && 1 < parseInt(a.LIMIT.from, 10) && (r += a.LIMIT.from + ","), r + a.LIMIT.nb) : "") : void 0 !== e["INSERT INTO"] ? (void 0 !== (r = e)["INSERT INTO"] ? (a = "INSERT INTO " + r["INSERT INTO"].table, void 0 !== r["INSERT INTO"].columns ? (a += " (") + r["INSERT INTO"].columns.join(", ") + ")" : a) : "") + (void 0 !== (o = e).VALUES ? " VALUES " + o.VALUES.map(function (e) { return "(" + e.join(", ") + ")" }).join(", ") : "") : void 0 !== e.UPDATE ? (void 0 !== (o = e).UPDATE ? "UPDATE " + o.UPDATE.map(function (e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (i = e).SET ? " SET " + i.SET.map(function (e) { return e.expression }).join(", ") : "") + t(e) : void 0 !== e["DELETE FROM"] ? (void 0 !== (i = e)["DELETE FROM"] ? "DELETE FROM " + i["DELETE FROM"].map(function (e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + t(e) : null }, Bn.trim = Vn, Bn.protect = Hn, Bn.unprotect = Gn, Bn.protect_split = Fn, Bn.CondLexer = kn, Bn.CondParser = Nn; var yl, vl = function (e) { for (var t = [], i = 0; i < e.length; i++)for (var o = 0; o < e[i].positions.length; o += 3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o + 0], e[i].positions[o + 1], 0)); return t }, wl = function (e, t, i, o) { for (var r = 0, n = 0; n < e.length; n++)for (var a = o ? bl : i(e[n]), s = 2; s < e[n].positions.length; s += 3) { null == t[r].height && (t[r].height = 0), null == e[n].absoluteHeightPositions && (e[n].absoluteHeightPositions = []), e[n].absoluteHeightPositions[s - 2] = e[n].positions[s - 2], e[n].absoluteHeightPositions[s - 1] = e[n].positions[s - 1], e[n].absoluteHeightPositions[+s] = e[n].positions[+s]; var l = o ? 0 : e[n].positions[s]; e[n].absoluteHeightPositions[s] = l + t[r].height + a, r++ } }, bl = 1, Tl = (Object.defineProperties(ul.prototype, { style: { get: function () { return this._style }, set: function (e) { this._style = e } } }), ul.prototype.clonePartOfMultiFeature = function (e, t) { var i = e.geometryType.includes("multi") ? e.fid + "." + t : e.fid; return { positions: e.positions[t], attributes: e.attributes, fid: i, geometryType: e.geometryType } }, ul.prototype.createPrimitiveFromWFSFeatures = function (e) { new Cesium.PrimitiveCollection; for (var t = [], i = [], o = [], r = e.features.numPositions = 0; r < e.features.length; r++) { var n = e.features[r]; switch (this.sanitizePositions(n.positions), e.features.numPositions += n.positions.length, n.geometryType) { case "polygon": t.push(n); break; case "multipolygon": for (var a = n.positions.length, s = 0; s < a; s++)t.push(this.clonePartOfMultiFeature(n, s)); break; case "linestring": i.push(n); break; case "multilinestring": for (a = n.positions.length, s = 0; s < a; s++)i.push(this.clonePartOfMultiFeature(n, s)); break; case "point": o.push(n); break; case "multipoint": for (a = n.positions.length, s = 0; s < a; s++)o.push(this.clonePartOfMultiFeature(n, s)) } } 0 < t.length ? (e.features = t, this.createPolygonPrimitive(e)) : 0 < i.length ? (e.features = i, this.createLinestringPrimitive(e)) : 0 < o.length && (e.features = o, this.createPointPrimitive(e)) }, ul.prototype.createPolygonPrimitive = function (g) { function f(t) { if (t.isQuery) t.onFinishedQuery(e); else { var o = "", e = [], r = [], n = [], a = [], s = [], l = b.style.polygon, c = l.clampToGround || !l.perPositionHeight && !l.extrudedHeight && !l.height; let i; l.text && (i = new Cesium.LabelCollection); for (var u, h, m, d = 0; d < t.features.length; d++) { var p = t.features[d]; if (ml(t, p.fid)) { var g, f = p.absoluteHeightPositions || p.positions, _ = b.createPolygonOptions(f, p.attributes), f = b.createCommonOptions(p.attributes), C = Cesium.BoundingSphere.fromPoints(_.hierarchy.positions); if (p.absoluteHeightPositions && delete p.absoluteHeightPositions, e.push(C), !t.isQuery) { let e; if (_.randomColor && (e = Cesium.Color.fromRandom()), _.outline && !c ? (g = b.createPolygonGeometryHelper("outline", p, _.outlineColor, _), n.push(g)) : _.outline && n.push(new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: _.hierarchy.positions, width: _.outlineWidth }) })), _.text) { var y = b._core.getCenterOfMass(_.hierarchy.positions); let t = b.createPointOptions(y, p.attributes); if (c || null != b.style.pointHeight || !_.extrudedHeight && !_.height || (t.position = Cesium.Cartesian3.fromDegrees(y[0], y[1], _.extrudedHeight ? (_.height || 0) + _.extrudedHeight : _.height)), (_.labelNear || _.labelFar) && (t.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(_.labelNear || 0, _.labelFar || 1 / 0)), _.offsetPoint && _.offsetPoint[t.label.text]) { let e = b._core.toDegrees(t.position); b._core.getCenterOfMass(_.hierarchy.positions); y = _.offsetPoint[t.label.text]; y[0] && (e.lon = y[0]), y[1] && (e.lat = y[1]), void 0 !== y[2] && (e.height = y[2]), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height) } let e = i.add({ id: p, position: t.position, ...t.label }); delete e.id.positions, e.id.boundingSphere = C } if (_.colorConfig) { let e; for (var v in _.colorConfig) { for (var w in _.colorConfig[v]) if (p.attributes[v] == w) { e = _.colorConfig[v][w]; break } if (e) break; _.colorConfig[v]["#"] && (e = _.colorConfig[v]["#"]) } e && (_.material = Cesium.Color.fromCssColorString(e)) } _.fill && 0 < _.material.alpha && (g = b.createPolygonGeometryHelper("fill", p, e || _.material, _), r.push(g)), t.parentLayer.addRenderedFeatureId(p.fid), o += p.fid + ";", a.push(p.fid), s.push(f.tooltip) } } } "" != o && (l = new Cesium.PrimitiveCollection, h = new Cesium.PerInstanceColorAppearance({ flat: 0 == _.material.alpha, translucent: _.material.alpha < 1 }), i && l.add(i), 0 < r.length && (_.water && (u = { color: _.water.color || "rgba(135,206,235,0.6)", image: _.water.image || window.SmartEarthRootUrl + I.water, frequency: _.water.frequency || 1e3, speed: _.water.speed || 10, amplitude: _.water.amplitude || 10 }, m = Cesium.Color.fromCssColorString(u.color), h = new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: m, blendColor: m, normalMap: u.image, frequency: u.frequency, animationSpeed: u.speed / 1e3, amplitude: u.amplitude } } }) })), ((m = c ? new Cesium.GroundPrimitive({ geometryInstances: r, appearance: h, classificationType: _.classificationType }) : new Cesium.Primitive({ geometryInstances: r, appearance: h }))._parentCollection = l).add(m)), 0 < n.length && (_.clampToGround ? l.add(new Cesium.GroundPolylinePrimitive({ geometryInstances: n, appearance: new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: _.outlineColor } } }) }) })) : ((m = new Cesium.Primitive({ geometryInstances: n, appearance: h }))._parentCollection = l).add(m)), l.ID = "polygons:" + cl(o), l._instanceIds = a, l._tooltips = s, t.onFinishedCreatePrimitive(l, e)) } } var e, b = this; 3 == this.style.altitudeMethod ? (g.features = hl(g.features, dl(b)), f(g)) : (e = function (e) { for (var t = [], i = e.length, o = 0; o < i; o++)for (var r = e[o], n = r.positions.length, a = 0; a < n; a++)for (var s = r.positions[a], l = 0; l < s.length; l += 3)t.push(Cesium.Cartographic.fromDegrees(s[l + 0], s[l + 1], 0)); return t }(g.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium.SampleRenderedDataFlags.FLOOR), Cesium.when(e, function (e) { for (var t = 2 == b._style.altitudeMethod, i = g.features, o = e, r = dl(b), n = t, a = 0, s = 0; s < i.length; s++) { var l = i[s], c = n ? bl : r(l); null == l.absoluteHeightPositions && (l.absoluteHeightPositions = []); for (var u = 0; u < l.positions.length; u++)for (var h = l.positions[u], m = l.absoluteHeightPositions[u] = [], d = 2; d < h.length; d += 3) { var p = n ? 0 : h[d]; null == o[a].height && (o[a].height = 0), m[d - 2] = h[d - 2], m[d - 1] = h[d - 1], m[+d] = h[+d], m[d] = p + o[a].height + c, a++ } } f(g) })) }, ul.prototype.createPolygonGeometryHelper = function (e, t, i, o) { var r = o.hierarchy, n = o.perPositionHeight, a = o.extrudedHeight, s = o.height, l = o.water, c = null != a || void 0 !== s ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT : Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT; l && (c = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT), void 0 !== a && void 0 !== s && (a += s); let u; return l = o.bulidingWall ? new (u = "fill" === e ? Cesium.CorridorGeometry : Cesium.CorridorOutlineGeometry)({ positions: r.positions, width: o.bulidingWallWidth || .8, vertexFormat: c, extrudedHeight: a, height: s, cornerType: Cesium.CornerType.MITERED }) : new (u = "fill" === e ? Cesium.PolygonGeometry : Cesium.PolygonOutlineGeometry)({ polygonHierarchy: r, vertexFormat: c, perPositionHeight: void 0 !== s ? void 0 : n, extrudedHeight: a, height: s }), new Cesium.GeometryInstance({ geometry: l, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(i) } }) }, ul.prototype.createLinestringPrimitive = function (e) { var t = this, o = (t && t.style && void 0 !== t.style.height && (e.features = hl(e.features, dl(t))), e); if (o.isQuery) o.onFinishedQuery(a); else { var r, n = "", a = [], s = [], l = []; let i = new Cesium.PrimitiveCollection; for (var c = 0; c < o.features.length; c++) { var u = o.features[c]; if (ml(o, u.fid)) { var h = u.absoluteHeightPositions || u.positions, h = t.createLinestringOptions(h, u.attributes), m = t.createCommonOptions(u.attributes); if (h.vertexFormat = (r ? Cesium.PerInstanceColorAppearance : Cesium.PolylineColorAppearance).VERTEX_FORMAT, u.absoluteHeightPositions && delete u.absoluteHeightPositions, a.push(Cesium.BoundingSphere.fromPoints(h.positions)), !o.isQuery) { d = h.clampToGround ? new Cesium.GroundPolylineGeometry({ positions: h.positions, width: h.width }) : new Cesium.PolylineGeometry(h); var d = new Cesium.GeometryInstance({ id: u, geometry: d, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }); o.parentLayer.addRenderedFeatureId(u.fid), n += u.fid + ";", s.push(u.fid), l.push(m.tooltip); let e = null, t; t = h.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineDashType, { color: h.material, gapColor: h.gapColor || Cesium.Color.TRANSPARENT, dashLength: h.dashLength || 20 }) }) : new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: h.material, outlineColor: h.outlineColor || h.material, outlineWidth: h.outlineWidth || 0 } } }) }), e = h.clampToGround ? new Cesium.GroundPolylinePrimitive({ geometryInstances: d, appearance: t, classificationType: h.classificationType }) : new Cesium.Primitive({ geometryInstances: d, appearance: t }), i.add(e) } } } "" != n && ((e = i).ID = "polylines:" + cl(n), e._instanceIds && 0 === e._instanceIds.length && (e._instanceIds = s), e._tooltips = l, o.onFinishedCreatePrimitive(e, a)) } }, ul.prototype.createPointPrimitive = function (i) { function o(e) { if (e.isQuery) e.onFinishedQuery(n); else { for (var t, i, o = "", r = [], n = [], a = [], s = new Cesium.LabelCollection({ scene: v.viewer.scene }), l = new Cesium.PointPrimitiveCollection({ scene: v.viewer.scene }), c = new Cesium.BillboardCollection({ scene: v.viewer.scene }), u = new Cesium.PrimitiveCollection, h = new Cesium.PolylineCollection, m = 0; m < e.features.length; m++) { var d, p, f, _, C, y = e.features[m]; ml(e, y.fid) && (d = y.absoluteHeightPositions || y.positions, d = v.createPointOptions(d, y.attributes), p = v.createCommonOptions(y.attributes), y.clampToGround = d.clampToGround, d.sgsPointPosition && (y.sgsPointPosition = d.sgsPointPosition, delete d.sgsPointPosition), y.absoluteHeightPositions && delete y.absoluteHeightPositions, n.push(Cesium.BoundingSphere.fromPoints([d.position])), e.isQuery || (d.label && (d.label.position = d.position, d.label.id = y, v.setEyeOffset(d.label), null != d.label.imageFile && (d.label.image = v.applyConditionalClassification(d.label.imageFile, y.attributes), d.label.label = d.label, c.add(d.label), v.setEyeOffset(d.label, -5)), null != d.label.imageFile && null != d.label.showText && d.label.showText && (v.viewer.scene.onHoverShowTextArray[d.label.id] = !0), null != d.label.isBold && d.label.isBold ? s.add(g) : null != d.label.isUnderline && d.label.isUnderline ? (_ = null != d.label.text.match(/[iljf1]/g) ? d.label.text.match(/[iljf1]/g) : [], f = d.label.text.length, f = Array(Math.ceil(f - .5 * _.length)).join("_"), _ = $.extend({}, d.label), null != d.label.image && delete d.label.image, _.position = d.label.position, _.id = d.label.id, _.text = f, _.alignment = null != d.label.alignment ? d.label.alignment : void 0, _.underline = !0, _.textRelativeToImage = null != d.label.textRelativeToImage ? d.label.textRelativeToImage : void 0, -1 < d.label.font.indexOf("pt") ? Number(d.label.font.split("pt")[0]) : -1 < d.label.font.indexOf("px") && Number(d.label.font.split("px")[0]), _.pixelOffset = new Cesium.Cartesian2(0, -45), s.add(_)) : s.add(d.label)), d.billboard && (d.billboard.position = d.position, d.billboard.id = y, v.setEyeOffset(d.billboard), c.add(d.billboard)), d.model && (d.model.url = d.model.uri, d.model.id = y, u.add(Cesium.Model.fromGltf(d.model))), d.point && (d.point.position = d.position, d.point.id = y, v.setEyeOffset(d.point), l.add(d.point)), 0 != d.lineToGround && (f = Cesium.Cartographic.fromCartesian(d.position), _ = Cesium.Cartesian3.fromRadians(f.longitude, f.latitude, 0), 2 == d.lineToGround && (C = d.lineToGroundLength / Cesium.Cartesian3.distance(d.position, _), Cesium.Cartesian3.lerp(d.position, _, C, _)), h.add({ show: !0, width: 1, positions: [d.position, _], material: Cesium.Material.fromType("Color", { color: d.lineToGroundColor }) })), e.parentLayer.addRenderedFeatureId(y.fid), o += y.fid + ";", r.push(y.fid), a.push(p.tooltip))) } "" != o && (i = new Cesium.PrimitiveCollection, 0 < s.length && ($.each(s._labels, function (e, t) { t._type = "Label" }), (s._billboardCollection._parentCollection = i).add(s), t = "labels"), 0 < c.length && ($.each(c._billboards, function (e, t) { t._type = "Billboard" }), (c._parentCollection = i).add(c), t = "billboards"), 0 < u.length && ($.each(u._primitives, function (e, t) { t._type = "Model", t._parentCollection = i }), i.add(u), t = "models"), 0 < l.length && ($.each(l._pointPrimitives, function (e, t) { t._type = "Point" }), (l._parentCollection = i).add(l), t = "points"), 0 < h.length && ($.each(h._polylines, function (e, t) { t._type = "L2G" }), (h._parentCollection = i).add(h), t = "L2G"), i.ID = t + ":" + cl(o), i._instanceIds = r, i._tooltips = a, e.onFinishedCreatePrimitive(i, n)) } } var e, v = this; 3 == this.style.altitudeMethod ? (i.features = hl(i.features, dl(v)), o(i)) : (e = vl(i.features), e = Cesium.sampleRenderedData(e), Cesium.when(e, function (e) { var t = 2 == v._style.altitudeMethod; wl(i.features, e, dl(v), t), o(i) }).otherwise(function (e) { })) }, ul.prototype.createCommonOptions = function (e) { var t = {}; return t.tooltip = this.applyConditionalClassification(this.style.tooltip, e), t }, ul.prototype.createPolygonOptions = function (e, t) { var i = this.getPolygonStyle(this.style); i.preLoad && i.preLoad(i.polygon, t), i.polygon.hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[0]), holes: [] }; for (var o = 1; o < e.length; o++)i.polygon.hierarchy.holes.push({ positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[o]) }); var r, n = this.applyConditionalClassification(i.polygon.material, t); return i.polygon.material = pl(n), null != i.polygon.fill && null != i.polygon.fromKml && (1 < (r = this.applyConditionalClassification(i.polygon.fill, t)) && (r /= 100), i.polygon.material = new Cesium.Color(i.polygon.material.red, i.polygon.material.green, i.polygon.material.blue, r)), i.polygon.height && (i.polygon.height = Number(this.getValueFromProp(i.polygon.height, t))), i.polygon.extrudedHeight && i.polygon.extrudedHeight && i.polygon.extrudedHeight.indexOf && -1 < i.polygon.extrudedHeight.indexOf("[") && -1 < i.polygon.extrudedHeight.defaultValue.indexOf("]") && (n = t[i.polygon.extrudedHeight.defaultValue.substring(1, i.polygon.extrudedHeight.defaultValue.length - 1)], void 0 !== (n = parseInt(n)) && (i.polygon.extrudedHeight = 3 * n)), i.polygon.extrudedHeight && (i.polygon.extrudedHeight = Number(i.polygon.extrudedHeight)), t.FSCALE && (r = this.getLevelDistance(t.FSCALE), i.polygon.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, r)), n = this.applyConditionalClassification(i.polygon.outlineColor, t), i.polygon.outlineColor = pl(n), i.polygon }, ul.prototype.translateLineWidth = function (e, t) { t = this.applyConditionalClassification(e.polyline.width, t); return 0 < t ? TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS ? 1 < t && (e.polyline.widthInMeters = !0, t *= .8, 0 < e.polyline.backgroundOpacity && (t *= .8)) : t = 1 < t ? 2 : 1 : t < 0 ? t = Math.min(5, Math.abs(t)) : 0 == t && (t = 1), t }, ul.prototype.createLinestringOptions = function (e, t) { var i = this.getLinestringStyle(this.style), e = (i.preLoad && i.preLoad(i.polyline, t), i.id = t, i.polyline.positions = Cesium.Cartesian3.fromDegreesArrayHeights(e), this.applyConditionalClassification(i.polyline.material, t)); return i.polyline.material = pl(e), i.polyline.far && (i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(void 0 !== i.polyline.near ? i.polyline.near : 0, i.polyline.far)), t.FSCALE && (e = this.getLevelDistance(t.FSCALE), i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, e)), i.polyline.width = this.applyConditionalClassification(i.polyline.width, t), i.polyline }, ul.prototype.getValueFromProp = function (e, i) { let o = e && e.defaultValue ? e.defaultValue : e; if (o && o.indexOf) if (-1 < o.indexOf("[") && -1 < o.indexOf("]")) o = o.replace("[", "").replace("]", ""), o = this.getPropValue(i, o); else if (-1 < o.indexOf("{") && -1 < o.indexOf("}")) { let e = o.match(/\{[^\}]+\}/g); e.forEach(e => { var t = this.getPropValue(i, e.substring(1, e.length - 1)); o = o.replace(e, t) }), o = o.replaceAll("\\n", "\n") } return o }, ul.prototype.getPropValue = function (e, t) { return e[t] || (t.includes(":") ? e[t.split(":")[1]] : void 0) }, ul.prototype.applyConditionalClassification = function (e, i) { if (null != e) { if (null == e.defaultValue) return e; var o, r = fl(e.defaultValue); if (void 0 === e.classificationArray) { if (!isNaN(r)) return r; if (r instanceof Cesium.Color) return r } if (void 0 !== e.attributeName) { var t = "[" + e.attributeName + "]"; if (r === t) r = i[e.attributeName]; else if (e.multipleAttributeReplacementNeeded) for (name in i) r = Cl(r, "[" + name + "]", i[name]); else r = Cl(r, t, i[e.attributeName]) } else void 0 !== e.classification ? r = _l(e.classification, i) : void 0 !== (o = e.classificationArray) && $(Object.keys(o)).each(function (e, t) { t = function (e, t) { var i; if (void 0 !== e && 0 !== e.condition.length) return void 0 === e.func || !(i = void 0) === _l(e, t) ? fl(e.value) : i }(o[t], i); t && (r = t) }); return r } }, ul.prototype.createLineToGroundOptions = function (e, t) { var i = this.applyConditionalClassification(e.lineToGround, t); null != i && 0 != Number(i) ? (e.lineToGround = i, i = gl(i = this.applyConditionalClassification(e.lineToGroundColor, t)), e.lineToGroundColor = i, "string" == typeof (i = this.applyConditionalClassification(e.lineToGroundLength, t)) && -1 < i.indexOf("[") && -1 < i.indexOf("]") && (i = t[i.substring(1, i.length - 1)] || 0), e.lineToGroundLength = Number(i)) : (e.lineToGround = 0, e.lineToGroundColor = 0, e.lineToGroundLength = 0) }, ul.prototype.createPointOptions = function (e, t) { var i, o, r, n, a, s = this.getPointStyle(this.style); return s.pointHeight ? (o = s.pointHeight, o = this.getValueFromProp(o, t) || 0, s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], o), e[2] = o) : s.position = Array.isArray(e) ? Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]) : e, s.sgsPointPosition = e, s.id = t, s.label && (s.label.text = this.getValueFromProp(s.label.text, t), s.label.text = this.o(s.label.text) ? this.s(s.label.text) : s.label.text, -1 < s.label.text.indexOf("[") && -1 < s.label.text.indexOf("]") && (s.label.text = ""), null != s.label.family && (o = this.applyConditionalClassification(s.label.family, t), e = this.applyConditionalClassification(s.label.font, t), s.label.font = 0 <= e ? (3 * e / 4).toString() + "pt " + o : (3 * (-1 * (72 * e / 96)) / 4).toString() + "pt " + o), s.label.fillColor = gl(this.applyConditionalClassification(s.label.fillColor, t)), s.label.backgroundColor = gl(this.applyConditionalClassification(s.label.backgroundColor, t)), null == s.label.backgroundColor && (s.label.backgroundColor = new Cesium.Color(.165, .165, .165, 0)), s.label.showBackground = !0, null != s.label.showText && ((a = this.applyConditionalClassification(s.label.showText, t)) && 1 === Number(a) && (s.label.onHoverShowText = !0), a && null == viewer.scene.canvas.onHoverShowText && (i = viewer.scene, new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function (e) { var t = {}; i.screenToWorld(e.endPosition, t), Cesium.defined(t.pickPrimitive) && "Billboard" == t.pickPrimitive.constructor.name && null != t.pickPrimitive.label ? null != i.onHoverShowTextArray[t.pickPrimitive.label.id] && (null != i._lastObjectShowOnText && i._lastObjectShowOnText.id != t.pickPrimitive.label.id && null != i._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1), viewer.scene._lastObjectShowOnText = i.onHoverShowTextArray[t.pickPrimitive.label.id], null != i._lastObjectShowOnText.show && (viewer.scene._lastObjectShowOnText.show = !0)) : null != i._lastObjectShowOnText && null != i._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), viewer.scene.canvas.onHoverShowText = !0)), null != s.label.textRelativeToImage && null != s.label.textAlignment && (s.label.textRelativeToImage = this.applyConditionalClassification(s.label.textRelativeToImage, t), s.label.alignment = this.applyConditionalClassification(s.label.textAlignment, t)), null != s.label.underline && (s.label.isUnderline = this.applyConditionalClassification(s.label.underline, t)), null != s.label.bold && 1 == this.applyConditionalClassification(s.label.bold, t) && (s.label.font = "bold " + s.label.font), null != s.label.italic && 1 == this.applyConditionalClassification(s.label.italic, t) && (s.label.font = "italic " + s.label.font), null != s.label.backgroundOpacity && (s.label.backgroundColor.alpha = this.applyConditionalClassification(s.label.backgroundOpacity, t)), null != s.label.minViewingHeight && (r = this.applyConditionalClassification(s.label.minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.label.scaleMPP, t), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.label.disableDepthTestDistance || (s.label.disableDepthTestDistance = 1e3), s.clampToGround && (s.label.heightReference = 1)), s.billboard && (s.billboard.sizeInMeters = !1, null != s.billboard.imageColor && (e = gl(e = this.applyConditionalClassification(s.billboard.imageColor, t)), s.billboard.color = e), null != s.billboard.imageOpacity && null != s.billboard.color.alpha && (s.billboard.color.alpha = Number(this.applyConditionalClassification(s.billboard.imageOpacity, t))), s.billboard.image = this.applyConditionalClassification(s.billboard.image, t), null != s.billboard.minViewingHeight && (r = this.applyConditionalClassification(s.billboard.minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.billboard.scaleMPP, t), s.billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s.billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.billboard.link && s.id && "object" == typeof s.id && (s.id.link = this.applyConditionalClassification(s.billboard.link, t)), s.billboard.disableDepthTestDistance || (s.billboard.disableDepthTestDistance = 1e3), s.clampToGround && (s.billboard.heightReference = 1)), s.model && (o = function (e) { e = Number(e); return e = Cesium.defined(e) && !isNaN(e) ? e : 0 }, s.model.uri = this.applyClassification(s.model.uri, t), s.model.scale = o(this.applyClassification(s.model.scale, t)), e = o(this.applyClassification(s.model.heading, t)), r = o(this.applyClassification(s.model.pitch, t)), n = o(this.applyClassification(s.model.roll, t)), a = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e), Cesium.Math.toRadians(r), Cesium.Math.toRadians(n)), s.model.modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(s.position, a)), this.createLineToGroundOptions(s, t), s }, ul.prototype.s = function (e) { return e.split("").reverse().join("") }, ul.prototype.getLevelDistance = function (e) { var t = 2e7; switch (parseInt(e)) { case 2: t = 10123e3; break; case 3: t = 7123e3; break; case 4: t = 6321e3; break; case 5: t = 5522e3; break; case 6: t = 3436e3; break; case 7: t = 539e3; break; case 8: t = 305e3; break; case 9: t = 18e4; break; case 10: t = 133e3; break; case 11: t = 1e5; break; case 12: t = 76500; break; case 13: t = 58200; break; case 14: t = 23500; break; case 15: t = 9600; break; case 16: t = 4e3; break; case 17: t = 2e3; break; case 18: t = 1700; break; case 19: t = 1500; break; case 20: t = 1e3; break; case 21: t = 500; break; case 22: t = 200; break; case 23: t = 100 }return t }, ul.prototype.o = function (e) { return e && new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0]) }, ul.prototype.applyClassification = function (e, t) { if ("string" === $.type(e)) { if (null != /(\[([^\]]+)\])/g.exec(e)) for (var i in t) e = Cl(e, "[" + i + "]", t[i]); for (var o = /(\<([^\>]+)\>)/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 }, ul.prototype.getPolygonStyle = function (e) { return $.extend(!0, {}, Tl.DEFAULT_POLYGON_STYLE, e) }, ul.prototype.getLinestringStyle = function (e) { return $.extend(!0, {}, Tl.DEFAULT_POLYLINE_STYLE, e) }, ul.prototype.getPointStyle = function (e) { return null != e.label ? $.extend(!0, {}, Tl.DEFAULT_LABEL_STYLE, e) : null != e.billboard ? $.extend(!0, {}, Tl.DEFAULT_BILLBOARD_STYLE, e) : null != e.model ? $.extend(!0, {}, Tl.DEFAULT_MODEL_STYLE, e) : null != e.point ? $.extend(!0, {}, Tl.DEFAULT_POINT_STYLE, e) : Tl.DEFAULT_POINT_STYLE }, ul.prototype.sanitizePositions = function (e) { for (var t = 0; t < e.length; t++)e[t] instanceof Array ? this.sanitizePositions(e[t]) : isNaN(e[t]) && (e[t] = 0) }, {}); function W(e, t, i, o, r, n, a, s, l) { var u = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(d(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function c(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function (e, t) { for (var i = 0; i < e.children.length; i++)if (e.children[i].state >= 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(u._Viewer.scene.primitives._primitives, function (e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = u.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r.height])[0], i.z = o.z) } return e } function d(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = c(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function p(e) { this.value = new Float32Array([e]) } this._viewer = e, this._Viewer = e, u.G = 65535, yl = new Tn, Il = new de({ workerPath: SmartEarthRootUrl + "Workers/featurefetcherworker.js" }), Cesium.sampleRenderedData || (Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource.fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium.loadArrayBuffer = Cesium.Resource.fetchArrayBuffer, Cesium.loadImage = Cesium.Resource.fetchImage), p.fromZBias = function (e) { if (Cesium.defined(e)) return new p(e); throw new DeveloperError("zbias is required.") }, p.toValue = function (e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, p.equals = function (e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, p.defaultBias = function () { return p.fromZBias(15e-6) }, Cesium.ZBiasGeometryInstanceAttribute = p, Cesium.ZBiasGeometryInstanceAttribute = p, Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, Cesium.DynamicEyeOffset = function (e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, Cesium.sampleRenderedData = function (r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function (e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), c = (e & i && l.push(h(u._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when.defer(), Cesium.when(m(i), function (e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function (e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != u.G && (i.height < o.height || c) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, Cesium.sampleRenderedMesh = function (e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(m(e), function (e) { i.resolve(e) }), i.promise }, Cesium.sampleRenderedTerrain = function (t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(d(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function () { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function () { var t = []; return this._tilesToRender.forEach(function (e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t }), r = r || {}, this._level = o || { min: 0, max: 22 }, "number" == typeof this._level && (this._level = { min: o, max: 22 }), this._url = t, this._layerName = i, this._guid = Cesium.createGuid(), this._visible = !0, this._gmlParser = new bn(!0, null, null, !0); var g, o = !this._viewer.TileManager; this._tileManager = yl.getInstance(e), this._tileManager.tileLevel[this._guid] = { level: this._level, visible: this._visible }, this._tileManager._loadTileEvent.addEventListener(W.prototype.loadTile, this), this._useWorkers = !0, this._layerDisplayName = n, this._showAttributesAsMessage = r.showAttributesAsMessage, delete r.showAttributesAsMessage, this._entityCreator = new ul(r, e), this._featuresMap = {}, this._boundingBox = void 0, this._geometryFieldName = void 0, this._operations = {}, this._subdomains = a, this.latLon = !0, this._addedFeatures = [], this.simpleSqlParser = Bn, this.myLayer = l, this._statistics = { numberOfAddedFeatures: 0, numberOfDeletedFeatures: 0, numberOfAddePositions: 0, numberOfDeletedPositions: 0, getNumberOfCurrentlyRenderedFeatures: function () { return this.numberOfAddedFeatures - this.numberOfDeletedFeatures }, getNumberOfCurrentlyRenderedPositions: function () { return this.numberOfAddePositions - this.numberOfDeletedPositions } }, t = (g = this).cleanUrl(g._url).replace("{s}", g.sTag(g._layerName.length, g._layerName.length, g._level)), t = (t += Pl(t)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + g._layerName), i = Cesium.TrustedServers.contains(Sl(g._url, g._subdomains)), $.ajax({ dataType: "xml", xhrFields: { withCredentials: i }, url: encodeURI(t), success: function (e) { var i, o; o = g, El(e, "FeatureType", "wfs").each(function (e, t) { return El(t, "Name", "wfs").text() != o._layerName || (1 === (t = El(t, "LatLongBoundingBox", "wfs")).length && (o._boundingBox = Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value), parseFloat(t[0].attributes.miny.value), parseFloat(t[0].attributes.maxx.value), parseFloat(t[0].attributes.maxy.value))), !1) }), i = g, $(e).find("FeatureType").each(function (e, t) { return $(t).children("Name").text() != i._layerName || (0 != (t = $(t).children("Operations")).length && t.children().each(function () { i._operations[this.tagName.toLowerCase()] = {} }), !1) }) } }), xl(this), void 0 !== s && this.setVisibility(s), o || this.refresh() } function Sl(e, t) { t = -1 != e.indexOf("{s}") ? null != t && 0 < t.length ? e.replace("{s}", t[0]) : console.error("Error - sTag with no subdomains.") : e; return t } function El(e, t, i) { var o = $(e).find(t); return 0 < (o = 0 == o.length && "wfs" === i.toLowerCase() ? $(e).find("wfs\\:" + t + "," + t) : o).length ? o : $([]) } function Pl(e) { return -1 < e.indexOf("?") ? "&" : "?" } function xl(i) { i.featureColumnNames = null; var e = i.cleanUrl(i._url).replace("{s}", i.sTag(i._layerName.length, i._layerName.length, i._level)), t = (e = (e += Pl(e)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + i._layerName), Cesium.TrustedServers.contains(Sl(i._url, i._subdomains))); $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(e), success: function (e) { var o, t; o = i, e = e, t = $(e).find("[type^='gml:']"), o._geometryFieldName = $(t).attr("name"), o.geometryResponseData = e, o.wfsNamespace = function (e, t) { let i = eval; if (null == e) return null; try { var o = (new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):" + 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 Dl(e) { return null == e ? void 0 : e.parentLayer ? e : e._parentCollection || (e.primitive && e.primitive._parentCollection ? e.primitive._parentCollection : void 0) } Object.defineProperties(Tl, { 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 Il, Al = 180 / Math.PI; function Ll(e) { this.Viewer = e, this._core = new f, this.colorTool = this._core.gradientColor() } function Ml(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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>", n = "", $(e).each(function () { var e = this, t = '<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}", this.layerId); $(i).each(function () { t += "<wfs:Property><wfs:Name>" + this + "</wfs:Name><wfs:Value>" + e[this] + "</wfs:Value></wfs:Property>" }), t += '<ogc:Filter><ogc:FeatureId fid="' + e.originFid + '"/></ogc:Filter>', n += t += "</wfs:Update>" }), r = "<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}", n), a = "Failed to save changes to server", e = Sl(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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"), a = (n = (n = n.replace("{layer_name}", this._layerName)).replace("{REQUEST_MAX_FEATURES}", 1e3), ""), e = ("" != e.replace(/[ ]/g, "") && (a = (a = "<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>") + 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 = "<ogc:" + o + ("like" == t.operator.toLowerCase() ? ' wildCard="*" singleChar="*" escape="*"' : "") + ">"; n += "<ogc:PropertyName>" + r + "</ogc:PropertyName>"; var a = null == (r = (r = -1 != i.indexOf(t.right) ? t.left : t.right).replace(/^'|'$$/g, "")).match(/^[%]|[%]$$/); return n = n + ("<ogc:Literal>" + (r = "like" == t.operator.toLowerCase() && a ? "%" + r + "%" : r)) + "</ogc:Literal></ogc:" + o + ">" } a = "and" == t.logic.toLowerCase() ? "And" : "Or", n = "<ogc:" + a + ">"; 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) + "</ogc:" + a + ">" }(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, o) + "</ogc:Filter>"), n = n.replace("{wfs_filter}", a), Sl(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 () { var e, t; return this.featureColumnNames || (0 == (e = $(this.geometryResponseData).find(this.wfsNamespace + "\\:sequence " + this.wfsNamespace + "\\:element")).length && (e = $(this.geometryResponseData).find("sequence").find("element")), t = [], 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 < i; e++)t[e].data.wfsLayerData[this._guid] && t[e].data.wfsLayerData[this._guid].freeResources(), this.loadTile(t[e]); e && xl(this) } }, W.prototype.setVisibility = function (e) { if (this._visible != e) if (this._visible = e, 0 == (this._tileManager.tileLevel[this._guid].visible = e)) for (var t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++)o[i].data.wfsLayerData[this._guid] && o[i].data.wfsLayerData[this._guid].primitive && (o[i].data.wfsLayerData[this._guid].primitive.show = !1); else for (var o, t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++)o[i].data.wfsLayerData[this._guid] && (o[i].data.wfsLayerData[this._guid].primitive ? o[i].data.wfsLayerData[this._guid].primitive.show = !0 : this.loadTile(o[i])) }, W.prototype.loadTile = function (e) { var t = this; e.data.wfsLayerData[this._guid] = { id: e.data.id, primitive: void 0, freeResources: function () { Cesium.defined(this.xhr) && (this.xhr.abort(), this.xhr = void 0), Cesium.defined(this.features) && (t.removeFeaturesFromLayer(this.features), this.features = void 0), Cesium.defined(this.primitive) && (t._tileManager.removeFromScene(this.primitive), this.primitive = void 0) } }, this.show && e.level >= 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 < t) for (var i = 0; i < t; i++)e[i].data.wfsLayerData[this._guid] && e[i].data.wfsLayerData[this._guid].freeResources(); return this._tileManager._loadTileEvent.removeEventListener(W.prototype.loadTile, this), Cesium.destroyObject(this) }, W.prototype.sTag = function (e, t, i) { return null == this._subdomains ? "" : (e = (e + t + i) % this._subdomains.length, this._subdomains[e]) }, W.prototype.cleanUrl = function (e) { return -1 != e.indexOf("?") ? e.split("?")[0] : e }, W.prototype.beginLoadWFSData = function (t) { if ((null == this.latLon || this.latLon) && (null == this.BoundingBox || 0 != this.BoundingBox.width && 0 != this.BoundingBox.height || (this.BoundingBox.east += 1, this.BoundingBox.north += 1, this.BoundingBox.beenModified = !0), void 0 === this.BoundingBox || void 0 !== Cesium.Rectangle.intersection(this.BoundingBox, t.rectangle))) { var e = [Al * t.rectangle.west, Al * t.rectangle.south, Al * t.rectangle.east, Al * t.rectangle.north], i = this, o = this.cleanUrl(this._url).replace("{s}", this.sTag(t.x, t.y, t.level)); o += Pl(o); o += "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + this._layerName + "&srsName=EPSG:4326&BBOX=" + e.join(","); e = Cesium.TrustedServers.contains(Sl(this._url, this._subdomains)); t.data.wfsLayerData[this._guid].xhr = $.ajax({ dataType: this._useWorkers ? "text" : "xml", url: encodeURI(o), cache: !0, xhrFields: { withCredentials: e }, success: function (e) { i.processWFSData(t, e, "GML2") }, error: function (e, t, i) { "abort" !== i && console.log("Failed to retrieve data from " + o + " :" + i) }, complete: function () { t.data.wfsLayerData[i._guid].xhr = void 0 } }) } }, W.prototype.processWFSData = function (e, t, i) { var o; e.data.wfsLayerData[this._guid].xhr = void 0, this._useWorkers ? Il.queueWorkItem({ id: e.data.id, text: t, format: i, geometryFieldName: (o = this)._geometryFieldName }).then(function (e) { o.addFeaturesToTile(e) }) : (i = this._gmlParser.read(t), this.addFeaturesToTile({ id: e.data.id, features: i })) }, W.prototype.boundingSphereFromGML = function (e, i) { var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, o = this; Il.queueWorkItem({ id: "0", text: e, geometryFieldName: this._geometryFieldName }).then(function (e) { e = { parentLayer: o, features: e.features, sampleTerrainLevel: t + 1, isQuery: !0, onFinishedQuery: function (e) { var t; 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)), i(t) } }; o._entityCreator.createPrimitiveFromWFSFeatures(e) }) }, W.prototype.boundingSphereFromFeature = function (e) { var t, i = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel; return this._entityCreator.createPrimitiveFromWFSFeatures({ parentLayer: this, features: [e], sampleTerrainLevel: i + 1, isQuery: !0, onFinishedQuery: function (e) { 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)) } }), t }, W.prototype.addRenderedFeatureId = function (e) { null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), this._addedFeatures[e]++ }, W.prototype.removeRenderedFeatureId = function (i, o) { if (o && o.geometryType && o.geometryType.includes("multi")) for (let e = 0, t; e < o.positions.length; e++)t = i + "." + e, null != this._addedFeatures[t] && this._addedFeatures[t]--, 0 == this._addedFeatures[t] && (this._addedFeatures[t] = void 0); else null != this._addedFeatures[i] && this._addedFeatures[i]--, 0 == this._addedFeatures[i] && (this._addedFeatures[i] = void 0) }, W.prototype.isExistRenderedFeatureId = function (e) { return null != this._addedFeatures[e] }, W.prototype.addFeaturesToTile = function (i, o) { var r, e, n = this._tileManager.getTile(i.id); void 0 !== n && (e = o ? n.data.wfsLayerData[this._guid].primitive._instanceIds : void 0, e = { parentLayer: r = this, originalInstanceIds: e, features: i.features, onFinishedCreatePrimitive: function (e) { var t; null != i.features && null != n.data.wfsLayerData && (n.data.wfsLayerData[r._guid].features = i.features, o || r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features), (void 0 === e.length || 0 < e.length) && (t = n.data.wfsLayerData[r._guid].primitive, e.show = r.show, (n.data.wfsLayerData[r._guid].primitive = e).parentLayer = r, e.parentTileId = i.id, e._guid = Cesium.createGuid(), o ? r._tileManager.replaceInScene(t, e) : r._tileManager.addToScene(e))) } }, this._entityCreator.createPrimitiveFromWFSFeatures(e)) }, W.prototype.addFeaturesToLayer = function (e) { this._statistics.numberOfAddedFeatures += e.length, this._statistics.numberOfAddePositions += Cesium.defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++)!1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) ? this._featuresMap[e[i].fid] = { refCount: 1, feature: e[i] } : this._featuresMap[e[i].fid].refCount++ }, W.prototype.removeFeaturesFromLayer = function (e) { this._statistics.numberOfDeletedFeatures += e.length, this._statistics.numberOfDeletedPositions += Cesium.defaultValue(e.numPositions, 0); for (var t, i = e.length, o = 0; o < i; o++)t = e[o].fid, !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, t) && (this._featuresMap[t].refCount--, 0 === this._featuresMap[t].refCount && delete this._featuresMap[t], this.removeRenderedFeatureId(t, e[o])) }, W.prototype.getFeature = function (e) { return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) ? null : this._featuresMap[e] }, W.prototype.updateTile = function (e) { e = this._tileManager.getTile(e); void 0 !== e && (null == e.data.wfsLayerData[this._guid].features ? this.loadTile(e) : this.addFeaturesToTile(e.data.wfsLayerData[this._guid], !0)) }, W.blockRequestPrimitiveFromPrimitive = function (e) { var t; if (null != e) return null == (t = Dl(e)) && (e._labelCollection && e._labelCollection._billboardCollection ? t = Dl(e._labelCollection._billboardCollection) : e._billboardCollection && (t = Dl(e._billboardCollection))), t }, W.prototype.resetAttributesTable = function () { this.lastEditedCell = null, this.attrTblDialogMemo = null }, Ll.prototype.CreateWfs = function (e, t) { let i = {}, o, r; var n; if ("point" === e ? t.sgStyleJSON ? i = this.getSGStyle("point", t.sgStyleJSON, t.name) : (o = this.colorTool.colorRgb(this._core.defaultValue(t.color, "#ffffff")), n = this.colorTool.colorRgb(this._core.defaultValue(t.bgColor, "#010101")), i = { preLoad: t.preLoad, lineToGround: { defaultValue: t.lineToGround ? t.lineToGroundLength ? "2" : "1" : "0" }, lineToGroundLength: { defaultValue: t.lineToGroundLength || 0 }, lineToGroundColor: { defaultValue: { red: 1, green: 1, blue: 1, alpha: 1 } }, altitudeMethod: 0, altitudeOffset: { defaultValue: "0" }, clampToGround: this._core.defaultValue(t.clampToGround, !1), pointHeight: this._core.defaultValue(t.height, void 0) }, t.text && (t.offsetX && (t.offsetX = parseInt(t.offsetX)), t.offsetY && (t.offsetY = parseInt(t.offsetY)), i.label = { text: { defaultValue: t.text }, scaleMPP: { defaultValue: "15000" }, fillColor: { defaultValue: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, scaleByDistance: { near: 150, nearValue: 1, far: 8e5, farValue: .5 }, minViewingHeight: { defaultValue: "0" }, font: { defaultValue: "12" }, family: { defaultValue: this._core.defaultValue(t.font, "Arial") }, backgroundColor: { defaultValue: { red: n[0] / 255, green: n[1] / 255, blue: n[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, scale: this._core.defaultValue(t.scale, 2), backgroundOpacity: { defaultValue: t.bgColor ? "0.5" : "0" }, italic: { defaultValue: t.italic ? "1" : "0" }, bold: { defaultValue: t.bold ? "1" : "0" }, 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 ? -10 : 0)), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor, "#ffffff")), outlineWidth: this._core.defaultValue(t.outlineWidth, 2), horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, disableDepthTestDistance: "Infinity" === t.disableDepthTestDistance ? Number.POSITIVE_INFINITY : t.disableDepthTestDistance }), t.outlineColor && i.label && (i.label.style = Cesium.LabelStyle.FILL_AND_OUTLINE), t.image && (i.billboard = { image: t.image, scale: this._core.defaultValue(t.imageScale, 1), disableDepthTestDistance: t.disableDepthTestDistance, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, link: t.link })) : "polyline" === e ? i = t.sgStyleJSON ? this.getSGStyle("polyline", t.sgStyleJSON, t.name) : (o = this.colorTool.colorRgb(this._core.defaultValue(t.color, "#ffff00")), { preLoad: t.preLoad, polyline: { material: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) }, outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(t.outlineColor, "#ffffff")), lineOpacity: this._core.defaultValue(t.alpha, 1), outlineWidth: this._core.defaultValue(t.outlineWidth, 0), width: this._core.defaultValue(t.width, 4), clampToGround: this._core.defaultValue(t.clampToGround, !0), classificationType: t.classificationType, dash: t.dash, gapColor: t.gapColor && Cesium.Color.fromCssColorString(t.gapColor), dashLength: t.dashLength }, height: t.height }) : "polygon" === e && (t.sgStyleJSON ? i = this.getSGStyle("polygon", t.sgStyleJSON, t.name) : (o = this.colorTool.colorRgb(this._core.defaultValue(t.color, "#6bbeef")), r = this.colorTool.colorRgb(this._core.defaultValue(t.outlineColor, "#ffffff")), i = { preLoad: t.preLoad, pointHeight: this._core.defaultValue(t.pointHeight, void 0), polygon: { text: !!t.text, labelNear: t.labelNear, labelFar: t.labelFar, offsetPoint: t.offsetPoint, outlineColor: { defaultValue: { red: r[0] / 255, green: r[1] / 255, blue: r[2] / 255, alpha: 1 } }, outlineWidth: t.outlineWidth, fill: { defaultValue: this._core.defaultValue(t.alpha, 1) }, height: t.height, extrudedHeight: t.extrudedHeight, clampToGround: this._core.defaultValue(t.clampToGround, void 0 === t.extrudedHeight && void 0 === t.height), classificationType: t.classificationType, water: t.water, bulidingWall: t.bulidingWall, bulidingWallWidth: t.bulidingWallWidth, randomColor: t.randomColor, colorConfig: t.colorConfig, outline: this._core.defaultValue(t.outline, !0), material: { defaultValue: { red: o[0] / 255, green: o[1] / 255, blue: o[2] / 255, alpha: this._core.defaultValue(t.alpha, 1) } }, fromKml: !0 } }, t.text && (i.label = { style: Cesium.LabelStyle.FILL_AND_OUTLINE, text: { defaultValue: t.text }, scaleMPP: { defaultValue: "15000" }, fillColor: { defaultValue: Cesium.Color.fromCssColorString(this._core.defaultValue(t.labelColor || t.color, "#ffffff")) }, scaleByDistance: { near: 150, nearValue: 1, far: 8e5, farValue: .5 }, minViewingHeight: { defaultValue: "0" }, font: { defaultValue: "12" }, family: { defaultValue: this._core.defaultValue(t.font, "Arial") }, backgroundColor: { defaultValue: { red: 0, green: 0, blue: 0, alpha: 0 } }, scale: this._core.defaultValue(t.scale, 2), backgroundOpacity: { defaultValue: t.bgColor ? "0.5" : "0" }, italic: { defaultValue: t.italic ? "1" : "0" }, bold: { defaultValue: t.bold ? "1" : "0" }, 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 ? -10 : 0)), outlineColor: Cesium.Color.fromCssColorString(this._core.defaultValue(t.labelOutlineColor || t.outlineColor, "#ffffff")), outlineWidth: this._core.defaultValue(t.scale, 2), horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, disableDepthTestDistance: "Infinity" === t.disableDepthTestDistance ? Number.POSITIVE_INFINITY : t.disableDepthTestDistance }))), i || !t.sgStyleJSON) return i.position_x && (t.lon = i.position_x, t.lat = i.position_y, t.height = i.position_z), new W(this.Viewer, this._core.defaultValue(t.urls, i.urls), this._core.defaultValue(t.layer, i.layer), { min: this._core.defaultValue(t.minimumLevel, i.minimumLevel || 0), max: this._core.defaultValue(t.maximumLevel, i.maximumLevel || 22) }, i, this._core.defaultValue(t.layer, i.layer), t.pID || "0", t.checked, void 0); console.log(t.name + "获取样式失败!") }, Ll.prototype.getSGColor = function (e) { let t = parseInt(e).toString(16); return 2 === t.length ? t = "0000" + t : 4 === t.length && (t = "00" + t), t = "#" + t.slice(4) + t.slice(2, 4) + t.slice(0, 2) }, Ll.prototype.getSGStyle = function (r, e, n) { let a; return $.ajax({ url: e, async: !1, contentType: "application/json", success: e => { 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(/<Value>(\S*)<\/Value>/)[1], t.Text.match(/<DefaultValue>(\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 }; ii = function (e, t, i) { return t && Rl(e.prototype, t), i && Rl(e, i), e }; function Rl(e, t) { for (var i = 0; i < t.length; i++) { var o = t[i]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o) } } function Ol() { var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0], t = this, i = Ol; if (!(t instanceof i)) throw new TypeError("Cannot call a class as a function"); this._url = "http://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 Bl(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function Vl(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V } Ml.prototype.BaiduImageryProvider = (ii(Ol, [{ key: "getTileCredits", value: function (e, t, i) { } }, { key: "requestImage", value: function (e, t, i) { var o, r; if (this.ready) return 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), Cesium.ImageryProvider.loadImage(this, e); throw new Cesium.DeveloperError("requestImage must not be called before the imagery provider is ready.") } }, { 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 } }]), Ol), Bl.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 }, Bl.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 < e.length; i++) { var o = e[i]; t.image = o.image, this._viewer.entities.add({ name: "", position: this._cesium.Cartesian3.fromDegrees(o.log, o.lat, o.height), billboard: t }) } return this }, Bl.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, c = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "box", position: { x: this._cesium.Math.toDegrees(c.longitude), y: this._cesium.Math.toDegrees(c.latitude), z: this._cesium.Math.toDegrees(c.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 } } }, Bl.prototype.setTreeobj = function (e) { this.treeobj = e }, Bl.prototype.setVisibility = function (e) { this.item && (this.item.show = b) }, Bl.prototype.deleteObject = function () { this.item && this._viewer.entities.remove(this.item), this.item = void 0 }, Vl.prototype.createBoxGeojsonFeatureLayer = function (e, t, i, o, n) { var r = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: CesiumMath.RADIANS_PER_DEGREE, perPositionHeight: !1, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC }, a = (this._core.isnull(i) || this._core.isnull(i.material) || "[" == i.material.charAt(0) && "]" == i.material.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.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.extend(r, i, !0)), r = (null == t && console.log("geojson is required"), null), r = t.then ? t : this._cesium.GeoJsonDataSource.load(t), s = this; return r.then(function (e) { for (var t = e.entities.values, i = [], o = 0; o < t.length; o++) { var r = t[o], r = (a.polygonHierarchy = new s._cesium.PolygonHierarchy(r.polyline.positions._value, []), new s._cesium.GeometryInstance({ id: r, geometry: new s._cesium.PolygonGeometry(a), attributes: { color: new s._cesium.ColorGeometryInstanceAttribute.fromColor(a.material) } })); i.push(r) } e = s._viewer.scene.primitives.add(new s._cesium.Primitive({ geometryInstances: i, appearance: new s._cesium.PerInstanceColorAppearance({ translucent: !1 }), shadows: s._cesium.ShadowMode.ENABLED })); e.show = a.show, s.item = e, "function" == typeof n && n(e) }), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), this._tree.insertGroupId({ id: a.id, name: e, checked: a.show, pId: this._core.isnull(o) ? 0 : o, type: "polylineLayer", item: this }, this._core.isnull(o) ? 0 : o), this }; let Fl = new f; function Hl(e, t) { this._viewer = e, this.type = t.type, this.videoContainer = t.videoContainer || t.video && t.video.container, this.prop = t.prop, this.cameraPosition = t.cameraPosition.x && t.cameraPosition.y && t.cameraPosition.z ? t.cameraPosition : Cesium.Cartesian3.fromDegrees(t.cameraPosition.lon, t.cameraPosition.lat, t.cameraPosition.height), this.position = t.position && (t.position instanceof Cesium.Cartesian3 ? t.position : Cesium.Cartesian3.fromDegrees(t.position.lon, t.position.lat, t.position.height)), this.heading = t.heading || 0, this.pitch = t.pitch || 0, this.alpha = t.alpha || .9, this.horizonAngle = t.horizonAngle || 60, this.verticalAngle = t.verticalAngle || 40, this.far = t.far || 30, this.showFarScale = t.showFarScale || 5, this.show = !0, this.useLine = Cesium.defaultValue(t.useLine, !0), this._viewer.scene.primitives.add(this), this.init() } Hl.prototype.createViewCone = function () { this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), this.useLine && (this.line = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.FrustumOutlineGeometry(this.cameraData), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE) } }), appearance: new Cesium.PerInstanceColorAppearance({ translucent: !1, flat: !0 }), asynchronous: !1, allowPicking: !1 }), this._viewer.scene.primitives.add(this.line)) }, Hl.prototype.createVideoPlane = function () { var t = new Float64Array(24); Cesium.FrustumGeometry._computeNearFarPlanes(this.cameraData.origin, this.cameraData.orientation, 0, this.cameraData.frustum, t); let i = []; for (let e = 12; e < t.length; e += 3)i.push(t[e], t[e + 1], t[e + 2]); this.plan && this.plan.destroy(); let e = Cesium.Material.fromType("Image"); e.uniforms.image = this.videoContainer, e.uniforms.color.alpha = this.alpha, this.plan = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.Geometry({ attributes: { position: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: i }), st: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: [0, 0, 1, 0, 1, 1, 0, 1] }) }, indices: [0, 1, 2, 0, 2, 3], primitiveType: Cesium.PrimitiveType.TRIANGLES, boundingSphere: Cesium.BoundingSphere.fromVertices(i) }), id: this.prop }), appearance: new Cesium.MaterialAppearance({ flat: !0, material: e }) }) }, Hl.prototype.isShow = function () { return this.show && Fl.getPointToCameraDistance(this._viewer, this.cameraPosition) < this.far * this.showFarScale }, Hl.prototype.init = function () { this.plan || (this.createCamera(), this.createVideoPlane(), this.createViewCone()) }, Hl.prototype.createCamera = function () { let e = this.videoCamera || new Cesium.Camera(this._viewer.scene); e.frustum.fov = Cesium.Math.toRadians(this.horizonAngle), e.frustum.aspectRatio = this.horizonAngle / this.verticalAngle, e.frustum.near = 1, e.frustum.far = this.far, this.position ? (e.position = this.cameraPosition, e.direction = Cesium.Cartesian3.subtract(this.position, this.cameraPosition, new Cesium.Cartesian3(0, 0, 0)), e.up = Cesium.Cartesian3.normalize(this.cameraPosition, new Cesium.Cartesian3(0, 0, 0)), t = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(this.position, this.cameraPosition, new Cesium.Cartesian3), new Cesium.Cartesian3), e.direction = t, this.heading = Cesium.Math.toDegrees(e.heading), this.pitch = Cesium.Math.toDegrees(e.pitch), this.position = null) : e.setView({ destination: this.cameraPosition, orientation: { heading: Cesium.Math.toRadians(this.heading), pitch: Cesium.Math.toRadians(this.pitch), roll: 0 } }); var t = new Cesium.Cartesian3, i = new Cesium.Matrix3, o = new Cesium.Quaternion, r = e.positionWC, n = e.upWC, a = e.rightWC, a = Cesium.Cartesian3.negate(a, t), t = i, i = (Cesium.Matrix3.setColumn(t, 0, a, t), Cesium.Matrix3.setColumn(t, 1, n, t), Cesium.Matrix3.setColumn(t, 2, e.direction, t), Cesium.Quaternion.fromRotationMatrix(t, o)); this.videoCamera = e, this.cameraData = { orientation: i, origin: r, frustum: e.frustum } }, Hl.prototype.flyTo = function () { this.videoCamera && this._viewer.camera.flyTo({ destination: this.videoCamera.position, orientation: { heading: this.videoCamera.heading, pitch: this.videoCamera.pitch, roll: 0 } }) }, Hl.prototype.updatePost = function (e) { e.cameraPosition && (this.cameraPosition = e.cameraPosition instanceof Cesium.Cartesian3 ? e.cameraPosition : Cesium.Cartesian3.fromDegrees(e.cameraPosition.lon, e.cameraPosition.lat, e.cameraPosition.height)), e.position && (this.position = e.position instanceof Cesium.Cartesian3 ? e.position : Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), isNaN(e.heading) || "number" != typeof e.heading || (this.heading = e.heading), isNaN(e.pitch) || "number" != typeof e.pitch || (this.pitch = e.pitch), isNaN(e.alpha) || "number" != typeof e.alpha || (this.alpha = e.alpha), isNaN(e.horizonAngle) || "number" != typeof e.horizonAngle || (this.horizonAngle = e.horizonAngle), isNaN(e.verticalAngle) || "number" != typeof e.verticalAngle || (this.verticalAngle = e.verticalAngle), isNaN(e.far) || "number" != typeof e.far || (this.far = e.far), isNaN(e.showFarScale) || "number" != typeof e.showFarScale || (this.showFarScale = e.showFarScale), void 0 !== e.useLine && (this.useLine = e.useLine), e.prop && (this.prop = e.prop), this.createCamera(), 0 <= e.type.indexOf("h265") ? this.createCanvasPlane() : this.createVideoPlane(), this.createViewCone() }, Hl.prototype.update = function (e) { var t; this.plan && this.show && (t = this.isShow(), this.plan && (this.plan.show = t), this.line && (this.line.show = t), this.plan.update(e)) }, Hl.prototype.setVisibility = function (e) { this.show = e, this.plan && (this.plan.show = e), this.line && (this.line.show = e) }, Hl.prototype.destroy = function () { return this.plan && (this.plan.destroy(), this.plan = void 0), this._viewer.scene.primitives.remove(this), this.line && (this._viewer.scene.primitives.remove(this.line), this.line = null), Cesium.destroyObject(this) }; let Y = { opacity: 1, poolSize: 16, canvas: null, layers: new Array, showid: null, width: 0, height: 0, cesium: null, viewer: null, workers: new Array, oceanCanvas: null, oceanCtx: null, oceanWorker: null }; var Gl, kl = !1, Nl = !1, jl = Math.floor(204), Ul = [NaN, NaN, null], zl = null, Wl = null, Yl = [], Jl = [[30, [10, 25, 68]], [33, [10, 25, 250]], [33.5, [24, 255, 255]], [34, [105, 233, 252]], [34.5, [255, 233, 65]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [34.5, [255, 233, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 225, 15]], [35, [255, 255, 15]], [35, [255, 235, 15]], [35, [255, 215, 15]], [35, [255, 195, 15]], [35, [255, 175, 15]], [35, [255, 155, 15]], [35, [255, 135, 15]], [35, [255, 115, 15]], [35, [255, 95, 15]], [35, [255, 75, 15]], [35, [255, 55, 15]], [35, [255, 35, 15]], [35, [255, 15, 15]]]; function Kl() { for (var a = {}, e = Math.round(7 * Gl.width), s = [], t = 0; t < e; t++)s.push(oc({ age: ic(0, 100) })); var i = Gl.valMax - Gl.valMin; i /= zl.length - 1; for (t = 0; t < zl.length; t++)zl[t][0] = Gl.valMin + t * i; var l = function (e) { for (var n = [], a = [], s = [], t = 0; t < e.length - 1; t++)n.push(e[t + 1][0]), a.push(function (e, t) { var i = e[0], o = e[1], r = e[2], n = t[0] - i, a = t[1] - o, s = t[2] - r; return function (e, t) { return [Math.floor(i + e * n), Math.floor(o + e * a), Math.floor(r + e * s), t] } }(e[t][1], e[t + 1][1])), s.push([e[t][0], e[t + 1][0]]); return function (e, t) { for (var i = 0; i < n.length - 1 && !(e <= n[i]); i++); var o, r = s[i]; return a[i]((o = r[0], r = r[1], (function (e, t, i) { return Math.max(t, Math.min(e, i)) }(e, o, r) - o) / (r - o)), t) } }(zl); kl = !1, Y.oceanCtx.clearRect(0, 0, Y.oceanCanvas.width, Y.oceanCanvas.height), function e() { try { if (!kl && !Nl) { if (a = [], s.forEach(function (e) { 100 < e.age && (e.xt = void 0, e.yt = void 0, oc(e).age = 0), e.xt && e.yt && (e.x = e.xt, e.y = e.yt); var t = e.x, i = e.y, o = ec(t, i), r = o[2]; null === r ? e.age = 100 : tc(t = t + o[0], i = i + o[1]) ? (e.xt = t, e.yt = i, r = "rgba(" + (o = l(r, jl))[0] + ", " + o[1] + ", " + o[2] + ", " + jl + ")", null == a[r] && (a[r] = []), a[r].push(e)) : (e.x = t, e.y = i), e.age += 1 }), !Nl) { var t, i = Y.oceanCtx, o = (i.lineWidth = 1, i.fillStyle = "rgba(0, 0, 0, 0.97)", i.globalCompositeOperation); for (t in i.globalCompositeOperation = "destination-in", i.fillRect(0, 0, Y.oceanCanvas.width, Y.oceanCanvas.height), i.globalCompositeOperation = o, a) { var r = a[t]; if (0 < r.length) { for (var n in i.beginPath(), i.strokeStyle = t, r) { n = r[n]; i.moveTo(n.x, n.y), i.lineTo(n.xt, n.yt), n.x = n.xt, n.y = n.yt } i.stroke(), i.strokeStyle = "#fff" } } } Wl = setTimeout(e, 30) } } catch (e) { } }() } function Ql(e) { zl = e.color || Jl, Y.oceanWorker = new Worker(SmartEarthRootUrl + "Workers/field/oceanWorker.js"), Y.oceanWorker.onmessage = function (e) { var t = e.data; switch (t.type) { case "success": break; case "draw": Gl = t.data, Yl = Gl.drawData, Kl() } }, Y.oceanWorker.postMessage(e.message) } function ql(l, c) { var t, i; t = { message: { id: l.id, ncpath: l.ncpath, variable: l.variable, depth: l.depth }, callback: function (e) { n = e.width, t = e.height, null != Y.canvas && (Y.canvas.remove(), Y.canvas = null), Y.canvas = document.createElement("canvas"), Y.canvas.width = n, Y.canvas.height = t; for (var t, i, o, r, n = Y.canvas.getContext("2d"), a = n.getImageData(0, 0, e.width, e.height), s = 0; s < e.arrayBufferView.length; s++)a.data[s] = e.arrayBufferView[s]; n.putImageData(a, 0, 0), t = e, n = l.id, i = e.minx, o = e.miny, r = e.maxx, t = e.maxy, i = Y.cesium.Rectangle.fromDegrees(i, o, r, t), o = new Y.cesium.ImageMaterialProperty({ image: Y.canvas, transparent: !0 }), mlayer = Y.viewer.entities.add({ show: !0, rectangle: { coordinates: i, material: o } }), Y.layers[n] = mlayer, "function" == typeof c && c(l.id) } }, (i = new Worker(SmartEarthRootUrl + "Workers/field/rendermapWorker.js")).onmessage = function (e) { t.callback(e.data), i.terminate() }, i.postMessage(t.message) } function Xl(e) { var t = { x: 0, y: 0, z: 0 }; return t.x = e.x, t.y = e.y, t.z = e.z, t } function Zl() { for (var e = Y.viewer.scene, t = e.camera, i = [], o = [], r = Xl(t.positionWC), n = Xl(t.directionWC), a = Xl(t.rightWC), s = Xl(t.upWC), l = 0; l < 16; l++)i[l] = t.viewMatrix[l], o[l] = t.frustum.projectionMatrix[l]; return { width: e.canvas.clientWidth, height: e.canvas.clientHeight, viewMatrix: i, projectionMatrix: o, frustum: { fovy: t.frustum.fovy, aspectRatio: t.frustum.aspectRatio, near: t.frustum.near }, positionWC: r, directionWC: n, rightWC: a, upWC: s } } function $l(t, i) { switch (t.type) { case "single": ql({ id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }, i); break; case "mfile": ql({ id: 0, ncpath: t.ncpath.format(t.params[0]), variable: t.variable, depth: t.depth }, function () { "function" == typeof i && i(0); for (var e = 1; e < t.params.length; e++)ql({ id: e, ncpath: t.ncpath.format(t.params[e]), variable: t.variable, depth: t.depth }) }); break; case "mdepth": break; case "ocean": var o = { id: 0, upath: t.upath, vpath: t.vpath }, r = Zl(); if (null == Y.oceanCanvas) { Y.oceanCanvas = document.createElement("canvas"), Y.oceanCanvas.width = r.width, Y.oceanCanvas.height = r.height, Y.oceanCanvas.id = "animation", Y.oceanCanvas.style = "position: absolute;left: 0px;top: 0px;pointer-events: none;", document.getElementsByClassName("cesium-widget")[0].appendChild(Y.oceanCanvas), Y.oceanCtx = Y.oceanCanvas.getContext("2d"); var n = { childList: !0, attributes: !0, subtree: !0 }; let e = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, t = new e(function () { Y.oceanCanvas.width = Y.viewer.cesiumWidget.canvas.width, Y.oceanCanvas.height = Y.viewer.cesiumWidget.canvas.height }); t.observe(Y.viewer.cesiumWidget.canvas, n), Ql({ message: { id: o.id, type: "init", upath: o.upath, vpath: o.vpath, scene: r }, callback: function (e) { } }), Y.viewer.scene.camera.moveStart.addEventListener(function () { Wl && clearTimeout(Wl), (Wl = null) != Y.oceanWorker && (Y.oceanWorker.postMessage({ type: "stop" }), Nl = !0, Yl = [], Y.oceanCtx.clearRect(0, 0, Y.oceanCanvas.width, Y.oceanCanvas.height)) }), Y.viewer.scene.camera.moveEnd.addEventListener(function () { null != Y.oceanWorker && (Nl = !1, Y.oceanWorker.postMessage({ type: "update", scene: Zl() })) }) } else Ql({ message: { id: o.id, type: "init", upath: o.upath, vpath: o.vpath, scene: r }, callback: function (e) { } }); break; default: ql({ id: 0, ncpath: t.ncpath, variable: t.variable, depth: t.depth }) } } function ec(e, t) { e = Yl[Math.round(e)]; return e && e[Math.round(t)] || Ul } function tc(e, t) { return null !== ec(e, t)[2] } function ic(e, t) { return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1)) } function oc(e) { for (var t, i, o = 0; !tc(t = Math.round(ic(0, Y.viewer.scene.canvas.clientWidth)), i = Math.round(ic(0, Y.viewer.scene.canvas.clientHeight))) && o++ < 30;); return e.x = t, e.y = i, e } function rc(e, t) { Y.viewer = e, Y.cesium = t } function nc(e, t = {}) { for (var i in this._viewer = e, this._cache = {}, this.option = { id: wn(), size: 18, pixelRange: 40, gradient: { 1e-4: "rgb(0,191,255)", .001: "rgb(0,128,0)", .01: "rgb(255,165,0)", .1: "rgb(255,0,0)" }, fontSize: 12, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, fontColor: "rgb(0,0,0)", style: "circle", ...t }, this.option.gradient) this.option.gradient[i] = Cesium.Color.fromCssColorString(this.option.gradient[i]); this.dataSource = new Cesium.CustomDataSource(this.option.id), this.dataSource.clustering.enabled = !0, this.dataSource.clustering.pixelRange = this.option.pixelRange, this.dataSource.clustering.clusterEvent.addEventListener(this._clusterEventHandler, this), this._viewer.dataSources.add(this.dataSource) } Y.hide = function () { (Y.showid || 0 == Y.showid) && Y.layers[Y.showid] && (Y.layers[Y.showid].show = !1) }, Y.show = function (e) { (Y.showid || 0 == Y.showid) && Y.layers[Y.showid] && (Y.layers[Y.showid].show = !1), (e || 0 == e) && Y.layers[e] && (Y.layers[e].show = !0, Y.showid = e) }, Y.draw = function (e, t) { $l(e, t) }, Y.destroy = function () { try { for (var e = 0; e < Y.layers.length; e++)Y.viewer.entities.remove(Y.layers[e]); Y.layers = [] } catch (e) { } try { for (e = 0; e < Y.workers.length; e++)try { Y.workers[e].terminate() } catch (e) { } Y.workers = [] } catch (e) { } try { Wl && clearTimeout(Wl), Wl = null } catch (e) { } try { Y.oceanWorker.terminate(), Y.oceanWorker = null, Y.oceanCtx.clearRect(0, 0, Y.oceanCanvas.width, Y.oceanCanvas.height) } catch (e) { } }, String.prototype.format = function (e) { var t, i = this; if (0 < arguments.length) if (1 == arguments.length && "object" == typeof e) for (var o in e) void 0 !== e[o] && (t = new RegExp("({" + o + "})", "g"), i = i.replace(t, e[o])); else for (var r, n = 0; n < arguments.length; n++)void 0 !== arguments[n] && (r = new RegExp("({)" + n + "(})", "g"), i = i.replace(r, arguments[n])); return i }, rc.prototype.createField = function (e, t) { return Y.draw(e, t), this }, rc.prototype.destroy = function () { Y.destroy() }, rc.prototype.remove = function () { Y.destroy() }, nc.prototype.add = function (e, t = {}) { return this.dataSource.entities.add({ id: t.id || wn(), name: t.name, position: Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height), billboard: { image: t.image || window.SmartEarthRootUrl + I.mark1, scale: t.scale || 1, horizontalOrigin: this.option.horizontalOrigin, verticalOrigin: this.option.verticalOrigin, disableDepthTestDistance: Number.POSITIVE_INFINITY } }) }, nc.prototype._drawCircle = function (i, o) { var r = o.length, n = this.option.size * (r + 1), a = i.toCssColorString() + "-" + n, r = n / 2 - r * this.option.fontSize / 3, s = (n + this.option.fontSize) / 2; if (!this._cache[a]) { let e = document.createElement("canvas"), t = (e.width = n, e.height = n, e.getContext("2d")); t.save(), t.scale(n / 24, n / 24), t.fillStyle = i.withAlpha(.2).toCssColorString(), t.beginPath(), t.arc(12, 12, 9, 0, 2 * Math.PI), t.closePath(), t.fill(), t.beginPath(), t.arc(12, 12, 6, 0, 2 * Math.PI), t.fillStyle = i.toCssColorString(), t.fill(), t.closePath(), t.restore(), t.font = `bold ${this.option.fontSize}px sans-serif`, t.fillStyle = this.option.fontColor, t.fillText(o, r, s), this._cache[a] = e.toDataURL() } return this._cache[a] }, nc.prototype._drawClustering = function (i, o) { var r = o.length, n = this.option.size * (r + 1), a = i.toCssColorString() + "-" + n, r = n / 2 - r * this.option.fontSize / 3, s = (n + this.option.fontSize) / 2; let l = -Math.PI / 12; var c = Math.PI / 2, u = Math.PI / 6; if (!this._cache[a]) { let e = document.createElement("canvas"), t = (e.width = n, e.height = n, e.getContext("2d")); t.save(), t.scale(n / 24, n / 24), t.beginPath(), t.arc(12, 12, 6, 0, 2 * Math.PI), t.fillStyle = i.toCssColorString(), t.fill(), t.closePath(), t.lineWidth = 2; for (let e = 0; e < 3; e++)t.beginPath(), t.arc(12, 12, 8, l, l + c, !1), t.strokeStyle = i.withAlpha(.4).toCssColorString(), t.stroke(), t.arc(12, 12, 11, l, l + c, !1), t.strokeStyle = i.withAlpha(.2).toCssColorString(), t.stroke(), t.closePath(), l = l + c + u; t.restore(), t.font = `bold ${this.option.fontSize}px sans-serif`, t.fillStyle = this.option.fontColor, t.fillText(o, r, s), this._cache[a] = e.toDataURL() } return this._cache[a] }, nc.prototype._clusterEventHandler = function (e, t) { if (this.dataSource.clustering.enabled && (t.billboard.show = !0, t.label.show = !1, t.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY, this.dataSource.entities.values.length)) { var i, o, r = this.dataSource.entities.values.length || 0; for (i in this.option.gradient) e.length >= 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)) } }, nc.prototype.clear = function () { this.dataSource.entities.removeAll(), this._cache = {} }, nc.prototype.setVisibility = function (e) { this.dataSource && (this.dataSource.show = e) }, nc.prototype.deleteObject = function () { this.clear(), this._viewer.dataSources.remove(this.dataSource), Cesium.destroyObject(this) }, Object.defineProperties(nc.prototype, { enableCluster: { set: function (e) { this.dataSource.clustering.enabled = e }, get: function () { return this.dataSource.clustering.enabled } } }); var ac = "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 sc(e) { return e.scene.colorAdjustment || (this.item = new Cesium.PostProcessStage({ name: "czm_colorAdjustment", fragmentShader: ac, uniforms: { brightness: 1, contrast: 1, saturation: 1 } }), this.item.enabled = !0, e.scene.postProcessStages.add(this.item), e.scene.colorAdjustment = this) } function lc(e) { this._viewer = e, this._core = new f, this._tree = V } function cc(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function uc(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 hc() { this._core = new f, 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, hc.prototype.ready || Object.defineProperties(hc.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 < this._numTilesInLevel[t] && e < t && (e = t); return e } } }) } function mc(i, e, o) { $.each(e._primitives, function (e, t) { if (t instanceof Cesium.BillboardCollection) return e = yc.indexOf(t = t), t._parentCollection._primitiveOld = o, -1 !== e ? (i.scene.primitives.remove(yc[e]._parentCollection), yc[e] = t) : yc.push(t), !1 }) } function dc(e, t, i) { e.scene.primitives.remove(i), t._onDestroyTilePrimitive = function () { e.scene.primitives.remove(i), this._onDestroyTilePrimitive = void 0 } } function pc(e, t, i, o) { Cesium.when.all(t, function () { e.scene.primitives.remove(o) }), i._onDestroyTilePrimitive = function () { e.scene.primitives.remove(o), this._onDestroyTilePrimitive = void 0 } } function gc(e, t, i) { pc(e, $.map(t._primitives, function (e) { return e.readyPromise }), t, i) } function fc(e, t, i) { pc(e, $.map(t._primitives[0]._primitives, function (e) { return e.readyPromise }), t, i) } function _c(e, t, i) { e.scene.primitives.remove(i) } function Cc(e, t, i) { pc(e, [t.readyPromise], t, i) } Object.defineProperties(sc.prototype, { brightness: { get: function () { return this.item.uniforms.brightness }, set: function (e) { this.item.uniforms.brightness = e } }, contrast: { get: function () { return this.item.uniforms.contrast }, set: function (e) { this.item.uniforms.contrast = e } }, saturation: { get: function () { return this.item.uniforms.saturation }, set: function (e) { this.item.uniforms.saturation = e } } }), lc.prototype.create = function (e, t, i = {}) { this.angle = (i.angle || 10) / 2, this.heading = this.pitch = this.roll = 0; let o = { subdivisions: 6, stackPartitions: 30, slicePartitions: 30, innerRadii: new Cesium.Cartesian3(1, 1, 1), radii: new Cesium.CallbackProperty(() => new 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 }, lc.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) }, lc.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)))) }, lc.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() }, lc.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() }, lc.prototype.changeAngle = function (e) { this.angle = e / 2 }, lc.prototype.setTreeobj = function (e) { this.treeobj = e }, lc.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, lc.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, cc.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 < t.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x, t[a].y, t[a].z)); else for (a = 0; a < t.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a].x, t[a].y)); else if (2 === t[0].length) for (var a = 0; a < t.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0], t[a][1])); else if (3 === t[0].length) for (var a = 0; a < t.length; a++)n.push(this._cesium.Cartesian3.fromDegrees(t[a][0], t[a][1], t[a][2])); i.positions = n; r = this._viewer.entities.add({ name: e, id: this._core.getuid(), corridor: i }); return this.item = r, this._tree.insertGroupId({ id: r.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "corridor", item: this }, this._core.isnull(o) ? 0 : o), this } console.log("options is required") }, cc.prototype.getstyles = function () { var e = {}; return e.show = !this.item.ellipse.show || this.item.ellipse.show._value, e.positions = this.item.ellipse.positions ? this.item.ellipse.positions.getValue().toString() : void 0, e.width = this.item.ellipse.width && this.item.ellipse.width._value ? this.item.ellipse.width.toString() : void 0, e.height = this.item.ellipse.height && this.item.ellipse.height._value ? this.item.ellipse.height.toString() : 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.cornerType = this.item.ellipse.cornerType ? this.item.ellipse.cornerType._value : void 0, e.material = {}, tyles.material.color = this.item.ellipse.material && this.item.ellipse.material.color && this.item.ellipse.material.color._value ? 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 ? this.item.ellipse.material.image._value : void 0, e.material.repeat = this.item.ellipse.material && this.item.ellipse.material.repeat && this.item.ellipse.material.repeat._value ? this.item.ellipse.material.repeat._value : void 0, e.fill = this.item.ellipse.fill ? this.item.ellipse.fill._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.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 }, cc.prototype.setVisibility = function (e) { this.item.show = e }, cc.prototype.getVisibility = function () { return this.item.show }, cc.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, cc.prototype.setItem = function (e) { this.item = e }, cc.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(uc.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 } } }), uc.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 < l; ++s)n = (r = a[s]).prefix ? r.prefix + ":" + i : i, "*" != i && n != r.nodeName || "*" != t && t != r.namespaceURI || o.push(r); return o }, uc.prototype.read = function (e) { for (var t = this.getElementsByTagNameNS(e.documentElement, this._gmlns, this.featureName), i = [], o = 0; o < t.length; o++) { var r = this.parseFeature(t[o]); r && i.push(r) } return i }, uc.prototype.parseFeature = function (e) { for (var t, i, o, r, n = ["MultiPolygon", "Polygon", "MultiLineString", "LineString", "MultiPoint", "Point", "Envelope"], a = 0; a < n.length; ++a)if (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, t = n[a])).length) { (r = this.parseGeometry[t.toLowerCase()]) ? o = r.apply(this, [i[0]]) : console.log("unsupportedGeometryType:" + t); break } for (var s, l = this.getElementsByTagNameNS(e, this._gmlns, "Box"), a = 0; a < l.length; ++a) { var c = l[a], u = this.parseGeometry.box.apply(this, [c]), c = c.parentNode; "boundedBy" === (c.localName || c.nodeName.split(":").pop()) ? s = u : o = u.toGeometry() } this.extractAttributes && (m = this.parseAttributes(e)); for (var h, m = { geometryType: t.toLowerCase(), positions: o, attributes: m }, d = (m.bounds = s, e.firstChild); d && (1 != d.nodeType || !(h = d.getAttribute("fid") || d.getAttribute("id")));)d = d.nextSibling; return m.fid = h, m }, uc.prototype.parseGeometry = { point: function (e) { var t = [], i = this.getElementsByTagNameNS(e, this._gmlns, "pos"); return 0 == (t = 0 < i.length ? i[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : t).length && (0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length && (t = i[0].firstChild.nodeValue.replace(this._regExes.removeSpace, "").split(","))), 0 == t.length && 0 < (i = this.getElementsByTagNameNS(e, this._gmlns, "coord")).length && (e = this.getElementsByTagNameNS(i[0], this._gmlns, "X"), i = this.getElementsByTagNameNS(i[0], this._gmlns, "Y"), 0 < e.length && 0 < i.length && (t = [e[0].firstChild.nodeValue, i[0].firstChild.nodeValue])), 2 == t.length && (t[2] = null), this.xy ? [parseFloat(t[0]), parseFloat(t[1]), parseFloat(t[2])] : [parseFloat(t[1]), parseFloat(t[0]), parseFloat(t[2])] }, multipoint: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Point"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.point.apply(this, [t[r]])) && i.push(o); return i }, linestring: function (e, t) { var i = [], o = [], r = this.getElementsByTagNameNS(e, this._gmlns, "posList"); if (0 < r.length) for (var n, a, s, i = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace), l = parseInt(r[0].getAttribute("dimension")), c = 0; c < i.length / l; ++c)s = c * l, n = parseFloat(i[s]), a = parseFloat(i[1 + s]), s = 2 == l ? null : parseFloat(i[2 + s]), this.xy ? o.push(n, a, s) : o.push(a, n, s); if (0 == i.length && 0 < (r = this.getElementsByTagNameNS(e, this._gmlns, "coordinates")).length) for (var u = this.getChildValue(r[0]).replace(this._regExes.trimSpace, "").replace(this._regExes.trimComma, ",").split(this._regExes.splitSpace), c = 0; c < u.length; ++c)2 == (i = u[c].split(",")).length && (i[2] = null), this.xy ? o.push(parseFloat(i[0]), parseFloat(i[1]), parseFloat(i[2])) : o.push(parseFloat(i[1]), parseFloat(i[0]), parseFloat(i[2])); return o }, multilinestring: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LineString"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r]])) && i.push(o); return i }, polygon: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "LinearRing"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.linestring.apply(this, [t[r], !0])) && i.push(o); return i }, multipolygon: function (e) { var t = this.getElementsByTagNameNS(e, this._gmlns, "Polygon"), i = []; if (0 < t.length) for (var o, r = 0; r < t.length; ++r)(o = this.parseGeometry.polygon.apply(this, [t[r]])) && i.push(o); return i }, envelope: function (e) { var t, i, o, r, n = [], a = this.getElementsByTagNameNS(e, this._gmlns, "lowerCorner"), a = (0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), i = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), this.getElementsByTagNameNS(e, this._gmlns, "upperCorner")); return 0 < a.length && (o = [], 2 == (o = 0 < a.length ? a[0].firstChild.nodeValue.replace(this._regExes.trimSpace, "").split(this._regExes.splitSpace) : o).length && (o[2] = null), r = this.xy ? new OpenLayers_Geometry_Point(o[0], o[1], o[2]) : new OpenLayers_Geometry_Point(o[1], o[0], o[2])), i && r && (n.push([i.x, i.y, null]), n.push([r.x, i.y, null]), n.push([r.x, r.y, null]), n.push([i.x, r.y, null]), n.push([i.x, i.y, null]), t = new OpenLayers_Geometry_Polygon([[n]])), t }, box: function (e) { var e = this.getElementsByTagNameNS(e, this._gmlns, "coordinates"), t = null, i = null; if (0 < e.length && (2 == (e = e[0].firstChild.nodeValue.split(" ")).length && (t = e[0].split(","), i = e[1].split(","))), null !== t && null !== i) return [parseFloat(t[0]), parseFloat(t[1]), null, parseFloat(i[0]), parseFloat(i[1]), null] } }, uc.prototype.parseAttributes = function (e) { for (var t, i, o, r, n, a = {}, s = e.firstChild; s;) { if (1 == s.nodeType) { for (t = s.childNodes, i = 0; i < t.length; ++i)1 == (o = t[i]).nodeType && (1 == (n = o.childNodes).length ? 3 != (n = n[0]).nodeType && 4 != n.nodeType || (r = o.prefix ? o.nodeName.split(":")[1] : o.nodeName, n = n.nodeValue.replace(this._regExes.trimSpace, ""), a[r] = n) : a[o.nodeName.split(":").pop()] = null); break } s = s.nextSibling } return a }, uc.prototype.getChildValue = function (e, t) { var i = t || ""; if (e) for (var o = e.firstChild; o; o = o.nextSibling)switch (o.nodeType) { case 3: case 4: i += o.nodeValue }return i }, hc.prototype.streamSpeedFactor = function () { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var yc = [], vc = 0, wc = (hc.prototype.onPreFrame = function (e, t) { if (vc++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && vc % this.streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this.STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives.add(i)); $.each(yc, function (e, t) { t.ready && this.viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }, hc.prototype.updateForPick = function (e) { }, Math.PI, hc.prototype.placeHolder = function (e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: this.viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, hc.prototype.getTile = function (e) { return this._tileCache[e] }, hc.prototype.getAllTiles = function () { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, hc.prototype.addToScene = function (e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, hc.prototype.removeFromScene = function (e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != t ? (this._primitivesWaitingToBeAddedToTheScene[t].destroy(), this._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : this.viewer.scene.primitives.remove(e) }, hc.prototype.replaceInScene = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), null != e._replacmentPrimitive && this.viewer.scene.primitives.remove(e._replacmentPrimitive), e._replacmentPrimitive = t, this.viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": mc(this.viewer, t, e); break; case "labels": dc(this.viewer, t, e); break; case "polygons": gc(this.viewer, t, e); break; case "models": fc(this.viewer, t, e); break; case "polylines": Cc(this.viewer, t, e); break; case "points": _c(this.viewer, 0, e); break; default: console.log("Error updating layer"), this.viewer.scene.primitives.remove(e) } }, { billboards: mc, labels: dc, polygons: gc, models: fc, polylines: Cc, points: _c }), bc = (hc.prototype.replaceInSceneNew = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != i ? this._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = wc[i]) ? i(t, e) : (console.log("Error updating layer"), this.viewer.scene.primitives.remove(e))) }, !(hc.prototype.update = function (e) { this.level = this._core.getLevel(this.viewer); let t = this.getAllTiles(), i, o; t.forEach(e => { 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 Tc() { } function Sc(e) { return "string" == typeof e ? e.replace(/^\s+/g, "").replace(/\s+$/g, "") : e } function Ec(t, e) { for (var i = !1, o = 0, r = "", n = 0; n < e.length; n++)!i && /['"`]/.test(e[n]) ? i = e[n] : i && e[n] == i ? i = !1 : i || "(" != e[n] ? i || ")" != e[n] || o-- : o++, e[n] == t && (0 < o || i) ? r += "######" : r += e[n]; return e = (e = (e = r).split(t)).map(function (e) { return Sc(e.replace(new RegExp("######", "g"), t)) }) } function Pc(e) { for (var t = "#", i = e.length, o = 0; o < i; o++)t += e[o] + "#"; return t } function xc(e) { for (var t = "", i = e.length, o = 1; o < i; o += 2)t += e[o]; return t } function Dc(e) { this.source = e, this.cursor = 0, this.currentChar = "", this.readNextChar() } function Ic(e) { this.lexer = new Dc(e), this.currentToken = "", this.readNextToken() } function Ac(e, t) { var i = ""; return void 0 !== e.logic ? (i = (i = e.terms.map(function (e) { return Ac(e, !0) })).join(" " + e.logic + " "), void 0 !== t && (i = "(" + i + ")")) : void 0 !== e.left ? (i = e.left, void 0 !== e.operator && (i += " " + e.operator, void 0 !== e.right && ("IN" === e.operator ? i += " (" + e.right + ")" : i += " " + e.right))) : i = e, i } function Lc(e) { var t, i = 0; if (0 !== e.length) for (t = 0; t < e.length; t++)i = (i << 5) - i + e.charCodeAt(t), i |= 0; return i } function Mc(e, t) { this._style = e || {}, this._core = new f, this._bufferAnalysis = new Ai(t, Cesium), t.scene.onHoverShowTextArray = {}, t.scene._lastObjectShowOnText = null, this.setEyeOffset = function (e, t) { void 0 === t && (t = 0), e.eyeOffset = Cesium.DynamicEyeOffset(t) }, this.viewer = t } function Rc(e, t) { for (var i = e.length, o = 0; o < i; o++) { var r = t(e[o]); if ("polygon" == e[o].geometryType || "multipolygon" == e[o].geometryType) { for (var n = e[o], a = n.positions.length, s = 0; s < a; s++) { for (var l = n.positions[s], c = 2; c < l.length; c += 3)l[c] = r; n.positions[s] = l } e[o] = n } else { for (var u = e[o], h = u.positions.length, s = 2; s < h; s += 3)u.positions[s] = r; e[o] = u } } return e } function Oc(e, t) { if (null == e.isQuery) if (null == e.originalInstanceIds) { if (e.parentLayer.isExistRenderedFeatureId(t)) return } else if (-1 == e.originalInstanceIds.indexOf(t)) return; return 1 } function Bc(t) { return function (e) { e = Number(t.applyConditionalClassification(t._style.altitudeOffset || t._style.height, e.attributes)); return e = isNaN(e) ? 0 : e } } function Vc(e) { if ("string" != typeof e) return e; var t = Number(e); if (isNaN(t)) return e; var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;)i = "0" + i, o++; e = Cesium.Color.fromCssColorString("#" + i); return null != e && (t = e.red, e.red = e.blue, e.blue = t), e } function Fc(e) { if (null != e) { var t = parseInt(e); if (null != e.alpha || isNaN(t)) return e; t < 0 && (t &= 16777215); var i = t.toString(16); if (i.length < 6 && null != i) for (var o = i.length; o < 6;)i = "0" + i, o++; var e = (e = "#" + i).substring(0, 7), t = Cesium.Color.fromCssColorString(e); return null != t && (e = t.red, t.red = t.blue, t.blue = e), t } } function Hc(e) { return isNaN(e) ? e : parseFloat(e) } function Gc(e, i) { var t, o = []; return $.each(e.attributeNames, function (e, t) { o.push(Hc(i[t])) }), 1 === o.length ? t = e.func(o[0]) : 2 === e.attributeNames.length ? t = e.func(o[0], o[1]) : 3 === e.attributeNames.length ? t = e.func(o[0], o[1], o[2]) : 4 === e.attributeNames.length && (t = e.func(o[0], o[1], o[2], o[3])), t } function kc(e, t, i) { return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), i) } hc.prototype.initialize = function (e) { bc || (this.viewer.scene.preRender.addEventListener(this.onPreFrame, this), bc = !0) }, hc.prototype.beginUpdate = function (e) { this.quadtree.beginFrame(e) }, hc.prototype.endUpdate = function (e) { var t = this; e.afterRender.push(function () { t.quadtree.endFrame(e) }) }, hc.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumError / (1 << e) }, hc.prototype.loadTile = function (e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function () { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, hc.prototype.computeTileVisibility = function (e, t, i) { var o = this.computeDistanceToTile(e, t); if (e._distance = o, t.fog.enabled && 1 <= Cesium.Math.fog(o, t.fog.density)) return Cesium.Visibility.NONE; o = e.data; if (o.tileBoundingRegion, void 0 === o.boundingVolumeSourceTile) return Cesium.Visibility.PARTIAL; var r = t.cullingVolume, n = o.orientedBoundingBox; !n && o.renderedMesh && (n = o.renderedMesh.boundingSphere3D), o.clippedByBoundaries = !1; a = e.rectangle, (s = this.cartographicLimitRectangle).west < s.east || (s = Rectangle.clone(s, splitCartographicLimitRectangleScratch), 0 < Rectangle.center(a, rectangleCenterScratch).longitude ? s.east = CesiumMath.PI : s.west = -CesiumMath.PI); var a = s, s = new Cesium.Rectangle, a = Cesium.Rectangle.simpleIntersection(a, e.rectangle, s); if (!a) return Visibility.NONE; if (Cesium.Rectangle.equals(a, e.rectangle) || (o.clippedByBoundaries = !0), t.mode, Cesium.SceneMode.SCENE3D, !n) return Cesium.Intersect.INTERSECTING; s = this._clippingPlanes; if (s && s.enabled) { a = s.computeIntersectionWithBoundingVolume(n); if (e.isClipped = a !== Intersect.INSIDE, a === Cesium.Intersect.OUTSIDE) return Cesium.Visibility.NONE } s = r.computeVisibility(n); return s !== Cesium.Intersect.OUTSIDE && (e = t.mode === Cesium.SceneMode.SCENE3D && t.camera.frustum instanceof Cesium.OrthographicFrustum, t.mode !== Cesium.SceneMode.SCENE3D || e || !i || !(a = o.occludeePointInScaledSpace) || i.ellipsoid.isScaledSpacePointVisible(a)) ? s : Cesium.Visibility.NONE }, hc.prototype.canRefine = function (e, t, i) { return e.level < 16 }, hc.prototype.showTileThisFrame = function (e, t, i, o) { e.data.geometryPrimitive && e.data.geometryPrimitive.update(t, i, o) }, hc.prototype.computeDistanceToTile = function (e, t) { s = e, this.terrainProvider, void 0 === (r = void 0 === (r = s.data) ? s.data = new Cesium.GlobeSurfaceTile : r).tileBoundingRegion && (r.tileBoundingRegion = new Cesium.TileBoundingRegion({ computeBoundingVolumes: !1, rectangle: s.rectangle, ellipsoid: s.tilingScheme.ellipsoid, minimumHeight: 0, maximumHeight: 0 })); var i, o, r = e.data, n = r.tileBoundingRegion; if (void 0 === s) return 9999999999; r.boundingVolumeSourceTile !== s && (r.boundingVolumeSourceTile = s, (s = e.rectangle) && s.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r.orientedBoundingBox = Cesium.OrientedBoundingBox.fromRectangle(e.rectangle, n.minimumHeight, n.maximumHeight, e.tilingScheme.ellipsoid, r.orientedBoundingBox), r.occludeePointInScaledSpace = (s = this, u = r.orientedBoundingBox.center, l = e.rectangle, c = n.maximumHeight, i = r.occludeePointInScaledSpace, a = (s = s.quadtree._occluders.ellipsoid).ellipsoid, o = [new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3, new Cesium.Cartesian3], Cesium.Cartesian3.fromRadians(l.west, l.south, c, a, o[0]), Cesium.Cartesian3.fromRadians(l.east, l.south, c, a, o[1]), Cesium.Cartesian3.fromRadians(l.west, l.north, c, a, o[2]), Cesium.Cartesian3.fromRadians(l.east, l.north, c, a, o[3]), s.computeHorizonCullingPoint(u, o, i)))); var a, s, l = n.minimumHeight, c = n.maximumHeight, u = (r.boundingVolumeSourceTile !== e && (a = t.camera.positionCartographic.height, s = Math.abs(a - l), Math.abs(a - c) < s ? (n.minimumHeight = l, n.maximumHeight = l) : (n.minimumHeight = c, n.maximumHeight = c)), n.distanceToCamera(t)); return n.minimumHeight = l, n.maximumHeight = c, u }, hc.prototype.isDestroyed = function () { return !1 }, hc.prototype.destroy = function () { return Cesium.destroyObject(this) }, hc.prototype.remove = function () { this.destroy() }, hc.prototype.getInstance = function (e) { var t; return 0 == Cesium.defined(e.TileManager) && (t = new hc, (e.TileManager = t).viewer = e, t = new Cesium.QuadtreePrimitive({ tileProvider: e.TileManager, maximumScreenSpaceError: 2 }), e.scene.primitives.add(t)), e.TileManager }, Tc.sql2ast = function (r, e) { function n(e, t) { return t } null == e && (e = !0); var t = "###semi-colon###", i = (r = (r = (r = (r = r.replace(/[("'`].*;.*[)"'`]/g, function (e) { return e.replace(/;/g, t) })).replace(/;/g, "###EOR###")).split("###EOR###")[0]).replace(new RegExp(t, "g"), ";"), ["SELECT", "FROM", "DELETE FROM", "INSERT INTO", "UPDATE", "JOIN", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "ORDER BY", "GROUP BY", "HAVING", "WHERE", "LIMIT", "VALUES", "SET"]), o = i.map(function (e) { return e + " " }), a = (o = (o = o.concat(i.map(function (e) { return e + "(" }))).concat(o.map(function (e) { return e.toLowerCase() }))).map(function (e) { return e.replace("(", "[\\(]") }), s = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(a.join("|"), "gi"), Pc) }), []), l = (o.forEach(function (e) { var t, i, o = 0; do { } while (-1 != (i = r.indexOf(e, o)) && (t = e.replace(/^((\w|\s)+?)\s?\(?$/i, n), o = i + (s[i] = t).length), -1 != i) }), 0), c = (s.forEach(function (e, t) { t < l ? delete s[t] : (l = parseInt(t, 10) + e.length, "JOIN" == e && (s[t] = "INNER JOIN")) }), a.slice(0)), u = (c = (c = c.map(Pc)).join("|"), r.split(new RegExp(a.join("|"), "i"))), h = (r = r.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(c, "gi"), xc) }), u = u.map(function (e) { return e.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi, function (e) { return e.replace(new RegExp(c, "gi"), xc) }) }), []), m = (h.SELECT = function (e) { return Ec(",", e).filter(function (e) { return "" !== e }).map(function (e) { return { name: e } }) }, h.SET = function (e) { return Ec(",", e).filter(function (e) { return "" !== e }).map(function (e) { return { expression: e } }) }, h.FROM = h["DELETE FROM"] = h.UPDATE = function (e) { var i = e.split(","); return (i = i.map(Sc)).forEach(function (e, t) { "" === e && i.splice(t) }), i = i.map(function (e) { var e = e.split(" AS "), t = e[1] || ""; return 0 === t.indexOf('"') && t.lastIndexOf('"') == t.length - 1 && (t = t.substring(1, t.length - 1)), { table: e[0], as: t } }) }, h["LEFT JOIN"] = h.JOIN = h["INNER JOIN"] = h["RIGHT JOIN"] = function (e) { var t = (e = e.split(" ON "))[0].split(" AS "), i = {}; return i.table = Sc(t[0]), i.as = Sc(t[1]) || "", i.cond = Sc(e[1]), i }, h.WHERE = Sc, h["ORDER BY"] = function (e) { e = e.split(","); var o = []; return e.forEach(function (e, t) { var i = /([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi; null !== (i = i.exec(e)) && ((e = {}).column = Sc(i[1]), e.order = Sc(i[2]), void 0 === i[2] && (e.order = "ASC"), o.push(e)) }), o }, h["GROUP BY"] = function (e) { e = e.split(","); var o = []; return e.forEach(function (e, t) { var i = /([A-Za-z0-9_\.]+)/gi; null !== (i = i.exec(e)) && ((e = {}).column = Sc(i[1]), o.push(e)) }), o }, h.LIMIT = function (e) { var t = /((\d+)\s*,\s*)?(\d+)/gi, e = (void 0 === (t = t.exec(e))[2] && (t[2] = 0), {}); return e.nb = parseInt(Sc(t[3]), 10), e.from = parseInt(Sc(t[2]), 10), e }, h["INSERT INTO"] = function (e) { var t = (t = /([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi).exec(e), e = {}; return e.table = Sc(t[1]), void 0 !== t[3] && (e.columns = t[3].split(","), e.columns = e.columns.map(Sc)), e }, h.VALUES = function (e) { var e = Ec(",", e = "(" != (e = Sc(e))[0] ? "(" + e : e), t = []; return e.forEach(function (e) { e = Ec(",", e = e.replace(/^\(/g, "").replace(/\)$/g, "")), t.push(e) }), t }, {}), d = 0; return s.forEach(function (e, t) { var i, o; e = e.toUpperCase(), d++, void 0 !== h[e] ? (i = h[e](u[d]), void 0 !== m[e] ? ("string" != typeof m[e] && void 0 !== m[e][0] || (o = m[e], m[e] = [], m[e].push(o)), m[e].push(i)) : m[e] = i) : console.log("Can't analyze statement \"" + e + '"') }), void 0 !== m["LEFT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["LEFT JOIN"][0] ? m["LEFT JOIN"].forEach(function (e) { e.type = "left", m.JOIN.push(e) }) : (m["LEFT JOIN"].type = "left", m.JOIN.push(m["LEFT JOIN"])), delete m["LEFT JOIN"]), void 0 !== m["INNER JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["INNER JOIN"][0] ? m["INNER JOIN"].forEach(function (e) { e.type = "inner", m.JOIN.push(e) }) : (m["INNER JOIN"].type = "inner", m.JOIN.push(m["INNER JOIN"])), delete m["INNER JOIN"]), void 0 !== m["RIGHT JOIN"] && (void 0 === m.JOIN && (m.JOIN = []), void 0 !== m["RIGHT JOIN"][0] ? m["RIGHT JOIN"].forEach(function (e) { e.type = "right", m.JOIN.push(e) }) : (m["RIGHT JOIN"].type = "right", m.JOIN.push(m["RIGHT JOIN"])), delete m["RIGHT JOIN"]), e && ("string" == typeof m.WHERE && (m.WHERE = Ic.parse(m.WHERE)), void 0 !== m.JOIN && m.JOIN.forEach(function (e, t) { m.JOIN[t].cond = Ic.parse(e.cond) })), m }, Dc.prototype = { constructor: Dc, readNextChar: function () { "string" != typeof this.source ? this.currentChar = "" : this.currentChar = this.source[this.cursor++] || "" }, readNextToken: function () { return /\w|[-]/.test(this.currentChar) ? this.readWord() : /["'`]/.test(this.currentChar) ? this.readString() : /[()]/.test(this.currentChar) ? this.readGroupSymbol() : /[!=<>]/.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 } } }, Dc.tokenize = function (e) { var t = new Dc(e), i = []; do { var o = t.readNextToken() } while ("empty" != o.type && i.push(o), t.currentChar); return i }, Ic.prototype = { constructor: Ic, 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 } }, Ic.parse = function (e) { return new Ic(e).parseExpressionsRecursively() }, Tc.ast2sql = function (e) { function t(e) { return void 0 !== e.WHERE ? " WHERE " + Ac(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 " + Ac(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 < parseInt(a.LIMIT.nb, 10) ? (r = " LIMIT ", void 0 !== a.LIMIT.from && 1 < parseInt(a.LIMIT.from, 10) && (r += a.LIMIT.from + ","), r + a.LIMIT.nb) : "") : void 0 !== e["INSERT INTO"] ? (void 0 !== (r = e)["INSERT INTO"] ? (a = "INSERT INTO " + r["INSERT INTO"].table, void 0 !== r["INSERT INTO"].columns ? (a += " (") + r["INSERT INTO"].columns.join(", ") + ")" : a) : "") + (void 0 !== (o = e).VALUES ? " VALUES " + o.VALUES.map(function (e) { return "(" + e.join(", ") + ")" }).join(", ") : "") : void 0 !== e.UPDATE ? (void 0 !== (o = e).UPDATE ? "UPDATE " + o.UPDATE.map(function (e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + (void 0 !== (i = e).SET ? " SET " + i.SET.map(function (e) { return e.expression }).join(", ") : "") + t(e) : void 0 !== e["DELETE FROM"] ? (void 0 !== (i = e)["DELETE FROM"] ? "DELETE FROM " + i["DELETE FROM"].map(function (e) { var t = e.table; return "" !== e.as && (t += " AS " + e.as), t }).join(", ") : "") + t(e) : null }, Tc.trim = Sc, Tc.protect = Pc, Tc.unprotect = xc, Tc.protect_split = Ec, Tc.CondLexer = Dc, Tc.CondParser = Ic; var Nc, jc = function (e) { for (var t = [], i = 0; i < e.length; i++)for (var o = 0; o < e[i].positions.length; o += 3)t.push(Cesium.Cartographic.fromDegrees(e[i].positions[o + 0], e[i].positions[o + 1], 0)); return t }, Uc = function (e, t, i, o) { for (var r = 0, n = 0; n < e.length; n++)for (var a = o ? zc : i(e[n]), s = 2; s < e[n].positions.length; s += 3) { null == t[r].height && (t[r].height = 0), null == e[n].absoluteHeightPositions && (e[n].absoluteHeightPositions = []), e[n].absoluteHeightPositions[s - 2] = e[n].positions[s - 2], e[n].absoluteHeightPositions[s - 1] = e[n].positions[s - 1], e[n].absoluteHeightPositions[+s] = e[n].positions[+s]; var l = o ? 0 : e[n].positions[s]; e[n].absoluteHeightPositions[s] = l + t[r].height + a, r++ } }, zc = 1, Wc = (Object.defineProperties(Mc.prototype, { style: { get: function () { return this._style }, set: function (e) { this._style = e } } }), Mc.prototype.clonePartOfMultiFeature = function (e, t) { var i = e.geometryType.includes("multi") ? e.fid + "." + t : e.fid; return { positions: e.positions[t], attributes: e.attributes, fid: i, geometryType: e.geometryType } }, Mc.prototype.createPrimitiveFromWFSFeatures = function (e) { new Cesium.PrimitiveCollection; for (var t = [], i = [], o = [], r = e.features.numPositions = 0; r < e.features.length; r++) { var n = e.features[r]; switch (this.sanitizePositions(n.positions), e.features.numPositions += n.positions.length, n.geometryType) { case "polygon": t.push(n); break; case "multipolygon": for (var a = n.positions.length, s = 0; s < a; s++)t.push(this.clonePartOfMultiFeature(n, s)); break; case "linestring": i.push(n); break; case "multilinestring": for (a = n.positions.length, s = 0; s < a; s++)i.push(this.clonePartOfMultiFeature(n, s)); break; case "point": o.push(n); break; case "multipoint": for (a = n.positions.length, s = 0; s < a; s++)o.push(this.clonePartOfMultiFeature(n, s)) } } 0 < t.length ? (e.features = t, this.createPolygonPrimitive(e)) : 0 < i.length ? (e.features = i, this.createLinestringPrimitive(e)) : 0 < o.length && (e.features = o, this.createPointPrimitive(e)) }, Mc.prototype.createPolygonPrimitive = function (g) { function f(t) { if (t.isQuery) t.onFinishedQuery(e); else { var o = "", e = [], r = [], n = [], a = [], s = [], l = b.style.polygon, c = l.clampToGround || !l.perPositionHeight && !l.extrudedHeight && !l.height; let i; l.text && (i = new Cesium.LabelCollection); for (var u, h, m, d = 0; d < t.features.length; d++) { var p = t.features[d]; if (Oc(t, p.fid)) { var g, f = p.absoluteHeightPositions || p.positions, _ = b.createPolygonOptions(f, p.attributes), f = b.createCommonOptions(p.attributes), C = Cesium.BoundingSphere.fromPoints(_.hierarchy.positions); if (p.absoluteHeightPositions && delete p.absoluteHeightPositions, e.push(C), !t.isQuery) { let e; if (_.randomColor && (e = Cesium.Color.fromRandom()), _.outline && !c ? (g = b.createPolygonGeometryHelper("outline", p, _.outlineColor, _), n.push(g)) : _.outline && n.push(new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: _.hierarchy.positions, width: _.outlineWidth }) })), _.text) { var y = b._core.getCenterOfMass(_.hierarchy.positions); let t = b.createPointOptions(y, p.attributes); if (c || null != b.style.pointHeight || !_.extrudedHeight && !_.height || (t.position = Cesium.Cartesian3.fromDegrees(y[0], y[1], _.extrudedHeight ? (_.height || 0) + _.extrudedHeight : _.height)), (_.labelNear || _.labelFar) && (t.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(_.labelNear || 0, _.labelFar || 1 / 0)), _.offsetPoint && _.offsetPoint[t.label.text]) { let e = b._core.toDegrees(t.position); b._core.getCenterOfMass(_.hierarchy.positions); y = _.offsetPoint[t.label.text]; y[0] && (e.lon = y[0]), y[1] && (e.lat = y[1]), void 0 !== y[2] && (e.height = y[2]), t.position = Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height) } let e = i.add({ id: p, position: t.position, ...t.label }); delete e.id.positions, e.id.boundingSphere = C } if (_.colorConfig) { let e; for (var v in _.colorConfig) { for (var w in _.colorConfig[v]) if (p.attributes[v] == w) { e = _.colorConfig[v][w]; break } if (e) break; _.colorConfig[v]["#"] && (e = _.colorConfig[v]["#"]) } e && (_.material = Cesium.Color.fromCssColorString(e)) } _.fill && 0 < _.material.alpha && (g = b.createPolygonGeometryHelper("fill", p, e || _.material, _), r.push(g)), t.parentLayer.addRenderedFeatureId(p.fid), o += p.fid + ";", a.push(p.fid), s.push(f.tooltip) } } } "" != o && (l = new Cesium.PrimitiveCollection, h = new Cesium.PerInstanceColorAppearance({ flat: 0 == _.material.alpha, translucent: _.material.alpha < 1 }), i && l.add(i), 0 < r.length && (_.water && (u = { color: _.water.color || "rgba(135,206,235,0.6)", image: _.water.image || window.SmartEarthRootUrl + I.water, frequency: _.water.frequency || 1e3, speed: _.water.speed || 10, amplitude: _.water.amplitude || 10 }, m = Cesium.Color.fromCssColorString(u.color), h = new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: m, blendColor: m, normalMap: u.image, frequency: u.frequency, animationSpeed: u.speed / 1e3, amplitude: u.amplitude } } }) })), ((m = c ? new Cesium.GroundPrimitive({ geometryInstances: r, appearance: h, classificationType: _.classificationType }) : new Cesium.Primitive({ geometryInstances: r, appearance: h }))._parentCollection = l).add(m)), 0 < n.length && (_.clampToGround ? l.add(new Cesium.GroundPolylinePrimitive({ geometryInstances: n, appearance: new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "Color", uniforms: { color: _.outlineColor } } }) }) })) : ((m = new Cesium.Primitive({ geometryInstances: n, appearance: h }))._parentCollection = l).add(m)), l.ID = "polygons:" + Lc(o), l._instanceIds = a, l._tooltips = s, t.onFinishedCreatePrimitive(l, e)) } } var e, b = this; 3 == this.style.altitudeMethod ? (g.features = Rc(g.features, Bc(b)), f(g)) : (e = function (e) { for (var t = [], i = e.length, o = 0; o < i; o++)for (var r = e[o], n = r.positions.length, a = 0; a < n; a++)for (var s = r.positions[a], l = 0; l < s.length; l += 3)t.push(Cesium.Cartographic.fromDegrees(s[l + 0], s[l + 1], 0)); return t }(g.features), e = Cesium.sampleRenderedData(e, Cesium.SampleRenderedDataFlags.TERRAIN | Cesium.SampleRenderedDataFlags.FLOOR), Cesium.when(e, function (e) { for (var t = 2 == b._style.altitudeMethod, i = g.features, o = e, r = Bc(b), n = t, a = 0, s = 0; s < i.length; s++) { var l = i[s], c = n ? zc : r(l); null == l.absoluteHeightPositions && (l.absoluteHeightPositions = []); for (var u = 0; u < l.positions.length; u++)for (var h = l.positions[u], m = l.absoluteHeightPositions[u] = [], d = 2; d < h.length; d += 3) { var p = n ? 0 : h[d]; null == o[a].height && (o[a].height = 0), m[d - 2] = h[d - 2], m[d - 1] = h[d - 1], m[+d] = h[+d], m[d] = p + o[a].height + c, a++ } } f(g) })) }, Mc.prototype.createPolygonGeometryHelper = function (e, t, i, o) { var r = o.hierarchy, n = o.perPositionHeight, a = o.extrudedHeight, s = o.height, l = o.water, c = null != a || void 0 !== s ? Cesium.PerInstanceColorAppearance.VERTEX_FORMAT : Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT; l && (c = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT), void 0 !== a && void 0 !== s && (a += s); let u; return l = o.bulidingWall ? new (u = "fill" === e ? Cesium.CorridorGeometry : Cesium.CorridorOutlineGeometry)({ positions: r.positions, width: o.bulidingWallWidth || .8, vertexFormat: c, extrudedHeight: a, height: s, cornerType: Cesium.CornerType.MITERED }) : new (u = "fill" === e ? Cesium.PolygonGeometry : Cesium.PolygonOutlineGeometry)({ polygonHierarchy: r, vertexFormat: c, perPositionHeight: void 0 !== s ? void 0 : n, extrudedHeight: a, height: s }), new Cesium.GeometryInstance({ geometry: l, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(i) } }) }, Mc.prototype.createLinestringPrimitive = function (e) { var t = this, o = (t && t.style && void 0 !== t.style.height && (e.features = Rc(e.features, Bc(t))), e); if (o.isQuery) o.onFinishedQuery(a); else { var r, n = "", a = [], s = [], l = []; let i = new Cesium.PrimitiveCollection; for (var c = 0; c < o.features.length; c++) { var u = o.features[c]; if (Oc(o, u.fid)) { var h = u.absoluteHeightPositions || u.positions, h = t.createLinestringOptions(h, u.attributes), m = t.createCommonOptions(u.attributes); if (h.vertexFormat = (r ? Cesium.PerInstanceColorAppearance : Cesium.PolylineColorAppearance).VERTEX_FORMAT, u.absoluteHeightPositions && delete u.absoluteHeightPositions, a.push(Cesium.BoundingSphere.fromPoints(h.positions)), !o.isQuery) { d = h.clampToGround ? new Cesium.GroundPolylineGeometry({ positions: h.positions, width: h.width }) : new Cesium.PolylineGeometry(h); var d = new Cesium.GeometryInstance({ id: u, geometry: d, attributes: { color: new Cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }); o.parentLayer.addRenderedFeatureId(u.fid), n += u.fid + ";", s.push(u.fid), l.push(m.tooltip); let e = null, t; t = h.dash ? new Cesium.PolylineMaterialAppearance({ material: Cesium.Material.fromType(Cesium.Material.PolylineDashType, { color: h.material, gapColor: h.gapColor || Cesium.Color.TRANSPARENT, dashLength: h.dashLength || 20 }) }) : new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { type: "PolylineOutline", uniforms: { color: h.material, outlineColor: h.outlineColor || h.material, outlineWidth: h.outlineWidth || 0 } } }) }), e = h.clampToGround ? new Cesium.GroundPolylinePrimitive({ geometryInstances: d, appearance: t, classificationType: h.classificationType }) : new Cesium.Primitive({ geometryInstances: d, appearance: t }), i.add(e) } } } "" != n && ((e = i).ID = "polylines:" + Lc(n), e._instanceIds && 0 === e._instanceIds.length && (e._instanceIds = s), e._tooltips = l, o.onFinishedCreatePrimitive(e, a)) } }, Mc.prototype.createPointPrimitive = function (i) { function o(e) { if (e.isQuery) e.onFinishedQuery(n); else { for (var t, i, o = "", r = [], n = [], a = [], s = new Cesium.LabelCollection({ scene: v.viewer.scene }), l = new Cesium.PointPrimitiveCollection({ scene: v.viewer.scene }), c = new Cesium.BillboardCollection({ scene: v.viewer.scene }), u = new Cesium.PrimitiveCollection, h = new Cesium.PolylineCollection, m = 0; m < e.features.length; m++) { var d, p, f, _, C, y = e.features[m]; Oc(e, y.fid) && (d = y.absoluteHeightPositions || y.positions, d = v.createPointOptions(d, y.attributes), p = v.createCommonOptions(y.attributes), y.clampToGround = d.clampToGround, d.sgsPointPosition && (y.sgsPointPosition = d.sgsPointPosition, delete d.sgsPointPosition), y.absoluteHeightPositions && delete y.absoluteHeightPositions, n.push(Cesium.BoundingSphere.fromPoints([d.position])), e.isQuery || (d.label && (d.label.position = d.position, d.label.id = y, v.setEyeOffset(d.label), null != d.label.imageFile && (d.label.image = v.applyConditionalClassification(d.label.imageFile, y.attributes), d.label.label = d.label, c.add(d.label), v.setEyeOffset(d.label, -5)), null != d.label.imageFile && null != d.label.showText && d.label.showText && (v.viewer.scene.onHoverShowTextArray[d.label.id] = !0), null != d.label.isBold && d.label.isBold ? s.add(g) : null != d.label.isUnderline && d.label.isUnderline ? (_ = null != d.label.text.match(/[iljf1]/g) ? d.label.text.match(/[iljf1]/g) : [], f = d.label.text.length, f = Array(Math.ceil(f - .5 * _.length)).join("_"), _ = $.extend({}, d.label), null != d.label.image && delete d.label.image, _.position = d.label.position, _.id = d.label.id, _.text = f, _.alignment = null != d.label.alignment ? d.label.alignment : void 0, _.underline = !0, _.textRelativeToImage = null != d.label.textRelativeToImage ? d.label.textRelativeToImage : void 0, -1 < d.label.font.indexOf("pt") ? Number(d.label.font.split("pt")[0]) : -1 < d.label.font.indexOf("px") && Number(d.label.font.split("px")[0]), _.pixelOffset = new Cesium.Cartesian2(0, -45), s.add(_)) : s.add(d.label)), d.billboard && (d.billboard.position = d.position, d.billboard.id = y, v.setEyeOffset(d.billboard), c.add(d.billboard)), d.model && (d.model.url = d.model.uri, d.model.id = y, u.add(Cesium.Model.fromGltf(d.model))), d.point && (d.point.position = d.position, d.point.id = y, v.setEyeOffset(d.point), l.add(d.point)), 0 != d.lineToGround && (f = Cesium.Cartographic.fromCartesian(d.position), _ = Cesium.Cartesian3.fromRadians(f.longitude, f.latitude, 0), 2 == d.lineToGround && (C = d.lineToGroundLength / Cesium.Cartesian3.distance(d.position, _), Cesium.Cartesian3.lerp(d.position, _, C, _)), h.add({ show: !0, width: 1, positions: [d.position, _], material: Cesium.Material.fromType("Color", { color: d.lineToGroundColor }) })), e.parentLayer.addRenderedFeatureId(y.fid), o += y.fid + ";", r.push(y.fid), a.push(p.tooltip))) } "" != o && (i = new Cesium.PrimitiveCollection, 0 < s.length && ($.each(s._labels, function (e, t) { t._type = "Label" }), (s._billboardCollection._parentCollection = i).add(s), t = "labels"), 0 < c.length && ($.each(c._billboards, function (e, t) { t._type = "Billboard" }), (c._parentCollection = i).add(c), t = "billboards"), 0 < u.length && ($.each(u._primitives, function (e, t) { t._type = "Model", t._parentCollection = i }), i.add(u), t = "models"), 0 < l.length && ($.each(l._pointPrimitives, function (e, t) { t._type = "Point" }), (l._parentCollection = i).add(l), t = "points"), 0 < h.length && ($.each(h._polylines, function (e, t) { t._type = "L2G" }), (h._parentCollection = i).add(h), t = "L2G"), i.ID = t + ":" + Lc(o), i._instanceIds = r, i._tooltips = a, e.onFinishedCreatePrimitive(i, n)) } } var e, v = this; 3 == this.style.altitudeMethod ? (i.features = Rc(i.features, Bc(v)), o(i)) : (e = jc(i.features), e = Cesium.sampleRenderedData(e), Cesium.when(e, function (e) { var t = 2 == v._style.altitudeMethod; Uc(i.features, e, Bc(v), t), o(i) }).otherwise(function (e) { })) }, Mc.prototype.createCommonOptions = function (e) { var t = {}; return t.tooltip = this.applyConditionalClassification(this.style.tooltip, e), t }, Mc.prototype.createPolygonOptions = function (e, t) { var i = this.getPolygonStyle(this.style); i.preLoad && i.preLoad(i.polygon, t), i.polygon.hierarchy = { positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[0]), holes: [] }; for (var o = 1; o < e.length; o++)i.polygon.hierarchy.holes.push({ positions: Cesium.Cartesian3.fromDegreesArrayHeights(e[o]) }); var r, n = this.applyConditionalClassification(i.polygon.material, t); return i.polygon.material = Vc(n), null != i.polygon.fill && null != i.polygon.fromKml && (1 < (r = this.applyConditionalClassification(i.polygon.fill, t)) && (r /= 100), i.polygon.material = new Cesium.Color(i.polygon.material.red, i.polygon.material.green, i.polygon.material.blue, r)), i.polygon.height && (i.polygon.height = Number(this.getValueFromProp(i.polygon.height, t))), i.polygon.extrudedHeight && i.polygon.extrudedHeight && i.polygon.extrudedHeight.indexOf && -1 < i.polygon.extrudedHeight.indexOf("[") && -1 < i.polygon.extrudedHeight.defaultValue.indexOf("]") && (n = t[i.polygon.extrudedHeight.defaultValue.substring(1, i.polygon.extrudedHeight.defaultValue.length - 1)], void 0 !== (n = parseInt(n)) && (i.polygon.extrudedHeight = 3 * n)), i.polygon.extrudedHeight && (i.polygon.extrudedHeight = Number(i.polygon.extrudedHeight)), t.FSCALE && (r = this.getLevelDistance(t.FSCALE), i.polygon.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, r)), n = this.applyConditionalClassification(i.polygon.outlineColor, t), i.polygon.outlineColor = Vc(n), i.polygon }, Mc.prototype.translateLineWidth = function (e, t) { t = this.applyConditionalClassification(e.polyline.width, t); return 0 < t ? TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS ? 1 < t && (e.polyline.widthInMeters = !0, t *= .8, 0 < e.polyline.backgroundOpacity && (t *= .8)) : t = 1 < t ? 2 : 1 : t < 0 ? t = Math.min(5, Math.abs(t)) : 0 == t && (t = 1), t }, Mc.prototype.createLinestringOptions = function (e, t) { var i = this.getLinestringStyle(this.style), e = (i.preLoad && i.preLoad(i.polyline, t), i.id = t, i.polyline.positions = Cesium.Cartesian3.fromDegreesArrayHeights(e), this.applyConditionalClassification(i.polyline.material, t)); return i.polyline.material = Vc(e), i.polyline.far && (i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(void 0 !== i.polyline.near ? i.polyline.near : 0, i.polyline.far)), t.FSCALE && (e = this.getLevelDistance(t.FSCALE), i.polyline.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, e)), i.polyline.width = this.applyConditionalClassification(i.polyline.width, t), i.polyline }, Mc.prototype.getValueFromProp = function (e, i) { let o = e && e.defaultValue ? e.defaultValue : e; if (o && o.indexOf) if (-1 < o.indexOf("[") && -1 < o.indexOf("]")) o = o.replace("[", "").replace("]", ""), o = this.getPropValue(i, o); else if (-1 < o.indexOf("{") && -1 < o.indexOf("}")) { let e = o.match(/\{[^\}]+\}/g); e.forEach(e => { var t = this.getPropValue(i, e.substring(1, e.length - 1)); o = o.replace(e, t) }), o = o.replaceAll("\\n", "\n") } return o }, Mc.prototype.getPropValue = function (e, t) { return e[t] || (t.includes(":") ? e[t.split(":")[1]] : void 0) }, Mc.prototype.applyConditionalClassification = function (e, i) { if (null != e) { if (null == e.defaultValue) return e; var o, r = Hc(e.defaultValue); if (void 0 === e.classificationArray) { if (!isNaN(r)) return r; if (r instanceof Cesium.Color) return r } if (void 0 !== e.attributeName) { var t = "[" + e.attributeName + "]"; if (r === t) r = i[e.attributeName]; else if (e.multipleAttributeReplacementNeeded) for (name in i) r = kc(r, "[" + name + "]", i[name]); else r = kc(r, t, i[e.attributeName]) } else void 0 !== e.classification ? r = Gc(e.classification, i) : void 0 !== (o = e.classificationArray) && $(Object.keys(o)).each(function (e, t) { t = function (e, t) { var i; if (void 0 !== e && 0 !== e.condition.length) return void 0 === e.func || !(i = void 0) === Gc(e, t) ? Hc(e.value) : i }(o[t], i); t && (r = t) }); return r } }, Mc.prototype.createLineToGroundOptions = function (e, t) { var i = this.applyConditionalClassification(e.lineToGround, t); null != i && 0 != Number(i) ? (e.lineToGround = i, i = Fc(i = this.applyConditionalClassification(e.lineToGroundColor, t)), e.lineToGroundColor = i, "string" == typeof (i = this.applyConditionalClassification(e.lineToGroundLength, t)) && -1 < i.indexOf("[") && -1 < i.indexOf("]") && (i = t[i.substring(1, i.length - 1)] || 0), e.lineToGroundLength = Number(i)) : (e.lineToGround = 0, e.lineToGroundColor = 0, e.lineToGroundLength = 0) }, Mc.prototype.createPointOptions = function (e, t) { var i, o, r, n, a, s = this.getPointStyle(this.style); return s.pointHeight ? (o = s.pointHeight, o = this.getValueFromProp(o, t) || 0, s.position = Cesium.Cartesian3.fromDegrees(e[0], e[1], o), e[2] = o) : s.position = Array.isArray(e) ? Cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]) : e, s.sgsPointPosition = e, s.id = t, s.label && (s.label.text = this.getValueFromProp(s.label.text, t), s.label.text = this.o(s.label.text) ? this.s(s.label.text) : s.label.text, -1 < s.label.text.indexOf("[") && -1 < s.label.text.indexOf("]") && (s.label.text = ""), null != s.label.family && (o = this.applyConditionalClassification(s.label.family, t), e = this.applyConditionalClassification(s.label.font, t), s.label.font = 0 <= e ? (3 * e / 4).toString() + "pt " + o : (3 * (-1 * (72 * e / 96)) / 4).toString() + "pt " + o), s.label.fillColor = Fc(this.applyConditionalClassification(s.label.fillColor, t)), s.label.backgroundColor = Fc(this.applyConditionalClassification(s.label.backgroundColor, t)), null == s.label.backgroundColor && (s.label.backgroundColor = new Cesium.Color(.165, .165, .165, 0)), s.label.showBackground = !0, null != s.label.showText && ((a = this.applyConditionalClassification(s.label.showText, t)) && 1 === Number(a) && (s.label.onHoverShowText = !0), a && null == viewer.scene.canvas.onHoverShowText && (i = viewer.scene, new Cesium.ScreenSpaceEventHandler(i.canvas).setInputAction(function (e) { var t = {}; i.screenToWorld(e.endPosition, t), Cesium.defined(t.pickPrimitive) && "Billboard" == t.pickPrimitive.constructor.name && null != t.pickPrimitive.label ? null != i.onHoverShowTextArray[t.pickPrimitive.label.id] && (null != i._lastObjectShowOnText && i._lastObjectShowOnText.id != t.pickPrimitive.label.id && null != i._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1), viewer.scene._lastObjectShowOnText = i.onHoverShowTextArray[t.pickPrimitive.label.id], null != i._lastObjectShowOnText.show && (viewer.scene._lastObjectShowOnText.show = !0)) : null != i._lastObjectShowOnText && null != i._lastObjectShowOnText.show && (i._lastObjectShowOnText.show = !1) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), viewer.scene.canvas.onHoverShowText = !0)), null != s.label.textRelativeToImage && null != s.label.textAlignment && (s.label.textRelativeToImage = this.applyConditionalClassification(s.label.textRelativeToImage, t), s.label.alignment = this.applyConditionalClassification(s.label.textAlignment, t)), null != s.label.underline && (s.label.isUnderline = this.applyConditionalClassification(s.label.underline, t)), null != s.label.bold && 1 == this.applyConditionalClassification(s.label.bold, t) && (s.label.font = "bold " + s.label.font), null != s.label.italic && 1 == this.applyConditionalClassification(s.label.italic, t) && (s.label.font = "italic " + s.label.font), null != s.label.backgroundOpacity && (s.label.backgroundColor.alpha = this.applyConditionalClassification(s.label.backgroundOpacity, t)), null != s.label.minViewingHeight && (r = this.applyConditionalClassification(s.label.minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.label.scaleMPP, t), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s.label.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.label.disableDepthTestDistance || (s.label.disableDepthTestDistance = 1e3), s.clampToGround && (s.label.heightReference = 1)), s.billboard && (s.billboard.sizeInMeters = !1, null != s.billboard.imageColor && (e = Fc(e = this.applyConditionalClassification(s.billboard.imageColor, t)), s.billboard.color = e), null != s.billboard.imageOpacity && null != s.billboard.color.alpha && (s.billboard.color.alpha = Number(this.applyConditionalClassification(s.billboard.imageOpacity, t))), s.billboard.image = this.applyConditionalClassification(s.billboard.image, t), null != s.billboard.minViewingHeight && (r = this.applyConditionalClassification(s.billboard.minViewingHeight, t), n = 650 * this.applyConditionalClassification(s.billboard.scaleMPP, t), s.billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(r, n)), t.FSCALE && (a = this.getLevelDistance(t.FSCALE), s.billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1, a)), s.billboard.link && s.id && "object" == typeof s.id && (s.id.link = this.applyConditionalClassification(s.billboard.link, t)), s.billboard.disableDepthTestDistance || (s.billboard.disableDepthTestDistance = 1e3), s.clampToGround && (s.billboard.heightReference = 1)), s.model && (o = function (e) { e = Number(e); return e = Cesium.defined(e) && !isNaN(e) ? e : 0 }, s.model.uri = this.applyClassification(s.model.uri, t), s.model.scale = o(this.applyClassification(s.model.scale, t)), e = o(this.applyClassification(s.model.heading, t)), r = o(this.applyClassification(s.model.pitch, t)), n = o(this.applyClassification(s.model.roll, t)), a = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(e), Cesium.Math.toRadians(r), Cesium.Math.toRadians(n)), s.model.modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(s.position, a)), this.createLineToGroundOptions(s, t), s }, Mc.prototype.s = function (e) { return e.split("").reverse().join("") }, Mc.prototype.getLevelDistance = function (e) { var t = 2e7; switch (parseInt(e)) { case 2: t = 10123e3; break; case 3: t = 7123e3; break; case 4: t = 6321e3; break; case 5: t = 5522e3; break; case 6: t = 3436e3; break; case 7: t = 539e3; break; case 8: t = 305e3; break; case 9: t = 18e4; break; case 10: t = 133e3; break; case 11: t = 1e5; break; case 12: t = 76500; break; case 13: t = 58200; break; case 14: t = 23500; break; case 15: t = 9600; break; case 16: t = 4e3; break; case 17: t = 2e3; break; case 18: t = 1700; break; case 19: t = 1500; break; case 20: t = 1e3; break; case 21: t = 500; break; case 22: t = 200; break; case 23: t = 100 }return t }, Mc.prototype.o = function (e) { return e && new RegExp("^[^A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿]*[֑-߿יִ-﷽ﹰ-ﻼ]").test(e[0]) }, Mc.prototype.applyClassification = function (e, t) { if ("string" === $.type(e)) { if (null != /(\[([^\]]+)\])/g.exec(e)) for (var i in t) e = kc(e, "[" + i + "]", t[i]); for (var o = /(\<([^\>]+)\>)/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 }, Mc.prototype.getPolygonStyle = function (e) { return $.extend(!0, {}, Wc.DEFAULT_POLYGON_STYLE, e) }, Mc.prototype.getLinestringStyle = function (e) { return $.extend(!0, {}, Wc.DEFAULT_POLYLINE_STYLE, e) }, Mc.prototype.getPointStyle = function (e) { return null != e.label ? $.extend(!0, {}, Wc.DEFAULT_LABEL_STYLE, e) : null != e.billboard ? $.extend(!0, {}, Wc.DEFAULT_BILLBOARD_STYLE, e) : null != e.model ? $.extend(!0, {}, Wc.DEFAULT_MODEL_STYLE, e) : null != e.point ? $.extend(!0, {}, Wc.DEFAULT_POINT_STYLE, e) : Wc.DEFAULT_POINT_STYLE }, Mc.prototype.sanitizePositions = function (e) { for (var t = 0; t < e.length; t++)e[t] instanceof Array ? this.sanitizePositions(e[t]) : isNaN(e[t]) && (e[t] = 0) }, {}); function J(e, t, i, o, r, n, a, s, l) { var u = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(d(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function c(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function (e, t) { for (var i = 0; i < e.children.length; i++)if (e.children[i].state >= 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(u._Viewer.scene.primitives._primitives, function (e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = u.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r.height])[0], i.z = o.z) } return e } function d(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = c(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function p(e) { this.value = new Float32Array([e]) } this._viewer = e, this._Viewer = e, u.G = 65535, Nc = new hc, Xc = new de({ workerPath: SmartEarthRootUrl + "Workers/featurefetcherworker.js" }), Cesium.sampleRenderedData || (Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource.fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium.loadArrayBuffer = Cesium.Resource.fetchArrayBuffer, Cesium.loadImage = Cesium.Resource.fetchImage), p.fromZBias = function (e) { if (Cesium.defined(e)) return new p(e); throw new DeveloperError("zbias is required.") }, p.toValue = function (e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, p.equals = function (e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, p.defaultBias = function () { return p.fromZBias(15e-6) }, Cesium.ZBiasGeometryInstanceAttribute = p, Cesium.ZBiasGeometryInstanceAttribute = p, Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, Cesium.DynamicEyeOffset = function (e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, Cesium.sampleRenderedData = function (r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function (e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), c = (e & i && l.push(h(u._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when.defer(), Cesium.when(m(i), function (e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function (e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != u.G && (i.height < o.height || c) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, Cesium.sampleRenderedMesh = function (e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(m(e), function (e) { i.resolve(e) }), i.promise }, Cesium.sampleRenderedTerrain = function (t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(d(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function () { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function () { var t = []; return this._tilesToRender.forEach(function (e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t }), r = r || {}, this._level = o || { min: 0, max: 22 }, "number" == typeof this._level && (this._level = { min: o, max: 22 }), this._url = t, this._layerName = i, this._guid = Cesium.createGuid(), this._visible = !0, this._gmlParser = new uc(!0, null, null, !0); var g, o = !this._viewer.TileManager; this._tileManager = Nc.getInstance(e), this._tileManager.tileLevel[this._guid] = { level: this._level, visible: this._visible }, this._tileManager._loadTileEvent.addEventListener(J.prototype.loadTile, this), this._useWorkers = !0, this._layerDisplayName = n, this._showAttributesAsMessage = r.showAttributesAsMessage, delete r.showAttributesAsMessage, this._entityCreator = new Mc(r, e), this._featuresMap = {}, this._boundingBox = void 0, this._geometryFieldName = void 0, this._operations = {}, this._subdomains = a, this.latLon = !0, this._addedFeatures = [], this.simpleSqlParser = Tc, this.myLayer = l, this._statistics = { numberOfAddedFeatures: 0, numberOfDeletedFeatures: 0, numberOfAddePositions: 0, numberOfDeletedPositions: 0, getNumberOfCurrentlyRenderedFeatures: function () { return this.numberOfAddedFeatures - this.numberOfDeletedFeatures }, getNumberOfCurrentlyRenderedPositions: function () { return this.numberOfAddePositions - this.numberOfDeletedPositions } }, t = (g = this).cleanUrl(g._url).replace("{s}", g.sTag(g._layerName.length, g._layerName.length, g._level)), t = (t += Kc(t)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName=" + g._layerName), i = Cesium.TrustedServers.contains(Yc(g._url, g._subdomains)), $.ajax({ dataType: "xml", xhrFields: { withCredentials: i }, url: encodeURI(t), success: function (e) { var i, o; o = g, Jc(e, "FeatureType", "wfs").each(function (e, t) { return Jc(t, "Name", "wfs").text() != o._layerName || (1 === (t = Jc(t, "LatLongBoundingBox", "wfs")).length && (o._boundingBox = Cesium.Rectangle.fromDegrees(parseFloat(t[0].attributes.minx.value), parseFloat(t[0].attributes.miny.value), parseFloat(t[0].attributes.maxx.value), parseFloat(t[0].attributes.maxy.value))), !1) }), i = g, $(e).find("FeatureType").each(function (e, t) { return $(t).children("Name").text() != i._layerName || (0 != (t = $(t).children("Operations")).length && t.children().each(function () { i._operations[this.tagName.toLowerCase()] = {} }), !1) }) } }), Qc(this), void 0 !== s && this.setVisibility(s), o || this.refresh() } function Yc(e, t) { t = -1 != e.indexOf("{s}") ? null != t && 0 < t.length ? e.replace("{s}", t[0]) : console.error("Error - sTag with no subdomains.") : e; return t } function Jc(e, t, i) { var o = $(e).find(t); return 0 < (o = 0 == o.length && "wfs" === i.toLowerCase() ? $(e).find("wfs\\:" + t + "," + t) : o).length ? o : $([]) } function Kc(e) { return -1 < e.indexOf("?") ? "&" : "?" } function Qc(i) { i.featureColumnNames = null; var e = i.cleanUrl(i._url).replace("{s}", i.sTag(i._layerName.length, i._layerName.length, i._level)), t = (e = (e += Kc(e)) + ("SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName=" + i._layerName), Cesium.TrustedServers.contains(Yc(i._url, i._subdomains))); $.ajax({ dataType: "xml", xhrFields: { withCredentials: t }, url: encodeURI(e), success: function (e) { var o, t; o = i, e = e, t = $(e).find("[type^='gml:']"), o._geometryFieldName = $(t).attr("name"), o.geometryResponseData = e, o.wfsNamespace = function (e, t) { let i = eval; if (null == e) return null; try { var o = (new XMLSerializer).serializeToString(e).match(i("/[<]([a-z]+):" + 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 qc(e) { return null == e ? void 0 : e.parentLayer ? e : e._parentCollection || (e.primitive && e.primitive._parentCollection ? e.primitive._parentCollection : void 0) } Object.defineProperties(Wc, { 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 Xc, Zc = 180 / Math.PI; function $c() { 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 eu(e, i) { $.each(e._primitives, function (e, t) { if (t instanceof Cesium.BillboardCollection) return e = lu.indexOf(t = t), t._parentCollection._primitiveOld = i, -1 !== e ? (viewer.scene.primitives.remove(lu[e]._parentCollection), lu[e] = t) : lu.push(t), !1 }) } function tu(e, t) { viewer.scene.primitives.remove(t), e._onDestroyTilePrimitive = function () { viewer.scene.primitives.remove(t), this._onDestroyTilePrimitive = void 0 } } function iu(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 ou(e, t) { iu($.map(e._primitives, function (e) { return e.readyPromise }), e, t) } function ru(e, t) { iu($.map(e._primitives[0]._primitives, function (e) { return e.readyPromise }), e, t) } function nu(e, t) { viewer.scene.primitives.remove(t) } function au(e, t) { iu([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:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>", n = "", $(e).each(function () { var e = this, t = '<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}", this.layerId); $(i).each(function () { t += "<wfs:Property><wfs:Name>" + this + "</wfs:Name><wfs:Value>" + e[this] + "</wfs:Value></wfs:Property>" }), t += '<ogc:Filter><ogc:FeatureId fid="' + e.originFid + '"/></ogc:Filter>', n += t += "</wfs:Update>" }), r = "<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>".replace("{wfs_updates}", n), a = "Failed to save changes to server", e = Yc(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:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}'  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>"), a = (n = (n = n.replace("{layer_name}", this._layerName)).replace("{REQUEST_MAX_FEATURES}", 1e3), ""), e = ("" != e.replace(/[ ]/g, "") && (a = (a = "<ogc:Filter  xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>") + 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 = "<ogc:" + o + ("like" == t.operator.toLowerCase() ? ' wildCard="*" singleChar="*" escape="*"' : "") + ">"; n += "<ogc:PropertyName>" + r + "</ogc:PropertyName>"; var a = null == (r = (r = -1 != i.indexOf(t.right) ? t.left : t.right).replace(/^'|'$$/g, "")).match(/^[%]|[%]$$/); return n = n + ("<ogc:Literal>" + (r = "like" == t.operator.toLowerCase() && a ? "%" + r + "%" : r)) + "</ogc:Literal></ogc:" + o + ">" } a = "and" == t.logic.toLowerCase() ? "And" : "Or", n = "<ogc:" + a + ">"; 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) + "</ogc:" + a + ">" }(i.simpleSqlParser.sql2ast("SELECT * FROM x WHERE " + e).WHERE, o) + "</ogc:Filter>"), n = n.replace("{wfs_filter}", a), Yc(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 () { var e, t; return this.featureColumnNames || (0 == (e = $(this.geometryResponseData).find(this.wfsNamespace + "\\:sequence " + this.wfsNamespace + "\\:element")).length && (e = $(this.geometryResponseData).find("sequence").find("element")), t = [], 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 < i; e++)t[e].data.wfsLayerData[this._guid] && t[e].data.wfsLayerData[this._guid].freeResources(), this.loadTile(t[e]); e && Qc(this) } }, J.prototype.setVisibility = function (e) { if (this._visible != e) if (this._visible = e, 0 == (this._tileManager.tileLevel[this._guid].visible = e)) for (var t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++)o[i].data.wfsLayerData[this._guid] && o[i].data.wfsLayerData[this._guid].primitive && (o[i].data.wfsLayerData[this._guid].primitive.show = !1); else for (var o, t = (o = this._tileManager.getAllTiles()).length, i = 0; i < t; i++)o[i].data.wfsLayerData[this._guid] && (o[i].data.wfsLayerData[this._guid].primitive ? o[i].data.wfsLayerData[this._guid].primitive.show = !0 : this.loadTile(o[i])) }, J.prototype.loadTile = function (e) { var t = this; e.data.wfsLayerData[this._guid] = { id: e.data.id, primitive: void 0, freeResources: function () { Cesium.defined(this.xhr) && (this.xhr.abort(), this.xhr = void 0), Cesium.defined(this.features) && (t.removeFeaturesFromLayer(this.features), this.features = void 0), Cesium.defined(this.primitive) && (t._tileManager.removeFromScene(this.primitive), this.primitive = void 0) } }, this.show && e.level >= 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 < t) for (var i = 0; i < t; i++)e[i].data.wfsLayerData[this._guid] && e[i].data.wfsLayerData[this._guid].freeResources(); return this._tileManager._loadTileEvent.removeEventListener(J.prototype.loadTile, this), Cesium.destroyObject(this) }, J.prototype.sTag = function (e, t, i) { return null == this._subdomains ? "" : (e = (e + t + i) % this._subdomains.length, this._subdomains[e]) }, J.prototype.cleanUrl = function (e) { return -1 != e.indexOf("?") ? e.split("?")[0] : e }, J.prototype.beginLoadWFSData = function (t) { if ((null == this.latLon || this.latLon) && (null == this.BoundingBox || 0 != this.BoundingBox.width && 0 != this.BoundingBox.height || (this.BoundingBox.east += 1, this.BoundingBox.north += 1, this.BoundingBox.beenModified = !0), void 0 === this.BoundingBox || void 0 !== Cesium.Rectangle.intersection(this.BoundingBox, t.rectangle))) { var e = [Zc * t.rectangle.west, Zc * t.rectangle.south, Zc * t.rectangle.east, Zc * t.rectangle.north], i = this, o = this.cleanUrl(this._url).replace("{s}", this.sTag(t.x, t.y, t.level)); o += Kc(o); o += "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat=GML2&typeName=" + this._layerName + "&srsName=EPSG:4326&BBOX=" + e.join(","); e = Cesium.TrustedServers.contains(Yc(this._url, this._subdomains)); t.data.wfsLayerData[this._guid].xhr = $.ajax({ dataType: this._useWorkers ? "text" : "xml", url: encodeURI(o), cache: !0, xhrFields: { withCredentials: e }, success: function (e) { i.processWFSData(t, e, "GML2") }, error: function (e, t, i) { "abort" !== i && console.log("Failed to retrieve data from " + o + " :" + i) }, complete: function () { t.data.wfsLayerData[i._guid].xhr = void 0 } }) } }, J.prototype.processWFSData = function (e, t, i) { var o; e.data.wfsLayerData[this._guid].xhr = void 0, this._useWorkers ? Xc.queueWorkItem({ id: e.data.id, text: t, format: i, geometryFieldName: (o = this)._geometryFieldName }).then(function (e) { o.addFeaturesToTile(e) }) : (i = this._gmlParser.read(t), this.addFeaturesToTile({ id: e.data.id, features: i })) }, J.prototype.boundingSphereFromGML = function (e, i) { var t = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel, o = this; Xc.queueWorkItem({ id: "0", text: e, geometryFieldName: this._geometryFieldName }).then(function (e) { e = { parentLayer: o, features: e.features, sampleTerrainLevel: t + 1, isQuery: !0, onFinishedQuery: function (e) { var t; 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)), i(t) } }; o._entityCreator.createPrimitiveFromWFSFeatures(e) }) }, J.prototype.boundingSphereFromFeature = function (e) { var t, i = viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel; return this._entityCreator.createPrimitiveFromWFSFeatures({ parentLayer: this, features: [e], sampleTerrainLevel: i + 1, isQuery: !0, onFinishedQuery: function (e) { 0 < e.length && (t = Cesium.BoundingSphere.fromBoundingSpheres(e)) } }), t }, J.prototype.addRenderedFeatureId = function (e) { null == this._addedFeatures[e] && (this._addedFeatures[e] = 0), this._addedFeatures[e]++ }, J.prototype.removeRenderedFeatureId = function (i, o) { if (o && o.geometryType && o.geometryType.includes("multi")) for (let e = 0, t; e < o.positions.length; e++)t = i + "." + e, null != this._addedFeatures[t] && this._addedFeatures[t]--, 0 == this._addedFeatures[t] && (this._addedFeatures[t] = void 0); else null != this._addedFeatures[i] && this._addedFeatures[i]--, 0 == this._addedFeatures[i] && (this._addedFeatures[i] = void 0) }, J.prototype.isExistRenderedFeatureId = function (e) { return null != this._addedFeatures[e] }, J.prototype.addFeaturesToTile = function (i, o) { var r, e, n = this._tileManager.getTile(i.id); void 0 !== n && (e = o ? n.data.wfsLayerData[this._guid].primitive._instanceIds : void 0, e = { parentLayer: r = this, originalInstanceIds: e, features: i.features, onFinishedCreatePrimitive: function (e) { var t; null != i.features && null != n.data.wfsLayerData && (n.data.wfsLayerData[r._guid].features = i.features, o || r.addFeaturesToLayer(n.data.wfsLayerData[r._guid].features), (void 0 === e.length || 0 < e.length) && (t = n.data.wfsLayerData[r._guid].primitive, e.show = r.show, (n.data.wfsLayerData[r._guid].primitive = e).parentLayer = r, e.parentTileId = i.id, e._guid = Cesium.createGuid(), o ? r._tileManager.replaceInScene(t, e) : r._tileManager.addToScene(e))) } }, this._entityCreator.createPrimitiveFromWFSFeatures(e)) }, J.prototype.addFeaturesToLayer = function (e) { this._statistics.numberOfAddedFeatures += e.length, this._statistics.numberOfAddePositions += Cesium.defaultValue(e.numPositions, 0); for (var t = e.length, i = 0; i < t; i++)!1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e[i].fid) ? this._featuresMap[e[i].fid] = { refCount: 1, feature: e[i] } : this._featuresMap[e[i].fid].refCount++ }, J.prototype.removeFeaturesFromLayer = function (e) { this._statistics.numberOfDeletedFeatures += e.length, this._statistics.numberOfDeletedPositions += Cesium.defaultValue(e.numPositions, 0); for (var t, i = e.length, o = 0; o < i; o++)t = e[o].fid, !1 !== Object.prototype.hasOwnProperty.call(this._featuresMap, t) && (this._featuresMap[t].refCount--, 0 === this._featuresMap[t].refCount && delete this._featuresMap[t], this.removeRenderedFeatureId(t, e[o])) }, J.prototype.getFeature = function (e) { return !1 === Object.prototype.hasOwnProperty.call(this._featuresMap, e) ? null : this._featuresMap[e] }, J.prototype.updateTile = function (e) { e = this._tileManager.getTile(e); void 0 !== e && (null == e.data.wfsLayerData[this._guid].features ? this.loadTile(e) : this.addFeaturesToTile(e.data.wfsLayerData[this._guid], !0)) }, J.blockRequestPrimitiveFromPrimitive = function (e) { var t; if (null != e) return null == (t = qc(e)) && (e._labelCollection && e._labelCollection._billboardCollection ? t = qc(e._labelCollection._billboardCollection) : e._billboardCollection && (t = qc(e._billboardCollection))), t }, J.prototype.resetAttributesTable = function () { this.lastEditedCell = null, this.attrTblDialogMemo = null }, Object.defineProperties($c.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 < this._numTilesInLevel[t] && e < t && (e = t); return e } } }), $c.prototype.streamSpeedFactor = function () { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var su, lu = [], cu = 0, uu = !($c.prototype.onPreFrame = function (e, t) { if (cu++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && cu % this.streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this.STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives.add(i)); $.each(lu, function (e, t) { t.ready && viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }), hu = ($c.prototype.initialize = function (e) { uu || (viewer.scene.preRender.addEventListener(this.onPreFrame, this), uu = !0) }, $c.prototype.beginUpdate = function (e) { this.quadtree.beginFrame(e) }, $c.prototype.endUpdate = function (e) { var t = this; e.afterRender.push(function () { t.quadtree.endFrame(e) }) }, $c.prototype.updateForPick = function (e) { }, $c.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumError / (1 << e) * this._quadtree.maximumScreenSpaceError }, Math.PI, $c.prototype.placeHolder = function (e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, $c.prototype.loadTile = function (e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function () { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, $c.prototype.getTile = function (e) { return this._tileCache[e] }, $c.prototype.getAllTiles = function () { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, $c.prototype.computeTileVisibility = function (e, t, i) { var o = this.computeDistanceToTile(e, t); return e._distance = o, t.fog.enabled && 9 < e._level && 1 <= Cesium.Math.fog(o, t.fog.density) ? Cesium.Visibility.NONE : (o = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, t.cullingVolume.computeVisibility(o)) }, $c.prototype.showTileThisFrame = function (e, t) { e.data.primitive.update(t) }, $c.prototype.computeDistanceToTile = function (e, t) { var i = new Cesium.Cartesian3, e = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, e = Cesium.Cartesian3.subtract(e.center, t.camera.positionWC, i), t = Cesium.Cartesian3.magnitude(e); return Math.max(1, t - TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition) }, $c.prototype.isDestroyed = function () { return !1 }, $c.prototype.destroy = function () { return Cesium.destroyObject(this) }, $c.prototype.getInstance = function (t) { var i; return 0 == Cesium.defined(t.TileManager) && (t.TileManager = new e, i = new Cesium.QuadtreePrimitive({ tileProvider: t.TileManager, maximumScreenSpaceError: 2 }), t.scene.primitives.add(i)), t.TileManager }, $c.prototype.addToScene = function (e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, $c.prototype.removeFromScene = function (e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != t ? (this._primitivesWaitingToBeAddedToTheScene[t].destroy(), this._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : viewer.scene.primitives.remove(e) }, $c.prototype.replaceInScene = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), null != e._replacmentPrimitive && viewer.scene.primitives.remove(e._replacmentPrimitive), e._replacmentPrimitive = t, viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": eu(t, e); break; case "labels": tu(t, e); break; case "polygons": ou(t, e); break; case "models": ru(t, e); break; case "polylines": au(t, e); break; case "points": nu(0, e); break; default: console.log("Error updating layer"), viewer.scene.primitives.remove(e) } }, { billboards: eu, labels: tu, polygons: ou, models: ru, polylines: au, points: nu }); function mu(e, t) { this._viewer = e, this._cesium = t, su = new $c } function du(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V } function pu(e, t) { this._viewer = e, this._cesium = t } function gu(e, t) { this._viewer = e, this._cesium = t, this._tree = V, this._core = new f, this._Color = new m(this._viewer, this._cesium) } function fu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } $c.prototype.replaceInSceneNew = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != i ? this._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = hu[i]) ? i(t, e) : (console.log("Error updating layer"), viewer.scene.primitives.remove(e))) }, mu.prototype.CreateWfsFeatureLayer = function (e, t, i, o, r, n, a, s, l) { return new J(e, t, i, o, r, n, a, s, l) }, mu.prototype.initTileManager = function () { this._viewer.scene; var i = this._viewer; i.scene.preRender.addEventListener(function (e, t) { su.getInstance(i).streamSpeed = 2 }) }, du.prototype.createPolylineVolume = function (e, t, i, o, r) { var n = { positions: [], shape: this.starPositions(7, 3e4, 2e4), material: this._cesium.Color.fromRandom({ alpha: 1 }) }; if (!this._core.isnull(o)) { o = this._core.extend(n, o, !0); var a = []; if (t[0].x || t[0].y) if (t[0].z) for (s = 0; s < t.length; s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y, t[s].z)); else for (s = 0; s < t.length; s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s].x, t[s].y)); else if (2 === t[0].length) for (var s = 0; s < t.length; s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][1])); else if (3 === t[0].length) for (var s = 0; s < t.length; s++)a.push(this._cesium.Cartesian3.fromDegrees(t[s][0], t[s][1], t[s][2])); o.positions = a, "circle" === i ? o.shape = this.computeCircle(o.radius || 10) : "star" === i ? (o.shape = this.starPositions(o.arms || 7, o.rOuter || 30, o.rInner || 20), o.cornerType = Cesium.CornerType.MITERED) : "box" === i && (o.radius = o.radius || 10, o.shape = [new this._cesium.Cartesian2(-o.radius, -o.radius), new this._cesium.Cartesian2(o.radius, -o.radius), new this._cesium.Cartesian2(o.radius, o.radius), new this._cesium.Cartesian2(-o.radius, o.radius)], o.cornerType = Cesium.CornerType.BEVELED); n = this._viewer.entities.add({ id: this._core.getuid(), name: e, polylineVolume: o }); return this.item = n, this._tree.insertGroupId({ id: n.id, name: e, pId: this._core.isnull(r) ? 0 : r, type: "polylinevolume", item: this }, this._core.isnull(r) ? 0 : r), this } console.log("options is required") }, du.prototype.getstyles = function () { var e = {}; return e.show = !this.item.polylineVolume.show || this.item.polylineVolume.show._value, e.positions = this.item.polylineVolume.positions.getValue().toString(), e.shape = this.item.polylineVolume.shape.toString(), e.cornerType = this.item.polylineVolume.cornerType ? this.item.polylineVolume.cornerType.toString() : null, e.granularity = this.item.polylineVolume.granularity ? this.item.polylineVolume.granularity.toString() : null, e.fill = this.item.polylineVolume.fill ? this.item.polylineVolume.fill._value : null, e.material = this.item.polylineVolume.material ? this.item.polylineVolume.material.toString() : null, e.outline = this.item.polylineVolume.outline ? this.item.polylineVolume.outline._value : null, e.outlineWidth = this.item.polylineVolume.outlineWidth ? this.item.polylineVolume.outlineWidth.toString() : null, e.outlineColor = this.item.polylineVolume.outlineColor && this.item.polylineVolume.outlineColor._value ? "rgba" + this.item.polylineVolume.outlineColor.toString() : null, e.near = this.item.polylineVolume.distanceDisplayCondition ? this.item.polylineVolume.distanceDisplayCondition._value.near : null, e.far = this.item.polylineVolume.distanceDisplayCondition ? this.item.polylineVolume.distanceDisplayCondition._value.far : null, e }, du.prototype.executeWall = function (t, i) { var a = [], o = void 0, s = this, r = (e.prototype._init = function () { var n = this, e = (this.options.wall.maximumHeights = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++)e.push(2e3); return e }, !1), this.options.wall.minimumHeights = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++)e.push(1e3); return e }, !1), this.options.wall.positions = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++) { if (!a[t]) return; var i = s._viewer.scene.globe.ellipsoid, o = new s._cesium.Cartesian3(a[t].x, a[t].y, a[t].z), i = i.cartesianToCartographic(o), o = s._cesium.Math.toDegrees(i.latitude), r = s._cesium.Math.toDegrees(i.longitude); i.height, e.push(r), e.push(o) } return s._cesium.Cartesian3.fromDegreesArray(e) }, !1), s._viewer.entities.add(this.options)); s.item = e, s._tree.insertGroupId({ id: this.options.id, name: t, pId: s._core.isnull(i) ? 0 : i, type: "wall", item: s }, s._core.isnull(i) ? 0 : i) }, e); function e(e) { this.options = { id: s._core.getuid(), type: "wall", wall: { positions: [], minimumHeights: [2e3, 2e3], maximumHeights: [1e3, 1e3], material: s._cesium.Color.AQUA.withAlpha(1) } }, this.positions = e, this._init() } var n = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); n.setInputAction(function (e) { e = s._viewer.scene.camera.pickEllipsoid(e.position, s._viewer.scene.globe.ellipsoid); 0 == a.length && a.push(C.clone(e)), a.push(C.clone(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function (e) { e = s._viewer.scene.camera.pickEllipsoid(e.endPosition, s._viewer.scene.globe.ellipsoid); 1 <= a.length && (s._cesium.defined(o) ? (a.pop(), a.push(e)) : o = new r(a)) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function (e) { n.destroy(), a.pop() }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK) }, du.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 this._cesium.Cartesian2(Math.cos(n * o) * a, Math.sin(n * o) * a); r.push(a) } return r }, du.prototype.computeCircle = function (e) { for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, du.prototype.setVisibility = function (e) { this.item.polylineVolume.show = e }, du.prototype.getVisibility = function () { return this.item.polylineVolume.show }, du.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, Object.defineProperties(du.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), Object.defineProperties(du.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), du.prototype.setItem = function (e) { this.item = e }, du.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(du.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(du.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(du.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(du.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), Object.defineProperties(du.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(du.prototype, { wallTempOptions: { get: function () { return { positions: [], maximumHeights: [], minimumHeights: [], show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, shadows: ShadowMode.DISABLED, distanceDisplayCondition: null } } } }), pu.prototype.createPosition = function (e, t, i) { return new this.Cartesian3.fromDegrees(e, t, i) }, pu.prototype.CreatePosition = function (e, t, i, o, r, n, a, s) { return { X: e, Y: t, Altitude: i, AltitudeType: o, Yaw: r, Pitch: n, Roll: a, Distance: s } }, gu.prototype.createImageLabel = function (e, t, i, o) { var r = { id: this._core.getuid(), image: "../images/Cesium_Logo_overlay.png", show: !0, color: this._cesium.Color.IVORY }, r = this._core.extend(r, t, !0), t = (!r.color || this._core.isnull(r) || this._core.isnull(r.color) || "[" == r.color.toString().charAt(0) && "]" == r.color.toString().charAt(r.color.length - 1) || (this._core.isHtmlColor(r.color) && /^#/.test(r.color.toString()) ? r.color = this._Color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r.color = this._Color.rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color.b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r.color.r && (r.color = this._Color.createColor(r.color.r, r.color.g, r.color.b, r.color.a)))), r.near && r.far && (r.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(r.near, r.far)), this.item = this._viewer.entities.add({ name: o, position: this._cesium.Cartesian3.fromDegrees(e[0], e[1], e[2]), billboard: r }), { id: this.item.id, name: o, pId: this._core.isnull(i) ? 0 : i, type: "Imagelabel", item: this }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, gu.prototype.getstyles = function () { var e = {}; return e.show = !this.item.billboard.show || this.item.billboard.show._value, e.image = this.item.billboard.image && this.item.billboard.image._value ? this.item.billboard.image._value : void 0, e.scale = this.item.billboard.scale && this.item.billboard.scale._value ? this.item.billboard.scale._value : void 0, e.pixelOffset = this.item.billboard.pixelOffset ? this.item.billboard.pixelOffset._value : void 0, e.horizontalOrigin = this.item.billboard.horizontalOrigin && this.item.billboard.horizontalOrigin._value ? this.item.billboard.horizontalOrigin._value : void 0, e.verticalOrigin = this.item.billboard.verticalOrigin && this.item.billboard.verticalOrigin._value ? this.item.billboard.verticalOrigin._value : void 0, e.heightReference = this.item.billboard.heightReference && this.item.billboard.heightReference._value && this.item.billboard.heightReference._value ? this.item.billboard.heightReference._value : null, e.color = this.item.billboard.color && this.item.billboard.color._value ? "rgba" + this.item.billboard.color.toString() : void 0, e.width = this.item.billboard.width && this.item.billboard.width._value ? this.item.billboard.width._value : void 0, e.height = this.item.billboard.height && this.item.billboard.height._value ? this.item.billboard.height._value : void 0, e.near = this.item.billboard.distanceDisplayCondition ? this.item.billboard.distanceDisplayCondition._value.near : void 0, e.far = this.item.billboard.distanceDisplayCondition ? this.item.billboard.distanceDisplayCondition._value.far : void 0, e.position = this.item.position.getValue().toString(), e }, gu.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, gu.prototype.setDistanceDisplayCondition = function (e, t) { e = new this._cesium.DistanceDisplayCondition(e, t); try { this.item._billboard.distanceDisplayCondition = e } catch (e) { console.log(e) } return this }, gu.prototype.setUrl = function (e) { this.item._billboard.image = e }, gu.prototype.setVisibility = function (e) { this.item.show = e }, gu.prototype.getVisibility = function () { return this.item.show }, gu.prototype.setColor = function (e) { try { this.item._billboard.color = new m(this._viewer, this._cesium).colorFromHtmlColor(e), this.item.color = this.item._billboard.color } catch (e) { console.log(e) } return this }, gu.prototype.setWidth = function (e) { try { this.item._billboard.width = e } catch (e) { console.log(e) } return this }, gu.prototype.setColorAlpha = function (e) { try { this.item._billboard.color._value.alpha = e } catch (e) { console.log(e) } return this }, gu.prototype.setHeight = function (e) { try { this.item._billboard.height = e } catch (e) { console.log(e) } return this }, gu.prototype.setHeightType = function (e) { try { 1 == e ? this.item._billboard.heightReference = this._cesium.HeightReference.CLAMP_TO_GROUND : 2 == e ? this.item._billboard.heightReference = this._cesium.HeightReference.NONE : 3 == e && (this.item._billboard.heightReference = this._cesium.HeightReference.RELATIVE_TO_GROUND) } catch (e) { console.log(e) } return this }, gu.prototype.setRotation = function (e) { try { this.item._billboard.rotation = this._cesium.Math.toRadians(e) } catch (e) { console.log(e) } return this }, gu.prototype.setItem = function (e) { this.item = e }, gu.prototype.setScale = function (e) { try { this.item._billboard.scale = e } catch (e) { console.log(e) } return this }, gu.prototype.CreateImageLabel = function (e, t, i, o, r) { i = { id: this._core.getuid(), image: gu, show: !0, scale: i.Scale, color: i.IconColor, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(i.MinViewingHeight, i.MaxViewingHeight) }, this.item = this._viewer.entities.add({ name: r, position: this._cesium.Cartesian3.fromDegrees(positions.X, positions.X, positions.Altitude), billboard: i }), i = this.item.id, r = { id: this.item.id, name: i = "" == r ? r : i, pId: this._core.isnull(o) ? 0 : o, type: "Imagelabel", item: this }; return this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(o) ? 0 : o), this }, gu.prototype.export = function () { var e = null == this.item.billboard.image ? void 0 : this.item.billboard.image._value, t = null == this.item.billboard.show ? void 0 : this.item.billboard.show._value, i = null == this.item.billboard.scale ? void 0 : this.item.billboard.scale._value, o = null == this.item.billboard.horizontalOrigin ? void 0 : this.item.billboard.horizontalOrigin._value, r = null == this.item.billboard.verticalOrigin ? void 0 : this.item.billboard.verticalOrigin._value, n = null == this.item.billboard.rotation ? void 0 : this.item.billboard.rotation._value, a = null == this.item.billboard.width ? void 0 : this.item.billboard.width._value, s = null == this.item.billboard.height ? void 0 : this.item.billboard.height._value, l = null == this.item.billboard.color ? void 0 : "rgba(" + this.item.billboard.color._value.red + "," + this.item.billboard.color._value.green + "," + this.item.billboard.color._value.blue + "," + this.item.billboard.color._value.alpha + ")", c = null == this.item.billboard.heightReference ? void 0 : this.item.billboard.heightReference._value, u = this.item.billboard.distanceDisplayCondition, h = null == u ? void 0 : u._value.near, u = null == u ? void 0 : u._value.far, m = this._cesium.Cartographic.fromCartesian(this.item.position._value); return { type: "image", position: { x: this._cesium.Math.toDegrees(m.longitude), y: this._cesium.Math.toDegrees(m.latitude), z: this._cesium.Math.toDegrees(m.height) }, treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { image: e, show: t, scale: i, horizontalOrigin: o, verticalOrigin: r, rotation: n, width: a, height: s, color: l, heightReference: c, near: h, far: u } } }, gu.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(gu.prototype, { position: { Altitude: { get: function () { return this._postion.Altitude }, set: function (e) { try { var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = this._cesium.Math.toDegrees(t.latitude), r = (this._cesium.Math.toDegrees(t.height), this._cesium.Cartesian3.fromDegrees(i, o, e)); this.item.position.position = r, this._postion.Altitude = e } 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 } catch (e) { console.log(e) } } }, Roll: { get: function () { return this._postion.Roll }, set: function (e) { try { this._postion.Roll = e } catch (e) { console.log(e) } } }, X: { get: function () { return this._postion.X }, set: function (e) { try { this._postion.X = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = (this._cesium.Math.toDegrees(t.longitude), this._cesium.Math.toDegrees(t.latitude)), o = this._cesium.Math.toDegrees(t.height), r = this._cesium.Cartesian3.fromDegrees(e, i, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Y: { get: function () { return this._postion.Y }, set: function (e) { try { this._postion.Y = e; var t = this._cesium.Cartographic.fromCartesian(this.item.position._value), i = this._cesium.Math.toDegrees(t.longitude), o = (this._cesium.Math.toDegrees(t.latitude), this._cesium.Math.toDegrees(t.height)), r = this._cesium.Cartesian3.fromDegrees(i, e, o); this.item.position.position = r } catch (e) { console.log(e) } } }, Yaw: { get: function () { return this._postion.Yaw }, set: function (e) { try { this._postion.Yaw = e } catch (e) { console.log(e) } } } }, LabelStyle: { BackgroundColor: { get: function () { return "" }, set: function (e) { } }, Bold: { get: function () { return "" }, set: function (e) { } }, FontName: { get: function () { return "" }, set: function (e) { } }, FontSize: { get: function () { return "" }, set: function (e) { } }, FrameFileName: { get: function () { return "" }, set: function (e) { } }, IconColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function () { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function () { return "" }, set: function (e) { } }, LimitScreenSize: { get: function () { return "" }, set: function (e) { } }, LineColor: { get: function () { return "" }, set: function (e) { } }, LineToGround: { get: function () { return "" }, set: function (e) { } }, LockMode: { get: function () { return "" }, set: function (e) { } }, MaxImageSize: { get: function () { return "" }, set: function (e) { } }, MaxViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.far }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.near), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.near }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.far), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function () { return "" }, set: function (e) { } }, PivotAlignment: { get: function () { return "" }, set: function (e) { } }, Scale: { get: function () { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function (e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function () { return "" }, set: function (e) { } }, TextColor: { get: function () { return "" }, set: function (e) { } }, TextOnImage: { get: function () { return "" }, set: function (e) { } }, Underline: { get: function () { return "" }, set: function (e) { } } } }), gu.prototype.CreateImageLabel = function (e, t, i, o, r) { this._postion = e; t = { id: this._core.getuid(), image: t, backgroundColor: i.BackgroundColor, fillColor: i.IconColor, font: i.FontName, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, outlineColor: i.LineColor, show: !0, scale: i.Scale, showBackground: !1, distanceDisplayCondition: new this._cesium.DistanceDisplayCondition(i.MinViewingHeight, i.MaxViewingHeight) }, i.Italic && (t.font = "italic " + t.font), i.Italic && (t.font = "Bold " + t.font), t = this._core.extend(t, i, !0), this.item = this._viewer.entities.add({ name: r, position: this._cesium.Cartesian3.fromDegrees(e.X, e.Y, e.Altitude), billboard: t }), i = { id: this.item.id, name: r, pId: this._core.isnull(o) ? 0 : o, type: "ImageLabel", item: this }; return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), this }, Object.defineProperties(gu.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) } } } }, LabelStyle: { BackgroundColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.backgroundColor = e, this.item.backgroundColor = e) }, 500), get: function () { var e = this.item.label.backgroundColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Bold: { get: function () { return -1 != this.item._label.font.getValue().indexOf("bold") }, set: function () { var e = "bold " + this.item._label.font.getValue(); this.item._label.font.setValue(e) } }, FontName: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if ("bold" != e[t] && -1 == e[t].indexOf("px") && -1 == e[t].indexOf("PX")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)"bold" != t[o] && -1 == t[o].indexOf("px") && -1 == t[o].indexOf("PX") || (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FontSize: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if (-1 != e[t].indexOf("px")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)-1 != t[o].indexOf("px") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, FrameFileName: { get: function () { return "" }, set: function (e) { } }, IconColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.fillColor = e) }, 500), get: function () { var e = this.item.label.fillColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, Italic: { get: function () { for (var e = this.item._label.font.getValue().split(" "), t = 0; t < e.length; t++)if (-1 != e[t].indexOf("italic")) return e[t] }, set: function (e) { for (var t = this.item._label.font.getValue().split(" "), i = e, o = 0; o < t.length; o++)-1 != t[o].indexOf("italic") && (i = i + " " + t[o]); this.item._label.font.setValue(i) } }, LimitScreenSize: { get: function () { return "" }, set: function (e) { } }, LineColor: { set: C.debounce(function (e) { this._core.isnull(e) || (this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._Color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._Color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._Color.createColor(e.r, e.g, e.b, e.a))), this.item.label.outlineColor = e) }, 500), get: function () { var e = this.item.label.outlineColor; return this._Color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } }, LineToGround: { get: function () { return "" }, set: function (e) { } }, LockMode: { get: function () { return "" }, set: function (e) { } }, MaxImageSize: { get: function () { return "" }, set: function (e) { } }, MaxViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.far }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.near), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(t, e) } }, MinViewingHeight: { get: function () { if (null != this.item._label.distanceDisplayCondition) return this.item._label.distanceDisplayCondition._value.near }, set: function (e) { var t = 0; null != this.item._label.distanceDisplayCondition && (t = this.item._label.distanceDisplayCondition._value.far), this.item._label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, t) } }, MultilineJustification: { get: function () { return "" }, set: function (e) { } }, PivotAlignment: { get: function () { return "" }, set: function (e) { } }, Scale: { get: function () { if (null != this.item._label.scale) return this.item.label.scale.getValue() }, set: function (e) { this.item.label.scale.setValue(e) } }, TextAlignment: { get: function () { return "" }, set: function (e) { } }, TextColor: { get: function () { return "" }, set: function (e) { } }, TextOnImage: { get: function () { return "" }, set: function (e) { } }, Underline: { get: function () { return "" }, set: function (e) { } } } }), fu.prototype.createWall = function (t, e, i, o) { var r = []; if ("object" == typeof t) { let e = t; var n = this._core.defaultValue(e.alpha, .6); e.points.forEach(e => { 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 f; 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; a < e.length; a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y, e[a].z)); else for (a = 0; a < e.length; a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a].x, e[a].y)); else if (2 === e[0].length) for (var a = 0; a < e.length; a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1])); else if (3 === e[0].length) for (var a = 0; a < e.length; a++)r.push(this._cesium.Cartesian3.fromDegrees(e[a][0], e[a][1], e[a][2])); i.positions = r, void 0 !== i.minHeight && (i.minimumHeights = new Array(i.positions.length).fill(i.minHeight)), void 0 !== i.maxHeight && (i.maximumHeights = new Array(i.positions.length).fill(i.maxHeight)), this.item = this._viewer.entities.add({ name: t, id: this._core.getuid(), wall: i }), this.item.positions = i.positions } return this._tree.insertGroupId({ id: this.item.id, name: t, pId: this._core.isnull(o) ? 0 : o, type: "wall", item: this }, this._core.isnull(o) ? 0 : o), this }, fu.prototype.executeWall = function (t, i) { var a = [], o = void 0, s = this, r = (e.prototype._init = function () { var n = this, e = (this.options.wall.maximumHeights = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++)e.push(2e3); return e }, !1), this.options.wall.minimumHeights = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++)e.push(1e3); return e }, !1), this.options.wall.positions = new s._cesium.CallbackProperty(function () { for (var e = [], t = 0; t < n.positions.length; t++) { if (!a[t]) return; var i = s._viewer.scene.globe.ellipsoid, o = new s._cesium.Cartesian3(a[t].x, a[t].y, a[t].z), i = i.cartesianToCartographic(o), o = s._cesium.Math.toDegrees(i.latitude), r = s._cesium.Math.toDegrees(i.longitude); i.height, e.push(r), e.push(o) } return s._cesium.Cartesian3.fromDegreesArray(e) }, !1), s._viewer.entities.add(this.options)); s.item = e, s._tree.insertGroupId({ id: this.options.id, name: t, pId: s._core.isnull(i) ? 0 : i, type: "wall", item: s }, s._core.isnull(i) ? 0 : i) }, e); function e(e) { this.options = { id: s._core.getuid(), type: "wall", wall: { positions: [], minimumHeights: [2e3, 2e3], maximumHeights: [1e3, 1e3], material: s._core.setImageMaterialProperty("img/arrow.png", s._cesium, 1) } }, this.positions = e, this._init() } var n = new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas); n.setInputAction(function (e) { e = s._viewer.scene.camera.pickEllipsoid(e.position, s._viewer.scene.globe.ellipsoid); 0 == a.length && a.push(C.clone(e)), a.push(C.clone(e)) }, s._cesium.ScreenSpaceEventType.LEFT_CLICK), n.setInputAction(function (e) { e = s._viewer.scene.camera.pickEllipsoid(e.endPosition, s._viewer.scene.globe.ellipsoid); 1 <= a.length && (s._cesium.defined(o) ? (a.pop(), a.push(e)) : o = new r(a)) }, s._cesium.ScreenSpaceEventType.MOUSE_MOVE), n.setInputAction(function (e) { n.destroy(), a.pop() }, s._cesium.ScreenSpaceEventType.RIGHT_CLICK) }; var _u = "a", Cu = 0; function yu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._BaiduImageryProvider = new Ml(e, t) } fu.prototype.drawCanvasImage = function (e, t) { var i = document.getElementById("canvas-" + _u), o = i.getContext("2d"), r = new Image; return r.src = "img/arrow.png", o.clearRect(0, 0, 700, 100), r.onload = function () { Cu <= 700 ? (o.drawImage(r, Cu, 0), o.drawImage(r, Cu + 100, 0)) : Cu = 0, Cu += 5 }, _u = "a" === _u ? "b" : "a", i }, fu.prototype.setVisibility = function (e) { this.item.wall.show = e }, fu.prototype.getVisibility = function () { return this.item.wall.show }, fu.prototype.deleteObject = function () { this._viewer.entities.remove(this.item) }, Object.defineProperties(fu.prototype, { rectangle: { get: function () { return this.item.rectangle }, set: function (e) { this.item.rectangle = e } } }), Object.defineProperties(fu.prototype, { polyline: { get: function () { return this.item.polyline }, set: function (e) { this.item.polyline = e } } }), fu.prototype.setItem = function (e) { this.item = e }, fu.prototype.setTreeobj = function (e) { this.treeobj = e }, Object.defineProperties(fu.prototype, { polygon: { get: function () { return this.item.polygon }, set: function (e) { this.item.polygon = e } } }), Object.defineProperties(fu.prototype, { point: { get: function () { return this.item.point }, set: function (e) { this.item.point = e } } }), Object.defineProperties(fu.prototype, { label: { get: function () { return this.item.label }, set: function (e) { this.item.label = e } } }), Object.defineProperties(fu.prototype, { model: { get: function () { return this.item.model }, set: function (e) { this.item.model = e } } }), Object.defineProperties(fu.prototype, { wall: { get: function () { return this.item.wall }, set: function (e) { this.item.wall = e } } }), Object.defineProperties(fu.prototype, { wallTempOptions: { get: function () { return { positions: [], maximumHeights: [], minimumHeights: [], show: !0, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, granularity: this._cesium.Math.RADIANS_PER_DEGREE, shadows: ShadowMode.DISABLED, distanceDisplayCondition: null } } } }), yu.prototype.createArcGisImageryLayer = function (e, t, i, o, r, n) { var a = { url: "" }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull(e) && (e = "新建影像图层"), new this._cesium.ArcGisMapServerImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? (e.split && (e = e.split(",")), l.maximumTerrainLevel = e[1], l.minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "arcgis", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, yu.prototype.createImageryLayerGrid = function (e) { e = this._viewer.imageryLayers.addImageryProvider(new this._cesium.GridImageryProvider(e)); return this.item = e, this }, yu.prototype.createWebMapServerImageLayer = function (e, t, i, o, r, n) { var a = { url: "", layers: "", parameters: { service: "WMS", format: "image/png", transparent: !0 } }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull(e) && (e = "新建影像图层"), new this._cesium.WebMapServiceImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? (e.split && (e = e.split(",")), l.maximumTerrainLevel = e[1], l.minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "wms", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, yu.prototype.createMVTWithStyle = function (e, t, i, o) { this.item = this._viewer.imageryLayers.addImageryProvider(t), checked || this.setVisibility(!1), t.show = !1; t = this._core.getuid(), t = { id: options.id || t, name: e, checked: checked, pId: (this._core.isnull(0), 0), type: "ImageryProvider", show: !1, item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, (this._core.isnull(0), 0)), this }, yu.prototype.createWebMapTileServerImageLayer = function (e, t, i, o, r, n) { var a = { url: "" }, s = null; this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull(e) && (e = "新建影像图层"); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? (e.split && (e = e.split(",")), l.maximumTerrainLevel = e[1], l.minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } a = s.TD_SD ? new vn(s.url, !1, l.minimumTerrainLevel || 0, l.maximumTerrainLevel || 21) : new this._cesium.WebMapTileServiceImageryProvider(s), s.addLevel && (a.addLevel = s.addLevel), s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "skymap", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, yu.prototype.createUrlTemplateImageryProvider = function (e, t, i, o, r, n) { var a = { url: "" }, s = null, a = (this._core.isUrl(t) ? (s = a).url = t : s = this._core.extend(a, t, !0), this._core.isnull(e) && (e = "新建影像图层"), new this._cesium.UrlTemplateImageryProvider(s)); let l = { alpha: s.alpha, brightness: s.brightness, availability: s.availability }; if (void 0 !== s.Level || void 0 !== s.level) { let e = this._core.defaultValue(s.Level, s.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? (e.split && (e = e.split(",")), l.maximumTerrainLevel = e[1], l.minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } s.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: s.time.start ? this._cesium.JulianDate.fromDate(new Date(s.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: s.time.end ? this._cesium.JulianDate.fromDate(new Date(s.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(a, l), this._viewer.imageryLayers.add(this.item, o), r || this.setVisibility(!1), n && "function" == typeof n && n(this.item); t = this._core.getuid(), a = { id: s.id || t, name: e, checked: r, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", smtype: "goglemap", item: this }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), this }, yu.prototype.createImageryProvider = function (e, t, i, o, r, n, a) { var s, i = this._core.extend({}, i, !0); "arcgis" == t ? s = new this._cesium.ArcGisMapServerImageryProvider(i) : "geoserver" == t || "wms" == t ? s = new this._cesium.WebMapServiceImageryProvider(i) : "cesiumBlack" == t || "tms" == t ? s = new this._cesium.TileMapServiceImageryProvider(i) : "skymap" == t ? s = new this._cesium.WebMapTileServiceImageryProvider(i) : "goglemap" == t ? s = new this._cesium.UrlTemplateImageryProvider(i) : "BingMap" == t ? s = new this._cesium.BingMapsImageryProvider(i) : "OpenStreetMap" == t ? s = new this._cesium.OpenStreetMapImageryProvider(i) : "MapBox" == t ? s = new this._cesium.MapboxImageryProvider(i) : "BaiduMap" == t && (s = new this._BaiduImageryProvider.BaiduImageryProvider(i)); let l = { alpha: i.alpha, brightness: i.brightness, availability: i.availability }; if (void 0 !== i.Level || void 0 !== i.level) { let e = this._core.defaultValue(i.Level, i.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? (e.split && (e = e.split(",")), l.maximumTerrainLevel = e[1], l.minimumTerrainLevel = e[0]) : l.minimumTerrainLevel = e } i.time && (l.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: i.time.start ? this._cesium.JulianDate.fromDate(new Date(i.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: i.time.end ? this._cesium.JulianDate.fromDate(new Date(i.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), this.availability = l.availability, this.item = new this._cesium.ImageryLayer(s, l), this._viewer.imageryLayers.add(this.item, r), n || this.setVisibility(!1), a && "function" == typeof a && a(this.item), this._core.isnull(i.id) && (i.id = this._core.getuid()); t = { id: i.id, name: e, pId: this._core.isnull(o) ? 0 : o, type: "ImageryProvider", checked: n, item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(o) ? 0 : o), this }, yu.prototype.createCacheImageryProvider = function (e, t, i, o, r, n) { o |= 1; t = this._core.extend({ fileExtension: "jpg", cacheMaxLevel: 16 }, t, !0); let a = { alpha: t.alpha, brightness: t.brightness, availability: t.availability, show: !0 }, s = { alpha: t.alpha, brightness: t.brightness, availability: t.availability, show: !0 }; if (t.time && (a.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: t.time.start ? this._cesium.JulianDate.fromDate(new Date(t.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: t.time.end ? this._cesium.JulianDate.fromDate(new Date(t.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })]), s.availability = new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({ start: t.time.start ? this._cesium.JulianDate.fromDate(new Date(t.time.start)) : this._cesium.Iso8601.MINIMUM_VALUE, stop: t.time.end ? this._cesium.JulianDate.fromDate(new Date(t.time.end)) : this._cesium.Iso8601.MAXIMUM_VALUE })])), void 0 !== t.Level || void 0 !== t.level) { let e = this._core.defaultValue(t.Level, t.level); e.indexOf && -1 < e.indexOf(",") || Array.isArray(e) ? ((e = e.split ? e.split(",") : e)[1] > t.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 ? (c = this.items.push(new this._cesium.ImageryLayer(l, s)), this._viewer.imageryLayers.add(this.items[c - 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, c = { id: t.id, name: e, pId: this._core.isnull(i) ? 0 : i, type: "ImageryProvider", checked: r, item: this }; return this.setTreeobj(c), this._tree.insertGroupId(c, this._core.isnull(i) ? 0 : i), this }, yu.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 }, yu.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 }, yu.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 } } }, yu.prototype.setTreeobj = function (e) { this.treeobj = e }, yu.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 }, yu.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 < this.items.length; t++)this.items[t].show = e, this.items[t]._availability && !e ? this.items[t]._availability = void 0 : this.availability && e && (this.items[t]._availability = this.availability) }, yu.prototype.getVisibility = function () { return this.item.show }, yu.prototype.getType = function () { return { label: "影像", value: "ImageryProvider" } }, yu.prototype.deleteObject = function () { return this._viewer.imageryLayers.remove(this.item) }, Object.defineProperties(yu.prototype, { url: { set: function (e) { }, get: function () { } } }), yu.prototype.setItem = function (e) { this.item = e }; var vu = function (e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o.length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, wu = "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 bu(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++)i[t] = e[t]; return i } return Array.from(e) } function Tu(e, t, i) { this._viewer = e, this._cesium = t, this._viewer = null, this._Cesium = i.Cesium, this.UrlData = { output: i.output, resultmode: i.resultmode, uid: i.uid, st: i.st, words: i.words, area: i.area, callback: i.callback }, this.minLevel1 = i.minLevel1, this.minLevel3 = i.minLevel3, this._url = i.url, this._urlTemplate = i.url, this._rectangle = i.rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i.minimumLevel || 1, this.dx = {}, this._tilingScheme = i.tilingScheme || new this._Cesium.GeographicTilingScheme, this._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = !1, this.cluster = "city", this.primitivecount = null, this._isCameraMoving = !1, this._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i.upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), c = this._lonLatToTileInWGS84([n, a], s), u = Math.min(l[0], c[0]), h = Math.max(l[0], c[0]), m = Math.min(l[1], c[1]), l = Math.max(l[1], c[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: u, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1 } function Su(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0, this.labelCollections1 = [], this.labelCollections2 = [], this.labelCollections = this._cesium.PointPrimitiveCollection(), this.gd = 0, this.model = [], this.Legend = [], this.sj = !0 } Tu.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : wu(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, Tu.prototype._fetch = function (r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function (t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function () { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function (e) { i(e) }, o.onloadend = function (e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, Tu.prototype._lonLatToTileInWGS84 = function (e, t) { var e = vu(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, Tu.prototype._radianToDegree = function (e) { return e / Math.PI * 180 }, Tu.prototype._isTileInRange = function (e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, Tu.prototype._cameraMoveStartHandler = function () { this._isCameraMoving = !0 }, Tu.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; 2 < e.length ? e.forEach(function (e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, bu(e)) }) : (t = o[i]).push.apply(t, bu(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProviderPolymerization: geometry type "' + e.geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, Tu.prototype._cameraMoveEndHandler = function () { var t, e, i, o, r, n, a, s, l; this._stop || (t = this, n = Date.now(), s = (l = this._viewer.scene.globe._surface._tilesToRender).map(function (e) { return e.level }), e = Math.min.apply(Math, bu(s)), i = Math.max.apply(Math, bu(s)), t._removeObsoletePrimitives(t._primitiveByTile, []), i < this._lowerLevelLimit && (t._tileKeys = [], t._removeObsoletePrimitives(t._primitiveByTile, []), l = []), this._upperLevelLimit && e > this._upperLevelLimit && (t._tileKeys = [], t._removeObsoletePrimitives(t._primitiveByTile, []), l = []), (l = 2 < i - e ? l.filter(function (e) { return e.level >= 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 })) }, Tu.prototype._refineTiles = function (e, s) { var l = [], c = []; return e.forEach(function (e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) c.includes(t) || (l.push(e), c.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++)for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); c.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), c.push(r)) } else { var n, a = e.level - s; 0 == a ? c.includes(t) || (l.push(e), c.push(t)) : (t = 2 * a, a = Math.floor(e.x / t), t = Math.floor(e.y / t), c.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), c.push(n))) } }), l }, Tu.prototype._removeObsoletePrimitives = function (e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || removed && delete e[i] }, Tu.prototype.addTo = function (e) { this._viewer = e, this._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler), this._cameraMoveEndHandler() }, Tu.prototype.remove = function () { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, Tu.prototype.setStatus = function (e) { this._stop = e }, Tu.prototype.isRemoved = function () { return this._isRemoved }, Tu.prototype.filterBy = function (e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, Tu.prototype.removeFilter = function () { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, Su.prototype.createLabelPointGeoJsonFeatureLayer = function (e, t, s, i, l) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), c = this, o = (o.then(function (e) { for (var t = { Name: "", text: "", font: " 30px sans-serif", stylet: c._cesium.LabelStyle.OUTLINE, fillColor: c._cesium.Color.WHITE, outlineColor: c._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new c._cesium.Color(.165, .165, .165, .8), backgroundPadding: new c._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: c._cesium.HorizontalOrigin.CENTER, verticalOrigin: c._cesium.VerticalOrigin.CENTER, eyeOffset: c._cesium.Cartesian3.ZERO, pixelOffset: c._cesium.Cartesian2.ZERO, heightReference: c._cesium.HeightReference.NONE, scaleByDistance: new c._cesium.NearFarScalar(0, 0, 1, 1) }, i = (s.material, c._core.isnull(s) || c._core.isnull(s.fillColor) || /^\[/.test(s.fillColor) && "[" == s.fillColor.toString().charAt(0) && "]" == s.fillColor.toString().charAt(s.fillColor.length - 1) || (c._core.isHtmlColor(s.fillColor) ? s.fillColor = c._color.colorFromHtmlColor(s.fillColor) : (/^rgb/.test(s.fillColor) && (s.fillColor = c._color.rgbaStringToRgbaObj(s.fillColor)), 1 < s.fillColor.r && (s.fillColor.r = s.fillColor.r / 255), 1 < s.fillColor.g && (s.fillColor.g = s.fillColor.g / 255), 1 < s.fillColor.b && (s.fillColor.b = s.fillColor.b / 255), 1 < s.fillColor.a && (s.fillColor.a = s.fillColor.a / 255), s.fillColor = c._color.createColor(s.fillColor.r, s.fillColor.g, s.fillColor.b, s.fillColor.a))), c._core.isnull(s) || c._core.isnull(s.material) || /^\[/.test(s.material) && "[" == s.material.toString().charAt(0) && "]" == s.material.toString().charAt(s.material.length - 1) || (c._core.isHtmlColor(s.material) ? s.material = c._color.colorFromHtmlColor(s.material) : (/^rgb/.test(s.material) && (s.material = c._color.rgbaStringToRgbaObj(s.material)), 1 < s.material.r && (s.material.r = s.fillColor.r / 255), 1 < s.material.g && (s.material.g = s.fillColor.g / 255), 1 < s.material.b && (s.material.b = s.material.b / 255), 1 < s.material.a && (s.material.a = s.material.a / 255), s.material = c._color.createColor(s.material.r, s.material.g, s.material.b, s.material.a))), c._core.isnull(s) || c._core.isnull(s.outlineColor) || /^\[/.test(s.outlineColor) && "[" == s.outlineColor.toString().charAt(0) && "]" == s.outlineColor.toString().charAt(s.outlineColor.length - 1) || (c._core.isHtmlColor(s.outlineColor) ? s.outlineColor = c._color.colorFromHtmlColor(s.outlineColor) : (/^rgb/.test(s.outlineColor) && (s.outlineColor = c._color.rgbaStringToRgbaObj(s.outlineColor)), 1 < s.outlineColor.r && (s.outlineColor.r = s.outlineColor.r / 255), 1 < s.outlineColor.g && (s.outlineColor.g = s.outlineColor.g / 255), 1 < s.outlineColor.b && (s.outlineColor.b = s.outlineColor.b / 255), 1 < s.outlineColor.a && (s.outlineColor.a = s.outlineColor.a / 255), s.outlineColor = c._color.createColor(s.outlineColor.r, s.outlineColor.g, s.outlineColor.b, s.outlineColor.a))), c._core.isnull(s) || c._core.isnull(s.backgroundColor) || /^\[/.test(s.backgroundColor) && "[" == s.backgroundColor.toString().charAt(0) && "]" == s.backgroundColor.toString().charAt(s.backgroundColor.length - 1) || (c._core.isHtmlColor(s.backgroundColor) ? s.backgroundColor = c._color.colorFromHtmlColor(s.backgroundColor) : (/^rgb/.test(s.backgroundColor) && (s.backgroundColor = c._color.rgbaStringToRgbaObj(s.backgroundColor)), 1 < s.backgroundColor.r && (s.backgroundColor.r = s.backgroundColor.r / 255), 1 < s.backgroundColor.g && (s.backgroundColor.g = s.backgroundColor.g / 255), 1 < s.backgroundColor.b && (s.backgroundColor.b = s.backgroundColor.b / 255), 1 < s.backgroundColor.a && (s.backgroundColor.a = s.backgroundColor.a / 255), s.backgroundColor = c._color.createColor(s.backgroundColor.r, s.backgroundColor.g, s.backgroundColor.b, s.backgroundColor.a))), c._core.extend(t, s, !0)), o = (c.item = e).entities.values, t = (c._core.isnull(s.near) && (s.near = 0), c._core.isnull(s.far) && (s.far = 999999999), parseFloat(s.near)), e = parseFloat(s.far), t = new c._cesium.DistanceDisplayCondition(t, e), r = (i.distanceDisplayCondition = t, c._core.isnull(s.font_size) && (s.font_size = "30px"), c._core.isnull(s.font_family) && (s.font_family = " sans-serif"), i.font = parseFloat(s.font_size) + "px " + s.font_family, new c._cesium.LabelCollection), n = 0; n < o.length; n++) { var a = o[n], a = (i.position = a.position._value, i.text = "a label", "fillColor:" + 255 * i.fillColor.red + "," + 255 * i.fillColor.green + "," + 255 * i.fillColor.blue + ";outlineColor:" + 255 * i.outlineColor.red + "," + 255 * i.outlineColor.green + "," + 255 * i.outlineColor.blue); c.Legend.push(a), r.add(i) } e = c._viewer.scene.primitives.add(r); "function" == typeof l && l(e) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t, style: options }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Su.prototype.createLabelPolymerizationGeoJsonFeatureLayer = function (e, t, u, i, h, m) { var o = { Name: "", text: "", font: " 30px sans-serif", style: this._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.RELATIVE_TO_GROUND, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, d = this, p = (this._core.isnull(u) || this._core.isnull(u.fillColor) || (this._core.isHtmlColor(u.fillColor) ? u.fillColor = this._color.colorFromHtmlColor(u.fillColor) : (/^rgb/.test(u.fillColor) && (u.fillColor = this._color.rgbaStringToRgbaObj(u.fillColor)), 1 < u.fillColor.r && (u.fillColor.r = u.fillColor.r / 255), 1 < u.fillColor.g && (u.fillColor.g = u.fillColor.g / 255), 1 < u.fillColor.b && (u.fillColor.b = u.fillColor.b / 255), 1 < u.fillColor.a && (u.fillColor.a = u.fillColor.a / 255), u.fillColor = this._color.createColor(u.fillColor.r, u.fillColor.g, u.fillColor.b, u.fillColor.a))), this._core.isnull(u) || this._core.isnull(u.outlineColor) || (this._core.isHtmlColor(u.outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : (/^rgb/.test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u.outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u.outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u.outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core.isnull(u) || this._core.isnull(u.backgroundColor) || (this._core.isHtmlColor(u.backgroundColor) ? u.backgroundColor = this._color.colorFromHtmlColor(u.backgroundColor) : (/^rgb/.test(u.backgroundColor) && (u.backgroundColor = this._color.rgbaStringToRgbaObj(u.backgroundColor)), 1 < u.backgroundColor.r && (u.backgroundColor.r = u.backgroundColor.r / 255), 1 < u.backgroundColor.g && (u.backgroundColor.g = u.backgroundColor.g / 255), 1 < u.backgroundColor.b && (u.backgroundColor.b = u.backgroundColor.b / 255), 1 < u.backgroundColor.a && (u.backgroundColor.a = u.backgroundColor.a / 255), u.backgroundColor = this._color.createColor(u.backgroundColor.r, u.backgroundColor.g, u.backgroundColor.b, u.backgroundColor.a))), d._core.isnull(u.near) && (u.near = 0), d._core.isnull(u.far) && (u.far = 999999999), this._core.extend(o, u, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))), d = this, o = (o.then(function (e) { var t = (d.item = e).entities.values; d._core.isnull(p.font_size) && (p.font_size = "30"), d._core.isnull(p.font_family) && (p.font_family = " sans-serif"), p.font = p.font_size + "px " + p.font_family; for (var i = 0; i < t.length; i++) { var o = t[i], r = (p.font = d._core.extendgl(o, u.font, p.font), p.style = parseInt(d._core.extendgl(o, u.stylet, p.stylet)), p.fillColor = d._core.extendgl(o, u.fillColor, p.fillColor), p.outlineColor = d._core.extendgl(o, u.outlineColor, p.outlineColor), p.outlineWidth = parseFloat(d._core.extendgl(o, u.outlineWidth, p.outlineWidth)), p.show = d._core.extendgl(o, u.show, p.show), p.showBackground = d._core.extendgl(o, u.showBackground, p.showBackground), p.backgroundColor = d._core.extendgl(o, u.backgroundColor, p.backgroundColor), p.backgroundPadding = d._core.extendgl(o, u.backgroundPadding, p.backgroundPadding), p.scale = parseFloat(d._core.extendgl(o, u.scale, p.scale)), p.horizontalOrigin = d._core.extendgl(o, u.horizontalOrigin, p.horizontalOrigin), p.pointHeight = parseFloat(d._core.extendgl(o, u.pointHeight, p.pointHeight)), p.text = d._core.extendgl(o, u.text, p.text), parseFloat(d._core.extendgl(o, p.near))), n = parseFloat(d._core.extendgl(o, p.far)), r = new d._cesium.DistanceDisplayCondition(r, n), n = (p.distanceDisplayCondition = r, p.text = null == o.properties[p.text] ? p.text : o.properties[p.text]._value, o.billboard.color = d._cesium.Color.WHITE.withAlpha(0), o.label = new d._cesium.LabelGraphics(p), d._viewer.scene.globe.ellipsoid, d._cesium.Cartographic.fromCartesian(o.position._value)), r = d._cesium.Math.toDegrees(n.longitude), a = d._cesium.Math.toDegrees(n.latitude), n = p.pointHeight || n.height, r = new d._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering.minimumClusterSize = 3; for (var s, l = new d._cesium.PinBuilder, c = (l.fromText("50+", d._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", d._cesium.Color.ORANGE, 48).toDataURL(), l.fromText("30+", d._cesium.Color.YELLOW, 48).toDataURL(), l.fromText("20+", d._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", d._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < c.length; ++i)c[i] = l.fromText("" + (i + 2), d._cesium.Color.VIOLET, 48).toDataURL(); s = d._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener(function (e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard.id = t.label.id, t.billboard.verticalOrigin = d._cesium.VerticalOrigin.BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, d._cesium.Color.BLUE, 48).toDataURL() : t.billboard.image = c[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering.pixelRange = s, h || d.setVisibility(h), d._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Su.prototype.createPointPolymerizationGeoJsonFeatureLayer = function (e, t, u, i, h, m) { var o = { color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0, scaleByDistance: new this._cesium.NearFarScalar(0, 0, 1, 1) }, d = (this._core.isnull(u) || this._core.isnull(u.color) || "[" == u.color.toString().charAt(0) && "]" == u.color.toString().charAt(u.color.length - 1) || (this._core.isHtmlColor(u.color) ? u.color = this._color.colorFromHtmlColor(u.color) : (/^rgb/.test(u.color) && (u.color = this._color.rgbaStringToRgbaObj(u.color)), 1 < u.color.r && (u.color.r = u.color.r / 255), 1 < u.color.g && (u.color.g = u.color.g / 255), 1 < u.color.b && (u.color.b = u.color.b / 255), 1 < u.color.a && (u.color.a = u.color.a / 255), u.color = this._color.createColor(u.color.r, u.color.g, u.color.b, u.color.a))), this._core.isnull(u) || this._core.isnull(u.outlineColor) || "[" == u.outlineColor.toString().charAt(0) && "]" == u.outlineColor.toString().charAt(u.outlineColor.length - 1) || (this._core.isHtmlColor(u.outlineColor) ? u.outlineColor = this._color.colorFromHtmlColor(u.outlineColor) : (/^rgb/.test(u.outlineColor) && (u.outlineColor = this._color.rgbaStringToRgbaObj(u.outlineColor)), 1 < u.outlineColor.r && (u.outlineColor.r = u.outlineColor.r / 255), 1 < u.outlineColor.g && (u.outlineColor.g = u.outlineColor.g / 255), 1 < u.outlineColor.b && (u.outlineColor.b = u.outlineColor.b / 255), 1 < u.outlineColor.a && (u.outlineColor.a = u.outlineColor.a / 255), u.outlineColor = this._color.createColor(u.outlineColor.r, u.outlineColor.g, u.outlineColor.b, u.outlineColor.a))), this._core.extend(o, u, !0)), o = (this._viewer.scene.camera, this._viewer.scene.canvas, this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(t))), p = this, o = (o.then(function (e) { for (var t = (p.item = e).entities.values, i = 0; i < t.length; i++) { var o = t[i], r = (d.color = p._core.extendgl(o, u.color, d.color), d.pixelSize = parseInt(p._core.extendgl(o, u.pixelSize, d.pixelSize)), d.outlineColor = p._core.extendgl(o, u.outlineColor, d.outlineColor), d.outlineWidth = parseFloat(p._core.extendgl(o, u.outlineWidth, d.outlineWidth)), d.show = p._core.extendgl(o, u.show, d.show), d.height = parseFloat(p._core.extendgl(o, u.height, d.height)), d.scaleByDistance = p._core.extendgl(o, u.scaleByDistance, d.scaleByDistance), parseFloat(p._core.extendgl(o, d.minDistanceDisplay))), n = parseFloat(p._core.extendgl(o, d.maxDistanceDisplay)), r = new p._cesium.DistanceDisplayCondition(r, n), n = (o.billboard.image = "", d.distanceDisplayCondition = r, o.point = new p._cesium.PointGraphics(d), d.pointHeight = p._core.extendgl(o, u.pointHeight, d.pointHeight), d.pointHeight = parseFloat(d.pointHeight), p._viewer.scene.globe.ellipsoid, p._cesium.Cartographic.fromCartesian(o.position._value)), r = p._cesium.Math.toDegrees(n.longitude), a = p._cesium.Math.toDegrees(n.latitude), n = d.pointHeight || n.height, r = new p._cesium.Cartesian3.fromDegrees(r, a, n); o.position._value = r } e.clustering.enabled = !0, e.clustering.pixelRange = 45, e.clustering.minimumClusterSize = 3; for (var s, l = new p._cesium.PinBuilder, c = (l.fromText("50+", p._cesium.Color.RED, 48).toDataURL(), l.fromText("40+", p._cesium.Color.ORANGE, 48).toDataURL(), l.fromText("30+", p._cesium.Color.YELLOW, 48).toDataURL(), l.fromText("20+", p._cesium.Color.GREEN, 48).toDataURL(), l.fromText("10+", p._cesium.Color.BLUE, 48).toDataURL(), new Array(8)), i = 0; i < c.length; ++i)c[i] = l.fromText("" + (i + 2), p._cesium.Color.VIOLET, 48).toDataURL(); s = p._cesium.defined(s) ? void s() : e.clustering.clusterEvent.addEventListener(function (e, t) { t.label.show = !1, t.point.show = !1, t.billboard.show = !0, t.billboard.id = t.label.id, t.billboard.verticalOrigin = p._cesium.VerticalOrigin.BOTTOM, 50 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium.Color.RED, 48).toDataURL() : 40 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium.Color.ORANGE, 48).toDataURL() : 30 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium.Color.YELLOW, 48).toDataURL() : 20 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium.Color.GREEN, 48).toDataURL() : 10 <= e.length ? t.billboard.image = l.fromText(e.length, p._cesium.Color.BLUE, 48).toDataURL() : t.billboard.image = c[e.length - 2] }), s = e.clustering.pixelRange, e.clustering.pixelRange = 0, e.clustering.pixelRange = s, h || p.setVisibility(h), p._cesium.knockout.track({ pixelRange: 45, minimumClusterSize: 3 }), "function" == typeof m && m(ps) }), this._core.getuid()), o = { id: o, name: e = this._core.isnull(e) ? "新建图层" + o : e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t }; return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Su.prototype._cameraMoveEndHandler = function () { if (this._viewer.camera.getMagnitude() < this.gd) { if (this.sj) { this._viewer.scene.primitives.remove(this.labelCollections), this.labelCollections = new this._cesium.LabelCollection; for (var e = 0; e < this.labelCollections1.length; e++)this.labelCollections.add(this.labelCollections1[e]); this._viewer.scene.primitives.add(this.labelCollections), this.sj = !1 } } else { this._viewer.scene.primitives.remove(this.labelCollections), new this._cesium.BillboardCollection; for (e = 0; e < this.labelCollections2.length; e++)this.BillboardCollections.add(this.labelCollections2[e]); this._viewer.scene.primitives.add(this.BillboardCollections), this.sj = !0 } }, Su.prototype.createLabelpolymerizationGeoJsonFeatureLayer = function (e, t, i, o, r, n) { for (var a = t, s = (this._viewer.scene.primitives, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this.gd = i.height, new this._cesium.BillboardCollection, {}), l = [], c = 0; c < a.length; c++) { var u = { position: new this._cesium.Cartesian3.fromDegrees(a[c].lng, a[c].lat, 100), text: a[c].name }, h = (this.labelCollections1.push(u), a[c]); if (s[h[i.adminname]]) for (var m = 0; m < l.length; m++) { var d = l[m]; if (d.adminname == h[i.adminname]) { d.data.push(h); break } } else l.push({ adminname: h[i.adminname], name: h.name, showBackground: !0, lat: h.lat, lng: h.lng, data: [h] }), s[h[i.adminname]] = h } for (c = 0; c < l.length; c++) { u = { position: new this._cesium.Cartesian3.fromDegrees(l[c].lng, l[c].lat, 100), image: pinBuilder.fromText(l[c].data.length + "", this._cesium.Color.BLACK, 48).toDataURL() }; this.labelCollections2.push(u), this.BillboardCollections.add(u) } this._viewer.scene.primitives.add(this.BillboardCollections) }, Su.prototype.createLabelpolymerizationGeoJsonFeatureLayers = function (e, t, i, o, r, n) { var a = { height: 0, material: this._cesium.Color.WHITE, size: 50, fill: this._cesium.Color.RED }, s = { url: t.url, upperLevelLimit: 21, lowerLevelLimit: 0, minLevel1: t.minLevel1, minLevel3: t.minLevel3, rectangle: this._cesium.Rectangle.fromDegrees(118.74324788700017, 32.036708147800084, 118.7994917630001, 32.07298490959994), Cesium: this._cesium, output: t.output, resultmode: t.resultmode, uid: t.uid, st: t.st, words: t.words, area: t.area, callback: t.callback }, l = (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) : /^http/.test(i.material) || (/^rgb/.test(i.material) && (i.material = this._color.rgbaStringToRgbaObj(i.material)), 1 < i.material.r && (i.material.r = i.material.r / 255), 1 < i.material.g && (i.material.g = i.material.g / 255), 1 < i.material.b && (i.material.b = i.material.b / 255), 1 < i.material.a && (i.material.a = i.material.a / 255), i.material = this._color.createColor(i.material.r, i.material.g, i.material.b, i.material.a))), this._core.isnull(i) || this._core.isnull(i.fill) || "[" == i.fill.toString().charAt(0) && "]" == i.fill.toString().charAt(i.fill.length - 1) || (this._core.isHtmlColor(i.fill) ? i.fill = this._color.colorFromHtmlColor(i.fill) : /^http/.test(i.fill) || (/^rgb/.test(i.fill) && (i.fill = this._color.rgbaStringToRgbaObj(i.fill)), 1 < i.fill.r && (i.fill.r = i.fill.r / 255), 1 < i.fill.g && (i.fill.g = i.fill.g / 255), 1 < i.fill.b && (i.fill.b = i.fill.b / 255), 1 < i.fill.a && (i.fill.a = i.fill.a / 255), i.fill = this._color.createColor(i.fill.r, i.fill.g, i.fill.b, i.fill.a))), this._core.extend(a, i, !0)), c = this, a = new Tu(this._viewer, this._cesium, s), s = ((this._Provider = a)._loadTile = function (e, o) { c._viewer.scene.primitives.remove(c.labelCollections), c.labelCollections = new ("" == o ? c._cesium.PointPrimitiveCollection : c._cesium.BillboardCollection); var r = new c._cesium.PinBuilder; return e.result.features.forEach(function (e) { var t, i = {}; null != e.lng && (t = new c._cesium.Cartesian3.fromDegrees(e.lng, e.lat, l.height), i = "" == o ? { id: e, color: l.material, position: t } : { position: t, image: r.fromText(e.count + "", l.fill, l.size).toDataURL(), verticalOrigin: c._cesium.VerticalOrigin.BOTTOM }, c.labelCollections.add(i)) }), c._viewer.scene.primitives.add(c.labelCollections), c.item = c.labelCollections, c.labelCollections }, a.addTo(this._viewer), r || this.setVisibility(!1), this._core.isnull(l.id) && (l.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + l.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: l.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "polygonLayer", item: this, url: t.url, style: i }); return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, Su.prototype.createLabelGeoJsonFeatureLayerProvider = function (e, t, a, 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 }, s = this, n = (a.material, s._core.isnull(a) || s._core.isnull(a.fillColor) || /^\[/.test(a.fillColor) && "[" == a.fillColor.toString().charAt(0) && "]" == a.fillColor.toString().charAt(a.fillColor.length - 1) || (s._core.isHtmlColor(a.fillColor) ? a.fillColor = s._color.colorFromHtmlColor(a.fillColor) : (/^rgb/.test(a.fillColor) && (a.fillColor = s._color.rgbaStringToRgbaObj(a.fillColor)), 1 < a.fillColor.r && (a.fillColor.r = a.fillColor.r / 255), 1 < a.fillColor.g && (a.fillColor.g = a.fillColor.g / 255), 1 < a.fillColor.b && (a.fillColor.b = a.fillColor.b / 255), 1 < a.fillColor.a && (a.fillColor.a = a.fillColor.a / 255), a.fillColor = s._color.createColor(a.fillColor.r, a.fillColor.g, a.fillColor.b, a.fillColor.a))), s._core.isnull(a) || s._core.isnull(a.material) || /^\[/.test(a.material) && "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (s._core.isHtmlColor(a.material) ? a.material = s._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = s._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = s._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a.outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color.colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a.backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function (e) { var r, t = { Name: "", text: "", font: " 30px sans-serif", style: s._cesium.LabelStyle.FILL_AND_OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1), maxDistanceDisplay: 99999999, minDistanceDisplay: 0, far: 99999999, near: 0 }, n = s._core.extend(t, a, !0), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i); return n.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), n.font = parseFloat(a.font_size) + "px " + a.font_family, r = new (null != n.image && null != n.image ? s._cesium.BillboardCollection : s._cesium.LabelCollection), e.features.forEach(function (e) { n.id = e; var t, i = n.pointHeight, o = (/^\[/.test(i) && /\]$/.test(i) ? (o = i.replace(/\[/, "").replace(/\]/, ""), i = parseFloat(e.properties[o])) : null != i && "" != i ? i = parseFloat(i) : null != e.properties.height && (i = parseFloat(e.properties.height)), n.position = new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], i), /^\[/.test(a.fillColor) && /\]$/.test(a.fillColor) && (t = a.fillColor.replace(/\[/, "").replace(/\]/, ""), n.fillColor = e.properties[t], s._core.isHtmlColor(n.fillColor) ? n.fillColor = s._color.colorFromHtmlColor(n.fillColor) : (/^rgb/.test(n.fillColor) && (n.fillColor = s._color.rgbaStringToRgbaObj(n.fillColor)), 1 < n.fillColor.r && (n.fillColor.r = n.fillColor.r / 255), 1 < n.fillColor.g && (n.fillColor.g = n.fillColor.g / 255), 1 < n.fillColor.b && (n.fillColor.b = n.fillColor.b / 255), 1 < n.fillColor.a && (n.fillColor.a = n.fillColor.a / 255), n.fillColor = s._color.createColor(n.fillColor.r, n.fillColor.g, n.fillColor.b, n.fillColor.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a.outlineColor) && (t = a.outlineColor.replace(/\[/, "").replace(/\]/, ""), n.outlineColor = e.properties[t], s._core.isHtmlColor(n.outlineColor) ? n.outlineColor = s._color.colorFromHtmlColor(n.outlineColor) : (/^rgb/.test(n.outlineColor) && (n.outlineColor = s._color.rgbaStringToRgbaObj(n.outlineColor)), 1 < n.outlineColor.r && (n.outlineColor.r = n.outlineColor.r / 255), 1 < n.outlineColor.g && (n.outlineColor.g = n.outlineColor.g / 255), 1 < n.outlineColor.b && (n.outlineColor.b = n.outlineColor.b / 255), 1 < n.outlineColor.a && (n.outlineColor.a = n.outlineColor.a / 255), n.outlineColor = s._color.createColor(n.outlineColor.r, n.outlineColor.g, n.outlineColor.b, n.outlineColor.a))), "fillColor:" + 255 * n.fillColor.red + "," + 255 * n.fillColor.green + "," + 255 * n.fillColor.blue + ";outlineColor:" + 255 * n.outlineColor.red + "," + 255 * n.outlineColor.green + "," + 255 * n.outlineColor.blue); s.Legend.push(o), /^\[/.test(a.text) && /\]$/.test(a.text) && (t = a.text.replace(/\[/, "").replace(/\]/, ""), n.text = e.properties[t]), r.add(n) }), r }, a && a.time && (n.availability = new s._cesium.TimeIntervalCollection([new s._cesium.TimeInterval({ start: a.time.start ? s._cesium.JulianDate.fromDate(new Date(a.time.start)) : s._cesium.Iso8601.MINIMUM_VALUE, stop: a.time.end ? s._cesium.JulianDate.fromDate(new Date(a.time.end)) : s._cesium.Iso8601.MAXIMUM_VALUE })])), this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "labelPointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Su.prototype.createLabelRichtextGeoJsonFeatureLayerProvider = function (e, t, u, i, h, m) { null == t && console.log("geojson is required"); var o = this._cesium.GeoJsonDataSource.load(t), d = (this._viewer.dataSources.add(o), this), p = new this._cesium.PointPrimitiveCollection, o = (d.optiontext = [], o.then(function (e) { for (var t = (d.item = e).entities.values, i = 0; i < t.length; i++) { var o, r, n = t[i], n = (o = /^\[/.test(u.text) && /\]$/.test(u.text) ? (o = u.text.replace(/\[/, "").replace(/\]/, ""), n.properties[o]._value) : u.text, d.optiontext.push(o), n.billboard = void 0, d._viewer.scene.globe.ellipsoid, d._cesium.Cartographic.fromCartesian(n.position._value)), n = [d._cesium.Math.toDegrees(n.longitude), d._cesium.Math.toDegrees(n.latitude), u.pointHeight || n.height], a = d._core.getuid(); n instanceof Array ? 2 === n.length ? r = d._cesium.Cartesian3.fromDegrees(n[0], n[1]) : 3 === n.length && (r = d._cesium.Cartesian3.fromDegrees(n[0], n[1], n[2])) : r = n.z ? d._cesium.Cartesian3.fromDegrees(n.x, n.y, n.z) : d._cesium.Cartesian3.fromDegrees(n.x, n.y), p.add({ id: "DivPoint" + a, position: r, color: d._cesium.Color.YELLOW, description: u.text }) } d.item = p, d.pointPrimitive = d._viewer.scene.primitives.add(p); var s, l, c = !0; d.pointPrimitive.update = function () { for (var e, t, i = 0; i < d.pointPrimitive.length; i++) { if (e = d.pointPrimitive.get(i), l = e.position, !(l = d._viewer.scene.cartesianToCanvasCoordinates(l))) return; (s = document.getElementById(e.id)) || (t = '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint1 + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + d.optiontext[i] + "</div>\n           </div>", $(".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) + ")" } c && (h || d.setVisibility(!1), c = !1) }, "function" == typeof m && m(e) }), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "富文本"), { id: u.id, name: e, checked: h, pId: this._core.isnull(i) ? 0 : i, type: "DivPoint", item: this, url: t, style: u }); return this.setTreeobj(o), this._tree.insertGroupId(o, this._core.isnull(i) ? 0 : i), this }, Su.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 }, c = this, r = new v(this._viewer, this._cesium, r), r = ((this._Provider = r)._loadTile = function (e) { var o, r, n = new c._cesium.PointPrimitiveCollection, a = (c.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 c._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]), c._core.getuid()); n.add({ id: "DivPoint" + i, position: Cartesian3, color: c._cesium.Color.YELLOW, description: s.text }), c.optiontext.push(option.text) }), c.pointPrimitive = c._viewer.scene.primitives.add(n), !0); return c.pointPrimitive.update = function () { for (var e, t, i = 0; i < c.pointPrimitive.length; i++) { if (e = c.pointPrimitive.get(i), r = e.position, !(r = c._viewer.scene.cartesianToCanvasCoordinates(r))) return; (o = document.getElementById(e.id)) || (t = '<div id="' + e.id + '" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url(' + window.SmartEarthRootUrl + I.divpoint1 + ');transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;">\n                   <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">' + c.optiontext[i] + "</div>\n           </div>", $(".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 || c.setVisibility(!1), a = !1) }, c.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 }, Su.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 < n.color.r && (n.color.r = n.color.r / 255), 1 < n.color.g && (n.color.g = n.color.g / 255), 1 < n.color.b && (n.color.b = n.color.b / 255), 1 < n.color.a && (n.color.a = n.color.a / 255), n.color = s._color.createColor(n.color.r, n.color.g, n.color.b, n.color.a))), new v(this._viewer, this._cesium, a)), a = ((this._Provider = a)._loadTile = function (e) { var t = { url: "", modelMatrix: s._cesium.Transforms.eastNorthUpToFixedFrame(origin), color: s._cesium.Color.DARKSALMON, scale: 2 }, o = s._core.extend(t, n, !0), t = (s._core.isnull(n.near) && (n.near = 0), s._core.isnull(n.far) && (n.far = 999999999), parseFloat(n.near)), i = parseFloat(n.far), t = new s._cesium.DistanceDisplayCondition(t, i), r = (o.distanceDisplayCondition = t, new s._cesium.PrimitiveCollection); return e.features.forEach(function (e) { o.id = e; var t = o.height, i = (null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(o.height) && /\]$/.test(o.height) && (i = o.height.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])), o.modelMatrix = s._cesium.Transforms.eastNorthUpToFixedFrame(s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t)), s._cesium.Model.fromGltf({ id: e, url: o.uri, color: o.color, modelMatrix: o.modelMatrix, scale: o.scale, heightReference: parseInt(o.heightReference), distanceDisplayCondition: o.distanceDisplayCondition })); r.add(i) }), r }, this.item = a._primitiveCollection, a.addTo(this._viewer), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + n.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, o || this.setVisibility(!1), { id: n.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "modelLayer", item: this, url: t.url, style: n }); return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Su.prototype.createPointGeoJsonFeatureLayerProvider = function (e, t, a, 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 }, s = this, n = (s._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color.toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core.isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a.color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a.color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a.color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a.outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color.colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function (e) { var t = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: s._cesium.LabelStyle.OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1) }, r = (a.material, s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a.backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), s._core.extend(t, a, !0)), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i), n = (r.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), r.font = parseFloat(a.font_size) + "px " + a.font_family, new s._cesium.PointPrimitiveCollection); return e.features.forEach(function (e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r.pointHeight) ? (i = r.pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])) : void 0 !== r.pointHeight && "" !== r.pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(a.color) && /\]$/.test(a.color) && (o = a.color.replace(/\[/, "").replace(/\]/, ""), r.color = e.properties[o], s._core.isHtmlColor(r.color) ? r.color = s._color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r.color = s._color.rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color.b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r.color = s._color.createColor(r.color.r, r.color.g, r.color.b, r.color.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a.outlineColor) && (o = a.outlineColor.replace(/\[/, "").replace(/\]/, ""), r.outlineColor = e.properties[o], s._core.isHtmlColor(r.outlineColor) ? r.outlineColor = s._color.colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r.outlineColor) && (r.outlineColor = s._color.rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor.r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r.outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r.outlineColor.a / 255), r.outlineColor = s._color.createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor.b, r.outlineColor.a))), r.position = new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t), r.text = e.properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r.color.green + "," + 255 * r.color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r.outlineColor.green + "," + 255 * r.outlineColor.blue; s.Legend.push(o), n.add(i) }), n }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Su.prototype.createPointGeoJsonFeatureLayerProvider = function (e, t, a, 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 }, s = this, n = (s._core.isnull(a) || s._core.isnull(a.color) || /^\[/.test(a.color) && "[" == a.color.toString().charAt(0) && "]" == a.color.toString().charAt(a.color.length - 1) || (s._core.isHtmlColor(a.color) ? a.color = s._color.colorFromHtmlColor(a.color) : (/^rgb/.test(a.color) && (a.color = s._color.rgbaStringToRgbaObj(a.color)), 1 < a.color.r && (a.color.r = a.color.r / 255), 1 < a.color.g && (a.color.g = a.color.g / 255), 1 < a.color.b && (a.color.b = a.color.b / 255), 1 < a.color.a && (a.color.a = a.color.a / 255), a.color = s._color.createColor(a.color.r, a.color.g, a.color.b, a.color.a))), s._core.isnull(a) || s._core.isnull(a.outlineColor) || /^\[/.test(a.outlineColor) && "[" == a.outlineColor.toString().charAt(0) && "]" == a.outlineColor.toString().charAt(a.outlineColor.length - 1) || (s._core.isHtmlColor(a.outlineColor) ? a.outlineColor = s._color.colorFromHtmlColor(a.outlineColor) : (/^rgb/.test(a.outlineColor) && (a.outlineColor = s._color.rgbaStringToRgbaObj(a.outlineColor)), 1 < a.outlineColor.r && (a.outlineColor.r = a.outlineColor.r / 255), 1 < a.outlineColor.g && (a.outlineColor.g = a.outlineColor.g / 255), 1 < a.outlineColor.b && (a.outlineColor.b = a.outlineColor.b / 255), 1 < a.outlineColor.a && (a.outlineColor.a = a.outlineColor.a / 255), a.outlineColor = s._color.createColor(a.outlineColor.r, a.outlineColor.g, a.outlineColor.b, a.outlineColor.a))), new v(this._viewer, this._cesium, n)), n = ((this._Provider = n)._loadTile = function (e) { var t = { Name: "", text: "", font: " 30px sans-serif", pixelSize: 10, style: s._cesium.LabelStyle.OUTLINE, fillColor: s._cesium.Color.WHITE, outlineColor: s._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new s._cesium.Color(.165, .165, .165, .8), backgroundPadding: new s._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: s._cesium.HorizontalOrigin.CENTER, verticalOrigin: s._cesium.VerticalOrigin.CENTER, eyeOffset: s._cesium.Cartesian3.ZERO, pixelOffset: s._cesium.Cartesian2.ZERO, heightReference: s._cesium.HeightReference.NONE, scaleByDistance: new s._cesium.NearFarScalar(0, 0, 1, 1) }, r = (a.material, s._core.isnull(a) || s._core.isnull(a.backgroundColor) || /^\[/.test(a.backgroundColor) && "[" == a.backgroundColor.toString().charAt(0) && "]" == a.backgroundColor.toString().charAt(a.backgroundColor.length - 1) || (s._core.isHtmlColor(a.backgroundColor) ? a.backgroundColor = s._color.colorFromHtmlColor(a.backgroundColor) : (/^rgb/.test(a.backgroundColor) && (a.backgroundColor = s._color.rgbaStringToRgbaObj(a.backgroundColor)), 1 < a.backgroundColor.r && (a.backgroundColor.r = a.backgroundColor.r / 255), 1 < a.backgroundColor.g && (a.backgroundColor.g = a.backgroundColor.g / 255), 1 < a.backgroundColor.b && (a.backgroundColor.b = a.backgroundColor.b / 255), 1 < a.backgroundColor.a && (a.backgroundColor.a = a.backgroundColor.a / 255), a.backgroundColor = s._color.createColor(a.backgroundColor.r, a.backgroundColor.g, a.backgroundColor.b, a.backgroundColor.a))), s._core.extend(t, a, !0)), t = (s._core.isnull(a.near) && (a.near = 0), s._core.isnull(a.far) && (a.far = 999999999), parseFloat(a.near)), i = parseFloat(a.far), t = new s._cesium.DistanceDisplayCondition(t, i), n = (r.distanceDisplayCondition = t, s._core.isnull(a.font_size) && (a.font_size = "30px"), s._core.isnull(a.font_family) && (a.font_family = " sans-serif"), r.font = parseFloat(a.font_size) + "px " + a.font_family, new s._cesium.PointPrimitiveCollection); return e.features.forEach(function (e) { r.id = e; var t = 0, i = (/^\[/.test(r.pointHeight) && /\]$/.test(r.pointHeight) ? (i = r.pointHeight.replace(/\[/, "").replace(/\]/, ""), t = parseFloat(e.properties[i])) : void 0 !== r.pointHeight && "" !== r.pointHeight ? t = parseFloat(r.pointHeight) : null != e.properties.height && (t = parseFloat(e.properties.height)), /^\[/.test(a.color) && /\]$/.test(a.color) && (o = a.color.replace(/\[/, "").replace(/\]/, ""), r.color = e.properties[o], s._core.isHtmlColor(r.color) ? r.color = s._color.colorFromHtmlColor(r.color) : (/^rgb/.test(r.color) && (r.color = s._color.rgbaStringToRgbaObj(r.color)), 1 < r.color.r && (r.color.r = r.color.r / 255), 1 < r.color.g && (r.color.g = r.color.g / 255), 1 < r.color.b && (r.color.b = r.color.b / 255), 1 < r.color.a && (r.color.a = r.color.a / 255), r.color = s._color.createColor(r.color.r, r.color.g, r.color.b, r.color.a))), /^\[/.test(a.outlineColor) && /\]$/.test(a.outlineColor) && (o = a.outlineColor.replace(/\[/, "").replace(/\]/, ""), r.outlineColor = e.properties[o], s._core.isHtmlColor(r.outlineColor) ? r.outlineColor = s._color.colorFromHtmlColor(r.outlineColor) : (/^rgb/.test(r.outlineColor) && (r.outlineColor = s._color.rgbaStringToRgbaObj(r.outlineColor)), 1 < r.outlineColor.r && (r.outlineColor.r = r.outlineColor.r / 255), 1 < r.outlineColor.g && (r.outlineColor.g = r.outlineColor.g / 255), 1 < r.outlineColor.b && (r.outlineColor.b = r.outlineColor.b / 255), 1 < r.outlineColor.a && (r.outlineColor.a = r.outlineColor.a / 255), r.outlineColor = s._color.createColor(r.outlineColor.r, r.outlineColor.g, r.outlineColor.b, r.outlineColor.a))), r.position = new s._cesium.Cartesian3.fromDegrees(e.geometry.coordinates[0], e.geometry.coordinates[1], t), r.text = e.properties.name, { show: r.show, position: r.position, pixelSize: r.pixelSize, color: r.color, outlineColor: r.outlineColor, outlineWidth: r.outlineWidth, id: e }), o = "color:" + 255 * r.color.red + "," + 255 * r.color.green + "," + 255 * r.color.blue + ";outlineColor:" + 255 * r.outlineColor.red + "," + 255 * r.outlineColor.green + "," + 255 * r.outlineColor.blue; s.Legend.push(o), n.add(i) }), n }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(a.id) && (a.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + a.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: a.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "pointLayer", item: this, url: t.url, style: a }); return this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item), this }, Su.prototype.setTreeobj = function (e) { this.treeobj = e }, Su.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Su.prototype.deleteObject = function () { if (null != this._Provider && this._Provider.setStatus(!1), null != this.items && null != this.items && 0 < this.items.length) for (var e = 0; e < this.items.length; e++)this._viewer.scene.primitives.remove(this.items[e]); else this._viewer.scene.primitives.remove(this.item); if ("DivPoint" === this.treeobj.type && this.item && null != this.item._pointPrimitives && null != this.item._pointPrimitives) for (e = 0; e < this.item._pointPrimitives.length; e++) { var t = document.getElementById(this.item._pointPrimitives[e].id); t && t.remove() } try { this._Provider.remove() } catch (e) { } }, Su.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Su.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, Su.prototype.setVisibility = function (e) { if (null != this.treeobj && "DivPoint" === this.treeobj.type && this.item && null != this.item._pointPrimitives && null != this.item._pointPrimitives) for (var t = 0; t < this.item._pointPrimitives.length; t++) { var i = document.getElementById(this.item._pointPrimitives[t].id); i && (i.style.display = e ? "block" : "none") } null != this.item && (this.item.show = e), this._Provider && this._Provider.setStatus(!e) }, Object.defineProperties(Su.prototype, { labelText: { set: C.debounce(function (e) { var t = e; if (!this._core.isnull(e)) { var i = this.item.entities && this.item.entities.values; if (i && 0 < i.length) for (var o = 0; o < i.length; o++)if (/^\[/.test(e) && (t = e.replace(/\[/, "").replace(/\]/, ""), t = i[o].properties[t]._value), i[o].label) { i[o].label.text = t; try { i[o].point.show = !1 } catch (e) { } } else { try { i[o].point.show = !1 } catch (e) { } i[o].label = new this._cesium.LabelGraphics({ text: t, font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE }) } } }, 500) }, labelStyles: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.style = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.style : void 0 } }, labelFont: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = 16; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[0]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = o + "px " + e } } }, 500) }, labelFontSize1: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), !t || /^point.fid/.test(t[0]._id) || null != t[0].label) { var i = t[0].label.font, o = "sans-serif"; if (i && (o = (i = i._value.trimLeft().trimRight()).split("px")[1]), t && 0 < t.length && t[0].label) for (var r = 0; r < t.length; r++)t[r].label.font = e + "px  " + o } } }, 500) }, labelFontSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if (e = e.toString().replace(/px/g, ""), (!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.font = e + "px  sans-serif" } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? parseFloat(e[0].label.font) : void 0 } }, labelFillColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.fillColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.fillColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.outlineColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, labelOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.outlineWidth = e } }, 200), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.outlineWidth; if (e) return e._value } } }, labelBackgroundColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.backgroundColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? (e = e[0].label.backgroundColor, this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")")) : void 0 } }, labelBackground: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.showBackground = e }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.background : void 0 } }, labelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].label.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.scale; if (e) return e._value } } }, labelHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.horizontalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.horizontalOrigin; if (e) return e._value } } }, labelVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.verticalOrigin = parseInt(e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.verticalOrigin; if (e) return e._value } } }, labelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = 0; i < t.length; i++)t[i].label.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label) { e = e[0].label.heightReference; if (e) return e._value } } }, labelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, parseInt(e)), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(i, 1, parseInt(e), 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, labelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].label) && t && 0 < t.length && t[0].label) for (var i = t[0].label.distanceDisplayCondition ? t[0].label.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].label.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(parseInt(e), i), t[o].label.scaleByDistance = new this._cesium.NearFarScalar(parseInt(e), 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.distanceDisplayCondition ? e[0].label.distanceDisplayCondition._value.near : 0 : void 0 } }, labelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, labelShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].label && e ? (t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].label = new this._cesium.LabelGraphics({ text: "label", font: "30px sans-serif", style: this._cesium.LabelStyle.FILL, fillColor: this._cesium.Color.WHITE, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, show: !0, showBackground: !1, backgroundColor: new this._cesium.Color(.165, .165, .165, .8), backgroundPadding: new this._cesium.Cartesian2(7, 5), scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, heightReference: this._cesium.HeightReference.NONE })) : (t[i].label && (t[i].label.show = e), t[i].point && (t[i].point.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].label) && e && 0 < e.length && e[0].label ? e[0].label.show : void 0 } }, modelShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e), !t[i].model && e ? t[i].model = new this._cesium.ModelGraphics({ show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE }) : (t[i].model && (t[i].model.show = e), t[i].label && (t[i].label.show = !e), t[i].point && (t[i].point.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.show : void 0 } }, modelUri: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)t[o].model ? t[o].model.uri = e : (/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].model = new this._cesium.ModelGraphics({ uri: e, show: !0, scale: 1, minimumPixelSize: 0, incrementallyLoadTextures: !0, runAnimations: !0, clampAnimations: !0, shadows: this._cesium.ShadowMode.ENABLED, heightReference: this._cesium.HeightReference.NONE, color: this._cesium.Color.WHITE })) } }, 500) }, modelScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { e = parseFloat(e); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].model.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.scale; if (e) return e._value } } }, modelShadows: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.shadows = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.shadows : void 0 } }, modelHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.heightReference; if (e) return e._value } } }, modelDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; e && !/^point.fid/.test(e[0]._id) && null == e[0].model || e && 0 < e.length && e[0].model && (e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE) } }, modelDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = t[0].model.distanceDisplayCondition ? t[0].model.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].model.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model ? e[0].model.distanceDisplayCondition ? e[0].model.distanceDisplayCondition._value.near : 0 : void 0 } }, modelColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelLightColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].model) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].model.lightColor = e } }, 100), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].model) && e && 0 < e.length && e[0].model) { e = e[0].model.lightColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, modelHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, pointColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].point && e ? (t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e), t[i].point = new this._cesium.PointGraphics({ color: this._cesium.Color.WHITE, pixelSize: 1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 0, show: !0 })) : (t[i].point && (t[i].point.show = e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.show : void 0 } }, pointPixelSize: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.pixelSize = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.pixelSize; if (e) return e._value } } }, pointOutlineColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.outlineColor = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineColor; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, pointOutlineWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)/^\[/.test(e) && (e = e.replace(/\[/, "").replace(/\]/, ""), e = t[i].properties[e]), t[i].point.outlineWidth = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.outlineWidth; if (e) return e._value } } }, pointHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = 0; i < t.length; i++)t[i].point.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point) { e = e[0].point.heightReference; if (e) return e._value } } }, pointDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, pointDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].point) && t && 0 < t.length && t[0].point) for (var i = t[0].point.distanceDisplayCondition ? t[0].point.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].point.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].point.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].point) && e && 0 < e.length && e[0].point ? e[0].point.distanceDisplayCondition ? e[0].point.distanceDisplayCondition._value.near : 0 : void 0 } }, pointHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } }, billboardShow: { set: C.debounce(function (e) { var t = this.item.entities && this.item.entities.values; if (t && 0 < t.length) for (var i = 0; i < t.length; i++)!t[i].billboard && e ? (t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].model && (t[i].model.show = !e), t[i].billboard = new this._cesium.BillboardGraphics({ show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE })) : (t[i].billboard && (t[i].billboard.show = e), t[i].point && (t[i].point.show = !e), t[i].label && (t[i].label.show = !e), t[i].billboard && (t[i].billboard.show = !e)) }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.show : void 0 } }, billboardImage: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length) for (var i, o = 0; o < t.length; o++)/^\[/.test(e) && (e = 1 < (i = e.split("[")).length ? i[0] + i[1].replace(/\[/, "").replace(/\]/, "") : (e = e.replace(/\[/, "").replace(/\]/, ""), t[o].properties[e])), t[o].billboard ? t[o].billboard.image = e : t[o].billboard = new this._cesium.BillboardGraphics({ image: e, show: !0, scale: 1, horizontalOrigin: this._cesium.HorizontalOrigin.CENTER, verticalOrigin: this._cesium.VerticalOrigin.CENTER, eyeOffset: this._cesium.Cartesian3.ZERO, pixelOffset: this._cesium.Cartesian2.ZERO, rotation: 0, alignedAxis: this._cesium.Cartesian3.ZERO, width: void 0, height: void 0, color: this._cesium.Color.WHITE, heightReference: this._cesium.HeightReference.NONE }) } }, 500) }, billboardScale: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.scale = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.scale; if (e) return e._value } } }, billboardHorizontalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.horizontalOrigin = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.horizontalOrigin : void 0 } }, billboardVerticalOrigin: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.verticalOrigin = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.verticalOrigin : void 0 } }, billboardWidth: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.width = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.width; if (e) return e._value } } }, billboardHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.height = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.height; if (e) return e._value } } }, billboardColor: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { this._core.isnull(e) || (e = this._core.isHtmlColor(e) ? this._color.colorFromHtmlColor(e) : (1 < (e = /^rgb/.test(e) ? this._color.rgbaStringToRgbaObj(e) : e).r && (e.r = e.r / 255), 1 < e.g && (e.g = e.g / 255), 1 < e.b && (e.b = e.b / 255), 1 < e.a && (e.a = e.a / 255), this._color.createColor(e.r, e.g, e.b, e.a))); var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = 0; i < t.length; i++)t[i].billboard.color = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard) { e = e[0].billboard.color; try { return this._color.toHtmlColor("rgb(" + 255 * e._value.red + "," + 255 * e._value.green + "," + 255 * e._value.blue + "," + 255 * e._value.alpha + ")") } catch (e) { } } } }, billboardHeightReference: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].model) for (var i = 0; i < t.length; i++)t[i].billboard.heightReference = e } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; if ((!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].model) { e = e[0].billboard.heightReference; if (e) return e._value } } }, billboardDistanceDisplayMaxCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.near : 0, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(i, e), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(i, 1, e, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE : void 0 } }, billboardDistanceDisplayMinCondition: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].billboard) && t && 0 < t.length && t[0].billboard) for (var i = t[0].billboard.distanceDisplayCondition ? t[0].billboard.distanceDisplayCondition._value.far : Number.MAX_VALUE, o = 0; o < t.length; o++)t[o].billboard.distanceDisplayCondition = new this._cesium.DistanceDisplayCondition(e, i), t[o].billboard.scaleByDistance = new this._cesium.NearFarScalar(e, 1, i, 0) } }, 500), get: function () { var e = this.item.entities && this.item.entities.values; return (!e || /^point.fid/.test(e[0]._id) || null != e[0].billboard) && e && 0 < e.length && e[0].billboard ? e[0].billboard.distanceDisplayCondition ? e[0].billboard.distanceDisplayCondition._value.near : 0 : void 0 } }, billboardPHeight: { set: C.debounce(function (e) { if (!this._core.isnull(e)) { var t = this.item.entities && this.item.entities.values; if ((!t || /^point.fid/.test(t[0]._id) || null != t[0].position) && t && 0 < t.length && t[0].position) for (var i = 0; i < t.length; i++) { var o = this._cesium.Cartographic.fromCartesian(t[i].position._value), r = this._cesium.Math.toDegrees(o.longitude), o = this._cesium.Math.toDegrees(o.latitude), r = this._cesium.Cartesian3.fromDegrees(r, o, e); t[i].position = r } } }, 500), get: function () { return 0 } } }); function Eu(e, u, h, m) { var d = [], p = void 0 !== e[0].longitude; return e.forEach(function (e) { var t, i, o, r, n, a, s, l, c = [], e = p ? e : Pu.scene.globe.ellipsoid.cartesianToCartographic(e); t = e, o = m, r = (i = u).west, n = u.east, a = u.south, i = u.north - a, s = 180 * t.longitude / Math.PI, l = 180 * t.latitude / Math.PI, t.normalizedLongitude = (s - r) / (n - r) * h, t.normalizedLatitude = (l - a) / i * o, e = t, c.push(e.normalizedLongitude), c.push(e.normalizedLatitude), d.push(c) }), d } var Pu, xu = function (e, t, i) { var o = t.west * Cesium.Math.DEGREES_PER_RADIAN, r = t.east * Cesium.Math.DEGREES_PER_RADIAN, n = t.south * Cesium.Math.DEGREES_PER_RADIAN, t = t.north * Cesium.Math.DEGREES_PER_RADIAN, o = new Cesium.Rectangle(o, n, r, t), a = Eu(e, o, 32, 32), n = "#FF0000", r = 32, t = 32; e = void 0, (e = document.createElement("canvas")).width = r, e.height = t; var s = e.getContext("2d"); if (!(a.length <= 0)) { s.moveTo(a[0][0], a[0][1]); for (var l = 0; l < a.length; l++)s.lineTo(a[l][0], a[l][1]); return null != n && (s.fillStyle = n, s.fill()), e } }; function Du(e, t) { return Math.floor(Math.random() * (t - e + 1)) + e } function Iu(e, o) { var t = Cesium.when.defer(), r = []; return e.forEach(function (e) { var t, i; r.push((e = e, t = o, i = Cesium.when.defer(), (Du = xu(e.vertices, t, e.heights[0])).timeStamp = e.timeStamp, Du.mtHeight = e.heights, Du.mtType = e.mtType, Du.fromKML = e.fromKML, Du.rect = e.rectangle, Du.level = e.level, i.resolve(Du), i)) }), Cesium.when.all(r, function (e) { e[0].lenght; var o; 1 === e.length ? t.resolve(e[0]) : (e = e.sort(function (e, t) { return t.timeStamp - e.timeStamp }), o = e.shift(), e.forEach(function (i) { o.forEach(function (e, t) { e === Du && i[t] !== Du && (o[t] = i[t]) }) }), t.resolve(o)) }), t } function Au(e, t) { if (Pu = e, !Cesium.defined(t)) throw new Cesium.DeveloperError("options is required."); this._errorEvent = new Cesium.Event, this._modelFloorMasks = {}, this._credit = t.credit, "string" == typeof this._credit && (this._credit = new Cesium.Credit(this._credit)), t.heightMapWidth = Cesium.defaultValue(t.heightMapWidth, 32), t.heightMapHeight = Cesium.defaultValue(t.heightMapHeight, 32), this._options = t, this.readyPromise = Cesium.when.resolve(!0), this._subdomains = t.subdomains, t.firstRequestUrl = t.url.replace("{s}", this.sTag(0, 0, 0)), this._firstRequest = t.firstRequestUrl + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers=" + t.layerName + "&Styles=&Format=image/mpt"; var i = this, e = t.pngOnly; void 0 !== t.maxTerrainLevel && isNaN(t.maxTerrainLevel) && (t.maxTerrainLevel = void 0), this._maxTerrainLevel = Cesium.defaultValue(t.maxTerrainLevel, 30), e ? i.setFormatMPT(!1) : $.ajax({ url: t.cacheUrl ? t.cacheUrl + "/0/0/0." + (t.cacheFormat || "mpt") : this._firstRequest, success: function (e) { if (!!(Cesium.defined(e.childNodes) && 0 < e.childNodes.length)) return i.setFormatMPT(!1), null; i.setFormatMPT(!0) }, error: function () { return i.setFormatMPT(!1), null }, async: !1 }), t.cacheUrl && (this.isCache = !0, this.cacheLevel = t.cacheLevel || 16, this._cacheUrl = t.cacheUrl + "/{z}/{x}/{reverseY}." + (t.cacheFormat || "mpt")); let o = this._maxTerrainLevel; this._availability = { computeMaximumLevelAtPosition: function (e) { return Math.min(o, 16) } }, this._urlTemplate = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=" + t.layerName + "&Styles=&Format=image/" + this._format, this._allElevationLayers = null, this._tilingScheme = new Cesium.GeographicTilingScheme, this._levelZeroMaximumGeometricError = Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 4 * t.heightMapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._workerPool = new de({ workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js" }), this._pendingRequests = 0, this._requestGridSize = 8, this._requestsCache = {}, this._requestsCacheKeys = [], this.errorEvent.addEventListener(function (e) { }, this) } Au._geometricErrorFactor = 2, Object.defineProperties(Au.prototype, { errorEvent: { get: function () { return this._errorEvent } }, availability: { get: function () { return this._availability } }, credit: { get: function () { return this._credit } }, hasVertexNormals: { get: function () { return !1 } }, tilingScheme: { get: function () { return this._tilingScheme } }, ready: { get: function () { return !0 } }, hasWaterMask: { get: function () { return !1 } }, heightMapHeight: { get: function () { return this._options.heightMapHeight } }, heightMapWidth: { get: function () { return this._options.heightMapWidth } }, pendingRequests: { get: function () { return this._pendingRequests } } }), Au.prototype.setFormatMPT = function (e) { var t; e && this.pngOnly || (t = this._format, this._format = e ? "mpt" : "png", t !== this._format && (this._isMPT = e, void 0 !== this._urlTemplate && (this._urlTemplate = this._urlTemplate.replace("image/" + t, "image/" + this._format)))) }, Au.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumGeometricError / (1 << e) * Au._geometricErrorFactor }, Au.prototype.createKeyFromTile = function (e, t, i) { return e + "_" + t + "_" + i }, Au.prototype.getTileDataAvailable = function (e, t, i) { var o = Math.min(this._maxTerrainLevel, 25); return !!this._isMPT || i < o }, Au.prototype.requestFactorForLevel = function (e) { var t = Math.log(this._requestGridSize) / Math.log(2), t = Math.min(t, e); return Math.pow(2, t) }, Au.prototype.getRequestBaseTerrainUrl = function (e, t, i, o) { return this.getRequestUrl(e, t, i, o) }, Au.prototype.getRequestElevationLayer = function (e, t, i) { return this.getRequestUrl(e, t, i, !1, !0) }, Au.prototype.getRequestUrl = function (e, t, i, o, r) { var n, a = i, s = null != o ? this.requestFactorForLevel(i) : 1, e = null != o ? (e - e % s) / s : e, t = null != o ? (t - t % s) / s : t, i = null != o ? i - Math.log(s) / Math.log(2) : i; return this.isCache && 0 !== i && i <= this.cacheLevel ? (n = this.tilingScheme.getNumberOfYTilesAtLevel(i) - t - 1, this._cacheUrl.replace("{x}", e).replace("{reverseY}", n).replace("{z}", i)) : (n = this.tilingScheme.tileXYToNativeRectangle(e, t, i), o = this.heightMapWidth * s == 256 && o ? 1 : 0, r && (o = 0), this._urlTemplate.replace("{south}", n.south).replace("{north}", n.north).replace("{west}", n.west).replace("{east}", n.east).replace("{optimizedOnly}", o).replace("{width}", this.heightMapWidth * s).replace("{height}", this.heightMapHeight * s).replace("{s}", this.sTag(e, t, i)) + "&level=" + i + "&origLevel=" + a) }, Au.prototype.isT_Inside_E = function (e, t) { return e.west >= 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 }, Au.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) }, Au.prototype.sTag = function (e, t, i) { return null == this._subdomains ? "" : (e = (e + t + i) % this._subdomains.length, this._subdomains[e]) }, Au.prototype.refreshElevationLayer = function (e) { e.rectangle && void 0 !== Pu.scene.globe._surface._levelZeroTiles && this.findDirectParent(e.rectangle, !0).freeResources() }, Au.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 < o; r++) { var n = e.children[r]; if (Cesium.Rectangle.contains(n._rectangle, Cesium.Rectangle.center(t))) return a(n, t, i) } return null } if (e.width != Math.PI) for (var i = 0; i < Pu.scene.globe._surface._levelZeroTiles.length; i++) { var o = a(Pu.scene.globe._surface._levelZeroTiles[i], e, t); if (o) return o } return null }, Au.prototype.isTileAvailable = function (e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); if (r && r.data && r.data.terrainData) { if (!(0 < r.data.terrainData._childTileMask)) return !1; for (var n = r.children.length, a = 0; a < n; a++) { var s = r.children[a]; if (Cesium.Rectangle.equals(s._rectangle, o)) return r.data.terrainData._childTileMask & 1 << a } } return !0 }, Au.prototype.markTileAsUnavailable = function (e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); r && r.data && r.data.terrainData && 0 < r.data.terrainData._childTileMask && $.each(r.children, function (e, t) { if (Cesium.Rectangle.equals(t._rectangle, o)) { switch (e) { case 0: r.data.terrainData._childTileMask &= -5; break; case 1: r.data.terrainData._childTileMask &= -9; break; case 2: r.data.terrainData._childTileMask &= -2; break; case 3: r.data.terrainData._childTileMask &= -3 }return !1 } return !0 }) }, Au.prototype.requestBaseTerrainTileGeometry = function (e, t, i, o) { return this.requestTileGeometryBuffers(e, t, i, o) }, Au.prototype.requestElevationLayerTileGeometry = function (e, t, i, o, r) { return this.requestTileGeometryBuffers(e, t, i, o, r) }, Au.prototype.requestTileGeometryBuffers = function (e, t, i, o, r) { var m = this, d = {}; d.requestedRectangle = this.tilingScheme.tileXYToNativeRectangle(e, t, i), d.layer = r; var n, a, p = Cesium.when.defer(), s = this.requestTileHeightBuffer(e, t, i, o, void 0, r); return void 0 === s ? void 0 : (n = this.requestTileHeightBuffer(e + 1, t, i, o, !0, r), a = this.requestTileHeightBuffer(e, t + 1, i, o, !0, r), e = this.requestTileHeightBuffer(e + 1, t + 1, i, o, !0, r), Cesium.when.all([s, n, a, e], function (e) { if (null != e[0].myReject && e[0].myReject) p.reject(); else { for (var t = m.heightMapWidth + 1, i = m.heightMapHeight + 1, o = new Float32Array(t * i), r = e[0].isFloor, n = 0; n < t; n++)for (var a = 0; a < i; a++) { var s = n, l = a, c = 0, u = (a === t - 1 && (l = 0, c = 1, r && (c = 0, l = t - 2)), n === i - 1 && (s = 0, c = 2), n * t + a), s = s * m.heightMapWidth + l; null === e[c] || null != e[c].myReject && e[c].myReject || (o[u] = e[c][s]) } null != e[3].myReject && e[3].myReject || (o[t * i - 1] = e[3][0]); var h = m.arrayToHeightmapTerrainData(o, t, i, 15); d.buffer = h, p.resolve(d) } }).otherwise(function () { p.reject() }), p) }, Au.prototype.requestTileGeometry = function (o, r, n, a) { var s = this, l = [], c = s.tilingScheme.tileXYToNativeRectangle(o, r, n), u = (null != this._allElevationLayers && 0 < this._allElevationLayers.length && 7 < n ? $(this._allElevationLayers).each(function (e, t) { var i; t.show ? (i = t.rectangle, s.isT_Inside_E(c, i) ? (s.setFormatMPT(!1), l.push(s.requestElevationLayerTileGeometry(o, r, n, a, t))) : (null != s.isT_Intersects_E(c, i) ? (s.setFormatMPT(!1), l.push(s.requestElevationLayerTileGeometry(o, r, n, a, t))) : s.setFormatMPT(!0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a)))) : (s.setFormatMPT(!0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a))) }) : (s.setFormatMPT(!0), l.push(s.requestBaseTerrainTileGeometry(o, r, n, a))), Cesium.when.defer()); return Cesium.when.all(l, function (e) { var t, i; 1 === e.length ? (void 0 !== e.layer && console.log("missing scale and offset"), u.resolve(e[0].buffer)) : 1 < e.length ? (t = $.grep(e, function (e) { return void 0 !== e.layer }), i = $.grep(e, function (e) { return void 0 === e.layer }), 0 === t.length ? u.resolve(e[0].buffer) : (e = t[t.length - 1], t = i[i.length - 1], i = { tolerance: e.layer.nullTolerance, nullValueNumber: e.layer.nullValueNumber, verticesX: e.layer.polygonVerticesX, verticesY: e.layer.polygonVerticesY, scale: Cesium.defaultValue(e.layer.scale, 1), offset: Cesium.defaultValue(e.layer.offset, 0) }, u.resolve(s.mergeBuffers(t.buffer, e.buffer, i, t.requestedRectangle)))) : u.reject() }).otherwise(function () { u.reject() }), u }, Au.prototype.mergeBuffers = function (e, t, i, o) { o.west, o.north, o.east, o.south, o.width, o.height; for (var r, n, a, s, l = i.scale, c = i.offset, o = i.nullValueNumber, u = i.tolerance, h = void 0 !== o && void 0 !== u, m = (h && (a = Cesium.defaultValue(i.nullValueNumber, 0), s = Cesium.defaultValue(Number(i.tolerance), 0)), new Float32Array(1089)), d = 0; d < 33; d++)for (r = 0, 0; r < 33; r++, 0)m[n = 33 * d + r] = h ? !t._buffer[n] || t._buffer[n] >= a - s && t._buffer[n] <= a + s ? e._buffer[n] : t._buffer[n] * l + c : t._buffer[n] ? t._buffer[n] * l + c : e._buffer[n]; return this.arrayToHeightmapTerrainData(m, 33, 33, 15) }, Au.prototype.requestTileHeightBuffer = function (c, u, h, e, t, o) { if (!isNaN(c + u + 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(c, u, h).replace(this._options.url, o.getUrlFromSTag(c, u, h) + "/Elevation").replace(this._options.layerName, o.name), "mpt" === o.format && (i = i.replace("image/png", "image/mpt"))) : (i = this.getRequestBaseTerrainUrl(c, u, h, e || t), m = Pu.terrainProvider.tilingScheme.tileXYToRectangle(c, u, h), e = Pu.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) }), !(0 < n.length) || 1 === n.length && n[0].modelFloorBestLevel && h > n[0].modelFloorBestLevel) ? r.resolve("NoMerge") : (t = Iu(n, m), Cesium.when(t, function (e) { r.resolve(e) }).otherwise(function (e) { console.log(e) })), d = Cesium.when.defer(), (1 === (e = $.grep([], function (e) { return 0 < e._selectedTiles.length })).length && e[0].level && h > e[0].level || (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, c = e.getHRMTFP(e, s, !0); 65535 !== (l = null != c && c.content && c.content._model && c.content._model.floor ? c.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"), Pu.scene.globe.ellipsoid), !1 === this._requestsCache.hasOwnProperty(i)) { if (this._requestsCache[i] = {}, this._requestsCacheKeys.push(i), 100 < this._requestsCacheKeys.length) { for (var a = 0; a < 50; a++)delete this._requestsCache[this._requestsCacheKeys[a]]; this._requestsCacheKeys.splice(0, 50) } } else { t = this._requestsCacheKeys.indexOf(i); this._requestsCacheKeys.splice(t, 1), this._requestsCacheKeys.push(i) } var f, s = this._requestsCache[i]; if (void 0 !== s.dataLoaded || (s.dataLoaded = Cesium.Resource.fetchArrayBuffer(i), Cesium.defined(s.dataLoaded))) return (f = this)._pendingRequests++, Cesium.when(s.dataLoaded, function (e) { void 0 === s.workerFinished && (s.workerFinished = f._workerPool.queueWorkItem({ buffer: e, isElevation: void 0 !== o, level: h })), Cesium.when.all([s.workerFinished, r, d], function (e) { var t = void 0 !== e[1] && "NoMerge" !== e[1], i = void 0 !== e[2] && "NoFloor" !== e[2]; if (e[0].rejected) { for (var o = f.heightMapWidth * f.heightMapHeight, r = new Int16Array(o), n = 0; n < o; n++)r[n] = 300; return 2 < h && (r.myReject = !0), g.resolve(r), g } var a = f.extractTileHeightBuffer(e[0].buffer, c, u, h); if (f._pendingRequests--, t) for (n = 0; n < 32; n++)for (var s = 0; s < 32; s++)a[l = 32 * n + s] = e[1].mtHeight[0]; if (i) { for (var l, n = 0; n < 32; n++)for (s = 0; s < 32; s++)a[l = 32 * n + s] = (65535 === e[2][l] || 10500 < e[2][l] ? a : e[2])[l]; a.isFloor = !0 } g.resolve(a) }).otherwise(function () { for (var e = f.heightMapWidth * f.heightMapHeight, t = new Int16Array(e), i = 0; i < e; i++)t[i] = 300; return 2 < h && (t.myReject = !0), g.resolve(t), g }) }).otherwise(function () { f._pendingRequests--, g.reject() }), g } }, Au.prototype.extractTileHeightBuffer = function (e, t, i, o) { try { for (var r = this.requestFactorForLevel(o), n = t % r, a = i % r, s = new Float32Array(this.heightMapWidth * this.heightMapHeight), l = 1e6, c = -1e5, u = 0; u < this.heightMapHeight; u++)for (var h = 0; h < this.heightMapWidth; h++) { var m = u + a * this.heightMapHeight, d = h + n * this.heightMapWidth, p = u * this.heightMapWidth + h, g = m * this.heightMapWidth * r + d; e[g] > c && (c = e[g]), e[g] < l && (l = e[g]), s[p] = e[g] } } catch (e) { console.log(e.message) } return s }, Au.prototype.arrayToHeightmapTerrainData = function (e, t, i, o) { return !1 === Cesium.defined(e) && (e = new Int16Array(t * i)), new Cesium.HeightmapTerrainData({ buffer: e, width: t, height: i, childTileMask: o }) }; function Lu(e, t, i) { var o, r, n, a, s, l = t.west * Cesium.Math.DEGREES_PER_RADIAN, c = t.east * Cesium.Math.DEGREES_PER_RADIAN, u = t.south * Cesium.Math.DEGREES_PER_RADIAN, t = t.north * Cesium.Math.DEGREES_PER_RADIAN, l = new Cesium.Rectangle(l, u, c, t), h = (o = l, n = r = 32, a = [], s = void 0 !== e[0].longitude, e.forEach(function (e) { var t = [], e = s ? e : Mu.scene.globe.ellipsoid.cartesianToCartographic(e), e = Ru(e, o, r, n); t.push(e.normalizedLongitude), t.push(e.normalizedLatitude), a.push(t) }), a), u = "#FF0000", c = 32, t = 32, m = (l = void 0, (l = document.createElement("canvas")).width = c, l.height = t, l.getContext("2d")); if (!(h.length <= 0)) { m.moveTo(h[0][0], h[0][1]); for (var d = 0; d < h.length; d++)m.lineTo(h[d][0], h[d][1]); return null != u && (m.fillStyle = u, m.fill()), l } } var Mu, Ru = function (e, t, i, o) { var r = t.west, n = t.east, a = t.south, t = t.north - a, s = 180 * e.longitude / Math.PI, l = 180 * e.latitude / Math.PI; return e.normalizedLongitude = (s - r) / (n - r) * i, e.normalizedLatitude = (l - a) / t * o, e }; function Ou(e, t) { if (Mu = e, !Cesium.defined(t)) throw new Cesium.DeveloperError("options is required."); this._errorEvent = new Cesium.Event, this._credit = t.credit, "string" == typeof this._credit && (this._credit = new Cesium.Credit(this._credit)), t.heightMapWidth = Cesium.defaultValue(t.heightMapWidth, 32), t.heightMapHeight = Cesium.defaultValue(t.heightMapHeight, 32), this._options = t, this._subdomains = t.subdomains, t.url = t.url.replace("{s}", this.sTag(0, 0, 0)), this._firstRequest = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers=" + t.layerName + "&Styles=&Format=image/mpt", t.token && (this._firstRequest += "&token=" + t.token), this._requestVertexNormals = Cesium.defaultValue(t.requestVertexNormals, !1); var i = this; $.ajax({ url: t.cacheUrl ? t.cacheUrl + "/0/0/0." + (t.cacheFormat || "mpt") : this._firstRequest, success: function (e) { if (!!(Cesium.defined(e.childNodes) && 0 < e.childNodes.length)) return i._isMPT = !1, i._format = "png", null; i._isMPT = !0, i._format = "mpt" }, error: function () { return i._isMPT = !1, i._format = "png", null }, async: !1 }), t.cacheUrl && (this.isCache = !0, this.cacheLevel = t.cacheLevel || 16, this._cacheUrl = t.cacheUrl + "/{z}/{x}/{reverseY}." + (t.cacheFormat || "mpt")); this._availability = { computeMaximumLevelAtPosition: function (e) { return Math.min(16, 16) } }, this._urlTemplate = t.url + "?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers=" + t.layerName + "&Styles=&Format=image/" + this._format, t.token && (this._urlTemplate += "&token=" + t.token), this._tilingScheme = new Cesium.GeographicTilingScheme, this._levelZeroMaximumGeometricError = Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 4 * t.heightMapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._workerPool = new de({ workerPath: SmartEarthRootUrl + "Workers/ParseElevationWorker.js" }), this._pendingRequests = 0, this._requestGridSize = 8, this._requestsCache = {}, this._requestsCacheKeys = [], this.errorEvent.addEventListener(function (e) { }, this) } function Bu(e) { this.resource = e.resource, this.version = e.version, this.isHeightmap = e.isHeightmap, this.tileUrlTemplates = e.tileUrlTemplates, this.availability = e.availability, this.hasVertexNormals = e.hasVertexNormals, this.hasWaterMask = e.hasWaterMask, this.hasMetadata = e.hasMetadata, this.availabilityLevels = e.availabilityLevels, this.availabilityTilesLoaded = e.availabilityTilesLoaded, this.littleEndianExtensionSize = e.littleEndianExtensionSize, this.availabilityPromiseCache = {} } function Vu(e) { this._heightmapWidth = 65, this._heightmapStructure = void 0, this._hasWaterMask = !1, this._hasVertexNormals = !1, this._ellipsoid = e.ellipsoid, this._requestVertexNormals = Cesium.defaultValue(e.requestVertexNormals, !1), this._requestWaterMask = Cesium.defaultValue(e.requestWaterMask, !1), this._requestMetadata = Cesium.defaultValue(e.requestMetadata, !0), this._errorEvent = new Cesium.Event; var v, w, b, t = e.credit, i = ("string" == typeof t && (t = new Cesium.Credit(t)), this._credit = t, this._availability = void 0, Cesium.when.defer()), T = (this._ready = !1, this._readyPromise = i, this._tileCredits = void 0, this), S = this._layers = [], E = "", P = [], x = 0; function D(e) { var t; if (e.format) if (e.tiles && 0 !== e.tiles.length) { var i = !1, o = !1, r = !1, n = !0, a = !1; if ("heightmap-1.0" === e.format) a = !0, Cesium.defined(T._heightmapStructure) || (T._heightmapStructure = { heightScale: .2, heightOffset: -1e3, elementsPerHeight: 1, stride: 1, elementMultiplier: 256, isBigEndian: !1, lowestEncodedHeight: 0, highestEncodedHeight: 65535 }), T._requestWaterMask = o = !0; else if (0 !== e.format.indexOf("quantized-mesh-1.")) return t = 'The tile format "' + e.format + '" is invalid or not supported.', void (b = Cesium.TileProviderError.handleError(b, T, T._errorEvent, t, void 0, void 0, void 0, A)); var s = e.tiles, l = e.maxzoom; if (x = Math.max(x, l), e.projection && "EPSG:4326" !== e.projection) { if ("EPSG:3857" !== e.projection) return t = 'The projection "' + e.projection + '" is invalid or not supported.', void (b = Cesium.TileProviderError.handleError(b, T, T._errorEvent, t, void 0, void 0, void 0, A)); T._tilingScheme = new Cesium.WebMercatorTilingScheme({ numberOfLevelZeroTilesX: 1, numberOfLevelZeroTilesY: 1, ellipsoid: T._ellipsoid }) } else T._tilingScheme = new Cesium.GeographicTilingScheme({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 1, ellipsoid: T._ellipsoid }); if (T._levelZeroMaximumGeometricError = Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(T._tilingScheme.ellipsoid, T._heightmapWidth, T._tilingScheme.getNumberOfXTilesAtLevel(0)), !e.scheme || "tms" === e.scheme || "slippyMap" === e.scheme) { T._scheme = e.scheme, Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("octvertexnormals") ? i = !0 : Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("vertexnormals") && (n = !(i = !0)), Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("watermask") && (o = !0), Cesium.defined(e.extensions) && -1 !== e.extensions.indexOf("metadata") && (r = !0); var c, u = e.metadataAvailability, h = e.available; if (Cesium.defined(h) && !Cesium.defined(u)) for (var m = new Cesium.TileAvailability(T._tilingScheme, h.length), d = 0; d < h.length; ++d) { var p = h[d], g = T._tilingScheme.getNumberOfYTilesAtLevel(d); Cesium.defined(P[d]) || (P[d] = []); for (var f = 0; f < p.length; ++f) { var _ = p[f], C = g - _.endY - 1, y = g - _.startY - 1; P[d].push([_.startX, C, _.endX, y]), m.addAvailableTileRange(d, _.startX, C, _.endX, y) } } else Cesium.defined(u) && (c = new Cesium.TileAvailability(T._tilingScheme, l), m = new Cesium.TileAvailability(T._tilingScheme, l), P[0] = [[0, 0, 1, 0]], m.addAvailableTileRange(0, 0, 0, 1, 0)); T._hasWaterMask = T._hasWaterMask || o, T._hasVertexNormals = T._hasVertexNormals || i, T._hasMetadata = T._hasMetadata || r, Cesium.defined(e.attribution) && (0 < E.length && (E += " "), E += e.attribution), S.push(new Bu({ resource: v, version: e.version, isHeightmap: a, tileUrlTemplates: s, availability: m, hasVertexNormals: i, hasWaterMask: o, hasMetadata: r, availabilityLevels: u, availabilityTilesLoaded: c, littleEndianExtensionSize: n })); l = e.parentUrl; if (Cesium.defined(l)) { if (!Cesium.defined(m)) return console.log("A layer.json can't have a parentUrl if it does't have an available array."), Cesium.when.resolve(); (v = v.getDerivedResource({ url: l })).appendForwardSlash(); a = (w = v.getDerivedResource({ url: "layer.json" })).fetchJson(); return Cesium.when(a, D, I) } return Cesium.when.resolve() } t = 'The scheme "' + e.scheme + '" is invalid or not supported.' } else t = "The layer.json file does not specify any tile URL templates."; else t = "The tile format is not specified in the layer.json file."; b = Cesium.TileProviderError.handleError(b, T, T._errorEvent, t, void 0, void 0, void 0, A) } function I(e) { var t = "An error occurred while accessing " + w.url + "."; b = Cesium.TileProviderError.handleError(b, T, T._errorEvent, t, void 0, void 0, void 0, A) } function o(e) { D(e).then(function () { if (!Cesium.defined(b)) { var e, t = P.length; if (0 < t) for (var i = T._availability = new Cesium.TileAvailability(T._tilingScheme, x), o = 0; o < t; ++o)for (var r = P[o], n = 0; n < r.length; ++n) { var a = r[n]; i.addAvailableTileRange(o, a[0], a[1], a[2], a[3]) } 0 < E.length && (e = new Cesium.Credit(E), Cesium.defined(T._tileCredits) ? T._tileCredits.push(e) : T._tileCredits = [e]), T._ready = !0, T._readyPromise.resolve(!0) } }) } function r(e) { o({ extensions: ["octvertexnormals"], format: "quantized-mesh-1.0", maxzoom: 18, minzoom: 0, name: "world", projection: "EPSG:3857", scheme: "slippyMap", tilejson: "1.0", tiles: ["{z}/{x}/{y}.terrain"], version: "1.0.0" }) } function A() { Cesium.when(w.fetchJson()).then(o).otherwise(r) } Cesium.when(e.url).then(function (e) { e = Cesium.Resource.createIfNeeded(e); e.appendForwardSlash(), w = (v = e).getDerivedResource({ url: "layer.json" }), T._tileCredits = e.credits, A() }).otherwise(function (e) { i.reject(e) }) } Ou._geometricErrorFactor = 2, Object.defineProperties(Ou.prototype, { errorEvent: { get: function () { return this._errorEvent } }, availability: { get: function () { return this._availability } }, credit: { get: function () { return this._credit } }, requestVertexNormals: { get: function () { return this._requestVertexNormals } }, hasVertexNormals: { get: function () { return this._requestVertexNormals } }, tilingScheme: { get: function () { return this._tilingScheme } }, ready: { get: function () { return !0 } }, hasWaterMask: { get: function () { return !1 } }, heightMapHeight: { get: function () { return this._options.heightMapHeight } }, heightMapWidth: { get: function () { return this._options.heightMapWidth } }, pendingRequests: { get: function () { return this._pendingRequests } } }), Ou.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumGeometricError / (1 << e) * Ou._geometricErrorFactor }, Ou.prototype.createKeyFromTile = function (e, t, i) { return e + "_" + t + "_" + i }, Ou.prototype.getTileDataAvailable = function (e, t, i) { return this._isMPT ? void 0 : i < 16 }, Ou.prototype.requestFactorForLevel = function (e) { var t = Math.log(this._requestGridSize) / Math.log(2), t = Math.min(t, e); return Math.pow(2, t) }, Ou.prototype.getRequestUrl = function (e, t, i, o) { var r, n = this.requestFactorForLevel(i); return e = (e - e % n) / n, t = (t - t % n) / n, i -= Math.log(n) / Math.log(2), this.isCache && 0 !== i && i <= this.cacheLevel ? (r = this.tilingScheme.getNumberOfYTilesAtLevel(i) - t - 1, this._cacheUrl.replace("{x}", e).replace("{reverseY}", r).replace("{z}", i)) : (r = this.tilingScheme.tileXYToNativeRectangle(e, t, i), o = this.heightMapWidth * n == 256 && o ? 1 : 0, this._urlTemplate.replace("{south}", r.south).replace("{north}", r.north).replace("{west}", r.west).replace("{east}", r.east).replace("{optimizedOnly}", o).replace("{width}", this.heightMapWidth * n).replace("{height}", this.heightMapHeight * n).replace("{s}", this.sTag(e, t, i))) }, Ou.prototype.sTag = function (e, t, i) { return null == this._subdomains ? "" : (e = (e + t + i) % this._subdomains.length, this._subdomains[e]) }, Ou.prototype.findDirectParent = function (e) { function n(e, t) { if (e._rectangle.width <= 2.1 * t.width && Cesium.Rectangle.contains(e._rectangle, Cesium.Rectangle.center(t))) return e; for (var i = e.children.length, o = 0; o < i; o++) { var r = e.children[o]; if (Cesium.Rectangle.contains(r._rectangle, Cesium.Rectangle.center(t))) return n(r, t) } return null } if (e.width != Math.PI) for (var t = 0; t < Mu.scene.globe._surface._levelZeroTiles.length; t++) { var i = n(Mu.scene.globe._surface._levelZeroTiles[t], e); if (i) return i } return null }, Ou.prototype.isTileAvailable = function (e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); if (r && r.data && r.data.terrainData) { if (!(0 < r.data.terrainData._childTileMask)) return !1; for (var n = r.children.length, a = 0; a < n; a++) { var s = r.children[a]; if (Cesium.Rectangle.equals(s._rectangle, o)) return r.data.terrainData._childTileMask & 1 << a } } return !0 }, Ou.prototype.markTileAsUnavailable = function (e, t, i) { var o = this._tilingScheme.tileXYToRectangle(e, t, i, new Cesium.Rectangle), r = this.findDirectParent(o); r && r.data && r.data.terrainData && 0 < r.data.terrainData._childTileMask && $.each(r.children, function (e, t) { if (Cesium.Rectangle.equals(t._rectangle, o)) { switch (e) { case 0: r.data.terrainData._childTileMask &= -5; break; case 1: r.data.terrainData._childTileMask &= -9; break; case 2: r.data.terrainData._childTileMask &= -2; break; case 3: r.data.terrainData._childTileMask &= -3 }return !1 } return !0 }) }, Ou.prototype.requestTileGeometry = function (h, m, d, e) { var p, t, i, g, o = this.requestTileHeightBuffer(h, m, d, e); if (void 0 !== o) return t = (p = this).requestTileHeightBuffer(h + 1, m, d, e, !0), i = this.requestTileHeightBuffer(h, m + 1, d, e, !0), e = this.requestTileHeightBuffer(h + 1, m + 1, d, e, !0), g = Cesium.when.defer(), Cesium.when.all([o, t, i, e], function (e) { if (null != e[0].myReject && e[0].myReject) p.markTileAsUnavailable(h, m, d), g.reject(); else { for (var t = p.heightMapWidth + 1, i = p.heightMapHeight + 1, o = new Float32Array(t * i), r = 0; r < t; r++)for (var n = 0; n < i; n++) { var a = r, s = n, l = 0, c = (n === t - 1 && (s = 0, l = 1), r === i - 1 && (a = 0, l = 2), r * t + n), a = a * p.heightMapWidth + s; null === e[l] || null != e[l].myReject && e[l].myReject || (o[c] = e[l][a]) } null != e[3].myReject && e[3].myReject || (o[t * i - 1] = e[3][0]); var u = p.arrayToHeightmapTerrainData(o, t, i, 15); g.resolve(u) } }).otherwise(function () { g.reject() }), g }, Ou.prototype.requestTileHeightBuffer = function (l, c, u, e, t, i) { if (!isNaN(l + c + u)) { var e = 0 == (e = Cesium.defined(e) && !1 !== e ? e : new Cesium.Request({ defer: !0 })).defer, h = (t = Cesium.defaultValue(e, !1), Cesium.when.defer()), t = this.getRequestUrl(l, c, u, e || t); if (!1 === this._requestsCache.hasOwnProperty(t)) { if (this._requestsCache[t] = {}, this._requestsCacheKeys.push(t), 100 < this._requestsCacheKeys.length) { for (var o = 0; o < 50; o++)delete this._requestsCache[this._requestsCacheKeys[o]]; this._requestsCacheKeys.splice(0, 50) } } else { var r = this._requestsCacheKeys.indexOf(t); this._requestsCacheKeys.splice(r, 1), this._requestsCacheKeys.push(t) } var n, m, d, p, a = this._requestsCache[t]; if (void 0 !== a.dataLoaded || (a.dataLoaded = e ? Cesium.RequestScheduler.request(t, Cesium.loadArrayBuffer) : Cesium.loadArrayBuffer(t), Cesium.defined(a.dataLoaded))) return n = Mu.terrainProvider.tilingScheme.tileXYToRectangle(l, c, u), r = Mu.terrainProvider._modifyTerrainObjects, (d = m = null) != r && 0 < r.length && r.forEach(function (e) { e.show && Cesium.Rectangle.intersection(n, e.rectangle, new Cesium.Rectangle) && (m = Lu((d = e).vertices, n, d.heights[0])) }), (p = this)._pendingRequests++, Cesium.when(a.dataLoaded, function (e) { void 0 === a.workerFinished && (a.workerFinished = p._workerPool.queueWorkItem({ buffer: e, isElevation: void 0 !== i, level: u })), Cesium.when(a.workerFinished, function (e) { if (e.rejected) { for (var t = p.heightMapWidth * p.heightMapHeight, i = new Int16Array(t), o = 0; o < t; o++)i[o] = 300; return 2 < u && (p.markTileAsUnavailable(l, c, u), i.myReject = !0), h.resolve(i), h } var r = p.extractTileHeightBuffer(e.buffer, l, c, u); if (null != m) for (var n = m.getContext("2d").getImageData(0, 0, 32, 32).data, a = 0; a < 32; a++)for (var s = 0; s < 32; s++)0 !== n[4 * (32 * a + s)] && (r[32 * (31 - a) + s] = d.heights[0]); p._pendingRequests--, h.resolve(r) }) }).otherwise(function () { p._pendingRequests--, h.reject() }), h } }, Ou.prototype.extractTileHeightBuffer = function (e, t, i, o) { try { for (var r = this.requestFactorForLevel(o), n = t % r, a = i % r, s = new Float32Array(this.heightMapWidth * this.heightMapHeight), l = 1e6, c = -1e5, u = 0; u < this.heightMapHeight; u++)for (var h = 0; h < this.heightMapWidth; h++) { var m = u + a * this.heightMapHeight, d = h + n * this.heightMapWidth, p = u * this.heightMapWidth + h, g = m * this.heightMapWidth * r + d; e[g] > c && (c = e[g]), e[g] < l && (l = e[g]), s[p] = e[g] } } catch (e) { console.log(e.message) } return s }, Ou.prototype.arrayToHeightmapTerrainData = function (e, t, i, o) { return !1 === Cesium.defined(e) && (e = new Int16Array(t * i)), new Cesium.HeightmapTerrainData({ buffer: e, width: t, height: i, childTileMask: o }) }; var Fu = { OCT_VERTEX_NORMALS: 1, WATER_MASK: 2, METADATA: 4 }; function Hu(e) { return Cesium.defined(e) && 0 !== e.length ? { Accept: "application/vnd.quantized-mesh;extensions=" + e.join("-") + ",application/octet-stream;q=0.9,*/*;q=0.01" } : { Accept: "application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01" } } function Gu(k, N, j, U, z, e) { if (!Cesium.defined(z)) return Cesium.when.reject(new Cesium.RuntimeError("Terrain tile doesn't exist")); var t = z.tileUrlTemplates; if (0 !== t.length) { i = k._scheme && "tms" !== k._scheme ? j : k._tilingScheme.getNumberOfYTilesAtLevel(U) - j - 1; var i, o, r = [], t = (k._requestVertexNormals && z.hasVertexNormals && r.push(z.littleEndianExtensionSize ? "octvertexnormals" : "vertexnormals"), k._requestWaterMask && z.hasWaterMask && r.push("watermask"), k._requestMetadata && z.hasMetadata && r.push("metadata"), t[(N + i + U) % t.length]), n = z.resource, r = Cesium.defined(n._ionEndpoint) && !Cesium.defined(n._ionEndpoint.externalType) ? (0 !== r.length && (o = { extensions: r.join("-") }), Hu(void 0)) : Hu(r), n = n.getDerivedResource({ url: t, templateValues: { version: z.version, z: U, x: N, y: i }, queryParameters: o, headers: r, request: e }).fetchArrayBuffer(); if (Cesium.defined(n)) return n.then(function (e) { if (Cesium.defined(k._heightmapStructure)) return h = k, c = e, u = new Uint16Array(c, 0, h._heightmapWidth * h._heightmapWidth), new Cesium.HeightmapTerrainData({ buffer: u, childTileMask: new Uint8Array(c, u.byteLength, 1)[0], waterMask: new Uint8Array(c, u.byteLength + 1, c.byteLength - u.byteLength - 1), width: h._heightmapWidth, height: h._heightmapWidth, structure: h._heightmapStructure, credits: h._tileCredits }); for (var t = k, i = e, o = U, r = N, n = j, a = z, s = a.littleEndianExtensionSize, l = 0, c = 3 * Float64Array.BYTES_PER_ELEMENT, u = 4 * Float64Array.BYTES_PER_ELEMENT, h = 3 * Uint16Array.BYTES_PER_ELEMENT, e = Uint16Array.BYTES_PER_ELEMENT, m = 3 * e, d = new DataView(i), V = new Cesium.Cartesian3(d.getFloat64(l, !0), d.getFloat64(l + 8, !0), d.getFloat64(l + 16, !0)), p = d.getFloat32(l += c, !0), g = (l += Float32Array.BYTES_PER_ELEMENT, d.getFloat32(l, !0)), F = (l += Float32Array.BYTES_PER_ELEMENT, new Cesium.BoundingSphere(new Cesium.Cartesian3(d.getFloat64(l, !0), d.getFloat64(l + 8, !0), d.getFloat64(l + 16, !0)), d.getFloat64(l + c, !0))), u = (l += u, new Cesium.Cartesian3(d.getFloat64(l, !0), d.getFloat64(l + 8, !0), d.getFloat64(l + 16, !0))), f = d.getUint32(l += c, !0), c = (l += Uint32Array.BYTES_PER_ELEMENT, new Uint16Array(i, l, 3 * f)), h = (l += f * h, 65536 < f && (m = 3 * (e = Uint32Array.BYTES_PER_ELEMENT)), c.subarray(0, f)), _ = c.subarray(f, 2 * f), C = c.subarray(2 * f, 3 * f), h = (Cesium.AttributeCompression.zigZagDeltaDecode(h, _, C), l % e != 0 && (l += e - l % e), d.getUint32(l, !0)), y = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f, i, l, 3 * h)), v = (l += h * m, 0), H = y.length, w = 0; w < H; ++w) { var b = y[w]; y[w] = v - b, 0 === b && ++v } var T, S, _ = d.getUint32(l, !0), C = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f, i, l, _)), h = d.getUint32(l += _ * e, !0), m = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f, i, l, h)), _ = d.getUint32(l += h * e, !0), h = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f, i, l, _)), _ = d.getUint32(l += _ * e, !0), G = (l += Uint32Array.BYTES_PER_ELEMENT, Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(f, i, l, _)); for (l += _ * e; l < d.byteLength;) { var E = d.getUint8(l, !0), P = (l += Uint8Array.BYTES_PER_ELEMENT, d.getUint32(l, s)); if (l += Uint32Array.BYTES_PER_ELEMENT, E === Fu.OCT_VERTEX_NORMALS && t._requestVertexNormals) T = new Uint8Array(i, l, 2 * f); else if (E === Fu.WATER_MASK && t._requestWaterMask) S = new Uint8Array(i, l, P); else if (E === Fu.METADATA && t._requestMetadata) { E = d.getUint32(l, !0); if (0 < E) { var x = Cesium.getJsonFromTypedArray(new Uint8Array(i), l + Uint32Array.BYTES_PER_ELEMENT, E).available; if (Cesium.defined(x)) for (var D = 0; D < x.length; ++D)for (var I = o + D + 1, A = x[D], L = t._tilingScheme.getNumberOfYTilesAtLevel(I), M = 0; M < A.length; ++M) { var R = A[M], O = L - R.endY - 1, B = L - R.startY - 1; t.availability.addAvailableTileRange(I, R.startX, O, R.endX, B), a.availability.addAvailableTileRange(I, R.startX, O, R.endX, B) } } a.availabilityTilesLoaded.addAvailableTileRange(o, r, n, r, n) } l += P } return _ = 5 * t.getLevelMaximumGeometricError(o), e = t._tilingScheme.tileXYToRectangle(r, n, o), e = Cesium.OrientedBoundingBox.fromRectangle(e, p, g, t._tilingScheme.ellipsoid), new Cesium.QuantizedMeshTerrainData({ center: V, minimumHeight: p, maximumHeight: g, boundingSphere: F, orientedBoundingBox: e, horizonOcclusionPoint: u, quantizedVertices: c, encodedNormals: T, indices: y, westIndices: C, southIndices: m, eastIndices: h, northIndices: G, westSkirtHeight: _, southSkirtHeight: _, eastSkirtHeight: _, northSkirtHeight: _, childTileMask: t.availability.computeChildMaskForTile(o, r, n), waterMask: S, credits: t._tileCredits }) }).otherwise(function (e) { return Cesium.when.resolve(new Cesium.HeightmapTerrainData({ buffer: new Uint8Array(256), width: 16, height: 16 })) }) } } function ku(e, t, i, o) { if (0 !== o) return { level: e = o % (e = e.availabilityLevels) == 0 ? o - e : (o / e | 0) * e, x: t / (t = 1 << o - e) | 0, y: i / t | 0 } } function Nu(e, t, i, o, r, n) { if (Cesium.defined(r.availabilityLevels)) for (var a, s, l, c = function () { delete r.availabilityPromiseCache[l] }, u = r.availabilityTilesLoaded, h = r.availability, m = ku(r, t, i, o); Cesium.defined(m);) { if (h.isTileAvailable(m.level, m.x, m.y) && !u.isTileAvailable(m.level, m.x, m.y)) return n || (l = m.level + "-" + m.x + "-" + m.y, s = r.availabilityPromiseCache[l], Cesium.defined(s) || (a = new Cesium.Request({ throttle: !1, throttleByServer: !0, type: Cesium.RequestType.TERRAIN }), s = Gu(e, m.x, m.y, m.level, r, a), Cesium.defined(s) && (r.availabilityPromiseCache[l] = s).then(c))), { result: !0, promise: s }; m = ku(r, m.x, m.y, m.level) } return { result: !1 } } Vu.prototype.requestTileGeometry = function (e, t, i, o) { var r, n = this._layers, a = n.length; if (1 === a) r = n[0]; else for (var s = 0; s < a; ++s) { var l = n[s]; if (!Cesium.defined(l.availability) || l.availability.isTileAvailable(i, e, t)) { r = l; break } } return Gu(this, e, t, i, r, o) }, Object.defineProperties(Vu.prototype, { errorEvent: { get: function () { return this._errorEvent } }, credit: { get: function () { return this._credit } }, tilingScheme: { get: function () { return this._tilingScheme } }, ready: { get: function () { return this._ready } }, readyPromise: { get: function () { return this._readyPromise.promise } }, hasWaterMask: { get: function () { return this._hasWaterMask && this._requestWaterMask } }, hasVertexNormals: { get: function () { return this._hasVertexNormals && this._requestVertexNormals } }, hasMetadata: { get: function () { return this._hasMetadata && this._requestMetadata } }, requestVertexNormals: { get: function () { return this._requestVertexNormals } }, requestWaterMask: { get: function () { return this._requestWaterMask } }, requestMetadata: { get: function () { return this._requestMetadata } }, availability: { get: function () { return this._availability } } }), Vu.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumGeometricError / (1 << e) }, Vu.prototype.getTileDataAvailable = function (e, t, i) { if (Cesium.defined(this._availability)) { if (!(i > this._availability._maximumLevel)) { if (this._availability.isTileAvailable(i, e, t)) return !0; if (this._hasMetadata) for (var o = this._layers, r = o.length, n = 0; n < r; ++n)if (Nu(this, e, t, i, o[n], 0 === n).result) return } return !1 } }, Vu.prototype.loadTileDataAvailability = function (e, t, i) { if (!(!Cesium.defined(this._availability) || i > this._availability._maximumLevel || this._availability.isTileAvailable(i, e, t)) && this._hasMetadata) for (var o = this._layers, r = o.length, n = 0; n < r; ++n) { var a = Nu(this, e, t, i, o[n], 0 === n); if (Cesium.defined(a.promise)) return a.promise } }, Vu._getAvailabilityTile = ku; const ju = new Uint8Array([172, 223, 96, 7, 210, 166, 80, 193, 62, 133, 0, 92, 97, 125, 81, 193, 175, 204, 114, 156, 24, 171, 39, 65, 215, 131, 189, 193, 92, 143, 98, 193, 172, 223, 224, 55, 148, 164, 80, 193, 62, 133, 128, 115, 254, 122, 81, 193, 175, 204, 114, 40, 74, 169, 39, 65, 199, 225, 33, 1, 165, 221, 10, 65, 165, 248, 77, 38, 221, 233, 229, 191, 118, 168, 124, 106, 57, 4, 231, 191, 208, 126, 103, 119, 149, 64, 191, 63, 9, 0, 0, 0, 254, 127, 253, 127, 254, 127, 253, 127, 0, 0, 254, 255, 255, 127, 0, 128, 0, 0, 254, 127, 253, 127, 0, 0, 254, 127, 0, 128, 0, 0, 0, 0, 253, 255, 254, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 5, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 9, 0, 7, 0, 4, 0, 9, 0, 1, 0, 5, 0, 9, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 1, 0, 7, 0, 2, 0, 3, 0, 0, 0, 7, 0, 5, 0, 8, 0, 3, 0, 0, 0, 4, 0, 5, 0, 6, 0]); class Uu { constructor(e = {}) { if (this.ready = !1, this.dummyTile = un(ju.buffer), this.tilingScheme = e.tilingScheme || new Cesium.WebMercatorTilingScheme, void 0 === e.url) throw new Error("url option is missing"); void 0 !== e.credit && (this.credits = [new Cesium.Credit(e.credit)]), this.urlTemplates = e.url, 0 !== this.urlTemplates.length && "/" === this.urlTemplates[this.urlTemplates.length - 1] || (this.urlTemplates = this.urlTemplates + "/"), this.readyPromise = Promise.resolve(!0), this.ready = !0 } getUrl(e, t, i) { return this.urlTemplates + (i + `/${e}/${t}.terrain`) } generateDummyTileHeader(e, t, i) { var o = this.tilingScheme.tileXYToRectangle(e, t, i), e = this.tilingScheme.tileXYToNativeRectangle(e, t, i), t = Cesium.Cartographic.toCartesian(Cesium.Rectangle.center(o)), i = Cesium.Ellipsoid.WGS84.transformPositionToScaledSpace(t); return { centerX: t.x, centerY: t.y, centerZ: t.z, minHeight: 0, maxHeight: 0, boundingSphereCenterX: t.x, boundingSphereCenterY: t.y, boundingSphereCenterZ: t.z, boundingSphereRadius: e.height, horizonOcclusionPointX: i.x, horizonOcclusionPointY: i.y, horizonOcclusionPointZ: i.z } } createQuantizedMeshData(e, t, i, o) { t = this.tilingScheme.tileXYToRectangle(t, i, o), i = new Cesium.Cartesian3(e.header.boundingSphereCenterX, e.header.boundingSphereCenterY, e.header.boundingSphereCenterZ), o = new Cesium.BoundingSphere(i, e.header.boundingSphereRadius), i = new Cesium.Cartesian3(e.header.horizonOcclusionPointX, e.header.horizonOcclusionPointY, e.header.horizonOcclusionPointZ); let r; return t.width < Cesium.Math.PI_OVER_TWO + Cesium.Math.EPSILON5 && (r = Cesium.OrientedBoundingBox.fromRectangle(t, e.header.minHeight, e.header.maxHeight)), new Cesium.QuantizedMeshTerrainData({ minimumHeight: e.header.minHeight, maximumHeight: e.header.maxHeight, quantizedVertices: e.vertexData, indices: e.triangleIndices, boundingSphere: o, orientedBoundingBox: r, horizonOcclusionPoint: i, westIndices: e.westIndices, southIndices: e.southIndices, eastIndices: e.eastIndices, northIndices: e.northIndices, westSkirtHeight: 100, southSkirtHeight: 100, eastSkirtHeight: 100, northSkirtHeight: 100, childTileMask: 15, credits: this.credits }) } generateDummyTile(e, t, i) { return Object.assign({}, this.dummyTile, this.generateDummyTileHeader(e, t, i)) } decodeResponse(e, t, i, o) { return e.arrayBuffer().then(e => un(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 << e) } } function zu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V, this._url = "", this._show = !0 } function Wu(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !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._primitiveByTile = {}, this._tileKeys = [], this._primitiveCollection = new this._cesium.PrimitiveCollection, this._cache = !1, this._forceRefreshPrvimitive = null } zu.prototype.createTerrainLayer = function (e, t, i, o, r, n) { "Topography" == n ? this.createTerrain(e, t, i, o, r) : "sgs" == n ? this.createSFSTerrain(e, t, i, o, r) : "Arcgis" == n ? this.createArcGISTerrain(e, t, i, o, r) : "Cesium" == r && this.createCesiumTerrain(e, t, i, o) }, zu.prototype.createTerrain = function (e, t, i, o, r) { var n, a = { type: "default", url: "", requestVertexNormals: !1, requestWaterMask: !1, requestMetadata: !0, credit: "" }, r = (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this.type = "createTerrain", null); return this._core.isUrl(t) ? (r = a).url = t : r = this._core.extend(a, t, !0), this._options = r, this._url = r.url, o ? (V.setVisibility(i, !1, this._viewer, this._cesium), a = new ("vector" === r.type ? Vu : Cesium.CesiumTerrainProvider)(r), n = (this._viewer.scene.terrainProvider = a, this.item = a, this._show = !0, { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }), this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)) : (n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.createCesiumTerrain = function (e, t, i, o) { this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.type = "createCesiumTerrain"; var r, n = this._core.extend({ requestVertexNormals: !0 }, t, !0), n = (this._options = n, Cesium.createWorldTerrain(n)); return this.type = "Cesium", this.item = n, o ? (V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.scene.terrainProvider = n, this._show = !0, r = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i)) : (r = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(r), this._tree.insertGroupId(r, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.createSFSTerrain = function (e, t, i, o, r) { var n, a = new Au(this._viewer, t); return this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this.type = "createSFSTerrain", this.type = "SGS", this._url = t.url, this.layerName = t.layerName, this.requestVertexNormals = t.requestVertexNormals, o ? (V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = a, this.item = a, this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)) : (this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.createSFSTerrain71 = function (e, t, i, o, r) { var n, a = new Ou(this._viewer, t); return this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this.type = "createSFSTerrain", this.type = "SGS71", this._url = t.url, this.layerName = t.layerName, this.requestVertexNormals = t.requestVertexNormals, o ? (V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = a, this.item = a, this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)) : (this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.createWMTSTerrain = function (e, t, i, o, r) { var n, a = new Uu({ url: t.url }); return this._viewer.scene.mode = this._cesium.SceneMode.COLUMBUS_VIEW, this.name = e, this.option = t, this.GroupID = i, this.checked = void 0 === o || o, this.Description = r, this.type = "createWMTSTerrain", this.type = "WMTSTerrain", this._url = t.url, this.layerName = t.layerName, this.requestVertexNormals = t.requestVertexNormals, this.checked ? (V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = a, this.item = a, this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)) : (this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.createArcGISTerrain = function (e, t, i, o, r) { var n, a = { url: "" }, r = (this.name = e, this.option = t, this.GroupID = i, this.checked = o, this.Description = r, this.type = "createArcGISTerrain", null), a = (this._core.isUrl(t) ? (r = a).url = t : r = this._core.extend(a, t, !0), this.type = "ArcGIS", this._url = r.url, new this._cesium.ArcGISTiledElevationTerrainProvider(r)); return o ? (V.setVisibility(i, !1, this._viewer, this._cesium), this._viewer.terrainProvider = a, this.item = a, this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)) : (this._show = !0, n = { id: t.id || this._core.getuid(), name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "terrain", item: this }, this.setTreeobj(n), this._tree.insertGroupId(n, this._core.isnull(i) ? 0 : i)), this }, zu.prototype.getType = function () { return { label: "影像", value: "TerrainProvider" } }, zu.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.item._layers[0].resource.url; return { type: "TerrainLayer", treeobj: { id: this.treeobj.id, name: this.treeobj.name, pId: this.treeobj.pId, type: this.treeobj.type }, style: { show: e, url: t } } }, zu.prototype.setVisibility = function (e) { var t, i; e ? (V.setVisibility(this.GroupID, !1, this._viewer, this._cesium), i = "SGS" === this.type ? (t = this.option, new Au(this._viewer, t)) : "SGS71" === this.type ? (t = this.option, new Ou(this._viewer, t)) : "ArcGIS" === this.type ? (t = this.option, new Cesium.ArcGISTiledElevationTerrainProvider(t)) : "Cesium" === this.type ? Cesium.createWorldTerrain(this._options) : (e = this._options, i = { url: "", requestVertexNormals: !1, requestWaterMask: !1, requestMetadata: !0, credit: "" }, this._core.isUrl(e) ? (t = i).url = e : t = this._core.extend(i, e, !0), new this._cesium.CesiumTerrainProvider(t)), this._show = !0, this.item = i) : (i = new this._cesium.EllipsoidTerrainProvider({}), this.item = i, this._show = !1), this._viewer.scene.terrainProvider = i }, zu.prototype.getVisibility = function () { return this._show }, zu.prototype.setTreeobj = function (e) { this.treeobj = e }, zu.prototype.deleteObject = function () { try { this.item = new this._cesium.EllipsoidTerrainProvider({}), this._viewer.scene.terrainProvider = this.item } catch (e) { console.log(e.message) } }, Object.defineProperties(zu.prototype, {}), Wu.prototype.createVolumeVectorGeoJsonFeatureLayer = function (o, r, e, a, s, t, i) { 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 }, l = (this._core.isnull(e) || this._core.isnull(e.material) || "[" == e.material.toString().charAt(0) && "]" == e.material.toString().charAt(e.material.length - 1) || (this._core.isHtmlColor(e.material) ? e.material = this._color.colorFromHtmlColor(e.material) : (/^rgb/.test(e.material) && (e.material = this._color.rgbaStringToRgbaObj(e.material)), 1 < e.material.r && (e.material.r = e.material.r / 255), 1 < e.material.g && (e.material.g = e.material.g / 255), 1 < e.material.b && (e.material.b = e.material.b / 255), 1 < e.material.a && (e.material.a = e.material.a / 255), e.material = this._color.createColor(e.material.r, e.material.g, e.material.b, e.material.a))), this._core.extend(n, e, !0)), c = (this._core.isnull(a) && (a = 16), this._core.isnull(s) && (s = 14), null == r && console.log("url is required"), null == o && console.log("layername is required"), []), u = this; this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = styleOption.level_max - 1, this._Provider.loadTile = function (e, t) { var i, n; (this.tile = t).state === u._cesium.QuadtreeTileLoadState.START && (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= s && t.level < a ? 0 != (i = C.filter(c, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && i[0].data && 0 < i[0].data.length ? (t.data.geometryPrimitive = new u._cesium.Primitive({ geometryInstances: i[0].data, appearance: new u._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: u._cesium.ShadowMode.ENABLED }), t.state = u._cesium.QuadtreeTileLoadState.LOADING, t.state === u._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = u._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, u._core.xhr({ url: r + "?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=" + o + "&STYLE=&TILEMATRIX=EPSG:4490:" + n.level + "&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL=" + n.x + "&TILEROW=" + n.y, type: "get", dataType: "json", success: function (e) { var t = []; for (var i = 0; i < e.features.length; i++) { var o = [], r = (!function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? e(t[i]) : o.push(t[i]) }(e.features[i].geometry.coordinates[0]), u._cesium.Cartesian3.fromDegreesArray(o)), r = (l.positions = r, new u._cesium.GeometryInstance({ geometry: new u._cesium.PolylineVolumeGeometry({ polylinePositions: l.positions }), attributes: { color: new u._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE) } })); t.push(r) } C.filter(c, function (e) { return e.x == n.x && e.y == n.y })[0].data = t, n.data.geometryPrimitive = new u._cesium.Primitive({ geometryInstances: t, appearance: new u._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: u._cesium.ShadowMode.ENABLED }) }, error: function () { c = C.remove(c, function (e) { return e.x == n.x && e.y == n.y && e.level == n.level }) }, complete: function () { n.state = u._cesium.QuadtreeTileLoadState.LOADING, n.state === u._cesium.QuadtreeTileLoadState.LOADING && (n.data.geometryPrimitive && n.data.geometryPrimitive.update(e, []), n.state = u._cesium.QuadtreeTileLoadState.DONE, n.renderable = !0) } })) : (t.state = u._cesium.QuadtreeTileLoadState.LOADING, t.state === u._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = u._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new u._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }), this._viewer.scene.primitives.add(this._primitive) }, Wu.prototype.createVolumeGeoJsonFeatureLayer1 = function (e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, c = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function (e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n.material) || (t = "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) ? n.material.replace(/\[/, "").replace("/]/", "") : C.clone(n.material), t = l._core.isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t.r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t.r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium.PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); c.push(r) } e = "material:" + 255 * t.red + "," + 255 * t.green + "," + 255 * t.blue, l.Legend.push(e), e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: c, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, Wu.prototype.computeCircle = function (e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, Wu.prototype.createVolumeGeoJsonFeatureLayerProvider1 = function (e, t, u, i, o, r) { var h = this, n = { show: !0, positions: [], shape: void 0, cornerType: this._cesium.CornerType.ROUNDED, granularity: this._cesium.Math.RADIANS_PER_DEGREE, fill: !0, material: this._cesium.Color.WHITE, outline: !1, outlineColor: this._cesium.Color.BLACK, outlineWidth: 1, shadows: this._cesium.ShadowMode.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, rectangle: this._cesium.Rectangle.fromDegrees(t.minx, t.miny, t.maxx, t.maxy), Cesium: this._cesium }, m = (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 < u.material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u.material.a && (u.material.a = u.material.a / 255), u.material = this._color.createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.extend(n, u, !0)), n = new v(this._viewer, this._cesium, a), d = (this._Provider = n, this), a = (n._loadTile = function (e) { var c = new d._cesium.PrimitiveCollection; return d.Legend = [], e.features.forEach(function (e) { var t = []; /^\[/.test(u.material) && /\]$/.test(u.material) && (s = u.material.replace(/\[/, "").replace(/\]/, ""), m.material = e.properties[s], h._core.isHtmlColor(m.material) ? m.material = h._color.colorFromHtmlColor(m.material) : (/^rgb/.test(m.material) && (m.material = h._color.rgbaStringToRgbaObj(m.material)), 1 < m.material.r && (m.material.r = m.material.r / 255), 1 < m.material.g && (m.material.g = m.material.g / 255), 1 < m.material.b && (m.material.b = m.material.b / 255), 1 < m.material.a && (m.material.a = m.material.a / 255), m.material = h._color.createColor(m.material.r, m.material.g, m.material.b, m.material.a))); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = d._cesium.Cartesian3.fromDegrees(n[0], n[1], m.height); t.push(n) } else { var a = d._cesium.Cartesian3.fromDegrees(o[0], o[1], m.height); t.push(a) } } m.position = t, e.positions = t, "0" == m.slttype || 0 == m.slttype ? m.shape = d._core.computeCircle(m.radius) : "1" == m.slttype || 1 == m.slttype ? m.shape = d._core.starPositions(m.number, m.exradius, m.inradius) : "2" != m.slttype && 2 != m.slttype || (s = m.orth_width / 2, l = m.orth_height / 2, m.shape = [new d._cesium.Cartesian2(-s, -l), new d._cesium.Cartesian2(s, -l), new d._cesium.Cartesian2(s, l), new d._cesium.Cartesian2(-s, l)]); var s = { polylinePositions: m.position, shapePositions: m.shape, cornerType: m.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new d._cesium.PolylineVolumeGeometry(s), s = new d._cesium.GeometryInstance({ id: e, geometry: l, attributes: { color: new d._cesium.ColorGeometryInstanceAttribute.fromColor(m.material) } }), l = "material:" + 255 * m.material.red + "," + 255 * m.material.green + "," + 255 * m.material.blue, l = (d.Legend.push(l), new d._cesium.Primitive({ allowPicking: !0, appearance: new d._cesium.MaterialAppearance({ material: new d._cesium.Material({ fabric: { type: "Color", uniforms: { color: m.material } } }), faceForward: !0, flat: !1 }), shadows: m.shadows, geometryInstances: s })); c.add(l) }), c }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(m.id) && (m.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + m.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: m.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: u }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, Wu.prototype.createVolumeGeoJsonFeatureLayerProvider = function (e, t, w, i, o, r) { var n, a = this, s = { 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, radiusScale: 1 }, 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, Cesium: this._cesium }, b = (this._core.isnull(w) || this._core.isnull(w.material) || "[" == w.material.toString().charAt(0) && "]" == w.material.toString().charAt(w.material.length - 1) || (this._core.isHtmlColor(w.material) ? w.material = this._color.colorFromHtmlColor(w.material) : (/^rgb/.test(w.material) && (w.material = this._color.rgbaStringToRgbaObj(w.material)), 1 < w.material.r && (w.material.r = w.material.r / 255), 1 < w.material.g && (w.material.g = w.material.g / 255), 1 < w.material.b && (w.material.b = w.material.b / 255), 1 < w.material.a && (w.material.a = w.material.a / 255), w.material = this._color.createColor(w.material.r, w.material.g, w.material.b, w.material.a))), this._core.extend({ ...s }, w, !0)); "string" == typeof b.radius && -1 < b.radius.indexOf("[") && -1 < b.radius.indexOf("]") ? (b.radius = b.radius.replace("[", ""), b.radius = b.radius.replace("]", ""), b.shape = void 0) : "0" == b.slttype || 0 == b.slttype ? (b.shape = this._core.computeCircle(b.radius), m = b.radius / 2, d = b.radius / 2, b.shape1 = [new this._cesium.Cartesian2(-m, -d), new this._cesium.Cartesian2(m, -d), new this._cesium.Cartesian2(m, d), new this._cesium.Cartesian2(-m, d)]) : "1" == b.slttype || 1 == b.slttype ? b.shape = this._core.starPositions(b.number, b.exradius, b.inradius) : "2" != b.slttype && 2 != b.slttype || (m = b.orth_width / 2, d = b.orth_height / 2, b.shape = [new this._cesium.Cartesian2(-m, -d), new this._cesium.Cartesian2(m, -d), new this._cesium.Cartesian2(m, d), new this._cesium.Cartesian2(-m, d)]); let c = -1 < t.url.indexOf("/gisserver/"); n = c ? t.url + `/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json` : t.url + "?" + this._serialize(l.urlParams), this._urlTemplate = n, this._Provider = new T(this._viewer, this._cesium, c ? new Cesium.WebMercatorTilingScheme : void 0), this._Provider._normalTile = w.level_max - 1, this._Provider._minimumHeight = parseFloat(w.height || 0), this.item.show = o, this.initThisProvider = () => { 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.level < w.level_max && v.item.show) { if (c && (y.reverseY = v._Provider.tilingScheme.getNumberOfYTilesAtLevel(y.level) - y.y - 1), v.TileMatrixLimits) { var i = v.TileMatrixLimits[y.level]; if (!i || y.x > i.maxCol || y.x < i.minCol || y.y > i.maxRow || y.y < i.minRow) return void (y.state = Cesium.QuadtreeTileLoadState.DONE, y.renderable = !0) } i = n.replace(window.encodeURIComponent("{x}"), y.x).replace(window.encodeURIComponent("{y}"), y.reverseY || y.y).replace(window.encodeURIComponent("{z}"), y.level); v._cache && (i += "&" + v._core.getuid()), v._core.xhr({ url: i, type: "get", dataType: "json", success: function (t) { if (null == t) y.state = Cesium.QuadtreeTileLoadState.DONE, y.renderable = !0; else { if (!b.shape && "string" == typeof b.radius && 0 < t.features.length) { let e; t.features[0] && t.features[0].properties[b.radius] ? (e = t.features[0].properties[b.radius]).indexOf && (-1 < e.indexOf("*") || -1 < e.indexOf("x") || -1 < e.indexOf("X")) ? (-1 < e.indexOf("*") ? e = e.split("*") : -1 < e.indexOf("X") ? e = e.split("X") : -1 < e.indexOf("x") && (e = e.split("x")), f = parseFloat(e[0]) * b.radiusScale, _ = parseFloat(e[1]) * b.radiusScale, b.shape = [new v._cesium.Cartesian2(-f, -_), new v._cesium.Cartesian2(f, -_), new v._cesium.Cartesian2(f, _), new v._cesium.Cartesian2(-f, _)]) : b.shape = v._core.computeCircle(e * b.radiusScale) : b.shape = v._core.computeCircle(.5) } v.Legend = []; for (var e = [], i = 0; i < t.features.length; i++) { for (var o = t.features[i], r = (/^\[/.test(w.material) && /\]$/.test(w.material) && (p = w.material.replace(/\[/, "").replace(/\]/, ""), b.material = o.properties[p], v._core.isHtmlColor(b.material) ? b.material = v._color.colorFromHtmlColor(b.material) : (/^rgb/.test(b.material) && (b.material = v._color.rgbaStringToRgbaObj(b.material)), 1 < b.material.r && (b.material.r = b.material.r / 255), 1 < b.material.g && (b.material.g = b.material.g / 255), 1 < b.material.b && (b.material.b = b.material.b / 255), 1 < b.material.a && (b.material.a = b.material.a / 255), b.material = v._color.createColor(b.material.r, b.material.g, b.material.b, b.material.a))), []), n = [], a = parseFloat(w.height || 0), s = 0; s < o.geometry.coordinates.length; s++) { var l = o.geometry.coordinates[s]; if (0 < l.length) if (Array.isArray(l[0])) for (var c = 0; c < l.length; c++) { var u = l[c], a = a < (u[2] || 0) ? u[2] || 0 : a, u = v._cesium.Cartesian3.fromDegrees(u[0], u[1], b.height); r.push(u), n.push(b.material) } else { a = a < (l[2] || 0) ? l[2] || 0 : a; var h = v._cesium.Cartesian3.fromDegrees(l[0], l[1], b.height); r.push(h), n.push(b.material) } } y._minimumHeight = a, b.position = r, o.positions = r; var m, d = "", p = "", g = (p = "0" != b.slttype && 0 != b.slttype || y.level >= parseFloat(w.level_max) - 8 && 19 < parseFloat(w.level_max) || y.level >= parseFloat(w.level_max) - 4 && 16 < parseFloat(w.level_max) || y.level >= 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 } else y.state = Cesium.QuadtreeTileLoadState.DONE, y.renderable = !0 }, "function" == typeof r && r(this.item) }; let u, 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 < e.radius.indexOf("[") && -1 < e.radius.indexOf("]") ? (b.radius = b.radius.replace("[", ""), b.radius = b.radius.replace("]", ""), b.shape = void 0) : e.radius && ("0" == b.slttype || 0 == b.slttype ? (b.shape = this._core.computeCircle(b.radius), t = b.radius / 2, i = b.radius / 2, b.shape1 = [new this._cesium.Cartesian2(-t, -i), new this._cesium.Cartesian2(t, -i), new this._cesium.Cartesian2(t, i), new this._cesium.Cartesian2(-t, i)]) : "1" == b.slttype || 1 == b.slttype ? b.shape = this._core.starPositions(b.number, b.exradius, b.inradius) : "2" != b.slttype && 2 != b.slttype || (t = b.orth_width / 2, i = b.orth_height / 2, b.shape = [new this._cesium.Cartesian2(-t, -i), new this._cesium.Cartesian2(t, -i), new this._cesium.Cartesian2(t, i), new this._cesium.Cartesian2(-t, i)])), w = a._core.extend(w, e, !0), b = a._core.extend(b, w, !0), a._Provider._normalTile = w.level_max - 1, a._primitive && a._primitive._tilesToRender && a._primitive._tilesToRender.length && (clearTimeout(u), u = setTimeout(() => { 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) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), m.add(this._primitive), this._core.getWMTSData({ url: t.url, layer: t.layer, srs: t.srs || "EPSG:4490", gisserverTMS: c }, 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 Yu = "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 Ju(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, 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 } Wu.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Yu(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, Wu.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.material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h.material.b = h.material.b / 255), 1 < h.material.a && (h.material.a = h.material.a / 255), h.material = this._color.createColor(h.material.r, h.material.g, h.material.b, h.material.a))), this), d = this._core.extend(a, h, !0), l = ("0" == d.slttype || 0 == d.slttype ? d.shape = m._core.computeCircle(d.radius) : "1" == d.slttype || 1 == d.slttype ? d.shape = m._core.starPositions(d.number, d.exradius, d.inradius) : "2" != d.slttype && 2 != d.slttype || (a = d.orth_width / 2, n = d.orth_height / 2, d.shape = [new m._cesium.Cartesian2(-a, -n), new m._cesium.Cartesian2(a, -n), new m._cesium.Cartesian2(a, n), new m._cesium.Cartesian2(-a, n)]), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []); this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = h.level_max - 1, this._Provider.loadTile = function (e, t) { var u, i, o; this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && m.item.show && (u = "z" + t.level + "x" + t.x + "y" + t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= h.level_min && t.level < h.level_max && m.item.show ? m.Primitivekey.includes(u) || (i = t, o = m._urlTemplate.replace(window.encodeURIComponent("{x}"), i.x).replace(window.encodeURIComponent("{y}"), i.y).replace(window.encodeURIComponent("{z}"), i.level), m.tilesLength++, m._cache && (o += "&" + m._core.getuid()), m._core.xhr({ url: o, type: "get", dataType: "json", success: function (e) { var i = [], o = new m._cesium.PrimitiveCollection; function r(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? r(e[t]) : s.push(e[t]) } function t() { /^\[/.test(h.material) && /\]$/.test(h.material) && (e = h.material.replace(/\[/, "").replace(/\]/, ""), d.material = l.properties[e], m._core.isHtmlColor(d.material) ? d.material = m._color.colorFromHtmlColor(d.material) : (/^rgb/.test(d.material) && (d.material = m._color.rgbaStringToRgbaObj(d.material)), 1 < d.material.r && (d.material.r = d.material.r / 255), 1 < d.material.g && (d.material.g = d.material.g / 255), 1 < d.material.b && (d.material.b = d.material.b / 255), 1 < d.material.a && (d.material.a = d.material.a / 255), d.material = m._color.createColor(d.material.r, d.material.g, d.material.b, d.material.a))); var e = m._cesium.Cartesian3.fromDegreesArray(s), e = (d.position = e, l.positions = e, { polylinePositions: d.position, shapePositions: d.shape, cornerType: d.cornerType }), e = new m._cesium.PolylineVolumeGeometry(e), e = new m._cesium.GeometryInstance({ id: l, geometry: e, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(d.material) } }), t = "material:" + 255 * d.material.red + "," + 255 * d.material.green + "," + 255 * d.material.blue, t = (m.Legend.push(t), i.push(e), new m._cesium.Primitive({ allowPicking: !0, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: d.material } } }), faceForward: !0, flat: !1 }), shadows: d.shadows, geometryInstances: e })); o.add(t) } m.Legend = []; for (var n, a = 0; a < e.features.length; a++) { var s = [], l = e.features[a]; if (Array.isArray(l.geometry.coordinates) && 0 < l.geometry.coordinates.length) if (Array.isArray(l.geometry.coordinates[0][0])) for (var c = 0; c < l.geometry.coordinates.length; c++)s = [], l.geometry.coordinates[c].pop(), r(l.geometry.coordinates[c]), 2 < s.length && t(); else r(l.geometry.coordinates), 2 < s.length && t() } 0 < i.length && (m.PrimitiveObj.data = o, m.PrimitiveObj.key = m.Primitivekey[m.returnCount], n = { key: m.Primitivekey[m.returnCount], data: o }, m.PrimitiveData.push(n), m._primitiveCollection.add(o), m._viewer.scene.primitives.add(o), m.datas.push(o), m.returnCount++, m._primitiveByTile[u] = o) }, error: function () { l = C.remove(l, function (e) { return e.x == i.x && e.y == i.y && e.level == i.level }) }, complete: function (e, t) { i.state = m._cesium.QuadtreeTileLoadState.LOADING, i.state === m._cesium.QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive && (i.state = m._cesium.QuadtreeTileLoadState.DONE), i.renderable = !0) } })) : (t.state = m._cesium.QuadtreeTileLoadState.LOADING, t.state === m._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = m._cesium.QuadtreeTileLoadState.DONE), t.renderable = !0))) }, this._primitive = new m._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider, tileCacheSize: 1, maximumScreenSpaceError: 3 }); this._viewer.scene.primitives.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: h }; this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, Wu.prototype.setTreeobj = function (e) { this.treeobj = e }, Wu.prototype._removeObsoletePrimitives = function (e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, Wu.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Wu.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, Wu.prototype.getLegend = function () { var e = []; return e = null != this.Legend ? this._core.unique(this.Legend) : e }, Wu.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(!e) } catch (e) { } }, Wu.prototype.setVisibility = function (e) { this.item.show = e, this._Provider && this._Provider.setStatus(e) }, Wu.prototype.isCache = function (e) { this._cache = e }, Wu.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, Wu.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }; var Ku = "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 Qu(e, t) { this._viewer = e, this._cesium = t, this.SkyBoxFS = "uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n", this.SkyBoxVS = "attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n" } function qu(e, t) { this._viewer = e, this._cesium = t, this._core = new f } Ju.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : Ku(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, Ju.prototype.createVolumeVectorGeoJsonFeatureLayer = 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 }, c = (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.material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o.material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._option = this._core.extend(a, o, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), u = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this; this._urlTemplate = t.url + "?" + this._core._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function (i, t) { var l, e; (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h.item.show && (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && h.item.show ? 0 != (e = C.filter(c, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && e[0].data && 0 < e[0].data.length ? (t.data.geometryPrimitive = new h._cesium.Primitive({ geometryInstances: e[0].data, appearance: new h._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._cesium.ShadowMode.ENABLED }), t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(), t.state = h._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (c.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), l = t, e = h._urlTemplate.replace(window.encodeURIComponent("{x}"), l.x).replace(window.encodeURIComponent("{y}"), l.y).replace(window.encodeURIComponent("{z}"), l.level), h._cache && (e += "&" + h._core.getuid()), h._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function t() { /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) ? (e = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), u.extrudedHeight = parseFloat(a.properties[e])) : u.extrudedHeight = parseFloat(h._option.extrudedHeight), u.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), u.material = a.properties[e], h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.red && (u.material.red = u.material.red / 255), 1 < u.material.green && (u.material.green = u.material.green / 255), 1 < u.material.blue && (u.material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u.material.alpha / 255), u.material = h._color.createColor(u.material.red, u.material.green, u.material.blue, u.material.alpha))) : (h._option.material && (u.material = h._option.material), u.material && (h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.red && (u.material.red = u.material.red / 255), 1 < u.material.green && (u.material.green = u.material.green / 255), 1 < u.material.blue && (u.material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u.material.alpha / 255), u.material = h._color.createColor(u.material.red, u.material.green, u.material.blue, u.material.alpha)))); var e = h._cesium.Cartesian3.fromDegreesArray(n), e = (u.polygonHierarchy = new h._cesium.PolygonHierarchy(e), new h._cesium.PolygonGeometry(u)), e = h._cesium.PolygonGeometry.createGeometry(e), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }), t = "material:" + 255 * u.material.red + "," + 255 * u.material.green + "," + 255 * u.material.blue; h.Legend.push(t), i.push(e) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)n = [], a.geometry.coordinates[s].pop(), o(a.geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } l.data.geometryPrimitive = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), shadows: h._option.shadows }) }, error: function () { c = C.remove(c, function (e) { return e.x == l.x && e.y == l.y && e.level == l.level }) }, complete: function (e, t) { l.state = h._cesium.QuadtreeTileLoadState.LOADING, l.state === h._cesium.QuadtreeTileLoadState.LOADING && (l.data.geometryPrimitive && l.data.geometryPrimitive.update(i), l.state = h._cesium.QuadtreeTileLoadState.DONE, l.renderable = !0) } })) : (t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(i, []), t.state = h._cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new h._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); a = this._viewer.scene.primitives, o && o.time && (this._Provider._availability = new h._cesium.TimeIntervalCollection([new h._cesium.TimeInterval({ start: o.time.start ? h._cesium.JulianDate.fromDate(new Date(o.time.start)) : h._cesium.Iso8601.MINIMUM_VALUE, stop: o.time.end ? h._cesium.JulianDate.fromDate(new Date(o.time.end)) : h._cesium.Iso8601.MAXIMUM_VALUE })]), this._Provider.isAvailable = function (e) { var t; if (Cesium.defined(e)) return t = this._availability, !Cesium.defined(t) || t.contains(e); throw new Cesium.DeveloperError("time is required.") }), a.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, s = { id: u.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item) }, Ju.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization = function (e, t, a, 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 }, 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(a) || this._core.isnull(a.material) || "[" == a.material.toString().charAt(0) && "]" == a.material.toString().charAt(a.material.length - 1) || (this._core.isHtmlColor(a.material) ? a.material = this._color.colorFromHtmlColor(a.material) : (/^rgb/.test(a.material) && (a.material = this._color.rgbaStringToRgbaObj(a.material)), 1 < a.material.r && (a.material.r = a.material.r / 255), 1 < a.material.g && (a.material.g = a.material.g / 255), 1 < a.material.b && (a.material.b = a.material.b / 255), 1 < a.material.a && (a.material.a = a.material.a / 255), a.material = this._color.createColor(a.material.r, a.material.g, a.material.b, a.material.a))), this._option = this._core.extend(n, a, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), u = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: this._cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: this._cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: this._cesium.ArcType.GEODESIC, material: this._cesium.Color.RED }, h = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = a.level_max - 1, this._Provider.loadTile = function (e, t) { if (this.tile = null, (this.tile = t).state === this._cesium.QuadtreeTileLoadState.START && h.item.show) { var i = "z" + t.level + "x" + t.x + "y" + t.y; if (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= a.level_min && t.level < a.level_max && h.item.show) { var o = C.filter(l, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level }); if (0 != o.length && o[0].data && 0 < o[0].data.length) t.data.geometryPrimitive = new h._cesium.Primitive({ geometryInstances: o[0].data, appearance: new h._cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: h._cesium.ShadowMode.ENABLED }), t.state = h._cesium.QuadtreeTileLoadState.LOADING, t.state === h._cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && (t.state = h._cesium.QuadtreeTileLoadState.DONE), t.renderable = !0); else { if (0 < h.PrimitiveData.length) for (var r = 0; r < h.PrimitiveData.length; r++)if (h.PrimitiveData[r].key == i) return void h.Primitivekey.push(i); h.Primitivekey.includes(i) || (h.Primitivekey.push(i), l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), n = t, o = h._urlTemplate.replace(window.encodeURIComponent("{x}"), n.x).replace(window.encodeURIComponent("{y}"), n.y).replace(window.encodeURIComponent("{z}"), n.level), h._cache && (o += "&" + h._core.getuid()), h.tilesLength++, h._core.xhr({ url: o, type: "get", dataType: "json", success: function (e) { var i = []; function o(e) { for (var t = 0; t < e.length; t++)Array.isArray(e[t]) ? o(e[t]) : n.push(e[t]) } function t() { /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) && (e = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), u.extrudedHeight = parseFloat(a.properties[e])), u.extrudedHeight = parseFloat(h._option.extrudedHeight), u.material = h._option.material, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (e = h._option.material.replace(/\[/, "").replace(/\]/, ""), u.material = a.properties[e], h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.red && (u.material.red = u.material.red / 255), 1 < u.material.green && (u.material.green = u.material.green / 255), 1 < u.material.blue && (u.material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u.material.alpha / 255), u.material = h._color.createColor(u.material.red, u.material.green, u.material.blue, u.material.alpha))) : (h._option.material && (u.material = h._option.material), u.material && (h._core.isHtmlColor(u.material) ? u.material = h._color.colorFromHtmlColor(u.material) : (/^rgb/.test(u.material) && (u.material = h._color.rgbaStringToRgbaObj(u.material)), 1 < u.material.red && (u.material.red = u.material.red / 255), 1 < u.material.green && (u.material.green = u.material.green / 255), 1 < u.material.blue && (u.material.blue = u.material.blue / 255), 1 < u.material.alpha && (u.material.a = u.material.alpha / 255), u.material = h._color.createColor(u.material.red, u.material.green, u.material.blue, u.material.alpha)))); var e = h._cesium.Cartesian3.fromDegreesArray(n), e = (u.polygonHierarchy = new h._cesium.PolygonHierarchy(e), new h._cesium.PolygonGeometry(u)), e = new h._cesium.GeometryInstance({ id: a, geometry: e, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(u.material) } }), t = "material:" + 255 * u.material.red + "," + 255 * u.material.green + "," + 255 * u.material.blue; h.Legend.push(t), i.push(e) } h.Legend = []; for (var r = 0; r < e.features.length; r++) { var n = [], a = e.features[r]; if (Array.isArray(a.geometry.coordinates) && 0 < a.geometry.coordinates.length) if (Array.isArray(a.geometry.coordinates[0][0])) for (var s = 0; s < a.geometry.coordinates.length; s++)n = [], a.geometry.coordinates[s].pop(), o(a.geometry.coordinates[s]), t(); else o(a.geometry.coordinates), t() } var l = new h._cesium.Primitive({ geometryInstances: i, appearance: new h._cesium.PerInstanceColorAppearance({ translucent: !1, vertexShaderSource: h._core.Shaders("vertexShaderSource"), fragmentShaderSource: h._core.Shaders("fragmentShaderSource") }), shadows: h._option.shadows }), c = (h.PrimitiveObj.data = l, h.PrimitiveObj.key = h.Primitivekey[h.returnCount], { key: h.Primitivekey[h.returnCount], data: l }); h.PrimitiveData.push(c), h._viewer.scene.primitives.add(l), h.datas.push(l), h.returnCount++, h.returnCount >= h.tilesLength && (h.returnCount = 0, h.tilesLength = 0, h.Primitivekey = []) }, error: function () { l = C.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(u.id) && (u.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + u.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; n = { id: u.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) }, Ju.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.material.r && (o.material.r = o.material.r / 255), 1 < o.material.g && (o.material.g = o.material.g / 255), 1 < o.material.b && (o.material.b = o.material.b / 255), 1 < o.material.a && (o.material.a = o.material.a / 255), o.material = this._color.createColor(o.material.r, o.material.g, o.material.b, o.material.a))), this._core.isnull(o) || this._core.isnull(o.outlineColor) || "[" == o.outlineColor.toString().charAt(0) && "]" == o.outlineColor.toString().charAt(o.outlineColor.length - 1) || (this._core.isHtmlColor(o.outlineColor) ? o.outlineColor = this._color.colorFromHtmlColor(o.outlineColor) : (/^rgb/.test(o.outlineColor) && (o.outlineColor = this._color.rgbaStringToRgbaObj(o.outlineColor)), 1 < o.outlineColor.r && (o.outlineColor.r = o.outlineColor.r / 255), 1 < o.outlineColor.g && (o.outlineColor.g = o.outlineColor.g / 255), 1 < o.outlineColor.b && (o.outlineColor.b = o.outlineColor.b / 255), 1 < o.outlineColor.a && (o.outlineColor.a = o.outlineColor.a / 255), o.outlineColor = this._color.createColor(o.outlineColor.r, o.outlineColor.g, o.outlineColor.b, o.outlineColor.a))), this._option = this._core.extend(a, o, !0), null == t && console.log("geoOptions is required"), null == e && console.log("layername is required"), []), h = { polygonHierarchy: void 0, height: 0, extrudedHeight: 0, vertexFormat: Cesium.VertexFormat.DEFAULT, stRotation: 0, ellipsoid: Cesium.Ellipsoid.WGS84, perPositionHeight: !0, closeTop: !0, closeBottom: !0, arcType: Cesium.ArcType.GEODESIC, material: Cesium.Color.RED }, m = this, a = (this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), t.url.split("geoserver")[0] + "geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=" + s.urlParams.LAYER + "&outputFormat=application%2Fjson"); m._core.xhr({ url: a, type: "get", async: !1, dataType: "json", success: function (e) { m.datas = e.features } }), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function (i, t) { var u, e; (this.tile = t).state === Cesium.QuadtreeTileLoadState.START && m.item.show && (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && m.item.show ? 0 != (e = C.filter(l, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && e[0].data && 0 < e[0].data.length ? (t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: e[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), u = t, e = m._urlTemplate.replace(window.encodeURIComponent("{x}"), u.x).replace(window.encodeURIComponent("{y}"), u.y).replace(window.encodeURIComponent("{z}"), u.level), m._cache && (e += "&" + m._core.getuid()), m._core.xhr({ url: e, type: "get", dataType: "json", success: function (e) { var t = []; m.Legend = []; for (var i, o, r = 0; r < e.features.length; r++) { var n = [], a = e.features[r].id, a = parseInt(a.split(".")[1]) + 1, s = m.datas[a]; if (Array.isArray(s.geometry.coordinates) && 0 < s.geometry.coordinates.length && Array.isArray(s.geometry.coordinates[0][0][0])) for (var l = 0; l < s.geometry.coordinates[0].length; l++)n = [], function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? (3 == t[i].length && (t[i].splice(2, 1), t[i].push(this._option.height)), e(t[i])) : n.push(t[i]) }(s.geometry.coordinates[0][l]), o = i = void 0, /^\[/.test(m._option.extrudedHeight) && /\]$/.test(m._option.extrudedHeight) ? (i = m._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), h.extrudedHeight = parseFloat(s.properties[i])) : h.extrudedHeight = parseFloat(m._option.extrudedHeight), h.material = m._option.material, /^\[/.test(m._option.material) && /\]$/.test(m._option.material) ? (i = m._option.material.replace(/\[/, "").replace(/\]/, ""), h.material = s.properties[i], m._core.isHtmlColor(h.material) ? h.material = m._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = m._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.red && (h.material.red = h.material.red / 255), 1 < h.material.green && (h.material.green = h.material.green / 255), 1 < h.material.blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h.material.alpha / 255), h.material = m._color.createColor(h.material.red, h.material.green, h.material.blue, h.material.alpha))) : (m._option.material && (h.material = m._option.material), h.material && (m._core.isHtmlColor(h.material) ? h.material = m._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = m._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.red && (h.material.red = h.material.red / 255), 1 < h.material.green && (h.material.green = h.material.green / 255), 1 < h.material.blue && (h.material.blue = h.material.blue / 255), 1 < h.material.alpha && (h.material.a = h.material.alpha / 255), h.material = m._color.createColor(h.material.red, h.material.green, h.material.blue, h.material.alpha)))), i = Cesium.Cartesian3.fromDegreesArrayHeights(n), h.polygonHierarchy = new Cesium.PolygonHierarchy(i), i = { positions: Cesium.Cartesian3.fromDegreesArrayHeights(n), width: m._option.outlineWidth, color: Cesium.ColorGeometryInstanceAttribute.fromColor(m._option.outlineColor) }, i = new Cesium.PolylineGeometry(i), i = new Cesium.GeometryInstance({ geometry: i }), o = "material:" + 255 * h.material.red + "," + 255 * h.material.green + "," + 255 * h.material.blue, m.Legend.push(o), t.push(i) } var c = new Cesium.PrimitiveCollection; c.add(new Cesium.Primitive({ geometryInstances: t, appearance: new Cesium.PolylineColorAppearance })), u.data.geometryPrimitive = c }, error: function () { l = C.remove(l, function (e) { return e.x == u.x && e.y == u.y && e.level == u.level }) }, complete: function (e, t) { u.state = Cesium.QuadtreeTileLoadState.LOADING, u.state === Cesium.QuadtreeTileLoadState.LOADING && (u.data.geometryPrimitive && u.data.geometryPrimitive.update(i), u.state = Cesium.QuadtreeTileLoadState.DONE, u.renderable = !0) } })) : (t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(i, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new m._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; s = { id: h.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; return this.setTreeobj(s), this._tree.insertGroupId(s, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item), this }, Ju.prototype.createVolumeVectorGeoJsonFeatureLayerDth = 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._option = this._core.extend(a, o, !0), null == t && console.log("url is required"), null == e && console.log("layername is required"), []), u = (Cesium.VertexFormat.DEFAULT, Cesium.Ellipsoid.WGS84, Cesium.ArcType.GEODESIC, Cesium.Color.WHITE), h = this; this._urlTemplate = t.url + "?" + this._serialize(s.urlParams), this._Provider = new T(this._viewer, this._cesium), this._Provider._normalTile = o.level_max - 1, this._Provider.loadTile = function (e, t) { var c, i; this.tile = t, _serialize, t.state === Cesium.QuadtreeTileLoadState.START && h.item.show && (t.level, t.x, t.y, t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= o.level_min && t.level < o.level_max && h.item.show ? 0 != (i = C.filter(l, function (e) { return e.x == t.x && e.y == t.y && e.level == t.level })).length && i[0].data && 0 < i[0].data.length ? (t.data.geometryPrimitive = new Cesium.Primitive({ geometryInstances: i[0].data, appearance: new Cesium.PerInstanceColorAppearance({ flat: !0, translucent: !0, faceForward: !0, closed: !0 }), shadows: Cesium.ShadowMode.ENABLED }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) : (l.push({ level: t.level, x: t.x, y: t.y, data: void 0 }), c = t, i = h._urlTemplate.replace(window.encodeURIComponent("{x}"), c.x).replace(window.encodeURIComponent("{y}"), c.y).replace(window.encodeURIComponent("{z}"), c.level), h._cache && (i += "&" + h._core.getuid()), h._core.xhr({ url: i, type: "get", dataType: "json", success: function (e) { var t = [], i = (h.Legend = [], new h._cesium.PrimitiveCollection); for (var o = 0; o < e.features.length; o++) { var r, n = [], a = e.features[o], s = (!function e(t) { for (var i = 0; i < t.length; i++)Array.isArray(t[i]) ? e(t[i]) : n.push(t[i]) }(e.features[o].geometry.coordinates[0]), /^\[/.test(h._option.extrudedHeight) && /\]$/.test(h._option.extrudedHeight) ? (r = h._option.extrudedHeight.replace(/\[/, "").replace(/\]/, ""), h._option.extrudedHeight = parseFloat(a.properties[r])) : h._option.extrudedHeight = parseFloat(h._option.extrudedHeight), 1 == h._option.heightReference && delete h._option.height, 1 == h._option.extrudedHeightReference && delete h._option.extrudedHeight, /^\[/.test(h._option.material) && /\]$/.test(h._option.material) ? (r = h._option.material.replace(/\[/, "").replace(/\]/, ""), h._option.material = a.properties[r], h._core.isHtmlColor(h._option.material) ? h._option.material = h._color.colorFromHtmlColor(h._option.material) : (/^rgb/.test(h._option.material) && (h._option.material = h._color.rgbaStringToRgbaObj(h._option.material)), 1 < h._option.material.red && (h._option.material.red = h._option.material.red / 255), 1 < h._option.material.green && (h._option.material.green = h._option.material.green / 255), 1 < h._option.material.blue && (h._option.material.blue = h._option.material.blue / 255), 1 < h._option.material.alpha && (h._option.material.a = h._option.material.alpha / 255), h._option.material = h._color.createColor(h._option.material.red, h._option.material.green, h._option.material.blue, h._option.material.alpha))) : (h._option.material && (h._option.material = h._option.material), h._option.material && (h._core.isHtmlColor(h._option.material) ? h._option.material = h._color.colorFromHtmlColor(h._option.material) : (/^rgb/.test(h._option.material) && (h._option.material = h._color.rgbaStringToRgbaObj(h._option.material)), 1 < h._option.material.red && (h._option.material.red = h._option.material.red / 255), 1 < h._option.material.green && (h._option.material.green = h._option.material.green / 255), 1 < h._option.material.blue && (h._option.material.blue = h._option.material.blue / 255), 1 < h._option.material.alpha && (h._option.material.a = h._option.material.alpha / 255), h._option.material = h._color.createColor(h._option.material.red, h._option.material.green, h._option.material.blue, h._option.material.alpha)))), Cesium.Cartesian3.fromDegreesArray(n)), s = (a.positions = s, h._option.polygonHierarchy = new Cesium.PolygonHierarchy(s), new Cesium.PolygonGeometry(h._option)), s = Cesium.PolygonGeometry.createGeometry(s), l = "material:" + 255 * u.red + "," + 255 * u.green + "," + 255 * u.blue, l = (h.Legend.push(l), new Cesium.GeometryInstance({ id: a, geometry: s, attributes: { color: new h._cesium.ColorGeometryInstanceAttribute.fromColor(h._option.material) } }), new Cesium.ClassificationPrimitive({ geometryInstances: t, appearance: new Cesium.PerInstanceColorAppearance({ closed: !0, flat: !1 }), classificationType: h._option.classificationType, shadows: Cesium.ShadowMode.ENABLED })); i.add(l) } c.data.geometryPrimitive = i }, error: function () { l = C.remove(l, function (e) { return e.x == c.x && e.y == c.y && e.level == c.level }) }, complete: function () { c.state = Cesium.QuadtreeTileLoadState.LOADING, c.state === Cesium.QuadtreeTileLoadState.LOADING && (c.data.geometryPrimitive && c.data.geometryPrimitive.update(e, []), c.state = Cesium.QuadtreeTileLoadState.DONE, c.renderable = !0) } })) : (t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive && t.data.geometryPrimitive.update(e, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0))) }, this._primitive = new h._cesium.QuadtreePrimitive({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), r || this.setVisibility(!1), this._core.isnull(h._option.id) && (h._option.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h._option.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy; a = { id: h._option.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polygonLayer", item: this, url: t.url, style: o }; this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof n && n(this.item) }, Ju.prototype.createVolumeGeoJsonFeatureLayer = function (e, t, n, i, a) { var s = { polylinePositions: void 0, shapePositions: void 0, ellipsoid: this._cesium.Ellipsoid.WGS84, granularity: this._cesium.Math.RADIANS_PER_DEGREE, vertexFormat: this._cesium.VertexFormat.DEFAULT, cornerType: this._cesium.CornerType.ROUNDED }, o = (null == t && console.log("geojson is required"), null), o = t.then ? t : this._cesium.GeoJsonDataSource.load(t), l = this, c = [], t = (s.shapePositions = this.computeCircle(n.radius), o.then(function (e) { for (var t = l._cesium.Color.WHITE, i = (l._core.isnull(n) || l._core.isnull(n.material) || (t = "[" == n.material.toString().charAt(0) && "]" == n.material.toString().charAt(n.material.length - 1) ? n.material.replace(/\[/, "").replace("/]/", "") : C.clone(n.material), t = l._core.isHtmlColor(t) ? l._color.colorFromHtmlColor(n.material) : (1 < (t = /^rgb/.test(t) ? l._color.rgbaStringToRgbaObj(t) : t).r && (t.r = t.r / 255), 1 < t.g && (t.g = t.g / 255), 1 < t.b && (t.b = t.b / 255), 1 < t.a && (t.a = t.a / 255), l._color.createColor(t.r, t.g, t.b, t.a))), e.entities.values), o = 0; o < i.length; o++) { var r = i[o], r = (s.polylinePositions = r.polyline.positions._value, new l._cesium.PolylineVolumeGeometry(s)), r = l._cesium.PolylineVolumeGeometry.createGeometry(r), r = new l._cesium.GeometryInstance({ geometry: r }); c.push(r) } e = l._viewer.scene.primitives.add(new l._cesium.Primitive({ geometryInstances: c, appearance: new l._cesium.MaterialAppearance({ material: new l._cesium.Material({ fabric: { type: "Color", uniforms: { color: t } } }), faceForward: !0, flat: !1 }) })); l.item = e, 0 == n.show && (e.show = !1), "function" == typeof a && a(e) }), this._core.isnull(n.id) && (n.id = this._core.getuid()), this._core.isnull(e) && (e = "新建管状图层" + n.id), { id: n.id, name: e, checked: !0, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: geoOptions.url, style: n }); return this.setTreeobj(t), this._tree.insertGroupId(t, this._core.isnull(i) ? 0 : i), this }, Ju.prototype.computeCircle = function (e) { this._core.isnull(e) && (e = 4); for (var t = [], i = 0; i < 360; i++) { var o = this._cesium.Math.toRadians(i); t.push(new this._cesium.Cartesian2(e * Math.cos(o), e * Math.sin(o))) } return t }, Ju.prototype.createVolumeGeoJsonFeatureLayerProvider = 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.RECEIVE_ONLY }, a = { url: t.url, urlParams: { REQUEST: "GetTile", SERVICE: "WMTS", VERSION: "1.0.0", LAYER: t.layer, STYLE: "", TILEMATRIX: "EPSG:4490:{z}", TILEMATRIXSET: "EPSG:4490", FORMAT: "application/json;type=geojson", TILECOL: "{x}", TILEROW: "{y}" }, upperLevelLimit: t.upperLevelLimit, lowerLevelLimit: t.lowerLevelLimit, Cesium: this._cesium }, h = (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 < u.material.r && (u.material.r = u.material.r / 255), 1 < u.material.g && (u.material.g = u.material.g / 255), 1 < u.material.b && (u.material.b = u.material.b / 255), 1 < u.material.a && (u.material.a = u.material.a / 255), u.material = this._color.createColor(u.material.r, u.material.g, u.material.b, u.material.a))), this._core.extend(n, u, !0)), n = new v(this._viewer, this._cesium, a), m = (this._Provider = n, this), a = (n._loadTile = function (e) { var c = new m._cesium.PrimitiveCollection; return e.features.forEach(function (e) { var t = []; /^\[/.test(u.material) && /\]$/.test(u.material) && (s = u.material.replace(/\[/, "").replace(/\]/, ""), h.material = e.properties[s], that._core.isHtmlColor(h.material) ? h.material = that._color.colorFromHtmlColor(h.material) : (/^rgb/.test(h.material) && (h.material = that._color.rgbaStringToRgbaObj(h.material)), 1 < h.material.r && (h.material.r = h.material.r / 255), 1 < h.material.g && (h.material.g = h.material.g / 255), 1 < h.material.b && (h.material.b = h.material.b / 255), 1 < h.material.a && (h.material.a = h.material.a / 255), h.material = that._color.createColor(h.material.r, h.material.g, h.material.b, h.material.a))); for (var i = 0; i < e.geometry.coordinates.length; i++) { var o = e.geometry.coordinates[i]; if (0 < o.length) if (Array.isArray(o[0])) for (var r = 0; r < o.length; r++) { var n = o[r], n = m._cesium.Cartesian3.fromDegrees(n[0], n[1], h.height); t.push(n) } else { var a = m._cesium.Cartesian3.fromDegrees(o[0], o[1], h.height); t.push(a) } } h.position = t, e.positions = t, "0" == h.slttype || 0 == h.slttype ? h.shape = m._core.computeCircle(h.radius) : "1" == h.slttype || 1 == h.slttype ? h.shape = m._core.starPositions(h.number, h.exradius, h.inradius) : "2" != h.slttype && 2 != h.slttype || (s = h.orth_width / 2, l = h.orth_height / 2, h.shape = [new m._cesium.Cartesian2(-s, -l), new m._cesium.Cartesian2(s, -l), new m._cesium.Cartesian2(s, l), new m._cesium.Cartesian2(-s, l)]); var s = { polylinePositions: h.position, shapePositions: h.shape, cornerType: h.cornerType, VertexFormat: { bitangent: !0, color: !0, position: !0, st: !0, normal: !0, tangent: !0 } }, l = new m._cesium.PolylineVolumeGeometry(s), s = m._cesium.PolylineVolumeGeometry.createGeometry(l), l = new m._cesium.GeometryInstance({ id: e, geometry: s, attributes: { color: new m._cesium.ColorGeometryInstanceAttribute.fromColor(h.material) } }), s = new m._cesium.Primitive({ allowPicking: !0, appearance: new m._cesium.MaterialAppearance({ material: new m._cesium.Material({ fabric: { type: "Color", uniforms: { color: h.material } } }), faceForward: !0, flat: !1 }), shadows: h.shadows, geometryInstances: l }); c.add(s) }), c }, this.item = n._primitiveCollection, n.addTo(this._viewer), o || this.setVisibility(!1), this._core.isnull(h.id) && (h.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + h.id), this.west = t.minx, this.south = t.miny, this.east = t.maxx, this.north = t.maxy, { id: h.id, name: e, checked: o, pId: this._core.isnull(i) ? 0 : i, type: "polylineVolumeLayer", item: this, url: t.url, style: u }); this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(i) ? 0 : i), "function" == typeof r && r(this.item) }, Ju.prototype.setTreeobj = function (e) { this.treeobj = e }, Ju.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, Ju.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, Ju.prototype.setRefresh = function (e) { try { this._Provider && this._Provider.setStatus(e) } catch (e) { } }, Ju.prototype.setVisibility = function (e) { try { null != this.item && null != this.item.show && (this.item.show = e), this._Provider && this._Provider.setStatus(e) } catch (e) { } }, Ju.prototype.isCache = function (e) { this._cache = e }, Ju.prototype.edit = function (e, t) { return this.isEditting = e, this.editoption = t, this._Provider && this._Provider.edit && this._Provider.edit(e, t) }, Ju.prototype.forceRefresh = function () { try { for (var e = 0; e < this._Provider.quadtree._levelZeroTiles.length; e++)this._Provider.quadtree._levelZeroTiles[e].freeResources() } catch (e) { } }, Qu.prototype.setSpaceBackground = function (e) { return this.clear && this.clear(), this._viewer.container.style.backgroundImage = "url(" + e + ")", this._viewer.scene.backgroundColor = new this._cesium.Color(0, 0, 0, 0), this._viewer.scene.skyAtmosphere.show = !1, this._viewer.scene.skyBox && (this._viewer.scene.skyBox.show = !1), this.clear = () => { 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 }, Qu.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 }, Qu.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 }, qu.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 }, qu.prototype._init = function () { this.windField = this.createField(); for (var e = 0; e < this.WindFieldOption.num; e++)this.particles.push(this.randomParticle(new Xu)) }, qu.prototype.createField = function () { var e = this._parseWindJson(); return new Zu(e) }, qu.prototype.animate = function () { var o, r, n = this, a = n.windField, e = n.particles, s = []; e.forEach(function (e) { var t, i; e.age <= 0 && n.randomParticle(e), 0 < e.age && (t = e.x, i = e.y, a.isInBound(t, i) ? (r = a.getIn(t, i), o = t + n.WindFieldOption.speed * r[0], r = i + n.WindFieldOption.speed * r[1], e.path.push(o, r), e.x = o, e.y = r, s.push(n._createLineInstance(n._map(e.path), e.age / e.birthAge)), e.age--) : e.age = 0) }), s.length <= 0 && this.removeLines(), n._drawLines(s) }, qu.prototype._parseWindJson = function () { var t = null, i = null, o = null; return this.windData.forEach(function (e) { switch (e.header.parameterCategory + "," + e.header.parameterNumber) { case "2,2": t = e.data, o = e.header; break; case "2,3": i = e.data } }), { header: o, uComponent: t, vComponent: i } }, qu.prototype.removeLines = function () { this.lines && (this.primitives.remove(this.lines), this.lines.destroy()) }, qu.prototype._map = function (e) { for (var t = e.length, i = this.windField, o = i.dx, r = i.dy, n = i.west, a = i.north, s = [], l = 0; l <= t - 2; l += 2)s.push(n + e[l] * o, a - e[l + 1] * r); return s }, qu.prototype._createLineInstance = function (e, t) { for (var i = [], o = e.length, r = o / 2, n = 0; n < o; n++)i.push("random" === this.WindFieldOption.color ? this._cesium.Color.fromRandom({ alpha: n / r * t * this.WindFieldOption.brighten }) : this.WindFieldOption.color.withAlpha(n / r * t * this.WindFieldOption.brighten)); return new this._cesium.GeometryInstance({ geometry: new this._cesium.PolylineGeometry({ positions: this._cesium.Cartesian3.fromDegreesArray(e), colors: i, width: 1.5, colorsPerVertex: !0 }) }) }, qu.prototype._drawLines = function (e) { this.removeLines(); e = new this._cesium.Primitive({ appearance: new this._cesium.PolylineColorAppearance({ translucent: !0 }), geometryInstances: e, asynchronous: !1 }); this.lines = this.primitives.add(e) }, qu.prototype.randomParticle = function (e) { for (var t, i, o = 30; t = Math.floor(Math.random() * (this.windField.cols - 2)), i = Math.floor(Math.random() * (this.windField.rows - 2)), this.windField.getIn(t, i)[2] <= 0 && o++ < 30;); return e.x = t, e.y = i, e.age = Math.round(Math.random() * this.WindFieldOption.maxAge), e.birthAge = e.age, e.path = [t, i], e }, qu.prototype.changeColor = function (e) { this.WindFieldOption.color = "random" === e ? e : this._cesium.Color.fromCssColorString(e) }, qu.prototype.setSpeed = function (e) { this.WindFieldOption.speed = e }, qu.prototype.setMaxAge = function (e) { this.WindFieldOption.maxAge = e }, qu.prototype.setBrighten = function (e) { this.WindFieldOption.brighten = e }, qu.prototype.destroy = function () { this.timer && clearInterval(this.timer), this.timer = void 0, this.removeLines() }; var Xu = function () { this.x = null, this.dx = null, this.dx = null, this.y = null, this.age = null, this.birthAge = null, this.path = null }, Zu = function (e) { this.west = null, this.east = null, this.south = null, this.north = null, this.rows = null, this.cols = null, this.dx = null, this.dy = null, this.unit = null, this.date = null, this.grid = null, this._init(e) }, $u = (Zu.prototype = { constructor: Zu, _init: function (e) { for (var t, i = e.header, o = e.uComponent, r = e.vComponent, n = (this.west = +i.lo1, this.east = +i.lo2, this.south = +i.la2, this.north = +i.la1, this.rows = +i.ny, this.cols = +i.nx, this.dx = +i.dx, this.dy = +i.dy, this.unit = i.parameterUnit, this.date = i.refTime, this.grid = [], 0), a = null, s = 0; s < this.rows; s++) { for (var a = [], l = 0; l < this.cols; l++, n++)t = this._calcUV(o[n], r[n]), a.push(t); this.grid.push(a) } }, _calcUV: function (e, t) { return [+e, +t, Math.sqrt(e * e + t * t)] }, _bilinearInterpolation: function (e, t, i, o, r, n) { var a = 1 - e, s = 1 - t, l = a * s, s = e * s, a = a * t, e = e * t, t = i[0] * l + o[0] * s + r[0] * a + n[0] * e, i = i[1] * l + o[1] * s + r[1] * a + n[1] * e; return this._calcUV(t, i) }, getIn: function (e, t) { var i, o, r, n, a, s = Math.floor(e), l = Math.floor(t); return s === e && l === t ? this.grid[t][e] : (a = s + 1, i = l + 1, o = this.getIn(s, l), r = this.getIn(a, l), n = this.getIn(s, i), a = this.getIn(a, i), this._bilinearInterpolation(e - s, t - l, o, r, n, a)) }, isInBound: function (e, t) { return 0 <= e && e < this.cols - 2 && 0 <= t && t < this.rows - 2 } }, "uniform vec4 u_moveColor;\nuniform vec4 u_lineColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_lineColor;\nfloat dt = clamp(tan(uv.x * 5.0  - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n"); function eh(e) { this._viewer = e, this.PrimitiveCollection = [], this.lineColor = Cesium.Color.fromCssColorString("#330066").withAlpha(.8), this.pointColor = Cesium.Color.fromCssColorString("#CCFFFF").withAlpha(1) } eh.prototype.create = function (e = {}) { this.position = e.position || void 0, this.positions = e.positions || void 0, this.linewidth = e.width || void 0, this.near = e.near, this.far = e.far, this._speed = e.speed, Cesium.defined(this._speed) || (this._speed = 1), this._id = e.id, e.color && (this.lineColor = Cesium.Color.fromCssColorString(e.color)), e.pointColor && (this.pointColor = Cesium.Color.fromCssColorString(e.pointColor)), this.getShader(), this.collection = new Cesium.PrimitiveCollection, this.collection._guid = this._id, this._viewer.scene.primitives.add(this.collection), this.PrimitiveCollection.push(this.collection), this.addPathLayer() }, eh.prototype.addPathLayer = async function () { this.position ? this.getInstance() : this.positions && this.getInstances(), this.instances.forEach(e => { this.addGroundLine(e) }) }, eh.prototype.getById = function (e) { for (var t = null, i = this._viewer.scene.primitives, o = i.length, r = 0; r < o; r++) { var n = i.get(r); n._guid === e && (t = n) } return t }, eh.prototype.remove = function (e) { e = this.getById(e); e && this._viewer.scene.primitives.remove(e) }, eh.prototype.removeAll = function () { for (var e = 0; e < this.PrimitiveCollection.length; e++) { var t = this.PrimitiveCollection[e]; this._viewer.scene.primitives.remove(t) } this.PrimitiveCollection = [] }, eh.prototype.show = function (e) { for (var t = 0; t < this.PrimitiveCollection.length; t++)this.PrimitiveCollection[t].show = e }, eh.prototype.getInstance = function () { let e; e = this.position[0] instanceof Cesium.Cartesian3 ? this.position : Cesium.Cartesian3.fromDegreesArray(this.position); var t = new Cesium.GroundPolylineGeometry({ positions: e, width: this.linewidth, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT }); this.instances = new Cesium.GeometryInstance({ geometry: t, attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } }) }, eh.prototype.getInstances = function () { this.instances = []; for (let t = 0; t < this.positions.length; t++) { let e; e = this.positions[t][0] instanceof Cesium.Cartesian3 ? this.positions[t] : Cesium.Cartesian3.fromDegreesArray(this.positions[t]); var i = new Cesium.GeometryInstance({ geometry: new Cesium.GroundPolylineGeometry({ positions: e, width: this.linewidth, vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT }), attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } }); this.instances.push(i) } }, eh.prototype.addGroundLine = async function (e) { e = new Cesium.GroundPolylinePrimitive({ geometryInstances: e, appearance: new Cesium.MaterialAppearance({ material: new Cesium.Material({ fabric: { source: this.fs, uniforms: { u_moveColor: this.pointColor, u_lineColor: this.lineColor } } }) }) }); this.collection.add(e) }, eh.prototype.addLine = function () { var e = new Cesium.PolylineMaterialAppearance({ material: new Cesium.Material({ fabric: { source: this.fs, uniforms: { u_moveColor: this.pointColor, u_lineColor: this.lineColor } } }) }), e = new Cesium.Primitive({ geometryInstances: this.instances, appearance: e }); this.collection.add(e) }, eh.prototype.getShader = function () { this.fs = $u.replace("{speed}", this._speed.toFixed(1)) }; var th, ih = "uniform vec4 u_moveColor;\nuniform vec4 u_wallColor;\n#define PI_OVER_TWO 1.5707963\nczm_material czm_getMaterial(czm_materialInput materialInput){\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat iTime = czm_frameNumber / 60.0 * {speed};\nvec2 uv = materialInput.st;\nvec4 finalColor = u_wallColor;\nfloat dt = clamp(tan(uv.y * 5.0  - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO);\nfinalColor = mix(finalColor, u_moveColor, dt);\nfloat alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0);\nif(uv.y < 0.5){\nalpha = 1.0;\nfinalColor = u_wallColor;\nif(uv.y > 0.4){\nalpha = (0.5 - uv.y) * 5.0 + 0.5;\n}\n}\nmaterial.diffuse = finalColor.xyz;\nmaterial.alpha = alpha;\nreturn material;\n}\n"; function oh(e) { this._viewer = e, this.PrimitiveCollection = [], this.color = Cesium.Color.BLUE } function rh(e, t) { this._viewer = e, this._cesium = t, this._Color = new m(this._viewer, this._cesium), this._core = new f, this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._polylines = [], this.Streamerpath = new eh(this._viewer), this.Streamerwall = new oh(this._viewer) } function nh(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._Buffer = new Ai(e, Cesium), this._tree = V } function ah(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function K(e) { this._viewer = e, this._core = new f, this._tree = V, this._getPosition = new y(this._viewer, Cesium), this._popupmessage = new Si(this._viewer, Cesium), this.tooltip = this._core.CreateTooltip({ id: "_jb" }), this.objectsToExclude = [], this.MilitaryStandardObj = [], this.drawHandler = void 0, this.editHandler = null, this.heightpointsId = [], this.state = 0, this.isEditting = !1, this.editProp = !1, this.openEdit = !0 } function sh(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this._Provider = void 0 } function lh(e) { this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, this.texturePixel = 1024 } function ch(e) { this._viewer = e, this._core = new f } function uh(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._tree = V } function hh(e) { if (this._viewer = e, this._cesium = Cesium, this._core = new f, this._tree = V, !window.h337) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/heatmap/heatmap.min.js"), e.addJs(window.SmartEarthRootUrl + "Workers/heatmap/webgl-heatmap.js") } } function mh(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.TrailEntitys = [] } function dh(e) { this.lon = 0, this.lat = 0, this.hei = e, this.phei = e / 2, this.time = 0 } function ph(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this._color = new m(this._viewer, this._cesium), this._tree = V, this.item = { show: !0 }, this._option = void 0, this._primitive = void 0, this._Provider = void 0 } function gh(e) { this._viewer = e, th = e } function fh(e, t) { this._viewer = e, this._cesium = t, this._core = new f, this.isPause = !1, this.isLoad = !1 } function _h(e, t) { if (this._viewer = e, this._cesium = t, this._core = new f, !Cesium.GeoWTFS) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/cesiumTdt.js") } } function Ch(e) { this._viewer = e, this._core = new f, this._tree = V } function yh(e) { this._viewer = e, this._core = new f } oh.prototype.create = function (e = {}) { this.position = e.position || void 0, this.positions = e.positions || void 0, this.height = e.height || 50, this.minHeight = e.minHeight, this.near = e.near, this.far = e.far, this._speed = e.speed || 1, this._id = e.id, e.color && (this.color = Cesium.Color.fromCssColorString(e.color)), this.getShader(), this.collection = new Cesium.PrimitiveCollection, this.collection._guid = this._id, this._viewer.scene.primitives.add(this.collection), this.position ? this.getInstance() : this.positions && this.getInstances(), this.addWall(), this.PrimitiveCollection.push(this.collection) }, oh.prototype.getById = function (e) { for (var t = null, i = this._viewer.scene.primitives, o = i.length, r = 0; r < o; r++) { var n = i.get(r); n._guid === e && (t = n) } return t }, oh.prototype.remove = function (e) { e = this.getById(e); null != e && this._viewer.scene.primitives.remove(e) }, oh.prototype.removeAll = function () { for (var e = 0; e < this.PrimitiveCollection.length; e++) { var t = this.PrimitiveCollection[e]; this._viewer.scene.primitives.remove(t) } this.PrimitiveCollection = [] }, oh.prototype.show = function (e) { for (var t = 0; t < this.PrimitiveCollection.length; t++)this.PrimitiveCollection[t].show = e }, oh.prototype.getInstance = function () { let e; e = this.position[0] instanceof Cesium.Cartesian3 ? this.position : Cesium.Cartesian3.fromDegreesArray(this.position); var t = Array(e.length).fill(this.height), i = Array(e.length).fill(this.minHeight || 0), t = new Cesium.WallGeometry({ positions: e, maximumHeights: t, minimumHeights: i }); this.instances = [new Cesium.GeometryInstance({ geometry: t, attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } })] }, oh.prototype.getInstances = function () { this.instances = []; for (let t = 0; t < this.positions.length; t++) { let e; e = this.positions[t][0] instanceof Cesium.Cartesian3 ? this.positions[t] : Cesium.Cartesian3.fromDegreesArray(this.positions[t]); var i = Array(e.length).fill(this.height), o = Array(e.length).fill(this.minHeight || 0), i = new Cesium.GeometryInstance({ geometry: new Cesium.WallGeometry({ positions: e, maximumHeights: i, minimumHeights: o }), attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(this.near, this.far) } }); this.instances.push(i) } }, oh.prototype.addWall = async function () { this.instances.forEach(e => { 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) }) }, oh.prototype.getShader = function () { this.fs = ih.replace("{speed}", this._speed.toFixed(1)) }, rh.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 < i.length; t++) { let e = i[t]; e.polyline ? (r.push(e.polyline.positions.getValue()), o = o.concat(r[r.length - 1])) : e.polygon && (r.push(e.polygon.hierarchy.getValue().positions), o = o.concat(r[r.length - 1])) } this.boundingSphere = Cesium.BoundingSphere.fromPoints(o), o = null, this.Streamerpath.create({ positions: r, ...t }) }), this.updateLayer = (e = {}) => { 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 }, rh.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 < i.length; t++) { let e = i[t]; e.polyline ? (r.push(e.polyline.positions.getValue()), o = o.concat(r[r.length - 1])) : e.polygon && (r.push(e.polygon.hierarchy.getValue().positions), o = o.concat(r[r.length - 1])) } this.boundingSphere = Cesium.BoundingSphere.fromPoints(o), o = null, this.Streamerwall.create({ positions: r, ...t }) }), this.updateLayer = (e = {}) => { 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 }, rh.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 c = 0; c < t.length; c++) { a ? (s = t[c], l = e) : (l = t[c], s = e); for (var u = this.parabolaEquation({ pt1: s, pt2: l, height: o.height, num: o.num }), h = [], m = 0; m < u.length; m++)h.push(u[m][0], u[m][1], u[m][2]); n.add(this.getPolylinePrimitive(h, r, o)) } this.pathMaterial = r; i = { id: this._core.getuid(), name: "新建流动路径", pId: 0, type: "TrailLinePrimitive", item: this }; return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, rh.prototype.getPolylinePrimitive = function (e, t, i = {}) { let o = i.clampToGround ? Cesium.GroundPolylineGeometry : Cesium.PolylineGeometry; e = new o({ positions: "object" == typeof e[0] ? e : Cesium.Cartesian3.fromDegreesArrayHeights(e), width: i.width }), e = new Cesium.GeometryInstance({ geometry: e, attributes: { distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near, i.far) } }); let r = i.clampToGround ? Cesium.GroundPolylinePrimitive : Cesium.Primitive; return new r({ geometryInstances: e, appearance: new Cesium.PolylineMaterialAppearance({ material: t }) }) }, rh.prototype.createFlyingLine = function (e, t = {}) { var i = this._core.extend({ time: 3e3, color: "#ffffff", width: 1, alpha: 0 }, t, !0), o = ie({ lightSpotColor: Cesium.Color.fromCssColorString(i.color), time: i.time, alpha: i.alpha, lightSpot: !0 }); let r = new Cesium.PrimitiveCollection; this._viewer.scene.primitives.add(r), this._polylines.push(r); let n; e.forEach(e => { 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 }, rh.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; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1], e[r][2])); t = this._viewer.scene.primitives.add(this.getPolylinePrimitive(o, t, i)), this._polylines.push(t), i = { id: this._core.getuid(), name: "新建流动线", pId: 0, type: "TrailLinePrimitive", item: this }; return this.setTreeobj(i), this._tree.insertGroupId(i, 0), this }, rh.prototype.createWall = function (e, t) { var i = { time: 9e3, LineColor: this._core.defaultValue((t = "number" == typeof (t = t || {}) ? { time: t } : t).color, this._cesium.Color.ORANGE), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + I.colors3) }, t = new te((i = this._core.extend(i, t, !0)).LineColor, i.LinkImage, i.time || 9e3), 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; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1], e[r][2])); this._polylines.push(this._viewer.entities.add({ name: "WallTrail", wall: { positions: o, material: t, maximumHeights: i.maximumHeights, minimumHeights: i.minimumHeights } })); t = { id: this._core.getuid(), name: "新建流动墙", pId: 0, type: "TrailLinePrimitive", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, rh.prototype.parabolaEquation = function (e, t) { var i = this._core.defaultValue(e.height, 5e3), o = Math.abs(e.pt1.lon - e.pt2.lon) > Math.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 && 50 < e.num ? e.num : 50, n = [], a = o / r, s = e.pt1.height || 0, l = e.pt2.height || 0; if (Math.abs(e.pt1.lon - e.pt2.lon) > Math.abs(e.pt1.lat - e.pt2.lat)) { var c = (e.pt2.lat - e.pt1.lat) / r; 0 < e.pt1.lon - e.pt2.lon && (a = -a); for (var u = 0; u <= r; u++) { var h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * u, 2) * i / Math.pow(o, 2) + s + (l - s) * u / r, m = e.pt1.lon + a * u, d = e.pt1.lat + c * u; n.push([m, d, h]) } } else { var p = (e.pt2.lon - e.pt1.lon) / r; 0 < e.pt1.lat - e.pt2.lat && (a = -a); for (u = 0; u <= r; u++) { h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * u, 2) * i / Math.pow(o, 2) + s + (l - s) * u / r, m = e.pt1.lon + p * u, d = e.pt1.lat + a * u; n.push([m, d, h]) } } return n }, rh.prototype.setThisPosition = function (e, t) { var i; this.pathMaterial && (i = this._cesium.Cartesian3.fromDegrees(e[0].lon, e[0].lat), e = this._cesium.Cartesian3.fromDegrees(e[1].lon, e[1].lat), t = this._cesium.Cartesian3.fromDegrees(t.lon, t.lat), e = this._core.getSpaceDistancem([i, e], this._cesium), i = this._core.getSpaceDistancem([i, t], this._cesium), this.pathMaterial.setScale(i / e)) }, rh.prototype.clear = function () { if (0 < this._polylines.length) for (var e = 0; e < this._polylines.length; e++)(this._polylines[e] instanceof Cesium.Entity ? this._viewer.entities : this._viewer.scene.primitives).remove(this._polylines[e]); this._polylines = [], this.Streamerpath.removeAll(), this.Streamerwall.removeAll() }, rh.prototype.setTreeobj = function (e) { this.treeobj = e }, rh.prototype.deleteObject = function () { this.clear() }, rh.prototype.setVisibility = function (e) { if (0 < this._polylines.length) for (var t = 0; t < this._polylines.length; t++)this._polylines[t].show = e; this.Streamerpath.show(e), this.Streamerwall.show(e) }, nh.prototype.createRoad = function (e = {}) { var t = { id: e.id || this._core.getuid(), image: window.SmartEarthRootUrl + I.road, height: 1, width: 20, alpha: 1 }, t = this._core.extend(t, e, !0); let i = []; e.positions.forEach(e => { 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 }, nh.prototype.setTreeobj = function (e) { this.treeobj = e }, nh.prototype.deleteObject = function () { this.item && this._viewer.entities.remove(this.item) }, nh.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, ah.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 = [], c = void 0, u = "单击开始绘制"; 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), V.states = 1, this.drawHandler.setInputAction(function (e) { u = "左键添加点 右键结束"; 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(u, e.endPosition, !0); var t, i, e = e.endPosition; 0 < s.length && (Cesium.defined(c) ? (s.pop(), l.pop(), i = n._createGeoPoints(a, [{ x: e.x, y: e.y }]), s.push({ x: i[0], y: i[1], z: i[2] }), l.push(i), t = n._createBezierPoints(s), i = [], t.forEach(e => { 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), (c = 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(c.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, c && (c.pottingPoint = l), n.drawHandler.destroy(), n._core.CreateTooltip(u, void 0, !1), n._core.mouse(n._viewer.container, 0), setTimeout(function () { V.states = 0 }, 100), "cancel" === e ? c && (a.entities.remove(c), n.MilitaryStandardObj.pop()) : t && t(c) }, this }, K.prototype.createBezierArrow = function (o, t) { var r, n = this, a = this._viewer, s = "单击开始绘制", l = [], c = [], u = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), n._core.mouse(n._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.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] }), c.push(e)), l.push({ x: e[0], y: e[1], z: e[2] }), c.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 < l.length && (Cesium.defined(u) ? (l.pop(), c.pop(), i = n._createGeoPoints(a, [{ x: e.x, y: e.y }]), l.push({ x: i[0], y: i[1], z: i[2] }), c.push(i), t = n._createBezierPoints(l), i = [], t.forEach(e => { 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), (u = 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(u.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, u && (u.pottingPoint = c), n.drawHandler.destroy(), n._core.CreateTooltip(s, void 0, !1), n._core.mouse(n._viewer.container, 0), setTimeout(function () { V.states = 0 }, 100), "cancel" === e ? u && (a.entities.remove(u), n.MilitaryStandardObj.pop()) : t && t(u) }, this }, K.prototype.createSwallowtailArrow = function (e, o, t) { var r, n = e, a = this, s = this._viewer, l = void 0, c = [], u = [], h = "单击开始绘制"; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), a._core.mouse(a._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.states = 1, a.drawHandler = new Cesium.ScreenSpaceEventHandler(s.scene.canvas), a.drawHandler.setInputAction(function (e) { var e = e.position; h = "单击完成绘制", 0 == u.length ? (e = a._createGeoPoints(s, [{ 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 && 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 < u.length && (Cesium.defined(l) ? (u.pop(), c.pop(), i = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), u.push({ x: i[0], y: i[1], z: i[2] }), c.push(i), t = a._computeSwallowtailArrow(u), i = [], t.forEach(e => { i.push(e.x, e.y, u[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (l = a.plotingSwallowtailArrow(s, u, n, o), t = a._computeSwallowtailArrow(u), i = [], t.forEach(e => { i.push(e.x, e.y, u[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 = c), a._core.CreateTooltip(h, void 0, !1), a.drawHandler.destroy(), a._core.mouse(a._viewer.container, 0), setTimeout(function () { V.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 = [], c = void 0, u = [], h = "单击开始绘制"; return V.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] }), u.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 < l.length && (Cesium.defined(c) ? (l.pop(), u.pop(), i = a._createGeoPoints(s, [{ x: e.x, y: e.y }]), l.push({ x: i[0], y: i[1], z: i[2] }), u.push(i), t = a.calculateMorePoints(l), i = [], t.forEach(e => { 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 ? c = 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 && (c = 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)")) } })), c.polygon.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(r) }, !1), c.GeoType = "StraightArrow", a.MilitaryStandardObj.push(c.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, c && (c.pottingPoint = u), a._core.CreateTooltip(h, void 0, !1), a.drawHandler.destroy(), a._core.mouse(a._viewer.container, 0), setTimeout(function () { V.states = 0 }, 100), "cancel" === e ? c && (s.entities.remove(c), a.MilitaryStandardObj.pop()) : t && t(c) }, this }, K.prototype.createRoundedRectangle = function (e, o, t) { var r, n = e, a = "单击开始绘制", s = this, l = this._viewer, c = [], u = [], h = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), s._core.mouse(s._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.states = 1, s.drawHandler = new Cesium.ScreenSpaceEventHandler(l.scene.canvas), s.drawHandler.setInputAction(function (e) { var e = e.position; a = "单击完成绘制", 0 == c.length ? (e = s._createGeoPoints(l, [{ 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 && 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 < c.length && (Cesium.defined(h) ? (c.pop(), u.pop(), i = s._createGeoPoints(l, [{ x: e.x, y: e.y }]), c.push({ x: i[0], y: i[1], z: i[2] }), u.push(i), t = s._computeRoundedRectanglePoints(c), i = [], t.forEach(e => { i.push(e.x, e.y, c[0].z) }), r = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = s._computeRoundedRectanglePoints(c), i = [], t.forEach(e => { i.push(e.x, e.y, c[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 = u), s._core.CreateTooltip(a, void 0, !1), s.drawHandler.destroy(), s._core.mouse(s._viewer.container, 0), setTimeout(function () { V.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 = "单击开始绘制", c = this._viewer, u = this, h = [], m = []; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), u._core.mouse(u._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.states = 1, u.drawHandler = new Cesium.ScreenSpaceEventHandler(c.scene.canvas), u.drawHandler.setInputAction(function (e) { l = "单击添加点"; e = e.position, e = u._createGeoPoints(c, [{ 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 && u.end && u.end(), 2 !== m.length || n || (n = c.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(u._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), width: 3 } })) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), u.drawHandler.setInputAction(function (e) { u._core.CreateTooltip(l, e.endPosition, !0); var t, i, e = e.endPosition; 2 === h.length && (h.pop(), m.pop(), i = u._createGeoPoints(c, [{ x: e.x, y: e.y }]), h.push({ x: i[0], y: i[1], z: i[2] }), m.push(i)), 2 < h.length && (n && c.entities.remove(n), Cesium.defined(r) ? (h.pop(), m.pop(), i = u._createGeoPoints(c, [{ x: e.x, y: e.y }]), h.push({ x: i[0], y: i[1], z: i[2] }), m.push(i), t = u._computeSectorPoints(h), i = [], t.forEach(e => { i.push(e.x, e.y, h[0].z) }), a = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = u._computeSectorPoints(h), i = [], t.forEach(e => { i.push(e.x, e.y, h[0].z) }), a = Cesium.Cartesian3.fromDegreesArrayHeights(i), "polygon" == s ? r = c.entities.add({ name: "Sector", polygon: { hierarchy: a, material: Cesium.Color.fromCssColorString(u._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: u._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(u._core.defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")) } }) : "box" == s && (r = c.entities.add({ name: "Sector", polygon: { hierarchy: a, material: Cesium.Color.fromCssColorString(u._core.defaultValue(o.color, "rgba(255,0,0,0.6)")), outline: u._core.defaultValue(o.outline, !0), outlineColor: Cesium.Color.fromCssColorString(u._core.defaultValue(o.outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: i[2] + u._core.defaultValue(o.extrudedHeight, 200), height: i[2] } })), r.polygon.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(a) }, !1), r.GeoType = "Sector", u.MilitaryStandardObj.push(r.id))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), u.drawHandler.setInputAction(function (e) { u.end && u.end() }, Cesium.ScreenSpaceEventType.RIGHT_DOWN), this.end = e => { this.end = void 0, r && (r.pottingPoint = m), u._core.CreateTooltip(l, void 0, !1), u.drawHandler.destroy(), u._core.mouse(u._viewer.container, 0), n && c.entities.remove(n), setTimeout(function () { V.states = 0 }, 100), "cancel" === e ? r && (c.entities.remove(r), u.MilitaryStandardObj.pop()) : t && t(r) }, this }, K.prototype.createBow = function (e, r, t) { var n, a = e, s = this, l = this._viewer, c = "单击开始绘制", u = [], 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), V.states = 1, s.drawHandler = new Cesium.ScreenSpaceEventHandler(l.scene.canvas), s.drawHandler.setInputAction(function (e) { c = "单击添加点"; e = e.position, e = s._createGeoPoints(l, [{ x: e.x, y: e.y }]); 0 == u.length ? (u.push({ x: e[0], y: e[1], z: e[2] }), h.push(e)) : 1 == u.length ? (u.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 == u.length && s.end && s.end() }, Cesium.ScreenSpaceEventType.LEFT_CLICK), s.drawHandler.setInputAction(function (e) { var t, i, o = e.endPosition; s._core.CreateTooltip(c, e.endPosition, !0), 2 < u.length && (Cesium.defined(m) ? (u.pop(), h.pop(), i = s._createGeoPoints(l, [{ x: o.x, y: o.y }]), u.push({ x: i[0], y: i[1], z: i[2] }), h.push(i), t = s._computeBowPoints(u), i = [], t.forEach(e => { i.push(e.x, e.y, u[0].z) }), n = Cesium.Cartesian3.fromDegreesArrayHeights(i)) : (t = s._computeBowPoints(u), i = [], t.forEach(e => { i.push(e.x, e.y, u[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(c, void 0, !1), s.drawHandler.destroy(), s._core.mouse(s._viewer.container, 0), setTimeout(function () { V.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 = [], c = [], u = void 0, h = "单击开始绘制"; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), a._core.mouse(a._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.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 < l.length ? (a._core.CreateTooltip(h, e.position, !1), u.pottingPoint = c, a.drawHandler.destroy(), a._core.mouse(a._viewer.container, 0), setTimeout(function () { V.states = 0 }, 100), r && r(u)) : (l.push(t), e = a._createGeoPoints(s, [{ x: i.x, y: i.y }]), c.push(e))) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), a.drawHandler.setInputAction(function (e) { var t, i; l.length < 2 || (a._core.CreateTooltip(h, e.endPosition, !0), (t = a._getPosition.getMousePosition(e)) && 2 <= l.length && (Cesium.defined(u) ? (l.pop(), c.pop(), l.push(t), i = a._createGeoPoints(s, [e.endPosition]), c.push(i)) : (l.push(t), i = a._createGeoPoints(s, [e.endPosition]), c.push(i), (u = a.showArrowOnMap(l, n, o)).GeoType = "PincerArrow", a.MilitaryStandardObj.push(u.id)))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) }, K.prototype.createAttackArrow = function (e, o, t) { var r = e, n = this, a = this._viewer, s = [], l = [], c = void 0, u = "单击开始绘制"; this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), n._core.mouse(n._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.states = 1, n.drawHandler = new Cesium.ScreenSpaceEventHandler(a.scene.canvas), n.drawHandler.setInputAction(function (e) { var t; u = "单击增加点", (t = n._getPosition.getMousePosition(e)) && (s.push(t), t = n._createGeoPoints(a, [e.position]), l.push(t)) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), n.drawHandler.setInputAction(function (e) { 1 < s.length && (s.pop(), l.pop()) }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), n.drawHandler.setInputAction(function (e) { var t, i; s.length < 2 || (n._core.CreateTooltip(u, e.endPosition, !0), (t = n._getPosition.getMousePosition(e)) && 2 <= s.length && (Cesium.defined(c) ? (s.pop(), l.pop(), s.push(t), i = n._createGeoPoints(a, [e.endPosition]), l.push(i)) : (s.push(t), i = n._createGeoPoints(a, [e.endPosition]), l.push(i), (c = n.showAttackArrowOnMap(s, r, o)).GeoType = "AttackArrow", n.MilitaryStandardObj.push(c.id)))) }, Cesium.ScreenSpaceEventType.MOUSE_MOVE), n.drawHandler.setInputAction(function (e) { n._core.CreateTooltip(u, e.position, !1), c.pottingPoint = l, n.drawHandler.destroy(), n._core.mouse(n._viewer.container, 0), setTimeout(function () { V.states = 0 }, 100), t && t(c) }, Cesium.ScreenSpaceEventType.RIGHT_DOWN) }, K.prototype.createHandlerPolygon = function (e, a, i) { var s, l = e, c = "单击开始绘制", u = this, h = this._viewer, m = [], d = [], p = void 0; return this.drawHandler && (this.drawHandler.destroy(), this.drawHandler = void 0), u._core.mouse(u._viewer.container, 1, window.SmartEarthRootUrl + I.draw), V.states = 1, u.drawHandler = new Cesium.ScreenSpaceEventHandler(h.scene.canvas), u.drawHandler.setInputAction(function (e) { var t, e = e.position; c = "单击完成绘制", 0 == m.length ? (t = u._createGeoPoints(h, [{ x: e.x, y: e.y }]), m.push({ x: t[0], y: t[1], z: t[2] }, { x: t[0] + 1e-7, y: t[1] + 1e-7, z: t[2] }), d.push(t, t)) : 2 == m.length && (u._core.CreateTooltip(c, e, !1), p.pottingPoint = d, setTimeout(function () { V.states = 0 }, 100), u.drawHandler.destroy(), u._core.mouse(u._viewer.container, 0), i && i(p)) }, Cesium.ScreenSpaceEventType.LEFT_CLICK), u.drawHandler.setInputAction(function (e) { var t, i, o, r, n = e.endPosition; u._core.CreateTooltip(c, e.endPosition, !0), 1 < m.length && (Cesium.defined(p) ? (m.pop(), d.pop(), r = u._createGeoPoints(h, [{ x: n.x, y: n.y }]), m.push({ x: r[0], y: r[1], z: r[2] }), d.push(r), i = u._computeGatheringPlacePoints(m), o = u.createCloseCardinal(i), r = [], (t = u.calculatePointsFBZ3(o, 100)).forEach(e => { r.push(e.x, e.y, m[0].z) }), s = r) : (i = u._computeGatheringPlacePoints(m), o = u.createCloseCardinal(i), t = u.calculatePointsFBZ3(o, 100), r = [], t.forEach(e => { r.push(e.x, e.y, m[0].z) }), s = r, (p = u.plotingGatheringPlace(h, m, l, a)).polygon.hierarchy = new Cesium.CallbackProperty(function () { return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(s)) }, !1), p.GeoType = "GatheringPlace", u.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 = U.algorithm.doubleArrow(i); let e = []; -1 == JSON.stringify(r.polygonalPoint).indexOf("null") && (e = r.polygonalPoint), t = e } else if ("AttackArrow" == e.type) { r = U.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 < t.length; o++) { var r = Number(t[o]).toString(16); "0" === (r = 1 === r.length ? "0" + r : r) && (r += r), i += r } return i = 7 !== i.length ? e : i } if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)) return e; var n = e.replace(/#/, "").split(""); if (6 === n.length) return e; if (3 === n.length) { for (var a = "#", o = 0; o < n.length; o += 1)a += n[o] + n[o]; return a } }, K.prototype.copyJb = function (e) { var t; return "StraightArrow" == e.type || "SwallowtailArrow" == e.type || "PincerArrow" == e.type ? (t = { holes: [], positions: this.szposis(e.pos) }, t = this._viewer.entities.add({ name: "StraightArrow", polygon: { hierarchy: t, material: Cesium.Color.RED.withAlpha(.5) } })) : "BezierArrow" == e.type ? t = this._viewer.entities.add({ name: "BezierArrow", polyline: { positions: this.szposis(e.pos), width: 5, clampToGround: !0, material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED) } }) : e.img ? t = this._viewer.entities.add({ position: this.zfsz(e.pos), billboard: { image: e.img, show: !0 } }) : e.text && (t = this._viewer.entities.add({ position: this.zfsz(e.pos), label: { text: e.text, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, verticalOrigin: Cesium.VerticalOrigin.CENTER, show: !0, showBackground: !1 } })), t._id = e.id, that.objectsToExclude.push(t), t }, K.prototype.getEntityById = function (e) { var t, e = this._viewer.entities.getById(e); return null != e.polyline && e.polyline ? t = { obj: e.polyline, type: e.name, posion: e.polyline.positions.getValue() } : null != e.polygon && e.polygon ? t = { obj: e.polygon, type: e.name, posion: e.polygon.hierarchy.getValue().positions } : null != e.label && e.label ? t = { obj: e.label, type: "lable", text: e.label.text.getValue(), posion: e.position.getValue() } : null != e.billboard && e.billboard && (t = { obj: e.billboard, type: "img", img: e.billboard.image.getValue(), posion: e.position.getValue() }), t }, K.prototype.szposis = function (e) { for (var t = [], i = e.split(",("), o = 0; o < i.length; o++) { var r = this.zfsz(i[o]); t.push(r) } return t }, K.prototype.zfsz = function (e) { for (var t = e.split(","), i = 0; i < t.length; i++)(-1 != t[i].indexOf("(") || -1 != t[i].indexOf(")")) && (t[i] = t[i].replace("(", "")); return { x: parseFloat(t[0]), y: parseFloat(t[1]), z: parseFloat(t[2]) } }, K.prototype.showArrowOnMap = function (a, e, t) { function i() { if (a.length < 3) return null; for (var e = [], t = 0; t < a.length; t++) { var i = s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[t]), o = Cesium.Math.toDegrees(i.latitude), i = Cesium.Math.toDegrees(i.longitude); e.push([i, o]) } var r = U.algorithm.doubleArrow(e), n = []; return -1 == JSON.stringify(r.polygonalPoint).indexOf("null") && (n = r.polygonalPoint), new Cesium.PolygonHierarchy(n) } var o, s = this, r = s._viewer.scene.globe.ellipsoid.cartesianToCartographic(a[0]).height; return "polygon" == e ? o = s._viewer.entities.add({ name: "PincerArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(i, !1), show: !0, fill: !0, material: Cesium.Color.fromCssColorString(s._core.defaultValue(t.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor, "rgba(255,0,0,0.6)")) }) }) : "box" == e && (o = s._viewer.entities.add({ name: "PincerArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(i, !1), show: !0, fill: !0, material: Cesium.Color.fromCssColorString(s._core.defaultValue(t.color, "rgba(255,0,0,0.6)")), outline: s._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(s._core.defaultValue(t.outlineColor, "rgba(255,0,0,0.6)")), extrudedHeight: r + s._core.defaultValue(t.extrudedHeight, 200), height: r }) })), o }, K.prototype.showAttackArrowOnMap = function (n, e, t) { var a = this, i = a._viewer.scene.globe.ellipsoid.cartesianToCartographic(n[0]).height; return this._viewer.entities.add({ name: "AttackArrow", polygon: new Cesium.PolygonGraphics({ hierarchy: new Cesium.CallbackProperty(function () { if (n.length < 3) return null; for (var e = [], t = 0; t < n.length; t++) { var i = a.cartesianToLatlng(n[t]); e.push(i) } var o = U.algorithm.tailedAttackArrow(e), r = []; return -1 == JSON.stringify(o.polygonalPoint).indexOf("null") && (r = o.polygonalPoint), new Cesium.PolygonHierarchy(r) }, !1), show: !0, fill: !0, classificationType: Cesium.ClassificationType.TERRAIN, extrudedHeight: "box" === e ? a._core.defaultValue(t.extrudedHeight, 200) + i : void 0, height: "box" === e ? i : void 0, material: Cesium.Color.fromCssColorString(a._core.defaultValue(t.color, "rgba(255,0,0,0.6)")), outline: a._core.defaultValue(t.outline, !0), outlineColor: Cesium.Color.fromCssColorString(a._core.defaultValue(t.outlineColor, "rgba(255,0,0,0.6)")) }) }) }, K.prototype.cartesianToLatlng = function (e) { var e = this._viewer.scene.globe.ellipsoid.cartesianToCartographic(e), t = Cesium.Math.toDegrees(e.latitude); return [Cesium.Math.toDegrees(e.longitude), t] }, K.prototype.getCatesian3FromPX = function (e, t) { for (var i, o = this._viewer.scene.drillPick(e), r = (this._viewer.render(), !0), n = 0; n < o.length; n++)(o[n] && o[n].primitive || o[n] instanceof Cesium.Cesium3DTileFeature) && (r = !0); if (r) i = this._viewer.scene.pickPosition(e); else { e = this._viewer.camera.getPickRay(e); if (!e) return null; i = this._viewer.scene.globe.pick(e, this._viewer.scene) } return i }, K.prototype._createGeoPoints = function (e, t) { for (var i, o, r, n, a = [], s = 0; s < t.length; s++)(i = (n = e.camera.getPickRay(t[s])) ? e.scene.globe.pick(n, e.scene) : i) && (n = Cesium.Cartographic.fromCartesian(i), o = Cesium.Math.toDegrees(n.longitude), r = Cesium.Math.toDegrees(n.latitude), n = n.height, a.push(o, r, n)); return a }, K.prototype._createScreenPoints = function (e, t) { for (var i, o = [], r = 0; r < t.length; r++)i = e.scene.cartesianToCanvasCoordinates(t[r]), o.push(i); return o }, K.prototype._createBezierPoints = function (e) { for (var t = [], i = 0; i <= 100; i++) { var o = this._computeBezierPoints(e, i / 100); t.push(o) } return t }, K.prototype._computeBezierPoints = function (e, t) { for (var i = 0, o = 0, r = this._computeBinomial(e), n = 0; n < e.length; n++) { var a = e[n]; i += a.x * Math.pow(1 - t, e.length - 1 - n) * Math.pow(t, n) * r[n], o += a.y * Math.pow(1 - t, e.length - 1 - n) * Math.pow(t, n) * r[n] } return { x: i, y: o } }, K.prototype._computeBinomial = function (e) { var t = e.length, i = []; i.push(1); for (var o = 1; o < t - 1; o++) { for (var r = 1, n = 1, a = 0; a < o; a++)r *= t - 1 - a, n *= o - a; i.push(r / n) } return i.push(1), i }, K.prototype._computeGatheringPlacePoints = function (e) { var t, i, o, r, n, a, s = []; return 2 == e.length && (t = e[0], n = { x: (e = e[e.length - 1]).x - t.x, y: e.y - t.y }, a = Math.sqrt(n.x * n.x + n.y * n.y), i = this.calculateVector(n, Math.PI / 3, Math.sqrt(3) / 12 * a)[1], i = { x: t.x + i.x, y: t.y + i.y }, o = { x: (t.x + e.x) / 2, y: (t.y + e.y) / 2 }, r = this.calculateVector(n, 2 * Math.PI / 3, Math.sqrt(3) / 12 * a)[1], r = { x: e.x + r.x, y: e.y + r.y }, a = { x: (n = this.calculateVector(n, Math.PI / 2, .5 * a)[0]).x + o.x, y: n.y + o.y }, s.push(t, i, o, r, e, a)), s }, K.prototype.createCloseCardinal = function (e) { if (null == e || e.length < 3) return e; for (var t = e[0], i = (e.push(t), e), o = [], r = i.length - 1, n = 0; n <= r - 1; n++) { d = n == r - 1 ? (a = i[r - 1], s = i[0], i[1]) : (a = i[n], s = i[n + 1], i[n + 2]); var a, s, l = { x: void 0, y: void 0 }, c = { x: void 0, y: void 0 }, u = s.x - a.x, h = s.y - a.y, m = d.x - s.x, d = d.y - s.y, p = Math.sqrt(u * u + h * h), g = Math.sqrt(m * m + d * d), u = u / p, h = h / p, m = m / g, d = d / g, f = u + m, _ = h + d, C = Math.sqrt(f * f + _ * _), f = f / C, _ = _ / C; Math.abs(1 - (u * m + h * d)) < .005 ? (l.x = s.x - m * p * .4, l.y = s.y - d * p * .4, c.x = s.x + u * g * .4, c.y = s.y + h * g * .4) : (l.x = s.x - f * p * .4, l.y = s.y - _ * p * .4, c.x = s.x + f * g * .4, c.y = s.y + _ * g * .4), n == r - 1 ? (o[0] = s, o[1] = c, o[3 * (r - 2) + 2 + 3] = l, o[3 * (r - 2) + 2 + 4] = i[r]) : (o[3 * n + 2] = l, o[3 * n + 2 + 1] = s, o[3 * n + 2 + 2] = c) } return o }, K.prototype.calculatePointsFBZ3 = function (e, t) { var i = [], o = .05; 0 < (t = t || 20) && (o = 1 / t); for (var r = 0; r < e.length - 3;) { var n = e[r], a = e[r + 1], s = e[r + 2], l = e[r + 3]; i.push(n); for (var c = 0; c < 1;) { var u = (1 - c) * (1 - c) * (1 - c) * n.x + 3 * c * (1 - c) * (1 - c) * a.x + 3 * c * c * (1 - c) * s.x + c * c * c * l.x, h = (1 - c) * (1 - c) * (1 - c) * n.y + 3 * c * (1 - c) * (1 - c) * a.y + 3 * c * c * (1 - c) * s.y + c * c * c * l.y; i.push({ x: u, y: h }), c += o } (r += 3) >= 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, c, u, 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 < e.x ? u = -(c = Math.sqrt(i * i - s * s)) : e.x < 0 && (c = -(u = Math.sqrt(i * i - s * s))), o = { x: s, y: c }, r = { x: l, y: u }) : (a = 1 + (n = -e.x / e.y) * n, t = (h = i * h * Math.cos(t) / e.y) * h - i * i, c = n * (s = (-(i = 2 * n * h) - Math.sqrt(i * i - 4 * a * t)) / (2 * a)) + h, u = n * (l = (-i + Math.sqrt(i * i - 4 * a * t)) / (2 * a)) + h, 0 <= e.y ? (o = { x: s, y: c }, r = { x: l, y: u }) : e.y < 0 && (o = { x: l, y: u }, r = { x: s, y: c })), [o, r] }, K.prototype.plotingSwallowtailArrow = function (e, t, i, o) { var r, n = this._computeSwallowtailArrow(t), a = []; return n.forEach(e => { 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 (2 < e.length) { for (var t, i, o = 0, r = 0; r < e.length - 1; r++)t = e[r], i = e[r + 1], o += Math.sqrt((i.y - t.y) * (i.y - t.y) + (i.x - t.x) * (i.x - t.x)); for (var n = o / 6, a = [], s = [], l = { x: void 0, y: void 0 }, c = { x: void 0, y: void 0 }, u = 0; u < e.length - 2; u++) { var h, m = e[u], d = e[u + 1], p = e[u + 2], g = { x: d.x - m.x, y: d.y - m.y }, p = { x: p.x - d.x, y: p.y - d.y }, f = this.calculateVector(g, Math.PI / 2, n / 2), _ = f[0], f = f[1], C = this.calculateVector(p, Math.PI / 2, n / 2), y = C[0], C = C[1], _ = { x: m.x + _.x, y: m.y + _.y }, m = { x: m.x + f.x, y: m.y + f.y }, f = { x: d.x + y.x, y: d.y + y.y }, y = { x: d.x + C.x, y: d.y + C.y }, d = this.calculateIntersection(g, p, _, f), C = this.calculateIntersection(g, p, m, y); p = 0 == u ? (h = { x: ((l = _).x + d.x) / 2, y: (l.y + d.y) / 2 }, { x: ((c = m).x + C.x) / 2, y: (c.y + C.y) / 2 }) : (f = a[a.length - 1], g = s[s.length - 1], h = { x: (f.x + d.x) / 2, y: (f.y + d.y) / 2 }, { x: (g.x + C.x) / 2, y: (g.y + C.y) / 2 }), a.push(h), s.push(p), a.push(d), s.push(C) } for (var v, w, b, T = e[e.length - 2], S = e[e.length - 1], E = { x: S.x - T.x, y: S.y - T.y }, P = Math.sqrt(E.x * E.x + E.y * E.y), x = [], D = { x: void 0, y: void 0 }, I = { x: void 0, y: void 0 }, A = { x: void 0, y: void 0 }, L = { x: void 0, y: void 0 }, M = { x: void 0, y: void 0 }, V = { x: void 0, y: void 0 }, R = a[a.length - 1], O = s[s.length - 1], V = P <= n ? (D = (x = this.calculateVector(E, Math.PI / 2, n / 2))[0], I = x[1], w = { x: T.x + D.x, y: T.y + D.y }, b = { x: T.x + I.x, y: T.y + I.y }, A = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }, L = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }, a.push(A), s.push(L), M = { x: 2 * w.x - T.x, y: 2 * w.y - T.y }, { x: 2 * b.x - T.x, y: 2 * b.y - T.y }) : (P = S.x - T.x, T = S.y - T.y, v = Math.sqrt(P * P + T * T), P = S.x - P * n / v, T = S.y - T * n / v, D = (x = this.calculateVector(E, Math.PI / 2, n / 2))[0], I = x[1], w = { x: P + D.x, y: T + D.y }, b = { x: P + I.x, y: T + I.y }, A = { x: (R.x + w.x) / 2, y: (R.y + w.y) / 2 }, L = { x: (O.x + b.x) / 2, y: (O.y + b.y) / 2 }, a.push(A), s.push(L), M = { x: 2 * w.x - P, y: 2 * w.y - T }, { x: 2 * b.x - P, y: 2 * b.y - T }), B = [], F = [], r = 0; r < a.length - 2; r++)var H = [], G = [], k = a[r], N = a[r + 1], j = a[r + 2], U = s[r], z = s[r + 1], W = s[r + 2], k = (H.push(k, N, j), G.push(U, z, W), this._createBezierPoints(H)), N = this._createBezierPoints(G), B = B.concat(k), F = F.concat(N); (v = (v = [l]).concat(B)).push(w), v.push(M), v.push(S), v.push(V), v.push(b), (v = v.concat(F.reverse())).push(c) } else v = this.calculateTwoPoints(e); return v }, K.prototype.calculateIntersection = function (e, t, i, o) { var r, e = e.y * t.x - e.x * t.y == 0 ? 0 < e.x * t.x || 0 < e.y * t.y ? (r = (i.x + o.x) / 2, (i.y + o.y) / 2) : (r = o.x, o.y) : (r = (e.x * t.x * (o.y - i.y) + i.x * e.y * t.x - o.x * t.y * e.x) / (e.y * t.x - e.x * t.y), 0 != e.x ? (r - i.x) * e.y / e.x + i.y : (r - o.x) * t.y / t.x + o.y); return { x: r, y: e } }, K.prototype.calculateTwoPoints = function (e) { var t = e[0], e = e[1], i = [], o = { x: e.x - t.x, y: e.y - t.y }, r = Math.sqrt((e.x - t.x) * (e.x - t.x) + (e.y - t.y) * (e.y - t.y)), n = t.x + 5 * (e.x - t.x) / 6, a = t.y + 5 * (e.y - t.y) / 6, o = this.calculateVector(o, Math.PI / 2, r / 6 / 2), r = o[0], o = o[1], s = { x: t.x + r.x, y: t.y + r.y }, l = { x: n + r.x, y: a + r.y }, r = { x: n + 2 * r.x, y: a + 2 * r.y }, e = { x: e.x, y: e.y }, c = { x: n + 2 * o.x, y: a + 2 * o.y }, n = { x: n + o.x, y: a + o.y }, a = { x: t.x + o.x, y: t.y + o.y }; return i.push(s, l, r, e, c, n, a), i }, K.prototype._computeRoundedRectanglePoints = function (e) { for (var t = (e[0].x + e[1].x) / 2, i = (e[0].y + e[1].y) / 2, o = Math.abs(e[0].x - e[1].x), e = Math.abs(e[0].y - e[1].y), r = .1 * Math.min(o, e), n = t - o / 2 + r, a = i - e / 2 + r, s = t + o / 2 - r, l = i - e / 2 + r, c = t + o / 2 - r, u = i + e / 2 - r, h = t - o / 2 + r, m = i + e / 2 - r, d = Math.PI / 180, p = [], g = Math.PI, f = 1.5 * Math.PI, _ = g, C = 0; C < Math.abs(g - f); C += d) { var y = n + r * Math.cos(_), v = a + r * Math.sin(_), _ = (_ = (_ += d) < 0 ? 2 * Math.PI + _ : _) > 2 * Math.PI ? 2 * Math.PI - _ : _; p.push({ x: y, y: v }) } for (var w = p, b = 3 * Math.PI / 2, T = 2 * Math.PI, S = b, C = 0; C < Math.abs(b - T); C += d) { y = s + r * Math.cos(S), v = l + r * Math.sin(S), S = (S = (S += d) < 0 ? 2 * Math.PI + S : S) > 2 * Math.PI ? 2 * Math.PI - S : S; w.push({ x: y, y: v }) } for (var E = w, P = .5 * Math.PI, x = 0, C = 0; C < Math.abs(0 - P); C += d) { y = c + r * Math.cos(x), v = u + r * Math.sin(x), x = (x = (x += d) < 0 ? 2 * Math.PI + x : x) > 2 * Math.PI ? 2 * Math.PI - x : x; E.push({ x: y, y: v }) } for (var D = E, I = .5 * Math.PI, A = Math.PI, L = I, C = 0; C < Math.abs(I - A); C += d) { y = h + r * Math.cos(L), v = m + r * Math.sin(L), L = (L = (L += d) < 0 ? 2 * Math.PI + L : L) > 2 * 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 = (i < t && (i = 2 * Math.PI + i), Math.PI / 180), r = t, n = [e[0]], a = Math.sqrt((e[1].x - e[0].x) * (e[1].x - e[0].x) + (e[1].y - e[0].y) * (e[1].y - e[0].y)), s = 0; s < Math.abs(t - i); s += o) { var l = e[0].x + a * Math.cos(r), c = e[0].y + a * Math.sin(r), r = (r = (r += o) < 0 ? 2 * Math.PI + r : r) > 2 * Math.PI ? r - 2 * Math.PI : r; n.push({ x: l, y: c }) } 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 }, c = Math.sqrt((e[0].x - s) * (e[0].x - s) + (e[0].y - l) * (e[0].y - l)), u = 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 (u < o && o < h || h < o && o < u) { d = u < h ? u : h; for (var g = 0; g < Math.abs(u - h); g += m) { var f = s + c * Math.cos(d), _ = l + c * Math.sin(d), d = (d = (d += m) < 0 ? 2 * Math.PI + d : d) > 2 * Math.PI ? 2 * Math.PI - d : d; p.push({ x: f, y: _ }) } } else { d = h < u ? u : h; for (g = 0; g < 2 * Math.PI - Math.abs(u - h); g += m) { f = s + c * Math.cos(d), _ = l + c * Math.sin(d); d = (d = (d += m) < 0 ? 2 * Math.PI + d : d) > 2 * 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 < t.heightpoints.length ? "ExtrudedPolygon" : "GroundPolygon", fn: { success: function (e, t) { i.editPropData.success && i.editPropData.success(e, t), SmartEarthPopupData.layerIndex = t, SmartEarthPopupData.window = e.find("iframe")[0].contentWindow }, end: function () { i.callBack && i.callBack.end && i.callBack.end(e), t.endThisEdit && t.endThisEdit(), SmartEarthPopupData.layerIndex = void 0, SmartEarthPopupData.window = void 0 } } }) }, K.prototype.defaultEdit = function () { this.openEdit ? this.MilitaryStandardObj.length && !this.editHandler ? this.edit(this.openEdit, this.editOption) : !this.MilitaryStandardObj.length && this.editHandler && this.edit(!1) : this.editHandler && this.edit(!1) }, K.prototype.startEdit = function (t) { var i = this._viewer; if (-1 !== this.MilitaryStandardObj.indexOf(t.id)) { let e = t; t = e.pottingPoint; if (t) { this.isEditting = !0; var o, r = t, n = { x: 0, y: 0, z: 0 }; for (o in r) { var a, s, l = r[o], c = (n.x += l[0], n.y += l[1], n.z += l[2], Cesium.Cartesian3.fromDegreesArrayHeights(l)), u = i.entities.add({ name: "polygon_point", position: c[0], point: { pixelSize: 10, color: Cesium.Color.ROYALBLUE, outlineWidth: 2, outlineColor: Cesium.Color.WHITE.withAlpha(.6), disableDepthTestDistance: Number.POSITIVE_INFINITY } }); u.pottingPoint = l, V.pointsId.push(u.id), this.objectsToExclude.push(u), e.polygon && e.polygon.extrudedHeight && (c = c.x ? Cesium.Cartographic.fromCartesian(c) : Cesium.Cartographic.fromCartesian(c[0]), s = Cesium.Math.toDegrees(c.longitude), c = Cesium.Math.toDegrees(c.latitude), a = e.polygon.extrudedHeight.getValue(), s = Cesium.Cartesian3.fromDegrees(s, c, a), (c = i.entities.add({ name: "box_point", position: s, point: { color: Cesium.Color.YELLOW, pixelSize: 12, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } })).pottingPoint = l, c.pointid = u.id, this.objectsToExclude.push(c), this.heightpoints.push(c), this.heightpointsId.push(c.id)) } return n.x /= r.length, n.y /= r.length, n.z /= r.length, this.movePoint = i.entities.add({ name: "move_point", position: Cesium.Cartesian3.fromDegrees(n.x, n.y, n.z), point: { color: Cesium.Color.PURPLE, pixelSize: 10, outlineColor: Cesium.Color.WHITE.withAlpha(.6), outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY } }), SmartEarthPopupData.editGraphic = { entity: e, graphic: e.polygon || e.polyline, heightpoints: this.heightpoints }, !0 } } }, K.prototype.edit = function (e, o) { var A = this, L = this._viewer; if (void 0 !== (o = o || this.editOption || {}).editProp && (this.editProp = o.editProp), this.editHandler) { for (var t in this.editHandler.destroy(), this.editHandler = void 0, V.pointsId) this._viewer.entities.removeById(V.pointsId[t]); V.pointsId = [] } if (e = void 0 === e ? !0 : e) { var M, R = void 0, O = (this.isEditting = !1, void 0), B = void 0; for (t in this.editHandler = new Cesium.ScreenSpaceEventHandler(L.scene.canvas), this.editHandler.setInputAction(e => { var t; Cesium.ExpandBySmartEarth && (Cesium.ExpandBySmartEarth.underEarth.enable || Cesium.ExpandBySmartEarth.isStreetView) ? A.isEditting && (A.endThisEdit(), A.defaultEvent(!1)) : V.editVector || (e = e.position, (e = L.scene.pick(e)) && e.id instanceof Cesium.Entity ? (e = e.id, A.isEditting || 0 != V.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 (!V.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 !== V.states || (i.id && -1 < A.MilitaryStandardObj.indexOf(i.id.id) ? A.tooltip.showAt(e.endPosition, "点击激活编辑") : A.tooltip.show(!1)); else 0 != V.states || O || A.tooltip.show(!1); if (A.isEditting && O) { A.tooltip.showAt(e.endPosition, "释放后完成修改"); i = e.startPosition; if (C = (i = L.camera.getPickRay(i)) ? L.scene.globe.pick(i, L.scene) : C) { var t = void 0; if ("polygon_point" == M) { for (var r in O.position = C, V.pointsId) if (V.pointsId[r] == O.id) { var o = L.entities.getById(A.heightpointsId[r]); if (!o) break; var n = Cesium.Cartographic.fromCartesian(C), a = Cesium.Math.toDegrees(n.longitude), s = Cesium.Math.toDegrees(n.latitude), l = Cesium.Cartographic.fromCartesian(o.position._value), c = n.height + l.height; o.position = Cesium.Cartesian3.fromDegrees(a, s, c) } var u = [], h = [], m = new Cesium.Cartesian3; for (r in V.pointsId) { var d = L.entities.getById(V.pointsId[r]).position._value, p = Cesium.Cartographic.fromCartesian(d), p = { x: Cesium.Math.toDegrees(p.longitude), y: Cesium.Math.toDegrees(p.latitude), z: p.height }; u.push(p), h.push([p.x, p.y, p.z]), m.x += d.x, m.y += d.y, m.z += d.z } if (m.x /= u.length, m.y /= u.length, m.z /= u.length, A.movePoint && (A.movePoint.position = m), "StraightArrow" == R.GeoType) x = A.calculateMorePoints(u); else if ("RoundedRectangle" == R.GeoType) x = A._computeRoundedRectanglePoints(u); else if ("Sector" == R.GeoType) x = A._computeSectorPoints(u); else if ("Bow" == R.GeoType) x = A._computeBowPoints(u); else if ("GatheringPlace" == R.GeoType) { var g = A._computeGatheringPlacePoints(u), g = A.createCloseCardinal(g); x = A.calculatePointsFBZ3(g, 100) } else if ("SwallowtailArrow" == R.GeoType) x = A._computeSwallowtailArrow(u); else if ("Bezierline" == R.GeoType) x = A._createBezierPoints(u); else if ("BezierArrow" == R.GeoType) x = A._createBezierPoints(u); else if ("PincerArrow" == R.GeoType) { g = U.algorithm.doubleArrow(h); let e = []; var f = JSON.stringify(g.polygonalPoint).indexOf("null"); x = e = -1 == f ? g.polygonalPoint : e } else if ("AttackArrow" == R.GeoType) { f = U.algorithm.tailedAttackArrow(h), g = JSON.stringify(f.polygonalPoint).indexOf("null"); let e = []; x = e = -1 == g ? f.polygonalPoint : e } let t; t = "AttackArrow" !== R.GeoType && "PincerArrow" !== R.GeoType ? (t = [], x.forEach(e => { t.push(e.x, e.y, u[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 = c = A.Cdcl(w, v, T, b); for (_ in A.heightpointsId) { var S = L.entities.getById(A.heightpointsId[_]), E = S.position._value, E = Cesium.Cartographic.fromCartesian(E), P = Cesium.Math.toDegrees(E.longitude), E = Cesium.Math.toDegrees(E.latitude), P = Cesium.Cartesian3.fromDegrees(P, E, t); S.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), u = (O.position = C, []), h = []; for (r in V.pointsId) { let e, t, i = L.entities.getById(V.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), u.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(u); else if ("RoundedRectangle" == R.GeoType) x = A._computeRoundedRectanglePoints(u); else if ("Sector" == R.GeoType) x = A._computeSectorPoints(u); else if ("Bow" == R.GeoType) x = A._computeBowPoints(u); else if ("GatheringPlace" == R.GeoType) { f = A._computeGatheringPlacePoints(u), e = A.createCloseCardinal(f); x = A.calculatePointsFBZ3(e, 100) } else if ("SwallowtailArrow" == R.GeoType) x = A._computeSwallowtailArrow(u); else if ("Bezierline" == R.GeoType) x = A._createBezierPoints(u); else if ("BezierArrow" == R.GeoType) x = A._createBezierPoints(u); else if ("PincerArrow" == R.GeoType) { i = U.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 = U.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, u[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)) : V.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)) : V.editVector || (t = L.scene.pick(e.position), Cesium.defined(t) && 0 == V.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), V.pointsId) L.entities.removeById(V.pointsId[t]); for (t in A.heightpointsId) L.entities.removeById(A.heightpointsId[t]); A.heightpointsId = [], A.heightpoints = [], V.pointsId = [], this.endThisEdit = () => { for (var e in A.defaultEvent(!0), V.pointsId) L.entities.removeById(V.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, V.pointsId = [], A.heightpointsId = [], A.heightpoints = [], A.delButton(!1) } } }, K.prototype.spArray = function (e, t) { for (var i = [], o = 0; o < t.length;)i.push(t.slice(o, o += e)); return i }, K.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;
@@ -335,21 +388,28 @@
                                    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)}},K.prototype.defaultEvent=function(e){var t=this._viewer.scene;t.screenSpaceCameraController.enableRotate=e,t.screenSpaceCameraController.enableTranslate=e,t.screenSpaceCameraController.enableZoom=e,t.screenSpaceCameraController.enableTilt=e,t.screenSpaceCameraController.enableLook=e},sh.prototype.createKmlLayer=function(e,t,r){var i={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=t,a=(this._cesium.HeightReference.CLAMP_TO_GROUND,{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:n,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}),s=this;this._cesium.KmlDataSource.load(e,i).then(function(e){if(e.entities,"model"==r)for(var t=0;t<e.entities.values.length;t++){var i=e.entities.values[t];s._viewer.entities.add({name:"",position:i.position,model:{uri:n,heightReference:s._cesium.HeightReference.CLAMP_TO_GROUND,minimumPixelSize:128,maximumScale:20,scale:1,runAnimations:!1}})}else if("billboard"==r){for(var o=s._core.extend(a,option,!0),t=0;t<e.entities.values.length;t++){i=e.entities.values[t];o.position=i.position._value,billboardCollections.add(o)}s._viewer.scene.primitives.add(billboardCollections)}})},sh.prototype.addKmlLayer=function(e,t,i,o){var r={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},n=this;let a=t,s;a.id&&(s=a.id,a=a.url);t=this._cesium.KmlDataSource.load(a,r),this._viewer.dataSources.add(t),t.then(function(e){n.item=e,i||n.setVisibility(!1),o&&"function"==typeof o&&o(e)}),r={id:s||this._core.getuid(),name:e,pId:0,type:"KML",item:this};return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},sh.prototype.export=function(){var e=null==this.item.show?void 0:this.item.show,t=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:e,url:t}}},sh.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},sh.prototype.setTreeobj=function(e){this.treeobj=e},sh.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},lh.prototype.createModifyMesh=function(e,t,i,o,r){var n=t.length,n=new Array(n),i=(n.fill(i),o.id||Cesium.createGuid()),a=Date.now(),s=Cesium.Rectangle.fromCartesianArray(t),i=(void 0===o.modifyMeshObject&&(o.modifyMeshObject=[]),{id:i,show:!0,name:e,rectangle:s,vertices:t,polygon:t,heights:n,meshObject:o,timeStamp:a,polygonGeometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(t)}),image:this.createTexture(t),texture:null});return o.modifyMeshObject=i,this.item=o,this},lh.prototype.createTexture=function(e){var t=Cesium.Rectangle.fromCartesianArray(e),i=180*t.west/Math.PI,o=180*t.south/Math.PI,r=180*t.east/Math.PI,t=180*t.north/Math.PI,n=new Cesium.Rectangle(i,o,r,t),a=[],s=this,i=(e.forEach(function(e){e=e.longitude?e:Cesium.Ellipsoid.WGS84.cartesianToCartographic(e),e=s.getPointRelativePosition(e,n,s.texturePixel,s.texturePixel);a.push([e.normalizedLongitude,e.normalizedLatitude])}),this.createCanvas(a,"#FF0000",s.texturePixel,s.texturePixel)),o=new Image;return o.width=s.texturePixel,o.height=s.texturePixel,o.src=i.toDataURL("image/png"),o},lh.prototype.getPointRelativePosition=function(e,t,i,o){var r=t.east-t.west,n=t.north-t.south,a=180*e.longitude/Math.PI,s=180*e.latitude/Math.PI;return e.normalizedLongitude=(a-t.west)/r*i,e.normalizedLatitude=(s-t.south)/n*o,e},lh.prototype.createCanvas=function(e,t,i,o){var r=document.createElement("canvas"),n=(r.width=i,r.height=o,r.getContext("2d"));if(n.fillStyle="#000",n.fillRect(0,0,i,i),!(e.length<=0)){n.moveTo(e[0][0],e[0][1]);for(var a=0;a<e.length;a++)n.lineTo(e[a][0],e[a][1]);return n.fillStyle=t,n.fill(),r}},lh.prototype.remove=function(){this.item.modifyMeshObject=void 0},ch.prototype.addClipping=function(r,n={}){if(this.remove(),"polygon"===n.type){let e=n.positions,t=[];e.forEach(e=>{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<t.length-1;e++){var s=this.createPlane(t[e],t[e+1],a);o.push(s)}r.clippingPlanes=new Cesium.ClippingPlaneCollection({planes:o,unionClippingRegions:!n.isInner})}return this.item=r,this},ch.prototype.getInverseTransform=function(e){let t,i=e.root.transform;return t=i&&i.equals(Cesium.Matrix4.IDENTITY)||!i?Cesium.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center):Cesium.Matrix4.fromArray(e.root.transform),Cesium.Matrix4.inverseTransformation(t,new Cesium.Matrix4)},ch.prototype.getOriginCoordinateSystemPoint=function(e,t){e=Cesium.Cartesian3.fromDegrees(e.lon,e.lat);return Cesium.Matrix4.multiplyByPoint(t,e,new Cesium.Cartesian3(0,0,0))},ch.prototype.createPlane=function(e,t,i){e=this.getOriginCoordinateSystemPoint(e,i),t=this.getOriginCoordinateSystemPoint(t,i),i=new Cesium.Cartesian3(0,0,1),t=Cesium.Cartesian3.subtract(t,e,new Cesium.Cartesian3),t=Cesium.Cartesian3.cross(t,i,new Cesium.Cartesian3),t=Cesium.Cartesian3.normalize(t,t),i=Cesium.Plane.fromPointNormal(e,t);return Cesium.ClippingPlane.fromPlane(i)},ch.prototype.isClockWise=function(t){if(t.length<3)return null;t[0]===t[t.length-1]&&(t=t.slice(0,t.length-1));let i={i:-1,val:90};for(let e=0;e<t.length;e++){var o=t[e]["lat"];o<i.val&&(i.val=o,i.i=e)}var e=(i.i+t.length-1)%t.length,r=i.i,n=(i.i+1)%t.length;let a=t[r].lat-t[e].lat,s=t[r].lon-t[e].lon,l=t[n].lat-t[r].lat,c=t[n].lon-t[r].lon;r=c*a-s*l;return 0==r?t[n].lon<t[e].lon:0<r},ch.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)},uh.prototype.addCZML=function(e,t,i){var o=this,r=(t=t||{},new this._cesium.CzmlDataSource),r=(this._viewer.dataSources.add(r),this.item=r,this._option=t,this.item.process(e).then(function(e){o.Pretreatment(e,t),i&&"function"==typeof i&&i(e)}),{id:this._core.getuid(),name:"新建CZML",pId:0,type:"CZML",item:this});return this.setTreeobj(r),this._tree.insertGroupId(r,0),this},uh.prototype.process=function(e,t){let i=this;this.item&&this.item.process(e).then(function(e){i.Pretreatment(e,i._option),t&&"function"==typeof t&&t(e)})},uh.prototype.Pretreatment=function(e,t){let o=this,i=e.entities.values;i.forEach(i=>{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))})},uh.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)},uh.prototype.setTreeobj=function(e){this.treeobj=e},uh.prototype.setVisibility=function(e){null!=this.item&&(this.item.show=e)},hh.prototype.addHeatMap=function(e,t={}){"HeatmapGL"===t.type?this.item=new on(this._viewer,t):this.item=new tn(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},hh.prototype.setData=function(e){this.item&&this.item.setData(e)},hh.prototype.flyToBounding=function(){this.item&&this.item.flyToBounding()},hh.prototype.deleteObject=function(){this.item&&this.item.destroy()},hh.prototype.setTreeobj=function(e){this.treeobj=e},hh.prototype.setVisibility=function(e){null!=this.item&&this.item.show(e)},mh.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},mh.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)},mh.prototype.clear=function(){this.TrailEntitys.forEach(e=>{this._viewer.entities.remove(e)}),this.TrailEntitys=[]},mh.prototype.faster=function(){this._viewer.animation.viewModel.faster()},mh.prototype.slower=function(){this._viewer.animation.viewModel.slower()},mh.prototype.setSpeed=function(e){this._viewer.clock.multiplier=parseFloat(e)},mh.prototype.isPause=function(e){this._viewer.clockViewModel.shouldAnimate=!e},mh.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<t.length;e++){var r=Cesium.JulianDate.addSeconds(i,t[e].time,new Cesium.JulianDate),n=Cesium.Cartesian3.fromDegrees(t[e].lon,t[e].lat,t[e].hei);o.addSample(r,n)}else if(2==e)for(let e=0;e<t.length;e++){var a=Cesium.JulianDate.addSeconds(i,t[e].time,new Cesium.JulianDate),s=Cesium.Cartesian3.fromDegrees(t[e].lon,t[e].lat,t[e].phei);o.addSample(a,s)}return o},mh.prototype.getRandState=function(t,i){var o=this.flyHeight;for(let e=0;e<i;e++){let i=[];var r=Math.floor(180*Math.random());for(let t=0;t<=360;t+=30){let e=new dh(o);t<=180?(e.lon=r,e.lat=t-90):(e.lon=r-180,e.lat=270-t),e.time=10*t,i.push(e)}t.push(i)}for(let e=0;e<i;e++){let i=[];var n=Math.floor(180*Math.random())-90;for(let t=-180;t<=180;t+=30){let e=new dh(o);e.lon=t,e.lat=n,e.time=10*(t+180),i.push(e)}t.push(i)}},ph.prototype.CreateWMSImageFeatureLayer=function(e,t,i,s,o,r,n){var l={url:"",queryParameters:{layers:"",style:"",transparent:!0,srs:"EPSG:4326",service:"WMS",request:"GetMap",version:"1.1.1",format:"image/png",bbox:"{westProjected},{southProjected},{eastProjected},{northProjected}",width:"256",height:"256"}},c=(l.url=t.url,l.queryParameters=this._core.extend(l.queryParameters,t.queryParameters,!0),i),u=(null==t&&console.log("options is required"),this);this._Provider=new T(this._viewer,this._cesium),this._Provider.loadTile=function(e,t){var i,o,r,n,a;o=e,r=c,e=u,n=this,(i=t).state===Cesium.QuadtreeTileLoadState.START&&(t.data={lines:[],geometryPrimitive:void 0},t.level>=(s.level_min||1)&&t.level<(s.level_max||22)&&e.item.show?(a=new Cesium.Rectangle(0,0,0,0),n._tilingScheme.tileXYToRectangle(i.x,i.y,i.level,a),l.queryParameters.bbox=180*a.west/Math.PI+","+180*a.south/Math.PI+","+180*a.east/Math.PI+","+180*a.north/Math.PI,new Cesium.Resource(l).fetchImage().then(function(e){e=new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:a})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}})})});e.cusResource=r,t.data.geometryPrimitive=e,t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state===Cesium.QuadtreeTileLoadState.LOADING&&(t.data.geometryPrimitive.update(o,[]),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},function(e){console.log(e)}),t.state=Cesium.QuadtreeTileLoadState.LOADING,t.state=Cesium.QuadtreeTileLoadState.LOADING):(t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0))},this._primitive=new u._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});this._viewer.scene.primitives.add(this._primitive),this._primitive.show=this.item.show,this.item=this._primitive,r||this.setVisibility(!1),this._core.isnull(t.id)&&(t.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+t.id);i={id:t.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(i),this._tree.insertGroupId(i,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},ph.prototype.CreateVectorImageFeatureLayer=function(e,t,i,s,o,r,n){var a={url:"",queryParameters:{layer:"",style:"",tilematrixset:"EPSG:4326",Service:"WMTS",Request:"GetTile",Version:"1.0.0",Format:"image/png",TileMatrix:"EPSG:4326:",TileCol:"",TileRow:""}},l=(this._option=this._core.extend(a,t,!0),this._queryOption=i,this._core.extend(a,t,!0)),c=i,u=(null==t&&console.log("options is required"),this);this._Provider=new T(this._viewer,this._cesium),this._Provider.loadTile=function(e,i){var o,r,n,a;r=e,n=c,e=u,a=this,(o=i).state===Cesium.QuadtreeTileLoadState.START&&(i.data={lines:[],geometryPrimitive:void 0},i.level>=s.level_min&&i.level<s.level_max&&e.item.show?(l.queryParameters.TileMatrix=l.queryParameters.tilematrixset+":"+o.level,l.queryParameters.TileCol=o.x,l.queryParameters.TileRow=o.y,new Cesium.Resource(l).fetchImage().then(function(e){var t=new Cesium.Rectangle(0,0,0,0),t=(a._tilingScheme.tileXYToRectangle(o.x,o.y,o.level,t),new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:t})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:e}}})})}));t.cusResource=n,i.data.geometryPrimitive=t,i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state===Cesium.QuadtreeTileLoadState.LOADING&&(i.data.geometryPrimitive.update(r,[]),i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0)},function(e){console.log(e)}),i.state=Cesium.QuadtreeTileLoadState.LOADING,i.state=Cesium.QuadtreeTileLoadState.LOADING):(i.state=Cesium.QuadtreeTileLoadState.DONE,i.renderable=!0))},this._primitive=new u._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});this._viewer.scene.primitives.add(this._primitive),this._primitive.show=this.item.show,this.item=this._primitive,r||this.setVisibility(!1),this._core.isnull(t.id)&&(t.id=this._core.getuid()),this._core.isnull(e)&&(e="新建图层"+t.id);a={id:t.id,name:e,checked:!0,pId:this._core.isnull(o)?0:o,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(a),this._tree.insertGroupId(a,this._core.isnull(o)?0:o),"function"==typeof n&&n(this.item),this},ph.prototype.setTreeobj=function(e){this.treeobj=e},ph.prototype.setVisibility=function(e){try{null!=this.item&&null!=this.item.show&&(this.item.show=e),this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(e)}catch(e){}},ph.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch(e){}},gh.prototype.findDirectParent=function(e){try{var t=[];if(e.width==Math.PI)return null;for(var i=0;i<th.scene.globe._surface._tilesToRender.length;i++){var o=th.scene.globe._surface._tilesToRender[i],r=o._rectangle;Cesium.Rectangle.intersection(r,e)&&t.push(o)}return t}catch(e){}return null},gh.prototype.createTerrainModifier=function(e,t,i){var o=t.length,o=new Array(o),r=(o.fill(i),Cesium.createGuid()),i=Date.now(),n=Cesium.Rectangle.fromCartesianArray(t),a=this.findDirectParent(n),s=(this._viewer.terrainProvider&&void 0===this._viewer.terrainProvider._modifyTerrainObjects&&(this._viewer.terrainProvider._modifyTerrainObjects=[]),this._viewer),e={id:r,name:e,show:!0,rectangle:n,vertices:t,heights:o,timeStamp:i,remove:function(){if(s.terrainProvider&&s.terrainProvider._modifyTerrainObjects)for(var e=s.terrainProvider._modifyTerrainObjects.length-1;0<=e;e--)s.terrainProvider._modifyTerrainObjects[e].id==r&&s.terrainProvider._modifyTerrainObjects.splice(e,1);if(a)try{for(e=0;e<a.length;e++)try{a[e]._parent.freeResources()}catch(e){}}catch(e){}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(e),a)try{for(var l=0;l<a.length;l++)try{a[l]._parent.freeResources()}catch(e){}}catch(e){}return e},fh.prototype.Video3D=function(e){return this.url=e.url,this.options=e,this.videoContainer=e.video||void 0,this.videoType=e.type||"mp4",this.video2D=e.video2D,this.options.video={container:this.videoContainer,offset:e.offset},e.type&&0<=e.type.indexOf("h265")?this.addDiv(e.success):this.addVideo(e.success),this},fh.prototype.addDiv=function(e){var t="Video3D"+this._core.getuid(),i=`<div id="${t}" style="display: none"></div>`;$(this._viewer.container).append(i),this.divContainer=document.getElementById(t),this.load(),e(this)},fh.prototype.addVideo=function(e){var t,i;this.videoContainer?this.videoContainer.oncanplay=()=>{this.init&&this.init()}:(i=`<video id="${t="Video3D"+this._core.getuid()}" autoplay muted loop crossorigin  style="display: none"></video>`,$(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))})},fh.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 if("flv-h265"===this.videoType){if(!window.WasmPlayer){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/EasyWasmPlayer.js")}if(window.WasmPlayer){let e=this;this.player=new WasmPlayer(null,this.divContainer.id,function(){e.thisVideo||e.init&&e.init()},{Height:!0}),this.videoContainer=this.player.canvas,this.options.video.container=this.videoContainer,this.player.play(t,1)}}else this.videoContainer.src=t,this.thisVideo&&(this.videoContainer.load(),this.videoContainer.play());this.isLoad=!0},fh.prototype.pause=function(){"mp4"!==this.videoType&&(this.isLoad=!1),this.player&&this.player.destroy(),this.videoContainer.pause()},fh.prototype.flyTo=function(){this.thisVideo&&this.thisVideo.flyTo()},fh.prototype.play=function(){this.isLoad||this.load(),this.videoContainer.play()},fh.prototype.init=function(){this.thisVideo||(!this.isPause&&this.videoContainer&&this.videoContainer.readyState===this.videoContainer.HAVE_ENOUGH_DATA&&this.play(),this.video2D?this.thisVideo=new Hl(this._viewer,this.options):this.thisVideo=new nr(this._viewer,this.options))},fh.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&&this.thisVideo.updatePost(e)},fh.prototype.setVisibility=function(e){this.thisVideo&&this.thisVideo.setVisibility(e)},fh.prototype.destroy=function(){this.thisVideo&&this.thisVideo.destroy(),this.thisVideo=null,this.player&&this.player.destroy&&this.player.destroy(),this.videoContainer&&this.videoContainer.remove()},_h.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<t.length;e++){var i=t[e];this.addPolygon(r,i,o)}}),this.item=this._viewer.scene.primitives.add(r);e={id:o.id,name:"新建水面图层",pId:0,type:"polygonLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},Ch.prototype.addPolygon=async function(e,t,i){var o=Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,r=Cesium.Color.fromCssColorString(i.color),o=new Cesium.PolygonGeometry({polygonHierarchy:t.polygon.hierarchy.getValue(),extrudedHeight:i.extrudedHeight,height:i.height,vertexFormat:o}),o=new Cesium.GeometryInstance({geometry:o,id:t,attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near,i.far)}});let n;t=new(n=i.height||i.extrudedHeight?Cesium.Primitive:Cesium.GroundPrimitive)({geometryInstances:o,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:{baseWaterColor:r,blendColor:r,normalMap:i.image,frequency:i.frequency,animationSpeed:i.speed/1e3,amplitude:i.amplitude}}})}),classificationType:i.classificationType});e.add(t)},Ch.prototype.setTreeobj=function(e){this.treeobj=e},Ch.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(e){console.log(e)}},Ch.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},yh.prototype.create=function(e,t={}){this.grid=this._core.defaultValue(t.grid,!0);let _=t.center,C=t.scale||1;return this._core.getJSON(e,n=>{var a=Math.max(...n.mData)*C,s=n.mHorPointsNum,l=n.mVerPointsNum;if(_=n.mCenterPoint&&n.mCenterPoint.length?n.mCenterPoint:_){var c=new Float64Array(3*n.mData.length),u=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<n.mHEndAngle;i+=n.mHStep,o++)for(let e=n.mVStartAngle,t=0;e<=n.mVEndAngle;e+=n.mVStep,t++){var g=n.mData[r++]*C,f=this._core.getPositionFromHPR(_,g,i,e),f=Cesium.Cartesian3.fromDegrees(f.lon,f.lat,f.height);c[u++]=f.x,c[u++]=f.y,c[u++]=f.z,h[m++]=(o+1)/s,h[m++]=Math.pow(g/a,3),0!==o&&0!==t&&(d[p++]=(o-1)*l+(t-1),d[p++]=(o-1)*l+t,d[p++]=o*l+t-1,d[p++]=(o-1)*l+t,d[p++]=o*l+t,d[p++]=o*l+t-1,o===s-1&&(d[p++]=t-1,d[p++]=t,d[p++]=o*l+t-1,d[p++]=t,d[p++]=o*l+t,d[p++]=o*l+t-1))}this.addGeometry({positions:c,st:h,indexs:d,minColor:t.minColor,maxColor:t.maxColor},t.flyTo)}else console.log("缺少场强中心坐标")}),this},yh.prototype.addGeometry=function(e,t){var i=new Cesium.Geometry({attributes:{position:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),st:new Cesium.GeometryAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e.st})},indices:e.indexs,primitiveType:this.grid?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,boundingSphere:Cesium.BoundingSphere.fromVertices(e.positions)}),o=new Cesium.GeometryInstance({geometry:i});this.item=new Cesium.Primitive({geometryInstances:o,appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color1:Cesium.Color.fromCssColorString(e.minColor||"#ff0000"),color2:Cesium.Color.fromCssColorString(e.maxColor||"#00ff00")},source:this.getShader()}})}),asynchronous:!1}),this._viewer.scene.primitives.add(this.item),t&&this._viewer.camera.flyToBoundingSphere(i.boundingSphere)},yh.prototype.setVisibility=function(e){this.item&&(this.item.show=e)},yh.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item)},yh.prototype.getShader=function(){return"uniform vec4 color1;\n    uniform vec4 color2;\n    czm_material czm_getMaterial(czm_materialInput materialInput)\n    {\n        czm_material material = czm_getDefaultMaterial(materialInput);\n        vec2 st = materialInput.st;\n        material.diffuse = color1.rgb * (1.0 - st.y) + color2.rgb * st.y; \n        material.alpha = color1.a * (1.0 - st.y) + color2.a * st.y;\n        return material;\n    }\n        "};var vh="uniform float angle;\nuniform sampler2D image;\nuniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nst.x = st.x - 0.5;\nst.y = st.y - 0.5;\nif(st.x * st.x + st.y * st.y <= 0.25){\nfloat x = st.x * cos(angle) - st.y * sin(angle);\nfloat y = st.y * cos(angle) + st.x * sin(angle);\nst.x = x + 0.5;\nst.y = y + 0.5;\n} else {\nst.x = st.x + 0.5;\nst.y = st.y + 0.5;\n}\nmaterial.diffuse = czm_gammaCorrect(texture2D(image, st).rgb * color.rgb);\nmaterial.alpha = texture2D(image, st).a * color.a;\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n";function wh(e){this._viewer=e,this._core=new f,this.angle=0,this.multiple=1,this.destroyed=!1,this.type="rotate",this.show=!0}wh.prototype.createRotateCircle=function(e={}){this.type="rotate",this.radius=this._core.defaultValue(e.radius,500),this.multiple=this._core.defaultValue(e.multiple,1),this.scale=[this.radius,this.radius,1];var t=Cesium.Color.fromCssColorString(e.color||"#80ccff");return this.color=[t.red,t.green,t.blue],this.clampToGround=e.clampToGround,this.position=e.position,this.image=e.image,e.image||(this.image=e.scan?SmartEarthRootUrl+I.scanCircle:SmartEarthRootUrl+I.effectCircle),e.scan&&(this.multiple=-this.multiple),Cesium.Resource.createIfNeeded(this.image).fetchImage().then(e=>{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},wh.prototype.createDRWCircle=function(e={}){this.type="DRW",this.radius=this._core.defaultValue(e.radius,50),this.multiple=this._core.defaultValue(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},wh.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}))},wh.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)})},wh.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:vh}})})},wh.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))},wh.prototype.isDestroyed=function(){return this.destroyed},wh.prototype.destroy=function(){this.circle&&this.circle.destroy(),this.circle=null,this.destroyed=!0},wh.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this)},wh.prototype.setVisibility=function(e){this.show=e};var bh="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",Th="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",Sh="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 Eh(e){this._viewer=e,this._core=new f,this.angle=0,this.multiple=1,this.destroyed=!1,this.type="cylinder",this.show=!0}function Ph(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 xh(e){this._viewer=e,this._core=new f,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 f,this._Label=new G(this._viewer,this._cesium),this._Circle=new H(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 F(this._viewer,this._cesium),this._Polygon=new M(this._viewer,this._cesium),this._ImageLabel=new gu(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new w(this._viewer,this._cesium,this._ImageryProvidererid),this._Ellipsoid=new Fr(this._viewer,this._cesium),this._PointModel=new P(this._viewer,this._cesium),this._wall=new fu(this._viewer,this._cesium),this._Terrain=new zu(this._viewer,this._cesium),this._createdynamicObject=new k(this._viewer,this._cesium),this._GeometryCreator,this._ImageryLayer=new yu(this._viewer,this._cesium),this._VolumeGeoJsonFeatureLayer=void 0,this._PolygonVectorGeoJsonFeatureLayer=void 0,this._skyBox=new Qu(this._viewer,this._cesium),this._flowField=new qu(this._viewer,this._cesium),this._canvasField=new rc(this._viewer,this._cesium),this.VectorGeoJsonFeatureLayer=new E(this._viewer,this._cesium),this._straightArrow=new K(this._viewer,this._cesium),this._SimpleGraphic=new x(this._viewer,this._cesium),this._popupmessage=new Si(this._viewer,this._cesium),this._VectorImgFeatureLayer=ph,this._TerrainModifier=new gh(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<e.indexOf("nullvalue=")&&(i=e.split("nullvalue=")[1].split("&")[0].split("%2C"),s.r=i[0],s.g=i[1],s.b=i[2]),-1<e.indexOf("nulltolerance=")&&(a=e.split("nulltolerance=")[1].split("&")[0]),new Image),c=document.createElement("canvas"),u=c.getContext("2d");l.url=e,l.onload=function(){if(null!=l.url&&-1!=l.url.indexOf("nullvalue")){delete l.url,c.width=l.width,c.height=l.height,u.drawImage(l,0,0),l.imageProcesses=[];for(var e=l.width/8,t=l.height,i=0;i<8;i++){var o=i*e,r=u.getImageData(o,0,e,t).data;l.imageProcesses[i]=h.queueWorkItem({nullValue:s,nullTolerance:a,canvasData:r,width:e,height:t,startX:o})}Cesium.when.all(l.imageProcesses,function(e){for(var t=0;t<e.length;t++){for(var i=u.createImageData(e[t].width,e[t].height),o=0;o<e[t].canvasData.length;o++)i.data[o]=e[t].canvasData[o];u.putImageData(i,e[t].startX,0)}l.src=c.toDataURL(),n.resolve(l)}).otherwise(function(e){console.log(e)})}else n.resolve(l)},l.onerror=function(e){n.reject(e)},t&&(Cesium.TrustedServers.contains(e)?l.crossOrigin="use-credentials":l.crossOrigin=""),l.src=e})}function Dh(e,t){this._viewer=e,this.Cesium=t,this.czmlData=new Map}function Ih(e,t){this._viewer=e,this._cesium=t,this._Core=new f}function Ah(e,t){this._viewer=e,this._cesium=t}function Lh(e,t){this._viewer=e,this._cesium=t}function Mh(e,t){this._viewer=e,this._cesium=t}function Rh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function Oh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource(),this._core=new f}function Bh(e,t){this._viewer=e,this._cesium=t}function Vh(e,t){this._viewer=e,this._cesium=t}function Fh(e,t){this._viewer=e,this._cesium=t}function Hh(e,t){this._viewer=e,this._cesium=t,this._zoomIn=new Lh(this._viewer,this._cesium),this._zoomOut=new Mh(this._viewer,this._cesium),this._flyTo=new Fi(this._viewer,this._cesium,this._tree),this._flyToObj=new Rh(this._viewer,this._cesium),this._jumpTo=new Oh(this._viewer,this._cesium,this._tree),this._northfinger=new Bh(this._viewer,this._cesium),this._Stop=new Fh(this._viewer,this._cesium),this._PointFly=new _r(this._viewer,this._cesium)}function Gh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function kh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function Nh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function jh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function Uh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function zh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function Wh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}Eh.prototype.createCylinder=function(e={}){this.type="cylinder",this.radius=e.radius||500,this.length=e.length||100,this.number=e.number||30,this.multiple=e.multiple||1,this.near=e.near,this.far=e.far;var t=Cesium.Color.fromCssColorString(e.color||"#80ccff"),t=(this.scale=[this.radius,this.radius,this.length],this.color=[t.red,t.green,t.blue,t.alpha],this.geometryValue=this.getCylinderGeometryValue(1,1,1,this.number),this.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),new Cesium.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix}));return this.cylinder=new Cesium.Primitive({geometryInstances:t,appearance:this.getAppearance(),asynchronous:!1}),this._viewer.scene.primitives.add(this),this},Eh.prototype.createCone=function(e={}){this.type="cone",this.radius=e.radius||500,this.length=e.length||100,this.near=e.near,this.far=e.far;var t=Cesium.Color.fromCssColorString(e.color||"#80ccff"),t=(this.scale=[this.radius,this.radius,this.length],this.color=[t.red,t.green,t.blue,t.alpha],this.geometryValue=this.getCylinderGeometryValue(2,.3,1,6),this.modelMatrix=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.position.lon,e.position.lat,e.position.height)),new Cesium.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix}));return this.cylinder=new Cesium.Primitive({geometryInstances:t,appearance:this.getAppearance(),asynchronous:!1}),Cesium.Resource.createIfNeeded(SmartEarthRootUrl+I.particles).fetchImage().then(e=>{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:Sh}}),renderState:{cull:{enabled:!1}}}),asynchronous:!1}),setTimeout(()=>{this.cylinder1.appearance.material.uniforms.color.alpha=2})}),this._viewer.scene.primitives.add(this),this},Eh.prototype.getAppearance=function(){return"cylinder"===this.type?new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color:new Cesium.Color(...this.color)},source:bh}}),renderState:{cull:{enabled:!1}}}):"cone"===this.type?new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{uniforms:{color:new Cesium.Color(...this.color)},source:Th}}),renderState:{cull:{enabled:!1}}}):void 0},Eh.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))})},Eh.prototype.getCylinderGeometryValue=function(e=1,t=1,n=1,a=30){var s=[e,0],l=[t,0],c=Cesium.Math.toRadians(360/a),u=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=c*e,i=u*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}},Eh.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,1<this.dt&&(this.dt=0),t=.5*(1-Math.cos(this.dt*Math.PI*2)),this.scale[0]=this.scale[1]=this.radius*(1-Math.cos(this.dt*Math.PI))*.5,this.scale[2]=this.length*t,this.color[3]=2*t,t=new Cesium.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix}),this.cylinder.destroy(),this.cylinder=new Cesium.Primitive({geometryInstances:t,appearance:this.getAppearance(),asynchronous:!1}),t=null),this.cylinder.update(e),this.cylinder1&&this.cylinder1.update(e))},Eh.prototype.isDestroyed=function(){return this.destroyed},Eh.prototype.destroy=function(){this.cylinder&&this.cylinder.destroy(),this.cylinder=null,this.cylinder1&&this.cylinder1.destroy(),this.cylinder1=null,this.destroyed=!0},Eh.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this)},Eh.prototype.setVisibility=function(e){this.show=e},Ph.prototype.update=function(e){this.show&&(Cesium.defined(this._command)||(this._command=this.createCommand(e.context)),Cesium.defined(this._outlineCommand)||(this._outlineCommand=this.createCommand(e.context,!0)),e.commandList.push(this._command,this._outlineCommand),this.animate&&(this._angle+=.01,1<this._angle&&(this._angle=0),this._height=.04*Math.sin(this._angle*Math.PI*2),e=new Cesium.Cartesian3(0,0,this._height),Cesium.Matrix4.multiplyByTranslation(this._modelMatrix,e,this._modelMatrix),e=Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(4*this._speed))),Cesium.Matrix4.multiply(this._modelMatrix,e,this._modelMatrix)))},Ph.prototype.isDestroyed=function(){return!1},Ph.prototype.destroy=function(){return Cesium.defined(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),Cesium.defined(this._outlineCommand)&&(this._outlineCommand.shaderProgram=this._outlineCommand.shaderProgram&&this._outlineCommand.shaderProgram.destroy()),Cesium.destroyObject(this)},Ph.prototype.startAnimate=function(){this.animate=!0},Ph.prototype.closeAnimate=function(){this.animate=!1},Ph.prototype.deleteObject=function(){this.destroy()},Ph.prototype.setVisibility=function(e){this.show=e},Ph.prototype.createCommand=function(e,t){var i=Cesium.Appearance.getDefaultRenderState(!0,!0,void 0),i=new Cesium.RenderState(i),o=Cesium.ShaderProgram.fromCache({context:e,vertexShaderSource:this.createVertexShader(),fragmentShaderSource:this.createFragmentShader(),attributeLocations:{position:0,textureCoordinates:1}});let r=t?this._outlineColor:this._color;return new Cesium.DrawCommand({pickId:"Tetrahedron",vertexArray:this.createVertexArray(e,t),primitiveType:t?Cesium.PrimitiveType.LINES:Cesium.PrimitiveType.TRIANGLES,renderState:i,shaderProgram:o,uniformMap:{color:()=>r},owner:this,pass:Cesium.Pass.TRANSLUCENT,modelMatrix:this._modelMatrix,boundingVolume:new Cesium.BoundingSphere(this._position,1)})},Ph.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})},Ph.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:[]}},Ph.prototype.createVertexShader=function(){return"attribute vec3 position;\n        void main()\n        {\n            gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n        }\n        "},Ph.prototype.createFragmentShader=function(){return"uniform vec4 color;\n        void main()\n        {\n            gl_FragColor = color;\n        }\n        "},Ph.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)},xh.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)},xh.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})})},xh.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]},xh.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),c=this.getImage("center"),u=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:c,0,0,l.width,l.height,303,15,l.width,l.height),e.context.drawImage(0===o?l:c,0,0,l.width,l.height,303,n,l.width,l.height),e.context.drawImage(1===o?l:c,0,0,l.width,l.height,303,m,l.width,l.height),e.context.drawImage(-1===r?u:h,0,0,u.width,u.height,485,15,u.width,u.height),e.context.drawImage(0===r?u:h,0,0,u.width,u.height,485,n,u.width,u.height),e.context.drawImage(1===r?u:h,0,0,u.width,u.height,485,m,u.width,u.height),this.drawTime(e.context,{left:i,center:o,x:153,y:143,time:t})},xh.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)},xh.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)},xh.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))},xh.prototype.isShow=function(e){return Cesium.Cartesian3.distance(this._viewer.camera.position,e.position)<e.far},xh.prototype.removeById=function(e){let t=this._values.get(e);t&&t.geometry&&t.geometry.destroy(),this._values.delete(e)},xh.prototype.showById=function(e,t){let i=this._values.get(e);i&&(i.show=t)},xh.prototype.isDestroyed=function(){return this.destroyed},xh.prototype.destroy=function(){for(var e of this._values.values())e.geometry&&e.geometry.destroy();this._values=new Map,this.img=null,this.imageData=null,this.destroyed=!0},xh.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this),this.destroy()},xh.prototype.setVisibility=function(e){this.show=e},Q.prototype.create3DTilesets=function(e,t,i,o,r,n,a){e=this._D3Tileset.create3DTilesets(e,t,i,o,r,n,a);return this._D3Tilesets||(this._D3Tilesets=[],this._SE3DTilesets=new Map),this._SE3DTilesets.set(e.treeobj.id,e),this._D3Tilesets.push(e.item),e},Q.prototype.set3DTilesetsAlpha=function(t){this._D3Tilesets&&this._D3Tilesets.forEach(e=>{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 Ht({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 uh(this._viewer,this._cesium);return o.addCZML(e,t,i)},Q.prototype.addHeatMap=function(e,t){let i=new hh(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<i;e++)t.imageryLayers.get(e).brightness=o;this._D3Tilesets&&this._D3Tilesets.forEach(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 _h(this._viewer,this._cesium)),this._TdtLabel.GeoWTFS(e)},Q.prototype.Video3D=function(e){let t=new fh(this._viewer,this._cesium);return t.Video3D(e)},Q.prototype.addRotateEffectCircle=function(e){return new wh(this._viewer).createRotateCircle(e)},Q.prototype.addTetrahedron=function(e){return new Ph(this._viewer,e)},Q.prototype.addTrafficLight=function(e){return this._TrafficLight||(this._TrafficLight=new xh(this._viewer)),this._TrafficLight.add(e)},Q.prototype.addDRWEffectCircle=function(e){return new wh(this._viewer).createDRWCircle(e)},Q.prototype.addEffectCylinder=function(e){return new Eh(this._viewer).createCylinder(e)},Q.prototype.addEffectCone=function(e){return new Eh(this._viewer).createCone(e)},Q.prototype.createGeoJsonFeatureLayerProviderOptimization=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.selectedItem.id),o=this._core.isnull(o)?0:o,a.createVector3DTilesFeatureLayerRelease(e,t,i,o,r,n)},Q.prototype.createGeojsonImage=function(e){return new E(this._viewer,this._cesium).createGeojsonImage(e)},Q.prototype.createGeoJsonFeatureLayerProvider=function(e,t,i,o,r,n){var a=new E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 zu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 mh(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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 pu(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 Ti(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 nh(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 fu(this._viewer,this._cesium).executeWall(e,t)},Q.prototype.createWall=function(e,t,i,o){return new fu(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 du(this._viewer,this._cesium).createPolylineVolume(e,t,i,o,r)},Q.prototype.createCorridor=function(e,t,i,o){return new cc(this._viewer,this._cesium).createCorridor(e,t,i,o)},Q.prototype.addViewCone=function(e){let t=new ar(this._viewer,this._cesium);return t.addViewCone(e)},Q.prototype.createViewCone=function(e,t){let i=new ar(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 ch(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 Si(this._viewer,this._cesium).createPopupMessage(e)},Q.prototype.createMeasurement=function(e){return new Si(this._viewer,this._cesium).createMeasurement(e)},Q.prototype.createPlotting=function(e){return new Si(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 ah(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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ii(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 sh(this._viewer,this._cesium).createKmlLayer(e,t,i)},Q.prototype.addKmlLayer=function(e,t,i,o){return new sh(this._viewer,this._cesium).addKmlLayer(e,t,i,o)},Q.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis=function(e,t,i,o,r){var n=new mo(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ii(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 S(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 E(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 yu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.selectedItem.id),i=this._core.isnull(i)?0:i,a.createArcGisImageryLayer(e,t,i,o,r,n)},Q.prototype.createImageryLayerGrid=function(e){return new yu(this._viewer,this._cesium).createImageryLayerGrid(e)},Q.prototype.createWebMapServerImageLayer=function(e,t,i,o,r,n){var a=new yu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 yu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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 yu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Hi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Hi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Hi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Hi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Wu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Wu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Wu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Wu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ju(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ju(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ju(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 go(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 go(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 yu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 yu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Ju(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Gi(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 H(this._viewer,this._cesium).createCircle(e,t,i,o)},Q.prototype.CreateRectangle=function(e,t,i,o,r){return new F(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 Bl(this._viewer,this._cesium).createBillboardbatch(e)},Q.prototype.createBillboard=function(e){return new Bl(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 lc(this._viewer).create(e,t,i)},Q.prototype.FieldIntensity=function(e,t){return new yh(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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 Fr(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 gu(this._viewer,this._cesium);return this._core.isnull(i)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(i=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(r=V.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 gu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 gu(this._viewer,this._cesium);return this._core.isnull(o)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(o=V.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 H(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(r=V.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 H(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(a=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(a=V.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 pu(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(V.selectedItem)&&"group"==V.selectedItem.type&&(a=V.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(V.selectedItem)&&"group"==V.selectedItem.type&&(a=V.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 Fr(this._viewer,this._cesium);return this._core.isnull(a)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(a=V.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 F(this._viewer,this._cesium).createRectangleOptimization(e,t)},Q.prototype.createCircleOptimization=function(e,t){return new H(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){var s=new this._VectorImgFeatureLayer(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(r=V.selectedItem.id),r=this._core.isnull(r)?0:r,s.CreateVectorImageFeatureLayer(e,t,i,o,r,n,a)},Q.prototype.CreateWMSImageFeatureLayer=function(e,t,i,o,r,n,a){var s=new this._VectorImgFeatureLayer(this._viewer,this._cesium);return this._core.isnull(r)&&!this._core.isnull(V.selectedItem)&&"group"==V.selectedItem.type&&(r=V.selectedItem.id),r=this._core.isnull(r)?0:r,s.CreateWMSImageFeatureLayer(e,t,i,o,r,n,a)},Q.prototype.createVolumetricMeasureTool=function(){return new Sr(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 rh(this._viewer,this._cesium)}}}),Object.defineProperties(Q.prototype,{_Point:{get:function(){return new L(this._viewer,this._cesium)}},GeometryCreator:{CreateLinearRingGeometry:function(e){return{}}}}),Dh.prototype.get=function(e){return this.czmlData.get(e)},Dh.prototype.flyTo=function(e){this._viewer.flyTo(this.get(e))},Dh.prototype.trackedEntity=function(e){let t=this.get(e);this._viewer.trackedEntity=t.entities.getById(e)},Dh.prototype.delete=function(e){var t=this.czmlData.get(e);this._viewer.dataSources.remove(t),this.czmlData.delete(e)},Dh.prototype.deleteAll=function(){for(var e of this.czmlData.values())this._viewer.dataSources.remove(e);this.czmlData=new Map},Dh.prototype.getThisPlayTime=function(){return this._viewer.clock.currentTime.secondsOfDay-this._viewer.clock.startTime.secondsOfDay},Dh.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},Dh.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)},Dh.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)},Dh.prototype.endPick=function(){this.pickHandler.destroy(),this.pickHandler=void 0},Ih.prototype.AttachEvent=function(e,o){var t,i,r=this._viewer,n=this._Core,n=this._Core;return e===en.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===en.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===en.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===en.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===en.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===en.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===en.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===en.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===en.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===en.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===en.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===en.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.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},Ih.prototype.AttachCameraChangeEvent=function(e){return this._viewer.scene.camera.percentageChanged=1e-6,this._viewer.scene.camera.changed.addEventListener(e),e},Ih.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)},Ah.prototype.DetachEvent=function(e,t){t===en.L_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK):t===en.L_DBL_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK):t===en.L_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN):t===en.L_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP):t===en.M_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK):t===en.M_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN):t===en.M_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP):t===en.R_Click?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK):t===en.R_Down?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN):t===en.R_Up?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP):t===en.Wheel?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL):t===en.Move?e&&e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE):e&&e.destroy()},Ah.prototype.DetachEventAll=function(e){e&&e.destroy()},Ah.prototype.RemoNormalCesiumLeftDoubleClick=function(){this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)},Ah.prototype.DetachCameraChangeEvent=function(e){this._viewer.scene.camera.percentageChanged=.5,this._viewer.scene.camera.changed.removeEventListener(e)},Lh.prototype.zoomIn=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomIn(e)},Mh.prototype.zoomOut=function(){var e=.6*Math.ceil(this._viewer.camera.positionCartographic.height);return this._viewer.camera.zoomOut(e)},Rh.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=V.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=C.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<t[0]._labels.length?(o=t[0]._labels[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s})):null!=t[0]._pointPrimitives&&0<t[0]._pointPrimitives.length?(o=t[0]._pointPrimitives[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s})):null!=t[0]._billboards&&0<t[0]._billboards.length&&(o=t[0]._billboards[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.flyTo({destination:s}))):e.item._primitives&&e.item._primitives._boundingSpheres?e.item._primitives._boundingSpheres.length&&this._viewer.camera.flyToBoundingSphere(e.item._primitives._boundingSpheres[0]):e.item._boundingSpheres&&0<e.item._boundingSpheres.length?this._viewer.camera.flyToBoundingSphere(e.item._boundingSpheres[0]):e.item._boundingVolumes&&e.item._boundingVolumes.length?(o=e.item._boundingVolumes[0].center,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,5e3),this._viewer.camera.flyTo({destination:s})):!(e.item instanceof Cesium.Cesium3DTileset)&&e.item.boundingSphere?this._viewer.camera.flyToBoundingSphere(e.item.boundingSphere):this._viewer.flyTo(e.item):e&&(e.boundingSphere?this._viewer.camera.flyToBoundingSphere(e.boundingSphere):this._viewer.flyTo(e))}},Oh.prototype.jumpTo=function(e){if(e&&null!=e.west&&null!=e.west)this._viewer.camera.setView({destination:this._cesium.Rectangle.fromDegrees(e.west,e.south,e.east,e.north)});else if(e&&void 0!==e.destination)this._viewer.camera.setView({destination:e.destination,orientation:e.orientation});else{if(e&&e.item&&null!=e.item.id&&null!=e.item.id){var t=V.getSourceById(this._tree,e.item.id);try{var i=this._viewer.scene.primitives.get(t.id);this._viewer.zoomTo(i)}catch(e){}}var o,r,n,a,s;e&&e.item?e.item.entities?this._viewer.zoomTo(e.item):e.item._primitives&&e.item._primitives.length?0<(t=C.filter(e.item._primitives,function(e){return null==e.geometryInstances})).length&&(null!=t[0]._boundingSpheres?this._viewer.camera.viewBoundingSphere(t[0]._boundingSpheres[0]):null!=t[0]._labels&&0<t[0]._labels.length?(o=t[0]._labels[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s})):null!=t[0]._pointPrimitives&&0<t[0]._pointPrimitives.length?(o=t[0]._pointPrimitives[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s})):null!=t[0]._billboards&&0<t[0]._billboards.length&&(o=t[0]._billboards[0].position,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,2e3),this._viewer.camera.setView({destination:s}))):e.item._primitives&&e.item._primitives._boundingSpheres?e.item._primitives._boundingSpheres.length&&this._viewer.camera.viewBoundingSphere(e.item._primitives._boundingSpheres[0]):e.item._boundingSpheres&&0<e.item._boundingSpheres.length?this._viewer.camera.viewBoundingSphere(e.item._boundingSpheres[0]):e.item._boundingVolumes&&e.item._boundingVolumes.length?(o=e.item._boundingVolumes[0].center,r=this._cesium.Cartographic.fromCartesian(o),n=this._cesium.Math.toDegrees(r.longitude),a=this._cesium.Math.toDegrees(r.latitude),s=this._cesium.Cartesian3.fromDegrees(n,a,5e3),this._viewer.camera.setView({destination:s})):this._viewer.zoomTo(e.item):e&&this._viewer.zoomTo(e)}},Oh.prototype.jumpToPosition=function(e,t,i,o={}){o={heading:this._core.defaultValue(o.heading,0),pitch:this._core.defaultValue(o.pitch,-90),roll:this._core.defaultValue(o.roll,0)};Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.setView({destination:this._cesium.Cartesian3.fromDegrees(e,t,i),orientation:new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading),Cesium.Math.toRadians(o.pitch),Cesium.Math.toRadians(o.roll)),duration:o.time}):this._viewer.camera.setView({destination:{x:e,y:t,z:i},orientation:new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading),Cesium.Math.toRadians(o.pitch),Cesium.Math.toRadians(o.roll))})},Bh.prototype.northfinger=function(){this._viewer.camera.setView({destination:this._viewer.camera._destination,orientation:{pitch:this._viewer.camera._pitch,roll:0}})},Vh.prototype.setPosition=function(e,t,i){Math.abs(e)<=180&&Math.abs(t)<=90?this._viewer.camera.setView({destination:this._cesium.Cartesian3.fromDegrees(e,t,i)}):this._viewer.camera.setView({destination:{x:e,y:t,z:i}})},Fh.prototype.Stop=function(){this._viewer.scene.camera.cancelFlight()},Hh.prototype.getPosition=function(){return this._getPosition||(this._getPosition=new y(this._viewer,this._cesium)),this._getPosition.getPosition()},Hh.prototype.getMousePosition=function(e,t,i,o,r){return this._getPosition||(this._getPosition=new y(this._viewer,this._cesium)),this._getPosition.getMousePosition(e,t,i,o,r)},Hh.prototype.getDegrees=function(){return this._getPosition||(this._getPosition=new y(this._viewer,this._cesium)),this._getPosition.getDegrees()},Hh.prototype.getMouseDegrees=function(e,t,i,o,r){return this._getPosition||(this._getPosition=new y(this._viewer,this._cesium)),this._getPosition.getMouseDegrees(e,t,i,o,r)},Hh.prototype.setPosition=function(e,t,i){return this.Stop(),this._setPosition||(this._setPosition=new Vh(this._viewer,this._cesium)),this._setPosition.setPosition(e,t,i)},Hh.prototype.zoomIn=function(){return this._zoomIn.zoomIn()},Hh.prototype.zoomOut=function(){return this._zoomOut.zoomOut()},Hh.prototype.flyTo=function(e,t){return this.Stop(),this._flyTo.flyTo(e,t)},Hh.prototype.flyToObj=function(e){this.Stop(),this._flyToObj.flyToObj(e)},Hh.prototype.jumpTo=function(e){return this.Stop(),this._jumpTo.jumpTo(e)},Hh.prototype.northfinger=function(){this._northfinger.northfinger()},Hh.prototype.flyToPosition=function(e,t,i,o){this.Stop(),this._flyTo.flyToPosition(e,t,i,o)},Hh.prototype.jumpToPosition=function(e,t,i,o){this.Stop(),this._jumpTo.jumpToPosition(e,t,i,o)},Hh.prototype.flyToPointsInterest=function(e,t){this.Stop(),this._flyTo.flyToPointsInterest(e,t)},Hh.prototype.Stop=function(){this._Stop.Stop()},Hh.prototype.rotateCenter=function(e=360,t=5){var i={x:this._viewer.canvas.clientWidth/2,y:this._viewer.canvas.clientHeight/2};return this._PointFly.setPointFly({position:this.getMousePosition(i),time:t,limitAngel:e,limitTime:!0,hideImage:!0,pitch:Cesium.Math.toDegrees(this._viewer.camera.pitch)})},Hh.prototype.getCameraInfo=function(e){let t=this.getDegrees();t.lon=t.lon.toFixed(5),t.lat=t.lat.toFixed(5),t.height=t.height.toFixed(2),t.x=t.lon,t.y=t.lat,t.z=t.height;var{heading:i,pitch:o,roll:r}=this._viewer.camera,i=Cesium.Math.toDegrees(i).toFixed(1),o=Cesium.Math.toDegrees(o).toFixed(1),r=Cesium.Math.toDegrees(r).toFixed(1),o={location:t,rotation:{heading:i,pitch:o,roll:r,yaw:i}};return e&&e(o),o},Hh.prototype.globalRotate=function(e={},t){this.Stop(),this.jumpTo({destination:e.startPosition||{x:-5909515.002227878,y:23989884.92116255,z:15985285.564042224}});let i=e.angle||3,o=360/i,r=(i=Cesium.Math.toRadians(i),0),n=()=>{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)},Gh.prototype.deleteItem=function(e){V.delete(e,this._viewer,this._cesium)},Gh.prototype.testTreeSource=function(){console.log(this._tree)},kh.prototype.findItem=function(e){for(var t="",i=C.clone(this._tree),o=e.split("\\"),r=0;r<o.length;r++)if(i=V.getSourceByName(i,o[r]),r==o.length-1){if(i){t=i.id;break}t=""}else{if(!i){t="",i=null;break}i=i.children}return t},Nh.prototype.getItemName=function(e){e=V.getSourceById(this._tree,e);return e?e.name:""},jh.prototype.getVisibility=function(e){e=V.getSourceById(this._tree,e);if(e)return e.item.getVisibility()},Uh.prototype.setVisibility=function(e,t){V.setVisibility(e,t,this._viewer,this._cesium)},zh.prototype.rename=function(e,t){var i=V.getSourceById(this._tree,e),i=(i&&(i.name=t),V.getTempSourceById(e));i&&(i.name=t)},Wh.prototype.getNextItem=function(e,t){};var Yh=Object.freeze({none:-1,point:0,polyline:1,polygon:2,label:3,imageLabel:4,position:5,imageLayer:6,dynamicObject:7,D3titles:8,box:9,circle:10,cone:11,pointfeaturelayer:12,polylinefeaturelayer:13,polygonfeaturelayer:14,pointmodel:15,rectangle:16,ellipsoid:17,wall:18,polylinevolume:19});function Jh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource(),this._treeSource=V.Source,this._treeTemp=V.getTempSource(),this._tree1=V,this._core=new f}function Kh(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}function Qh(e,t){this._viewer=e,this._cesium=t}function q(e,t,i){this._viewer=e,this._cesium=t,this._tree=V.Source,this._createGroup=new Ei(this._viewer,this._cesium,this._tree),this._deleteItem=new Gh(this._viewer,this._cesium,this._tree),this._findItem=new kh(this._viewer,this._cesium,this._tree),this._getItemName=new Nh(this._viewer,this._cesium,this._tree),this._getVisibility=new jh(this._viewer,this._cesium,this._tree),this._setVisibility=new Uh(this._viewer,this._cesium,this._tree),this._renameGroup=new zh(this._viewer,this._cesium,this._tree),this._getNextItem=new Wh(this._viewer,this._cesium,this._tree),this._isGroup=new Kh(this._viewer,this._cesium,this._tree),this._creator=new Q(this._viewer,this._cesium),this._getObject=new Jh(this._viewer,this._cesium),this._exportTree=new Qh(this._viewer,this._cesium),this._core=new f,this.InitTree(i,0),this.InitRootImageLayerAndTerrainlayer()}Jh.prototype.getObject=function(e){var t=C.clone(this._tree),t=V.getSourceById(t,e);return t?t.item:(t=C.clone(V.PointSelectSource),(t=V.getPointSelectSourceById(t,e))?t.item:void 0)},Jh.prototype.getTreeItem=function(e){var t=C.clone(this._tree),t=V.getSourceById(t,e);if(t)return t;for(var i=this._viewer.dataSources,o=0;o<i.length;o++){var r,n,a,s,l,c=i.get(o).entities.getById(e);if(c){if(c.point&&(null==c.point.show||c.point.show._value))return(s=new L(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"point",item:s},V.pusPointSelectSource(l),l;if(c.label&&(null==c.label.show||c.label.show._value))return(s=new G(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"label",item:s},V.pusPointSelectSource(l),l;if(c.box&&(null==c.box.show||c.box.show._value))return(r=new B(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"box",item:r},V.pusPointSelectSource(l),l;if(c.model&&(null==c.model.show||c.model.show._value))return(s=new model(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"model",item:s},V.pusPointSelectSource(l),l;if(c.wall&&(null==c.wall.show||c.wall.show._value))return(r=new fu(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"wall",item:r},V.pusPointSelectSource(l),l;if(c.polyline)return(n=new R(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"polyline",item:n},V.pusPointSelectSource(l),l;if(c.polygon)return(n=new M(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"polygon",item:n},V.pusPointSelectSource(l),l;if(c.rectangle)return(a=new F(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"rectangle",item:a},V.pusPointSelectSource(l),l;if(c.billboard&&(null==c.billboard.show||c.billboard.show._value))return(s=new gu(this._viewer,this._cesium)).setItem(c),l={id:this._core.getuid(),name:"",pId:0,type:"billboard",item:s},V.pusPointSelectSource(l),l}}},Jh.prototype.updateItemId=function(e,t){var i=this._treeSource,o=V.getSourceById(i,e);if(o&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(var r=0;r<o.children.length;r++)o.children[r].pId=t;i=this._treeTemp,o=V.getSourceById(i,e);if(o&&(o.id=t,"group"==o.type&&o.children&&0<o.children.length))for(r=0;r<o.children.length;r++)o.children[r].pId=t},Jh.prototype.unifiedProject=function(e,t){for(var i=0;i<t.length;i++)t[i].id=e[i].id,t[i].pId=t[i].pId,t[i].children&&0<t[i].children.length&&this.unifiedProject(e[i].children,t[i].children)},Jh.prototype.insertProjectTree=function(e,t,i,o,r){var n,a,s,l=!0;return this._core.isnull(t)&&(t=this._core.getuid()),l=0!=r,Yh.none==i||Yh.position==i?(s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null},V.insertGroupId(s,e)):Yh.imageLayer==i?(s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,checked:l,type:"unknown",item:null},V.insertGroupId(s,e)):Yh.dynamicObject==i?(s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"unknown",item:null},V.insertGroupId(s,e)):Yh.point==i?((n=new L(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"point",item:n},n.setTreeobj(s),V.insertGroupId(s,e)):Yh.polyline==i?((r=new R(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polyline",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.rectangle==i?((r=new F(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"rectangle",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.ellipsoid==i?((r=new Fr(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"ellipsoid",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.polygon==i?(r=new M(this._viewer,this._cesium),o._entity?(r.setItem(o._entity),r._points=o._points):r.setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polygon",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.wall==i?((r=new fu(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"wall",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.polylinevolume==i?((r=new du(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polylinevolume",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.pointmodel==i?((r=new P(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"pointmodel",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.label==i?((n=new G(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"label",item:n},n.setTreeobj(s),V.insertGroupId(s,e)):Yh.imageLabel==i?((n=new gu(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,checked:l,type:"billboard",item:n},n.setTreeobj(s),V.insertGroupId(s,e)):Yh.D3titles==i?((r=new A(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"3DTilesets",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.box==i?((l=new B(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"box",item:l},l.setTreeobj(s),V.insertGroupId(s,e)):Yh.circle==i?((n=new H(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"circle",item:n},n.setTreeobj(s),V.insertGroupId(s,e)):Yh.cone==i?((r=new j(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"cylinder",item:r},r.setTreeobj(s),V.insertGroupId(s,e)):Yh.pointfeaturelayer==i?((a=new w(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"pointLayer",item:a},V.insertGroupId(s,e)):Yh.pointfeaturelayer==i?((a=new w(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polylineLayer",item:a},V.insertGroupId(s,e)):Yh.polygonfeaturelayer==i&&((a=new w(this._viewer,this._cesium)).setItem(o),s={id:o&&o.id?o.id:this._core.getuid(),name:t,pId:e,type:"polygonLayer",item:a},V.insertGroupId(s,e)),s},Kh.prototype.isGroup=function(e){var t=C.clone(this._tree),t=V.getSourceById(t,e);return!(!t||"group"!=t.type)},Qh.prototype.exportMethod=function(e){for(var t,i=[],o=0;o<e.length;o++)"function"==typeof e[o].item.export&&(t=e[o].item.export(),i.push(t),e[o].children&&e[o].children.length&&(t=this.exportMethod(e[o].children),i.push(t)));return i},Qh.prototype.export=function(){return this.exportMethod(V.Source)},q.prototype.export=function(){var e=this._exportTree.export(),t=new Blob([JSON.stringify(e)],{type:""});return this._core.saveAs(t,"tree.json"),e},q.prototype.createGroup=function(e,t,i){return this._createGroup=new Ei(this._viewer,this._cesium),this._createGroup.createGroup(e,t,i)},q.prototype.changeGroup=function(e,t){this._createGroup.changeGroup(e,t)},q.prototype.starttemporaryItem=function(){return this._createGroup.starttemporaryItem()},q.prototype.pushtemporaryItem=function(e){this._createGroup.pushtemporaryItem(e)},q.prototype.pushStateItem=function(e){this._createGroup.pushStateItem(e)},q.prototype.endtemporaryItem=function(){this._createGroup.endtemporaryItem()},q.prototype.deleteItem=function(e){return this._deleteItem.deleteItem(e)},q.prototype.findItem=function(e){return this._findItem.findItem(e)},q.prototype.getItemName=function(e){return this._getItemName.getItemName(e)},q.prototype.getObject=function(e){return this._getObject.getObject(e)},q.prototype.getTreeItem=function(e){return this._getObject.getTreeItem(e)},q.prototype.updateItemId=function(e,t){return this._getObject.updateItemId(e,t)},q.prototype.getVisibility=function(e){return this._getVisibility.getVisibility(e)},q.prototype.setVisibility=function(e,t){return this._setVisibility.setVisibility(e,t)},q.prototype.removeAll=function(t){let i=[];this._viewer.entities.values.forEach(e=>{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 Yh}}}),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 V.exitsGroup(e,t)},q.prototype.getTreeSource=function(){var e=C.cloneDeep(V.getSource());return V.removeItem(e)},q.prototype.unifiedProject=function(e,t){this._getObject.unifiedProject(e,t)},q.prototype.clearn=function(){V.clearn()},Object.defineProperties(q.prototype,{Source:{get:function(){return V.TempSource}}}),Object.defineProperties(q.prototype,{currentObj:{get:function(){return V.currentObj}}}),q.prototype.InitTree=function(e,t){if(e&&e.length)for(var i=0;i<e.length;i++){var o=e[i];switch(o.type){case"group":var r=this.createGroup(o.name,t);o.children&&o.children.length&&this.InitTree(o.children,r);break;case"label":this._creator.createLabel(o.position,o.text,o.option,t,o.description);break;case"imgLabel":this._creator.createImageLabel(o.position,o.imageLabel,t,o.description);break;case"polygon":this._creator.createPolygon(o.geometry,o.lineColor,o.altitudeType,t,o.description);break;case"polyline":this._creator.createPolyline(o.geometry,o.lineColor,o.altitudeType,t,o.description);break;case"box":this._creator.createBox(o.position,o.box,o.name,t,o.description);break;case"circle":this._creator.createCircle(o.position,o.circle,o.name,t,o.description);break;case"cone":this._creator.createCone(o.position,o.cylinder,o.name,o.description)}}},q.prototype.InitRootImageLayerAndTerrainlayer=function(){},Object.defineProperties(q.prototype,{selectedItem:{get:function(){return V.selectedItem},set:function(e){V.selectedItem=e}}});function qh(){var e=arguments[0];let t,i,o;o=arguments[1]===Cesium?(t=arguments[2]||{},"function"==typeof arguments[3]?(i={},arguments[3]):(i=arguments[3],arguments[4])):"function"==typeof arguments[4]?(t=arguments[2]||{},i=arguments[3],arguments[4]):(t=arguments[1]||{},"function"==typeof arguments[2]?(i={},arguments[2]):(i=arguments[2],arguments[3])),this._core=new f,Cesium.Ion.defaultAccessToken=t.defaultAccessToken||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8",this.rightRotate=t.rightRotate;var a={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 t?a.imageryProvider=new Cesium.SingleTileImageryProvider({url:t}):(t.url&&(a.imageryProvider=new Cesium.SingleTileImageryProvider({url:t.url})),this._core.extend(a,t,!0)),a.baseLayerPicker){let t=this.getAllImageryView();if(a.basemaps)a.basemaps.forEach(e=>{a.imageryProviderViewModels.push(t[e])});else for(var r in t)a.imageryProviderViewModels.push(t[r])}else a.imageryProvider||(n=this._core.defaultValue(localStorage.getItem("sdkIsOnline"),1),parseInt(n)?a.imageryProvider=new Cesium.ArcGisMapServerImageryProvider({name:"ArcGisMapServer",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"}):a.imageryProvider=new Cesium.SingleTileImageryProvider({url:window.SmartEarthRootUrl+"Workers/image/earth.jpg"}));var n={destination:Cesium.Cartesian3.fromDegrees(t.x||110,t.y||32,t.z||8e6),orientation:{heading:Cesium.Math.toRadians(this._core.defaultValue(t.heading,0)),pitch:Cesium.Math.toRadians(this._core.defaultValue(t.pitch,-90)),roll:Cesium.Math.toRadians(this._core.defaultValue(t.roll,0))},duration:t.duration||.5};if(t.removeGlobe&&(a.skyBox=!1,a.skyAtmosphere=!1,a.contextOptions={failIfMajorPerformanceCaveat:!1,webgl:{alpha:!0,preserveDrawingBuffer:!0}}),this._Viewer=new Cesium.Viewer(e,a),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&&(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=t.toolbar,t.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)"),t.backgroundImage&&(this._Viewer.container.style.backgroundImage="url("+t.backgroundImage+")")):this._Viewer.scene.globe.depthTestAgainstTerrain=!0,this.Navigate.flyToPointsInterest(n,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),a.maxViewHeight&&(this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance=a.maxViewHeight),a.minViewHeight||a.maxViewPitch){this.minViewHeight=a.minViewHeight,this.maxViewPitch=a.maxViewPitch&&Cesium.Math.toRadians(a.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<this.minViewHeight,r+this.minViewHeight),i.pitch<0?i.pitch:0);e?i.setView({destination:this.oldPosition||Cesium.Cartesian3.fromRadians(i.positionCartographic.longitude,i.positionCartographic.latitude,t),orientation:{heading:i.heading,pitch:o,roll:0}}):this.oldPosition=i.position.clone()}}})}if(t.mouseDownView&&this.mouseDownView(!0),Object.defineProperties(Cesium.Model.prototype,{_cachedGltf:{configurable:!0,set:function(e){var a,t,s;this._vtxf_cachedGltf=e,this._vtxf_cachedGltf&&this._vtxf_cachedGltf._gltf&&(a=this._vtxf_cachedGltf._gltf).extensionsUsed&&a.extensionsRequired&&(e=a.extensionsUsed.indexOf("KHR_technique_webgl"),t=a.extensionsRequired.indexOf("KHR_technique_webgl"),-1!==e&&(a.extensionsRequired.splice(t,1,"KHR_techniques_webgl"),a.extensionsUsed.splice(e,1,"KHR_techniques_webgl"),a.extensions=a.extensions||{},a.extensions.KHR_techniques_webgl={},a.extensions.KHR_techniques_webgl.programs=a.programs,a.extensions.KHR_techniques_webgl.shaders=a.shaders,a.extensions.KHR_techniques_webgl.techniques=a.techniques,s=a.extensions.KHR_techniques_webgl.techniques,a.materials.forEach(function(e,t){a.materials[t].extensions.KHR_technique_webgl.values=a.materials[t].values,a.materials[t].extensions.KHR_techniques_webgl=a.materials[t].extensions.KHR_technique_webgl;var i,o=a.materials[t].extensions.KHR_techniques_webgl;for(i in o.values){var r,n=s[o.technique].uniforms;for(r in n)if(n[r]===i){o.values[r]=o.values[i],delete o.values[i];break}}}),s.forEach(function(e){for(var t in e.attributes){var i=e.attributes[t];e.attributes[t]=e.parameters[i]}for(var o in e.uniforms){i=e.uniforms[o];e.uniforms[o]=e.parameters[i]}})))},get:function(){return this._vtxf_cachedGltf}}}),Cesium.Resource&&(Cesium.loadText=Cesium.Resource.fetchText,Cesium.loadJson=Cesium.Resource.fetchJson,Cesium.loadBlob=Cesium.Resource.fetchBlob,Cesium.loadArrayBuffer=Cesium.Resource.fetchArrayBuffer,Cesium.loadImage=Cesium.Resource.fetchImage),Cesium.isArray||(Cesium.isArray=Array.isArray),a.navigation){if(!Cesium.viewerCesiumNavigationMixin){let e=new oe(!1);e.addJs(window.SmartEarthRootUrl+"Workers/viewerCesiumNavigationMixin.js")}e={defaultResetView:Cesium.Rectangle.fromDegrees(80,22,130,50),enableCompass:!0,enableZoomControls:!0,enableDistanceLegend:!0,enableCompassOuterRing:!0};t.navigationOption&&this._core.extend(e,t.navigationOption,!0),this._Viewer.extend(Cesium.viewerCesiumNavigationMixin,e)}a.disableRightClickMenu&&(document.oncontextmenu=function(){return!1});n=this._Viewer;if(n.cesiumWidget._supportsImageRenderingPixelated&&window&&window.devicePixelRatio){for(var s=window.devicePixelRatio;2<=s;)s/=2;n.resolutionScale=s}n.scene.postProcessStages.fxaa.enabled=!0,this.sunLight=!1;var u=this;function h(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(c(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise}function l(e,t){for(var i=e.tilingScheme,o=i.positionToTileXY(t,0),e=u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,r=e[0].x==o.x&&e[0].y==o.y?e[0]:e[1],n=1;n<22;n++){var a=function(e,t){for(var i=0;i<e.children.length;i++)if(e.children[i].state>=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(u._Viewer.scene.primitives._primitives,function(e){return e instanceof Cesium.Cesium3DTileset}),t=0;t<e.length;++t){var i=e[t],o=i instanceof Cesium.Cartographic,r=o?i:Cesium.Cartographic.fromCartesian(i);r.height=u.G,o||(o=Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude,r.latitude,r.height])[0],i.z=o.z)}return e}function c(e,t){for(var i=0;i<t.length;++i){var o=t[i],r=l(e,o);o.height=r.data.terrainData.interpolateHeight(r.rectangle,o.longitude,o.latitude)}return t}function d(e){this.value=new Float32Array([e])}u.G=65535,d.fromZBias=function(e){if(Cesium.defined(e))return new d(e);throw new DeveloperError("zbias is required.")},d.toValue=function(e,t){if(Cesium.defined(e))return Cesium.defined(t)?color.toBytes(t):new Float32Array(e);throw new DeveloperError("zbias is required.")},d.equals=function(e,t){return e===t||Cesium.defined(e)&&Cesium.defined(t)&&e.value[0]===t.value[0]},d.defaultBias=function(){return d.fromZBias(15e-6)},Cesium.ZBiasGeometryInstanceAttribute=d,Cesium.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},Cesium.DynamicEyeOffset=function(e){return void 0===e&&(e=0),new Cesium.Cartesian3(.001234321,0,e)},Cesium.sampleRenderedData=function(r,e){var t,i=2,o=4,n=8,a=(null==e&&(e=i|o),Cesium.when.defer()),s=[],l=(i<e?r.forEach(function(e){s.push(Cesium.Cartographic.fromRadians(e.longitude,e.latitude,e.height))}):s=r,[]),c=(e&i&&l.push(h(u._Viewer.terrainProvider,r)),0<(e&n));return e&(o|n)&&l.push((i=s,Cesium.Check.defined("positions",i),t=Cesium.when.defer(),Cesium.when(m(i),function(e){t.resolve(e)}),t.promise)),Cesium.when.all(l).then(function(e){if(1<l.length)for(var t=0;t<r.length;t++){var i=e[0][t],o=e[1][t];o.height!=u.G&&(i.height<o.height||c)&&(i.height=o.height)}a.resolve(e[0])}),a.promise},Cesium.sampleRenderedMesh=function(e,t){Cesium.Check.defined("positions",e);var i=Cesium.when.defer();return Cesium.when(m(e),function(e){i.resolve(e)}),i.promise},Cesium.sampleRenderedTerrain=function(t,i){Cesium.Check.typeOf.object("terrainProvider",t),Cesium.Check.defined("positions",i);var o=Cesium.when.defer();return function e(){t.ready?Cesium.when(c(t,i),function(e){o.resolve(e)}):setTimeout(e,10)}(),o.promise},Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var e,t=this.getRenderedLevelInfo(),i=0;for(e in t)i<Number(e)&&(i=Number(e));return{bestLevel:i,count:t[i]}},Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var t=[];return this._tilesToRender.forEach(function(e){null==t[e.level]&&(t[e.level]=0),t[e.level]++}),t}}function Xh(e,t){let i=new oe(!1);i.addJs(SmartEarthRootUrl+"SmartEarth.min.js"),this._core=new f,this.left=e,this.leftContainer=e._Viewer.container,this.leftContainer.style.width="50%",this.parentElement=this.leftContainer.parentElement,this.createRightScreen(t),this.addEvenListener()}qh.prototype.mouseDownView=function(e){if(e&&!this.cursorHandel){this.cursorHandel=new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas);let t,i,o=(this.cursorPoint=document.createElement("div"),this.cursorPoint.className="mouseDownViewPoint",this.cursorPoint.style.cssText="visibility: hidden;opacity: 0;pointer-events: none;position: absolute;z-index: 999;transition: visibility 0.2s ease 0s, opacity 0.2s ease-in;",this.cursorPoint.innerHTML='<img src="'+window.SmartEarthRootUrl+'Workers/image/cursor.png" style="width: 36px;height: 36px;">',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 _r(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},qh.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,c;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);c="坐标信息",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?(c=a.id.fid,s=a.id.attributes):a.id.id&&a.id.properties?(c=a.id.name||a.id.id,s=a.id.properties.getValue?a.id.properties.getValue():a.id.properties):a.id.feature&&(c=a.id.feature.id,s=a.id.feature.properties);else if(a._modelId)a._modelId.id&&a._modelId.properties&&(c=a._modelId.id,s=a._modelId.properties);else if(!a.color&&a.content){c="模型"+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='<table class="cesium-infoBox-defaultTable"><tbody>',s)l+=`<tr><th>${e}</th><td>${s[e]}</td></tr>`;l+="</tbody></table>",this._Viewer.selectedEntity=new Cesium.Entity({name:c,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)},qh.prototype.pickPosition=function(e,t=!0){this.endPick(),this.pick(e,t,!1,!0)},qh.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)},qh.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(qh.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 Hh(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 f),this._Core}},Command:{get:function(){return null==this._Command&&(this._Command=new $r(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 sc(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}}}),qh.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)))},qh.prototype.CreateWfs=function(e,t,i,o,r,n,a,s,l){return new W(e,t,i,o,r,n,a,s,l)},qh.prototype.AttachEvent=function(e,t){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachEvent(e,t)},qh.prototype.RemoNormalCesiumLeftDoubleClick=function(){return null==this._DetachEvent&&(this._DetachEvent=new Ah(this._Viewer,Cesium)),this._DetachEvent.RemoNormalCesiumLeftDoubleClick()},qh.prototype.AttachOnLButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonDblClkEvent(e)},qh.prototype.AttachOnLButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonDownEvent(e)},qh.prototype.AttachOnLButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnLButtonUpEvent(e)},qh.prototype.AttachOnMButtonDblClkEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonDblClkEvent(e)},qh.prototype.AttachOnMButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonDownEvent(e)},qh.prototype.AttachOnMButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnMButtonUpEvent(e)},qh.prototype.AttachOnMouseWheelEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnMouseWheelEvent(e)},qh.prototype.AttachOnFrameEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnFrameEvent(e)},qh.prototype.AttachOnRButtonDownEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnRButtonDownEvent(e)},qh.prototype.AttachOnRButtonUpEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachOnRButtonUpEvent(e)},qh.prototype.AttachCameraChangeEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.AttachCameraChangeEvent(e)},qh.prototype.CameraMoveEndEvent=function(e){return null==this._AttachEvent&&(this._AttachEvent=new Ih(this._Viewer,Cesium)),this._AttachEvent.CameraMoveEndEvent(e)},qh.prototype.DetachEvent=function(e,t){return null==this._DetachEvent&&(this._DetachEvent=new Ah(this._Viewer,Cesium)),this._DetachEvent.DetachEvent(e,t)},qh.prototype.DetachEventAll=function(e){return null==this._DetachEvent&&(this._DetachEvent=new Ah(this._Viewer,Cesium)),this._DetachEvent.DetachEventAll(e)},qh.prototype.DetachCameraChangeEvent=function(e){return null==this._DetachEvent&&(this._DetachEvent=new Ah(this._Viewer,Cesium)),this._DetachEvent.DetachCameraChangeEvent(e)},Xh.prototype.createRightScreen=function(e){this.rightContainer=document.createElement("div"),this.rightContainer.id="SDKSecondaryScreen",this.rightContainer.style.cssText=`
                                    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) }
    }, K.prototype.defaultEvent = function (e) { var t = this._viewer.scene; t.screenSpaceCameraController.enableRotate = e, t.screenSpaceCameraController.enableTranslate = e, t.screenSpaceCameraController.enableZoom = e, t.screenSpaceCameraController.enableTilt = e, t.screenSpaceCameraController.enableLook = e }, sh.prototype.createKmlLayer = function (e, t, r) { var i = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = t, a = (this._cesium.HeightReference.CLAMP_TO_GROUND, { 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: n, 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 }), s = this; this._cesium.KmlDataSource.load(e, i).then(function (e) { if (e.entities, "model" == r) for (var t = 0; t < e.entities.values.length; t++) { var i = e.entities.values[t]; s._viewer.entities.add({ name: "", position: i.position, model: { uri: n, heightReference: s._cesium.HeightReference.CLAMP_TO_GROUND, minimumPixelSize: 128, maximumScale: 20, scale: 1, runAnimations: !1 } }) } else if ("billboard" == r) { for (var o = s._core.extend(a, option, !0), t = 0; t < e.entities.values.length; t++) { i = e.entities.values[t]; o.position = i.position._value, billboardCollections.add(o) } s._viewer.scene.primitives.add(billboardCollections) } }) }, sh.prototype.addKmlLayer = function (e, t, i, o) { var r = { camera: this._viewer.scene.camera, canvas: this._viewer.scene.canvas }, n = this; let a = t, s; a.id && (s = a.id, a = a.url); t = this._cesium.KmlDataSource.load(a, r), this._viewer.dataSources.add(t), t.then(function (e) { n.item = e, i || n.setVisibility(!1), o && "function" == typeof o && o(e) }), r = { id: s || this._core.getuid(), name: e, pId: 0, type: "KML", item: this }; return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, sh.prototype.export = function () { var e = null == this.item.show ? void 0 : this.item.show, t = this.treeobj.url; return { type: this.treeobj.type, treeobj: { name: this.treeobj.name, pId: this.treeobj.pId }, style: { show: e, url: t } } }, sh.prototype.deleteObject = function () { this._viewer.dataSources.remove(this.item) }, sh.prototype.setTreeobj = function (e) { this.treeobj = e }, sh.prototype.setVisibility = function (e) { null != this.item && (this.item.show = e) }, lh.prototype.createModifyMesh = function (e, t, i, o, r) { var n = t.length, n = new Array(n), i = (n.fill(i), o.id || Cesium.createGuid()), a = Date.now(), s = Cesium.Rectangle.fromCartesianArray(t), i = (void 0 === o.modifyMeshObject && (o.modifyMeshObject = []), { id: i, show: !0, name: e, rectangle: s, vertices: t, polygon: t, heights: n, meshObject: o, timeStamp: a, polygonGeometry: new Cesium.PolygonGeometry({ polygonHierarchy: new Cesium.PolygonHierarchy(t) }), image: this.createTexture(t), texture: null }); return o.modifyMeshObject = i, this.item = o, this }, lh.prototype.createTexture = function (e) { var t = Cesium.Rectangle.fromCartesianArray(e), i = 180 * t.west / Math.PI, o = 180 * t.south / Math.PI, r = 180 * t.east / Math.PI, t = 180 * t.north / Math.PI, n = new Cesium.Rectangle(i, o, r, t), a = [], s = this, i = (e.forEach(function (e) { e = e.longitude ? e : Cesium.Ellipsoid.WGS84.cartesianToCartographic(e), e = s.getPointRelativePosition(e, n, s.texturePixel, s.texturePixel); a.push([e.normalizedLongitude, e.normalizedLatitude]) }), this.createCanvas(a, "#FF0000", s.texturePixel, s.texturePixel)), o = new Image; return o.width = s.texturePixel, o.height = s.texturePixel, o.src = i.toDataURL("image/png"), o }, lh.prototype.getPointRelativePosition = function (e, t, i, o) { var r = t.east - t.west, n = t.north - t.south, a = 180 * e.longitude / Math.PI, s = 180 * e.latitude / Math.PI; return e.normalizedLongitude = (a - t.west) / r * i, e.normalizedLatitude = (s - t.south) / n * o, e }, lh.prototype.createCanvas = function (e, t, i, o) { var r = document.createElement("canvas"), n = (r.width = i, r.height = o, r.getContext("2d")); if (n.fillStyle = "#000", n.fillRect(0, 0, i, i), !(e.length <= 0)) { n.moveTo(e[0][0], e[0][1]); for (var a = 0; a < e.length; a++)n.lineTo(e[a][0], e[a][1]); return n.fillStyle = t, n.fill(), r } }, lh.prototype.remove = function () { this.item.modifyMeshObject = void 0 }, ch.prototype.addClipping = function (r, n = {}) { if (this.remove(), "polygon" === n.type) { let e = n.positions, t = []; e.forEach(e => { 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 < t.length - 1; e++) { var s = this.createPlane(t[e], t[e + 1], a); o.push(s) } r.clippingPlanes = new Cesium.ClippingPlaneCollection({ planes: o, unionClippingRegions: !n.isInner }) } return this.item = r, this }, ch.prototype.getInverseTransform = function (e) { let t, i = e.root.transform; return t = i && i.equals(Cesium.Matrix4.IDENTITY) || !i ? Cesium.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center) : Cesium.Matrix4.fromArray(e.root.transform), Cesium.Matrix4.inverseTransformation(t, new Cesium.Matrix4) }, ch.prototype.getOriginCoordinateSystemPoint = function (e, t) { e = Cesium.Cartesian3.fromDegrees(e.lon, e.lat); return Cesium.Matrix4.multiplyByPoint(t, e, new Cesium.Cartesian3(0, 0, 0)) }, ch.prototype.createPlane = function (e, t, i) { e = this.getOriginCoordinateSystemPoint(e, i), t = this.getOriginCoordinateSystemPoint(t, i), i = new Cesium.Cartesian3(0, 0, 1), t = Cesium.Cartesian3.subtract(t, e, new Cesium.Cartesian3), t = Cesium.Cartesian3.cross(t, i, new Cesium.Cartesian3), t = Cesium.Cartesian3.normalize(t, t), i = Cesium.Plane.fromPointNormal(e, t); return Cesium.ClippingPlane.fromPlane(i) }, ch.prototype.isClockWise = function (t) { if (t.length < 3) return null; t[0] === t[t.length - 1] && (t = t.slice(0, t.length - 1)); let i = { i: -1, val: 90 }; for (let e = 0; e < t.length; e++) { var o = t[e]["lat"]; o < i.val && (i.val = o, i.i = e) } var e = (i.i + t.length - 1) % t.length, r = i.i, n = (i.i + 1) % t.length; let a = t[r].lat - t[e].lat, s = t[r].lon - t[e].lon, l = t[n].lat - t[r].lat, c = t[n].lon - t[r].lon; r = c * a - s * l; return 0 == r ? t[n].lon < t[e].lon : 0 < r }, ch.prototype.remove = function () { this.item && this.item.clippingPlanes && this.item.clippingPlanes.removeAll(), this.item && (this.item.clippingPlanes = void 0) }, uh.prototype.addCZML = function (e, t, i) { var o = this, r = (t = t || {}, new this._cesium.CzmlDataSource), r = (this._viewer.dataSources.add(r), this.item = r, this._option = t, this.item.process(e).then(function (e) { o.Pretreatment(e, t), i && "function" == typeof i && i(e) }), { id: this._core.getuid(), name: "新建CZML", pId: 0, type: "CZML", item: this }); return this.setTreeobj(r), this._tree.insertGroupId(r, 0), this }, uh.prototype.process = function (e, t) { let i = this; this.item && this.item.process(e).then(function (e) { i.Pretreatment(e, i._option), t && "function" == typeof t && t(e) }) }, uh.prototype.Pretreatment = function (e, t) { let o = this, i = e.entities.values; i.forEach(i => { 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)) }) }, uh.prototype.deleteObject = function () { this._viewer.dataSources.remove(this.item) }, uh.prototype.setTreeobj = function (e) { this.treeobj = e }, uh.prototype.setVisibility = function (e) { null != this.item && (this.item.show = e) }, hh.prototype.addHeatMap = function (e, t = {}) { "HeatmapGL" === t.type ? this.item = new on(this._viewer, t) : this.item = new tn(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 }, hh.prototype.setData = function (e) { this.item && this.item.setData(e) }, hh.prototype.flyToBounding = function () { this.item && this.item.flyToBounding() }, hh.prototype.deleteObject = function () { this.item && this.item.destroy() }, hh.prototype.setTreeobj = function (e) { this.treeobj = e }, hh.prototype.setVisibility = function (e) { null != this.item && this.item.show(e) }, mh.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 }, mh.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) }, mh.prototype.clear = function () { this.TrailEntitys.forEach(e => { this._viewer.entities.remove(e) }), this.TrailEntitys = [] }, mh.prototype.faster = function () { this._viewer.animation.viewModel.faster() }, mh.prototype.slower = function () { this._viewer.animation.viewModel.slower() }, mh.prototype.setSpeed = function (e) { this._viewer.clock.multiplier = parseFloat(e) }, mh.prototype.isPause = function (e) { this._viewer.clockViewModel.shouldAnimate = !e }, mh.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 < t.length; e++) { var r = Cesium.JulianDate.addSeconds(i, t[e].time, new Cesium.JulianDate), n = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat, t[e].hei); o.addSample(r, n) } else if (2 == e) for (let e = 0; e < t.length; e++) { var a = Cesium.JulianDate.addSeconds(i, t[e].time, new Cesium.JulianDate), s = Cesium.Cartesian3.fromDegrees(t[e].lon, t[e].lat, t[e].phei); o.addSample(a, s) } return o }, mh.prototype.getRandState = function (t, i) { var o = this.flyHeight; for (let e = 0; e < i; e++) { let i = []; var r = Math.floor(180 * Math.random()); for (let t = 0; t <= 360; t += 30) { let e = new dh(o); t <= 180 ? (e.lon = r, e.lat = t - 90) : (e.lon = r - 180, e.lat = 270 - t), e.time = 10 * t, i.push(e) } t.push(i) } for (let e = 0; e < i; e++) { let i = []; var n = Math.floor(180 * Math.random()) - 90; for (let t = -180; t <= 180; t += 30) { let e = new dh(o); e.lon = t, e.lat = n, e.time = 10 * (t + 180), i.push(e) } t.push(i) } }, ph.prototype.CreateWMSImageFeatureLayer = function (e, t, i, s, o, r, n) { var l = { url: "", queryParameters: { layers: "", style: "", transparent: !0, srs: "EPSG:4326", service: "WMS", request: "GetMap", version: "1.1.1", format: "image/png", bbox: "{westProjected},{southProjected},{eastProjected},{northProjected}", width: "256", height: "256" } }, c = (l.url = t.url, l.queryParameters = this._core.extend(l.queryParameters, t.queryParameters, !0), i), u = (null == t && console.log("options is required"), this); this._Provider = new T(this._viewer, this._cesium), this._Provider.loadTile = function (e, t) { var i, o, r, n, a; o = e, r = c, e = u, n = this, (i = t).state === Cesium.QuadtreeTileLoadState.START && (t.data = { lines: [], geometryPrimitive: void 0 }, t.level >= (s.level_min || 1) && t.level < (s.level_max || 22) && e.item.show ? (a = new Cesium.Rectangle(0, 0, 0, 0), n._tilingScheme.tileXYToRectangle(i.x, i.y, i.level, a), l.queryParameters.bbox = 180 * a.west / Math.PI + "," + 180 * a.south / Math.PI + "," + 180 * a.east / Math.PI + "," + 180 * a.north / Math.PI, new Cesium.Resource(l).fetchImage().then(function (e) { e = new Cesium.GroundPrimitive({ geometryInstances: [{ geometry: new Cesium.RectangleGeometry({ rectangle: a }) }], appearance: new Cesium.Appearance({ material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: e } } }) }) }); e.cusResource = r, t.data.geometryPrimitive = e, t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state === Cesium.QuadtreeTileLoadState.LOADING && (t.data.geometryPrimitive.update(o, []), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, function (e) { console.log(e) }), t.state = Cesium.QuadtreeTileLoadState.LOADING, t.state = Cesium.QuadtreeTileLoadState.LOADING) : (t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0)) }, this._primitive = new u._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), this._primitive.show = this.item.show, this.item = this._primitive, r || this.setVisibility(!1), this._core.isnull(t.id) && (t.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + t.id); i = { id: t.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "rasterLayer", item: this, options: this._option, queryOptions: this._queryOption }; return this.setTreeobj(i), this._tree.insertGroupId(i, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, ph.prototype.CreateVectorImageFeatureLayer = function (e, t, i, s, o, r, n) { var a = { url: "", queryParameters: { layer: "", style: "", tilematrixset: "EPSG:4326", Service: "WMTS", Request: "GetTile", Version: "1.0.0", Format: "image/png", TileMatrix: "EPSG:4326:", TileCol: "", TileRow: "" } }, l = (this._option = this._core.extend(a, t, !0), this._queryOption = i, this._core.extend(a, t, !0)), c = i, u = (null == t && console.log("options is required"), this); this._Provider = new T(this._viewer, this._cesium), this._Provider.loadTile = function (e, i) { var o, r, n, a; r = e, n = c, e = u, a = this, (o = i).state === Cesium.QuadtreeTileLoadState.START && (i.data = { lines: [], geometryPrimitive: void 0 }, i.level >= s.level_min && i.level < s.level_max && e.item.show ? (l.queryParameters.TileMatrix = l.queryParameters.tilematrixset + ":" + o.level, l.queryParameters.TileCol = o.x, l.queryParameters.TileRow = o.y, new Cesium.Resource(l).fetchImage().then(function (e) { var t = new Cesium.Rectangle(0, 0, 0, 0), t = (a._tilingScheme.tileXYToRectangle(o.x, o.y, o.level, t), new Cesium.GroundPrimitive({ geometryInstances: [{ geometry: new Cesium.RectangleGeometry({ rectangle: t }) }], appearance: new Cesium.Appearance({ material: new Cesium.Material({ fabric: { type: "Image", uniforms: { image: e } } }) }) })); t.cusResource = n, i.data.geometryPrimitive = t, i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state === Cesium.QuadtreeTileLoadState.LOADING && (i.data.geometryPrimitive.update(r, []), i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0) }, function (e) { console.log(e) }), i.state = Cesium.QuadtreeTileLoadState.LOADING, i.state = Cesium.QuadtreeTileLoadState.LOADING) : (i.state = Cesium.QuadtreeTileLoadState.DONE, i.renderable = !0)) }, this._primitive = new u._cesium.QuadtreePrimitivezh({ tileProvider: this._Provider }); this._viewer.scene.primitives.add(this._primitive), this._primitive.show = this.item.show, this.item = this._primitive, r || this.setVisibility(!1), this._core.isnull(t.id) && (t.id = this._core.getuid()), this._core.isnull(e) && (e = "新建图层" + t.id); a = { id: t.id, name: e, checked: !0, pId: this._core.isnull(o) ? 0 : o, type: "rasterLayer", item: this, options: this._option, queryOptions: this._queryOption }; return this.setTreeobj(a), this._tree.insertGroupId(a, this._core.isnull(o) ? 0 : o), "function" == typeof n && n(this.item), this }, ph.prototype.setTreeobj = function (e) { this.treeobj = e }, ph.prototype.setVisibility = function (e) { try { null != this.item && null != this.item.show && (this.item.show = e), this._Provider && this._Provider.setStatus && this._Provider.setStatus(e) } catch (e) { } }, ph.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item); try { this._Provider.remove() } catch (e) { } }, gh.prototype.findDirectParent = function (e) { try { var t = []; if (e.width == Math.PI) return null; for (var i = 0; i < th.scene.globe._surface._tilesToRender.length; i++) { var o = th.scene.globe._surface._tilesToRender[i], r = o._rectangle; Cesium.Rectangle.intersection(r, e) && t.push(o) } return t } catch (e) { } return null }, gh.prototype.createTerrainModifier = function (e, t, i) { var o = t.length, o = new Array(o), r = (o.fill(i), Cesium.createGuid()), i = Date.now(), n = Cesium.Rectangle.fromCartesianArray(t), a = this.findDirectParent(n), s = (this._viewer.terrainProvider && void 0 === this._viewer.terrainProvider._modifyTerrainObjects && (this._viewer.terrainProvider._modifyTerrainObjects = []), this._viewer), e = { id: r, name: e, show: !0, rectangle: n, vertices: t, heights: o, timeStamp: i, remove: function () { if (s.terrainProvider && s.terrainProvider._modifyTerrainObjects) for (var e = s.terrainProvider._modifyTerrainObjects.length - 1; 0 <= e; e--)s.terrainProvider._modifyTerrainObjects[e].id == r && s.terrainProvider._modifyTerrainObjects.splice(e, 1); if (a) try { for (e = 0; e < a.length; e++)try { a[e]._parent.freeResources() } catch (e) { } } catch (e) { } } }; if (this._viewer.terrainProvider._modifyTerrainObjects.push(e), a) try { for (var l = 0; l < a.length; l++)try { a[l]._parent.freeResources() } catch (e) { } } catch (e) { } return e }, fh.prototype.Video3D = function (e) { return this.url = e.url, this.options = e, this.videoContainer = e.video || void 0, this.videoType = e.type || "mp4", this.video2D = e.video2D, this.options.video = { container: this.videoContainer, offset: e.offset }, e.type && 0 <= e.type.indexOf("h265") ? this.addDiv(e.success) : this.addVideo(e.success), this }, fh.prototype.addDiv = function (e) { var t = "Video3D" + this._core.getuid(), i = `<div id="${t}" style="display: none"></div>`; $(this._viewer.container).append(i), this.divContainer = document.getElementById(t), this.load(), e(this) }, fh.prototype.addVideo = function (e) { var t, i; this.videoContainer ? this.videoContainer.oncanplay = () => { this.init && this.init() } : (i = `<video id="${t = "Video3D" + this._core.getuid()}" autoplay muted loop crossorigin  style="display: none"></video>`, $(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)) }) }, fh.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 if ("flv-h265" === this.videoType) { if (!window.WasmPlayer) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/EasyWasmPlayer.js") } if (window.WasmPlayer) { let e = this; this.player = new WasmPlayer(null, this.divContainer.id, function () { e.thisVideo || e.init && e.init() }, { Height: !0 }), this.videoContainer = this.player.canvas, this.options.video.container = this.videoContainer, this.player.play(t, 1) } } else this.videoContainer.src = t, this.thisVideo && (this.videoContainer.load(), this.videoContainer.play()); this.isLoad = !0 }, fh.prototype.pause = function () { "mp4" !== this.videoType && (this.isLoad = !1), this.player && this.player.destroy(), this.videoContainer.pause() }, fh.prototype.flyTo = function () { this.thisVideo && this.thisVideo.flyTo() }, fh.prototype.play = function () { this.isLoad || this.load(), this.videoContainer.play() }, fh.prototype.init = function () { this.thisVideo || (!this.isPause && this.videoContainer && this.videoContainer.readyState === this.videoContainer.HAVE_ENOUGH_DATA && this.play(), this.video2D ? this.thisVideo = new Hl(this._viewer, this.options) : this.thisVideo = new nr(this._viewer, this.options)) }, fh.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 && this.thisVideo.updatePost(e) }, fh.prototype.setVisibility = function (e) { this.thisVideo && this.thisVideo.setVisibility(e) }, fh.prototype.destroy = function () { this.thisVideo && this.thisVideo.destroy(), this.thisVideo = null, this.player && this.player.destroy && this.player.destroy(), this.videoContainer && this.videoContainer.remove() }, _h.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 < t.length; e++) { var i = t[e]; this.addPolygon(r, i, o) } }), this.item = this._viewer.scene.primitives.add(r); e = { id: o.id, name: "新建水面图层", pId: 0, type: "polygonLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, Ch.prototype.addPolygon = async function (e, t, i) { var o = Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, r = Cesium.Color.fromCssColorString(i.color), o = new Cesium.PolygonGeometry({ polygonHierarchy: t.polygon.hierarchy.getValue(), extrudedHeight: i.extrudedHeight, height: i.height, vertexFormat: o }), o = new Cesium.GeometryInstance({ geometry: o, id: t, attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(r), distanceDisplayCondition: new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(i.near, i.far) } }); let n; t = new (n = i.height || i.extrudedHeight ? Cesium.Primitive : Cesium.GroundPrimitive)({ geometryInstances: o, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { type: "Water", uniforms: { baseWaterColor: r, blendColor: r, normalMap: i.image, frequency: i.frequency, animationSpeed: i.speed / 1e3, amplitude: i.amplitude } } }) }), classificationType: i.classificationType }); e.add(t) }, Ch.prototype.setTreeobj = function (e) { this.treeobj = e }, Ch.prototype.deleteObject = function () { try { this._viewer.scene.primitives.remove(this.item) } catch (e) { console.log(e) } }, Ch.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, yh.prototype.create = function (e, t = {}) { this.grid = this._core.defaultValue(t.grid, !0); let _ = t.center, C = t.scale || 1; return this._core.getJSON(e, n => { var a = Math.max(...n.mData) * C, s = n.mHorPointsNum, l = n.mVerPointsNum; if (_ = n.mCenterPoint && n.mCenterPoint.length ? n.mCenterPoint : _) { var c = new Float64Array(3 * n.mData.length), u = 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 < n.mHEndAngle; i += n.mHStep, o++)for (let e = n.mVStartAngle, t = 0; e <= n.mVEndAngle; e += n.mVStep, t++) { var g = n.mData[r++] * C, f = this._core.getPositionFromHPR(_, g, i, e), f = Cesium.Cartesian3.fromDegrees(f.lon, f.lat, f.height); c[u++] = f.x, c[u++] = f.y, c[u++] = f.z, h[m++] = (o + 1) / s, h[m++] = Math.pow(g / a, 3), 0 !== o && 0 !== t && (d[p++] = (o - 1) * l + (t - 1), d[p++] = (o - 1) * l + t, d[p++] = o * l + t - 1, d[p++] = (o - 1) * l + t, d[p++] = o * l + t, d[p++] = o * l + t - 1, o === s - 1 && (d[p++] = t - 1, d[p++] = t, d[p++] = o * l + t - 1, d[p++] = t, d[p++] = o * l + t, d[p++] = o * l + t - 1)) } this.addGeometry({ positions: c, st: h, indexs: d, minColor: t.minColor, maxColor: t.maxColor }, t.flyTo) } else console.log("缺少场强中心坐标") }), this }, yh.prototype.addGeometry = function (e, t) { var i = new Cesium.Geometry({ attributes: { position: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.DOUBLE, componentsPerAttribute: 3, values: e.positions }), st: new Cesium.GeometryAttribute({ componentDatatype: Cesium.ComponentDatatype.FLOAT, componentsPerAttribute: 2, values: e.st }) }, indices: e.indexs, primitiveType: this.grid ? Cesium.PrimitiveType.LINES : Cesium.PrimitiveType.TRIANGLES, boundingSphere: Cesium.BoundingSphere.fromVertices(e.positions) }), o = new Cesium.GeometryInstance({ geometry: i }); this.item = new Cesium.Primitive({ geometryInstances: o, appearance: new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { uniforms: { color1: Cesium.Color.fromCssColorString(e.minColor || "#ff0000"), color2: Cesium.Color.fromCssColorString(e.maxColor || "#00ff00") }, source: this.getShader() } }) }), asynchronous: !1 }), this._viewer.scene.primitives.add(this.item), t && this._viewer.camera.flyToBoundingSphere(i.boundingSphere) }, yh.prototype.setVisibility = function (e) { this.item && (this.item.show = e) }, yh.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this.item) }, yh.prototype.getShader = function () { return "uniform vec4 color1;\n    uniform vec4 color2;\n    czm_material czm_getMaterial(czm_materialInput materialInput)\n    {\n        czm_material material = czm_getDefaultMaterial(materialInput);\n        vec2 st = materialInput.st;\n        material.diffuse = color1.rgb * (1.0 - st.y) + color2.rgb * st.y; \n        material.alpha = color1.a * (1.0 - st.y) + color2.a * st.y;\n        return material;\n    }\n        " }; var vh = "uniform float angle;\nuniform sampler2D image;\nuniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nst.x = st.x - 0.5;\nst.y = st.y - 0.5;\nif(st.x * st.x + st.y * st.y <= 0.25){\nfloat x = st.x * cos(angle) - st.y * sin(angle);\nfloat y = st.y * cos(angle) + st.x * sin(angle);\nst.x = x + 0.5;\nst.y = y + 0.5;\n} else {\nst.x = st.x + 0.5;\nst.y = st.y + 0.5;\n}\nmaterial.diffuse = czm_gammaCorrect(texture2D(image, st).rgb * color.rgb);\nmaterial.alpha = texture2D(image, st).a * color.a;\nmaterial.emission = vec3(0.2);\nreturn material;\n}\n"; function wh(e) { this._viewer = e, this._core = new f, this.angle = 0, this.multiple = 1, this.destroyed = !1, this.type = "rotate", this.show = !0 } wh.prototype.createRotateCircle = function (e = {}) { this.type = "rotate", this.radius = this._core.defaultValue(e.radius, 500), this.multiple = this._core.defaultValue(e.multiple, 1), this.scale = [this.radius, this.radius, 1]; var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"); return this.color = [t.red, t.green, t.blue], this.clampToGround = e.clampToGround, this.position = e.position, this.image = e.image, e.image || (this.image = e.scan ? SmartEarthRootUrl + I.scanCircle : SmartEarthRootUrl + I.effectCircle), e.scan && (this.multiple = -this.multiple), Cesium.Resource.createIfNeeded(this.image).fetchImage().then(e => { 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 }, wh.prototype.createDRWCircle = function (e = {}) { this.type = "DRW", this.radius = this._core.defaultValue(e.radius, 50), this.multiple = this._core.defaultValue(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 }, wh.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 })) }, wh.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) }) }, wh.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: vh } }) }) }, wh.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)) }, wh.prototype.isDestroyed = function () { return this.destroyed }, wh.prototype.destroy = function () { this.circle && this.circle.destroy(), this.circle = null, this.destroyed = !0 }, wh.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this) }, wh.prototype.setVisibility = function (e) { this.show = e }; var bh = "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", Th = "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", Sh = "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 Eh(e) { this._viewer = e, this._core = new f, this.angle = 0, this.multiple = 1, this.destroyed = !1, this.type = "cylinder", this.show = !0 } function Ph(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 xh(e) { this._viewer = e, this._core = new f, 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 f, this._Label = new G(this._viewer, this._cesium), this._Circle = new H(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 F(this._viewer, this._cesium), this._Polygon = new M(this._viewer, this._cesium), this._ImageLabel = new gu(this._viewer, this._cesium), this._GeoJsonFeatureLayer = new w(this._viewer, this._cesium, this._ImageryProvidererid), this._Ellipsoid = new Fr(this._viewer, this._cesium), this._PointModel = new P(this._viewer, this._cesium), this._wall = new fu(this._viewer, this._cesium), this._Terrain = new zu(this._viewer, this._cesium), this._createdynamicObject = new k(this._viewer, this._cesium), this._GeometryCreator, this._ImageryLayer = new yu(this._viewer, this._cesium), this._VolumeGeoJsonFeatureLayer = void 0, this._PolygonVectorGeoJsonFeatureLayer = void 0, this._skyBox = new Qu(this._viewer, this._cesium), this._flowField = new qu(this._viewer, this._cesium), this._canvasField = new rc(this._viewer, this._cesium), this.VectorGeoJsonFeatureLayer = new E(this._viewer, this._cesium), this._straightArrow = new K(this._viewer, this._cesium), this._SimpleGraphic = new x(this._viewer, this._cesium), this._popupmessage = new Si(this._viewer, this._cesium), this._VectorImgFeatureLayer = ph, this._TerrainModifier = new gh(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 < e.indexOf("nullvalue=") && (i = e.split("nullvalue=")[1].split("&")[0].split("%2C"), s.r = i[0], s.g = i[1], s.b = i[2]), -1 < e.indexOf("nulltolerance=") && (a = e.split("nulltolerance=")[1].split("&")[0]), new Image), c = document.createElement("canvas"), u = c.getContext("2d"); l.url = e, l.onload = function () { if (null != l.url && -1 != l.url.indexOf("nullvalue")) { delete l.url, c.width = l.width, c.height = l.height, u.drawImage(l, 0, 0), l.imageProcesses = []; for (var e = l.width / 8, t = l.height, i = 0; i < 8; i++) { var o = i * e, r = u.getImageData(o, 0, e, t).data; l.imageProcesses[i] = h.queueWorkItem({ nullValue: s, nullTolerance: a, canvasData: r, width: e, height: t, startX: o }) } Cesium.when.all(l.imageProcesses, function (e) { for (var t = 0; t < e.length; t++) { for (var i = u.createImageData(e[t].width, e[t].height), o = 0; o < e[t].canvasData.length; o++)i.data[o] = e[t].canvasData[o]; u.putImageData(i, e[t].startX, 0) } l.src = c.toDataURL(), n.resolve(l) }).otherwise(function (e) { console.log(e) }) } else n.resolve(l) }, l.onerror = function (e) { n.reject(e) }, t && (Cesium.TrustedServers.contains(e) ? l.crossOrigin = "use-credentials" : l.crossOrigin = ""), l.src = e }) } function Dh(e, t) { this._viewer = e, this.Cesium = t, this.czmlData = new Map } function Ih(e, t) { this._viewer = e, this._cesium = t, this._Core = new f } function Ah(e, t) { this._viewer = e, this._cesium = t } function Lh(e, t) { this._viewer = e, this._cesium = t } function Mh(e, t) { this._viewer = e, this._cesium = t } function Rh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Oh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource(), this._core = new f } function Bh(e, t) { this._viewer = e, this._cesium = t } function Vh(e, t) { this._viewer = e, this._cesium = t } function Fh(e, t) { this._viewer = e, this._cesium = t } function Hh(e, t) { this._viewer = e, this._cesium = t, this._zoomIn = new Lh(this._viewer, this._cesium), this._zoomOut = new Mh(this._viewer, this._cesium), this._flyTo = new Fi(this._viewer, this._cesium, this._tree), this._flyToObj = new Rh(this._viewer, this._cesium), this._jumpTo = new Oh(this._viewer, this._cesium, this._tree), this._northfinger = new Bh(this._viewer, this._cesium), this._Stop = new Fh(this._viewer, this._cesium), this._PointFly = new _r(this._viewer, this._cesium) } function Gh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function kh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Nh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function jh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Uh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function zh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Wh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } Eh.prototype.createCylinder = function (e = {}) { this.type = "cylinder", this.radius = e.radius || 500, this.length = e.length || 100, this.number = e.number || 30, this.multiple = e.multiple || 1, this.near = e.near, this.far = e.far; var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"), t = (this.scale = [this.radius, this.radius, this.length], this.color = [t.red, t.green, t.blue, t.alpha], this.geometryValue = this.getCylinderGeometryValue(1, 1, 1, this.number), this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), new Cesium.GeometryInstance({ geometry: this.getGeometry(this.geometryValue), modelMatrix: this.modelMatrix })); return this.cylinder = new Cesium.Primitive({ geometryInstances: t, appearance: this.getAppearance(), asynchronous: !1 }), this._viewer.scene.primitives.add(this), this }, Eh.prototype.createCone = function (e = {}) { this.type = "cone", this.radius = e.radius || 500, this.length = e.length || 100, this.near = e.near, this.far = e.far; var t = Cesium.Color.fromCssColorString(e.color || "#80ccff"), t = (this.scale = [this.radius, this.radius, this.length], this.color = [t.red, t.green, t.blue, t.alpha], this.geometryValue = this.getCylinderGeometryValue(2, .3, 1, 6), this.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(e.position.lon, e.position.lat, e.position.height)), new Cesium.GeometryInstance({ geometry: this.getGeometry(this.geometryValue), modelMatrix: this.modelMatrix })); return this.cylinder = new Cesium.Primitive({ geometryInstances: t, appearance: this.getAppearance(), asynchronous: !1 }), Cesium.Resource.createIfNeeded(SmartEarthRootUrl + I.particles).fetchImage().then(e => { 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: Sh } }), renderState: { cull: { enabled: !1 } } }), asynchronous: !1 }), setTimeout(() => { this.cylinder1.appearance.material.uniforms.color.alpha = 2 }) }), this._viewer.scene.primitives.add(this), this }, Eh.prototype.getAppearance = function () { return "cylinder" === this.type ? new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { uniforms: { color: new Cesium.Color(...this.color) }, source: bh } }), renderState: { cull: { enabled: !1 } } }) : "cone" === this.type ? new Cesium.EllipsoidSurfaceAppearance({ material: new Cesium.Material({ fabric: { uniforms: { color: new Cesium.Color(...this.color) }, source: Th } }), renderState: { cull: { enabled: !1 } } }) : void 0 }, Eh.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)) }) }, Eh.prototype.getCylinderGeometryValue = function (e = 1, t = 1, n = 1, a = 30) { var s = [e, 0], l = [t, 0], c = Cesium.Math.toRadians(360 / a), u = 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 = c * e, i = u * 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 } }, Eh.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, 1 < this.dt && (this.dt = 0), t = .5 * (1 - Math.cos(this.dt * Math.PI * 2)), this.scale[0] = this.scale[1] = this.radius * (1 - Math.cos(this.dt * Math.PI)) * .5, this.scale[2] = this.length * t, this.color[3] = 2 * t, t = new Cesium.GeometryInstance({ geometry: this.getGeometry(this.geometryValue), modelMatrix: this.modelMatrix }), this.cylinder.destroy(), this.cylinder = new Cesium.Primitive({ geometryInstances: t, appearance: this.getAppearance(), asynchronous: !1 }), t = null), this.cylinder.update(e), this.cylinder1 && this.cylinder1.update(e)) }, Eh.prototype.isDestroyed = function () { return this.destroyed }, Eh.prototype.destroy = function () { this.cylinder && this.cylinder.destroy(), this.cylinder = null, this.cylinder1 && this.cylinder1.destroy(), this.cylinder1 = null, this.destroyed = !0 }, Eh.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this) }, Eh.prototype.setVisibility = function (e) { this.show = e }, Ph.prototype.update = function (e) { this.show && (Cesium.defined(this._command) || (this._command = this.createCommand(e.context)), Cesium.defined(this._outlineCommand) || (this._outlineCommand = this.createCommand(e.context, !0)), e.commandList.push(this._command, this._outlineCommand), this.animate && (this._angle += .01, 1 < this._angle && (this._angle = 0), this._height = .04 * Math.sin(this._angle * Math.PI * 2), e = new Cesium.Cartesian3(0, 0, this._height), Cesium.Matrix4.multiplyByTranslation(this._modelMatrix, e, this._modelMatrix), e = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(4 * this._speed))), Cesium.Matrix4.multiply(this._modelMatrix, e, this._modelMatrix))) }, Ph.prototype.isDestroyed = function () { return !1 }, Ph.prototype.destroy = function () { return Cesium.defined(this._command) && (this._command.shaderProgram = this._command.shaderProgram && this._command.shaderProgram.destroy()), Cesium.defined(this._outlineCommand) && (this._outlineCommand.shaderProgram = this._outlineCommand.shaderProgram && this._outlineCommand.shaderProgram.destroy()), Cesium.destroyObject(this) }, Ph.prototype.startAnimate = function () { this.animate = !0 }, Ph.prototype.closeAnimate = function () { this.animate = !1 }, Ph.prototype.deleteObject = function () { this.destroy() }, Ph.prototype.setVisibility = function (e) { this.show = e }, Ph.prototype.createCommand = function (e, t) { var i = Cesium.Appearance.getDefaultRenderState(!0, !0, void 0), i = new Cesium.RenderState(i), o = Cesium.ShaderProgram.fromCache({ context: e, vertexShaderSource: this.createVertexShader(), fragmentShaderSource: this.createFragmentShader(), attributeLocations: { position: 0, textureCoordinates: 1 } }); let r = t ? this._outlineColor : this._color; return new Cesium.DrawCommand({ pickId: "Tetrahedron", vertexArray: this.createVertexArray(e, t), primitiveType: t ? Cesium.PrimitiveType.LINES : Cesium.PrimitiveType.TRIANGLES, renderState: i, shaderProgram: o, uniformMap: { color: () => r }, owner: this, pass: Cesium.Pass.TRANSLUCENT, modelMatrix: this._modelMatrix, boundingVolume: new Cesium.BoundingSphere(this._position, 1) }) }, Ph.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 }) }, Ph.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: [] } }, Ph.prototype.createVertexShader = function () { return "attribute vec3 position;\n        void main()\n        {\n            gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n        }\n        " }, Ph.prototype.createFragmentShader = function () { return "uniform vec4 color;\n        void main()\n        {\n            gl_FragColor = color;\n        }\n        " }, Ph.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) }, xh.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) }, xh.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 }) }) }, xh.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] }, xh.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), c = this.getImage("center"), u = 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 : c, 0, 0, l.width, l.height, 303, 15, l.width, l.height), e.context.drawImage(0 === o ? l : c, 0, 0, l.width, l.height, 303, n, l.width, l.height), e.context.drawImage(1 === o ? l : c, 0, 0, l.width, l.height, 303, m, l.width, l.height), e.context.drawImage(-1 === r ? u : h, 0, 0, u.width, u.height, 485, 15, u.width, u.height), e.context.drawImage(0 === r ? u : h, 0, 0, u.width, u.height, 485, n, u.width, u.height), e.context.drawImage(1 === r ? u : h, 0, 0, u.width, u.height, 485, m, u.width, u.height), this.drawTime(e.context, { left: i, center: o, x: 153, y: 143, time: t }) }, xh.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) }, xh.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) }, xh.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)) }, xh.prototype.isShow = function (e) { return Cesium.Cartesian3.distance(this._viewer.camera.position, e.position) < e.far }, xh.prototype.removeById = function (e) { let t = this._values.get(e); t && t.geometry && t.geometry.destroy(), this._values.delete(e) }, xh.prototype.showById = function (e, t) { let i = this._values.get(e); i && (i.show = t) }, xh.prototype.isDestroyed = function () { return this.destroyed }, xh.prototype.destroy = function () { for (var e of this._values.values()) e.geometry && e.geometry.destroy(); this._values = new Map, this.img = null, this.imageData = null, this.destroyed = !0 }, xh.prototype.deleteObject = function () { this._viewer.scene.primitives.remove(this), this.destroy() }, xh.prototype.setVisibility = function (e) { this.show = e }, Q.prototype.create3DTilesets = function (e, t, i, o, r, n, a) { e = this._D3Tileset.create3DTilesets(e, t, i, o, r, n, a); return this._D3Tilesets || (this._D3Tilesets = [], this._SE3DTilesets = new Map), this._SE3DTilesets.set(e.treeobj.id, e), this._D3Tilesets.push(e.item), e }, Q.prototype.set3DTilesetsAlpha = function (t) { this._D3Tilesets && this._D3Tilesets.forEach(e => { 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 Ht({ 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 uh(this._viewer, this._cesium); return o.addCZML(e, t, i) }, Q.prototype.addHeatMap = function (e, t) { let i = new hh(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 < i; e++)t.imageryLayers.get(e).brightness = o; this._D3Tilesets && this._D3Tilesets.forEach(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 _h(this._viewer, this._cesium)), this._TdtLabel.GeoWTFS(e) }, Q.prototype.Video3D = function (e) { let t = new fh(this._viewer, this._cesium); return t.Video3D(e) }, Q.prototype.addRotateEffectCircle = function (e) { return new wh(this._viewer).createRotateCircle(e) }, Q.prototype.addTetrahedron = function (e) { return new Ph(this._viewer, e) }, Q.prototype.addTrafficLight = function (e) { return this._TrafficLight || (this._TrafficLight = new xh(this._viewer)), this._TrafficLight.add(e) }, Q.prototype.addDRWEffectCircle = function (e) { return new wh(this._viewer).createDRWCircle(e) }, Q.prototype.addEffectCylinder = function (e) { return new Eh(this._viewer).createCylinder(e) }, Q.prototype.addEffectCone = function (e) { return new Eh(this._viewer).createCone(e) }, Q.prototype.createGeoJsonFeatureLayerProviderOptimization = function (e, t, i, o, r, n) { var a = new E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.selectedItem.id), o = this._core.isnull(o) ? 0 : o, a.createVector3DTilesFeatureLayerRelease(e, t, i, o, r, n) }, Q.prototype.createGeojsonImage = function (e) { return new E(this._viewer, this._cesium).createGeojsonImage(e) }, Q.prototype.createGeoJsonFeatureLayerProvider = function (e, t, i, o, r, n) { var a = new E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 zu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 mh(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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 pu(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 Ti(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 nh(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 fu(this._viewer, this._cesium).executeWall(e, t) }, Q.prototype.createWall = function (e, t, i, o) { return new fu(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 du(this._viewer, this._cesium).createPolylineVolume(e, t, i, o, r) }, Q.prototype.createCorridor = function (e, t, i, o) { return new cc(this._viewer, this._cesium).createCorridor(e, t, i, o) }, Q.prototype.addViewCone = function (e) { let t = new ar(this._viewer, this._cesium); return t.addViewCone(e) }, Q.prototype.createViewCone = function (e, t) { let i = new ar(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 ch(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 Si(this._viewer, this._cesium).createPopupMessage(e) }, Q.prototype.createMeasurement = function (e) { return new Si(this._viewer, this._cesium).createMeasurement(e) }, Q.prototype.createPlotting = function (e) { return new Si(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 ah(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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ii(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 sh(this._viewer, this._cesium).createKmlLayer(e, t, i) }, Q.prototype.addKmlLayer = function (e, t, i, o) { return new sh(this._viewer, this._cesium).addKmlLayer(e, t, i, o) }, Q.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis = function (e, t, i, o, r) { var n = new mo(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ii(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 S(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 E(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 yu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.selectedItem.id), i = this._core.isnull(i) ? 0 : i, a.createArcGisImageryLayer(e, t, i, o, r, n) }, Q.prototype.createImageryLayerGrid = function (e) { return new yu(this._viewer, this._cesium).createImageryLayerGrid(e) }, Q.prototype.createWebMapServerImageLayer = function (e, t, i, o, r, n) { var a = new yu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 yu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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 yu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Hi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Hi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Hi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Hi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Wu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Wu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Wu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Wu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ju(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ju(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ju(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 go(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 go(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 yu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 yu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Ju(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Gi(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 H(this._viewer, this._cesium).createCircle(e, t, i, o) }, Q.prototype.CreateRectangle = function (e, t, i, o, r) { return new F(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 Bl(this._viewer, this._cesium).createBillboardbatch(e) }, Q.prototype.createBillboard = function (e) { return new Bl(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 lc(this._viewer).create(e, t, i) }, Q.prototype.FieldIntensity = function (e, t) { return new yh(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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 Fr(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 gu(this._viewer, this._cesium); return this._core.isnull(i) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (i = V.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(V.selectedItem) && "group" == V.selectedItem.type && (r = V.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 gu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 gu(this._viewer, this._cesium); return this._core.isnull(o) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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(V.selectedItem) && "group" == V.selectedItem.type && (o = V.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 H(this._viewer, this._cesium); return this._core.isnull(r) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (r = V.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 H(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (a = V.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(V.selectedItem) && "group" == V.selectedItem.type && (a = V.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 pu(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(V.selectedItem) && "group" == V.selectedItem.type && (a = V.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(V.selectedItem) && "group" == V.selectedItem.type && (a = V.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 Fr(this._viewer, this._cesium); return this._core.isnull(a) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (a = V.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 F(this._viewer, this._cesium).createRectangleOptimization(e, t) }, Q.prototype.createCircleOptimization = function (e, t) { return new H(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) { var s = new this._VectorImgFeatureLayer(this._viewer, this._cesium); return this._core.isnull(r) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (r = V.selectedItem.id), r = this._core.isnull(r) ? 0 : r, s.CreateVectorImageFeatureLayer(e, t, i, o, r, n, a) }, Q.prototype.CreateWMSImageFeatureLayer = function (e, t, i, o, r, n, a) { var s = new this._VectorImgFeatureLayer(this._viewer, this._cesium); return this._core.isnull(r) && !this._core.isnull(V.selectedItem) && "group" == V.selectedItem.type && (r = V.selectedItem.id), r = this._core.isnull(r) ? 0 : r, s.CreateWMSImageFeatureLayer(e, t, i, o, r, n, a) }, Q.prototype.createVolumetricMeasureTool = function () { return new Sr(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 rh(this._viewer, this._cesium) } } }), Object.defineProperties(Q.prototype, { _Point: { get: function () { return new L(this._viewer, this._cesium) } }, GeometryCreator: { CreateLinearRingGeometry: function (e) { return {} } } }), Dh.prototype.get = function (e) { return this.czmlData.get(e) }, Dh.prototype.flyTo = function (e) { this._viewer.flyTo(this.get(e)) }, Dh.prototype.trackedEntity = function (e) { let t = this.get(e); this._viewer.trackedEntity = t.entities.getById(e) }, Dh.prototype.delete = function (e) { var t = this.czmlData.get(e); this._viewer.dataSources.remove(t), this.czmlData.delete(e) }, Dh.prototype.deleteAll = function () { for (var e of this.czmlData.values()) this._viewer.dataSources.remove(e); this.czmlData = new Map }, Dh.prototype.getThisPlayTime = function () { return this._viewer.clock.currentTime.secondsOfDay - this._viewer.clock.startTime.secondsOfDay }, Dh.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 }, Dh.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) }, Dh.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) }, Dh.prototype.endPick = function () { this.pickHandler.destroy(), this.pickHandler = void 0 }, Ih.prototype.AttachEvent = function (e, o) { var t, i, r = this._viewer, n = this._Core, n = this._Core; return e === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 === en.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.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 }, Ih.prototype.AttachCameraChangeEvent = function (e) { return this._viewer.scene.camera.percentageChanged = 1e-6, this._viewer.scene.camera.changed.addEventListener(e), e }, Ih.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) }, Ah.prototype.DetachEvent = function (e, t) { t === en.L_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK) : t === en.L_DBL_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK) : t === en.L_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN) : t === en.L_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP) : t === en.M_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK) : t === en.M_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN) : t === en.M_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP) : t === en.R_Click ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK) : t === en.R_Down ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN) : t === en.R_Up ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP) : t === en.Wheel ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL) : t === en.Move ? e && e.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE) : e && e.destroy() }, Ah.prototype.DetachEventAll = function (e) { e && e.destroy() }, Ah.prototype.RemoNormalCesiumLeftDoubleClick = function () { this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK) }, Ah.prototype.DetachCameraChangeEvent = function (e) { this._viewer.scene.camera.percentageChanged = .5, this._viewer.scene.camera.changed.removeEventListener(e) }, Lh.prototype.zoomIn = function () { var e = .6 * Math.ceil(this._viewer.camera.positionCartographic.height); return this._viewer.camera.zoomIn(e) }, Mh.prototype.zoomOut = function () { var e = .6 * Math.ceil(this._viewer.camera.positionCartographic.height); return this._viewer.camera.zoomOut(e) }, Rh.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 = V.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 = C.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 < t[0]._labels.length ? (o = t[0]._labels[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s })) : null != t[0]._pointPrimitives && 0 < t[0]._pointPrimitives.length ? (o = t[0]._pointPrimitives[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s })) : null != t[0]._billboards && 0 < t[0]._billboards.length && (o = t[0]._billboards[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.flyTo({ destination: s }))) : e.item._primitives && e.item._primitives._boundingSpheres ? e.item._primitives._boundingSpheres.length && this._viewer.camera.flyToBoundingSphere(e.item._primitives._boundingSpheres[0]) : e.item._boundingSpheres && 0 < e.item._boundingSpheres.length ? this._viewer.camera.flyToBoundingSphere(e.item._boundingSpheres[0]) : e.item._boundingVolumes && e.item._boundingVolumes.length ? (o = e.item._boundingVolumes[0].center, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 5e3), this._viewer.camera.flyTo({ destination: s })) : !(e.item instanceof Cesium.Cesium3DTileset) && e.item.boundingSphere ? this._viewer.camera.flyToBoundingSphere(e.item.boundingSphere) : this._viewer.flyTo(e.item) : e && (e.boundingSphere ? this._viewer.camera.flyToBoundingSphere(e.boundingSphere) : this._viewer.flyTo(e)) } }, Oh.prototype.jumpTo = function (e) { if (e && null != e.west && null != e.west) this._viewer.camera.setView({ destination: this._cesium.Rectangle.fromDegrees(e.west, e.south, e.east, e.north) }); else if (e && void 0 !== e.destination) this._viewer.camera.setView({ destination: e.destination, orientation: e.orientation }); else { if (e && e.item && null != e.item.id && null != e.item.id) { var t = V.getSourceById(this._tree, e.item.id); try { var i = this._viewer.scene.primitives.get(t.id); this._viewer.zoomTo(i) } catch (e) { } } var o, r, n, a, s; e && e.item ? e.item.entities ? this._viewer.zoomTo(e.item) : e.item._primitives && e.item._primitives.length ? 0 < (t = C.filter(e.item._primitives, function (e) { return null == e.geometryInstances })).length && (null != t[0]._boundingSpheres ? this._viewer.camera.viewBoundingSphere(t[0]._boundingSpheres[0]) : null != t[0]._labels && 0 < t[0]._labels.length ? (o = t[0]._labels[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s })) : null != t[0]._pointPrimitives && 0 < t[0]._pointPrimitives.length ? (o = t[0]._pointPrimitives[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s })) : null != t[0]._billboards && 0 < t[0]._billboards.length && (o = t[0]._billboards[0].position, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 2e3), this._viewer.camera.setView({ destination: s }))) : e.item._primitives && e.item._primitives._boundingSpheres ? e.item._primitives._boundingSpheres.length && this._viewer.camera.viewBoundingSphere(e.item._primitives._boundingSpheres[0]) : e.item._boundingSpheres && 0 < e.item._boundingSpheres.length ? this._viewer.camera.viewBoundingSphere(e.item._boundingSpheres[0]) : e.item._boundingVolumes && e.item._boundingVolumes.length ? (o = e.item._boundingVolumes[0].center, r = this._cesium.Cartographic.fromCartesian(o), n = this._cesium.Math.toDegrees(r.longitude), a = this._cesium.Math.toDegrees(r.latitude), s = this._cesium.Cartesian3.fromDegrees(n, a, 5e3), this._viewer.camera.setView({ destination: s })) : this._viewer.zoomTo(e.item) : e && this._viewer.zoomTo(e) } }, Oh.prototype.jumpToPosition = function (e, t, i, o = {}) { o = { heading: this._core.defaultValue(o.heading, 0), pitch: this._core.defaultValue(o.pitch, -90), roll: this._core.defaultValue(o.roll, 0) }; Math.abs(e) <= 180 && Math.abs(t) <= 90 ? this._viewer.camera.setView({ destination: this._cesium.Cartesian3.fromDegrees(e, t, i), orientation: new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading), Cesium.Math.toRadians(o.pitch), Cesium.Math.toRadians(o.roll)), duration: o.time }) : this._viewer.camera.setView({ destination: { x: e, y: t, z: i }, orientation: new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(o.heading), Cesium.Math.toRadians(o.pitch), Cesium.Math.toRadians(o.roll)) }) }, Bh.prototype.northfinger = function () { this._viewer.camera.setView({ destination: this._viewer.camera._destination, orientation: { pitch: this._viewer.camera._pitch, roll: 0 } }) }, Vh.prototype.setPosition = function (e, t, i) { Math.abs(e) <= 180 && Math.abs(t) <= 90 ? this._viewer.camera.setView({ destination: this._cesium.Cartesian3.fromDegrees(e, t, i) }) : this._viewer.camera.setView({ destination: { x: e, y: t, z: i } }) }, Fh.prototype.Stop = function () { this._viewer.scene.camera.cancelFlight() }, Hh.prototype.getPosition = function () { return this._getPosition || (this._getPosition = new y(this._viewer, this._cesium)), this._getPosition.getPosition() }, Hh.prototype.getMousePosition = function (e, t, i, o, r) { return this._getPosition || (this._getPosition = new y(this._viewer, this._cesium)), this._getPosition.getMousePosition(e, t, i, o, r) }, Hh.prototype.getDegrees = function () { return this._getPosition || (this._getPosition = new y(this._viewer, this._cesium)), this._getPosition.getDegrees() }, Hh.prototype.getMouseDegrees = function (e, t, i, o, r) { return this._getPosition || (this._getPosition = new y(this._viewer, this._cesium)), this._getPosition.getMouseDegrees(e, t, i, o, r) }, Hh.prototype.setPosition = function (e, t, i) { return this.Stop(), this._setPosition || (this._setPosition = new Vh(this._viewer, this._cesium)), this._setPosition.setPosition(e, t, i) }, Hh.prototype.zoomIn = function () { return this._zoomIn.zoomIn() }, Hh.prototype.zoomOut = function () { return this._zoomOut.zoomOut() }, Hh.prototype.flyTo = function (e, t) { return this.Stop(), this._flyTo.flyTo(e, t) }, Hh.prototype.flyToObj = function (e) { this.Stop(), this._flyToObj.flyToObj(e) }, Hh.prototype.jumpTo = function (e) { return this.Stop(), this._jumpTo.jumpTo(e) }, Hh.prototype.northfinger = function () { this._northfinger.northfinger() }, Hh.prototype.flyToPosition = function (e, t, i, o) { this.Stop(), this._flyTo.flyToPosition(e, t, i, o) }, Hh.prototype.jumpToPosition = function (e, t, i, o) { this.Stop(), this._jumpTo.jumpToPosition(e, t, i, o) }, Hh.prototype.flyToPointsInterest = function (e, t) { this.Stop(), this._flyTo.flyToPointsInterest(e, t) }, Hh.prototype.Stop = function () { this._Stop.Stop() }, Hh.prototype.rotateCenter = function (e = 360, t = 5) { var i = { x: this._viewer.canvas.clientWidth / 2, y: this._viewer.canvas.clientHeight / 2 }; return this._PointFly.setPointFly({ position: this.getMousePosition(i), time: t, limitAngel: e, limitTime: !0, hideImage: !0, pitch: Cesium.Math.toDegrees(this._viewer.camera.pitch) }) }, Hh.prototype.getCameraInfo = function (e) { let t = this.getDegrees(); t.lon = t.lon.toFixed(5), t.lat = t.lat.toFixed(5), t.height = t.height.toFixed(2), t.x = t.lon, t.y = t.lat, t.z = t.height; var { heading: i, pitch: o, roll: r } = this._viewer.camera, i = Cesium.Math.toDegrees(i).toFixed(1), o = Cesium.Math.toDegrees(o).toFixed(1), r = Cesium.Math.toDegrees(r).toFixed(1), o = { location: t, rotation: { heading: i, pitch: o, roll: r, yaw: i } }; return e && e(o), o }, Hh.prototype.globalRotate = function (e = {}, t) { this.Stop(), this.jumpTo({ destination: e.startPosition || { x: -5909515.002227878, y: 23989884.92116255, z: 15985285.564042224 } }); let i = e.angle || 3, o = 360 / i, r = (i = Cesium.Math.toRadians(i), 0), n = () => { 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) }, Gh.prototype.deleteItem = function (e) { V.delete(e, this._viewer, this._cesium) }, Gh.prototype.testTreeSource = function () { console.log(this._tree) }, kh.prototype.findItem = function (e) { for (var t = "", i = C.clone(this._tree), o = e.split("\\"), r = 0; r < o.length; r++)if (i = V.getSourceByName(i, o[r]), r == o.length - 1) { if (i) { t = i.id; break } t = "" } else { if (!i) { t = "", i = null; break } i = i.children } return t }, Nh.prototype.getItemName = function (e) { e = V.getSourceById(this._tree, e); return e ? e.name : "" }, jh.prototype.getVisibility = function (e) { e = V.getSourceById(this._tree, e); if (e) return e.item.getVisibility() }, Uh.prototype.setVisibility = function (e, t) { V.setVisibility(e, t, this._viewer, this._cesium) }, zh.prototype.rename = function (e, t) { var i = V.getSourceById(this._tree, e), i = (i && (i.name = t), V.getTempSourceById(e)); i && (i.name = t) }, Wh.prototype.getNextItem = function (e, t) { }; var Yh = Object.freeze({ none: -1, point: 0, polyline: 1, polygon: 2, label: 3, imageLabel: 4, position: 5, imageLayer: 6, dynamicObject: 7, D3titles: 8, box: 9, circle: 10, cone: 11, pointfeaturelayer: 12, polylinefeaturelayer: 13, polygonfeaturelayer: 14, pointmodel: 15, rectangle: 16, ellipsoid: 17, wall: 18, polylinevolume: 19 }); function Jh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource(), this._treeSource = V.Source, this._treeTemp = V.getTempSource(), this._tree1 = V, this._core = new f } function Kh(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } function Qh(e, t) { this._viewer = e, this._cesium = t } function q(e, t, i) { this._viewer = e, this._cesium = t, this._tree = V.Source, this._createGroup = new Ei(this._viewer, this._cesium, this._tree), this._deleteItem = new Gh(this._viewer, this._cesium, this._tree), this._findItem = new kh(this._viewer, this._cesium, this._tree), this._getItemName = new Nh(this._viewer, this._cesium, this._tree), this._getVisibility = new jh(this._viewer, this._cesium, this._tree), this._setVisibility = new Uh(this._viewer, this._cesium, this._tree), this._renameGroup = new zh(this._viewer, this._cesium, this._tree), this._getNextItem = new Wh(this._viewer, this._cesium, this._tree), this._isGroup = new Kh(this._viewer, this._cesium, this._tree), this._creator = new Q(this._viewer, this._cesium), this._getObject = new Jh(this._viewer, this._cesium), this._exportTree = new Qh(this._viewer, this._cesium), this._core = new f, this.InitTree(i, 0), this.InitRootImageLayerAndTerrainlayer() } Jh.prototype.getObject = function (e) { var t = C.clone(this._tree), t = V.getSourceById(t, e); return t ? t.item : (t = C.clone(V.PointSelectSource), (t = V.getPointSelectSourceById(t, e)) ? t.item : void 0) }, Jh.prototype.getTreeItem = function (e) { var t = C.clone(this._tree), t = V.getSourceById(t, e); if (t) return t; for (var i = this._viewer.dataSources, o = 0; o < i.length; o++) { var r, n, a, s, l, c = i.get(o).entities.getById(e); if (c) { if (c.point && (null == c.point.show || c.point.show._value)) return (s = new L(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "point", item: s }, V.pusPointSelectSource(l), l; if (c.label && (null == c.label.show || c.label.show._value)) return (s = new G(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "label", item: s }, V.pusPointSelectSource(l), l; if (c.box && (null == c.box.show || c.box.show._value)) return (r = new B(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "box", item: r }, V.pusPointSelectSource(l), l; if (c.model && (null == c.model.show || c.model.show._value)) return (s = new model(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "model", item: s }, V.pusPointSelectSource(l), l; if (c.wall && (null == c.wall.show || c.wall.show._value)) return (r = new fu(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "wall", item: r }, V.pusPointSelectSource(l), l; if (c.polyline) return (n = new R(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "polyline", item: n }, V.pusPointSelectSource(l), l; if (c.polygon) return (n = new M(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "polygon", item: n }, V.pusPointSelectSource(l), l; if (c.rectangle) return (a = new F(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "rectangle", item: a }, V.pusPointSelectSource(l), l; if (c.billboard && (null == c.billboard.show || c.billboard.show._value)) return (s = new gu(this._viewer, this._cesium)).setItem(c), l = { id: this._core.getuid(), name: "", pId: 0, type: "billboard", item: s }, V.pusPointSelectSource(l), l } } }, Jh.prototype.updateItemId = function (e, t) { var i = this._treeSource, o = V.getSourceById(i, e); if (o && (o.id = t, "group" == o.type && o.children && 0 < o.children.length)) for (var r = 0; r < o.children.length; r++)o.children[r].pId = t; i = this._treeTemp, o = V.getSourceById(i, e); if (o && (o.id = t, "group" == o.type && o.children && 0 < o.children.length)) for (r = 0; r < o.children.length; r++)o.children[r].pId = t }, Jh.prototype.unifiedProject = function (e, t) { for (var i = 0; i < t.length; i++)t[i].id = e[i].id, t[i].pId = t[i].pId, t[i].children && 0 < t[i].children.length && this.unifiedProject(e[i].children, t[i].children) }, Jh.prototype.insertProjectTree = function (e, t, i, o, r) { var n, a, s, l = !0; return this._core.isnull(t) && (t = this._core.getuid()), l = 0 != r, Yh.none == i || Yh.position == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "unknown", item: null }, V.insertGroupId(s, e)) : Yh.imageLayer == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, checked: l, type: "unknown", item: null }, V.insertGroupId(s, e)) : Yh.dynamicObject == i ? (s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "unknown", item: null }, V.insertGroupId(s, e)) : Yh.point == i ? ((n = new L(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "point", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Yh.polyline == i ? ((r = new R(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polyline", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.rectangle == i ? ((r = new F(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "rectangle", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.ellipsoid == i ? ((r = new Fr(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "ellipsoid", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.polygon == i ? (r = new M(this._viewer, this._cesium), o._entity ? (r.setItem(o._entity), r._points = o._points) : r.setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polygon", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.wall == i ? ((r = new fu(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "wall", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.polylinevolume == i ? ((r = new du(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polylinevolume", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.pointmodel == i ? ((r = new P(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "pointmodel", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.label == i ? ((n = new G(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "label", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Yh.imageLabel == i ? ((n = new gu(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, checked: l, type: "billboard", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Yh.D3titles == i ? ((r = new A(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "3DTilesets", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.box == i ? ((l = new B(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "box", item: l }, l.setTreeobj(s), V.insertGroupId(s, e)) : Yh.circle == i ? ((n = new H(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "circle", item: n }, n.setTreeobj(s), V.insertGroupId(s, e)) : Yh.cone == i ? ((r = new j(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "cylinder", item: r }, r.setTreeobj(s), V.insertGroupId(s, e)) : Yh.pointfeaturelayer == i ? ((a = new w(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "pointLayer", item: a }, V.insertGroupId(s, e)) : Yh.pointfeaturelayer == i ? ((a = new w(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polylineLayer", item: a }, V.insertGroupId(s, e)) : Yh.polygonfeaturelayer == i && ((a = new w(this._viewer, this._cesium)).setItem(o), s = { id: o && o.id ? o.id : this._core.getuid(), name: t, pId: e, type: "polygonLayer", item: a }, V.insertGroupId(s, e)), s }, Kh.prototype.isGroup = function (e) { var t = C.clone(this._tree), t = V.getSourceById(t, e); return !(!t || "group" != t.type) }, Qh.prototype.exportMethod = function (e) { for (var t, i = [], o = 0; o < e.length; o++)"function" == typeof e[o].item.export && (t = e[o].item.export(), i.push(t), e[o].children && e[o].children.length && (t = this.exportMethod(e[o].children), i.push(t))); return i }, Qh.prototype.export = function () { return this.exportMethod(V.Source) }, q.prototype.export = function () { var e = this._exportTree.export(), t = new Blob([JSON.stringify(e)], { type: "" }); return this._core.saveAs(t, "tree.json"), e }, q.prototype.createGroup = function (e, t, i) { return this._createGroup = new Ei(this._viewer, this._cesium), this._createGroup.createGroup(e, t, i) }, q.prototype.changeGroup = function (e, t) { this._createGroup.changeGroup(e, t) }, q.prototype.starttemporaryItem = function () { return this._createGroup.starttemporaryItem() }, q.prototype.pushtemporaryItem = function (e) { this._createGroup.pushtemporaryItem(e) }, q.prototype.pushStateItem = function (e) { this._createGroup.pushStateItem(e) }, q.prototype.endtemporaryItem = function () { this._createGroup.endtemporaryItem() }, q.prototype.deleteItem = function (e) { return this._deleteItem.deleteItem(e) }, q.prototype.findItem = function (e) { return this._findItem.findItem(e) }, q.prototype.getItemName = function (e) { return this._getItemName.getItemName(e) }, q.prototype.getObject = function (e) { return this._getObject.getObject(e) }, q.prototype.getTreeItem = function (e) { return this._getObject.getTreeItem(e) }, q.prototype.updateItemId = function (e, t) { return this._getObject.updateItemId(e, t) }, q.prototype.getVisibility = function (e) { return this._getVisibility.getVisibility(e) }, q.prototype.setVisibility = function (e, t) { return this._setVisibility.setVisibility(e, t) }, q.prototype.removeAll = function (t) { let i = []; this._viewer.entities.values.forEach(e => { 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 Yh } } }), 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 V.exitsGroup(e, t) }, q.prototype.getTreeSource = function () { var e = C.cloneDeep(V.getSource()); return V.removeItem(e) }, q.prototype.unifiedProject = function (e, t) { this._getObject.unifiedProject(e, t) }, q.prototype.clearn = function () { V.clearn() }, Object.defineProperties(q.prototype, { Source: { get: function () { return V.TempSource } } }), Object.defineProperties(q.prototype, { currentObj: { get: function () { return V.currentObj } } }), q.prototype.InitTree = function (e, t) { if (e && e.length) for (var i = 0; i < e.length; i++) { var o = e[i]; switch (o.type) { case "group": var r = this.createGroup(o.name, t); o.children && o.children.length && this.InitTree(o.children, r); break; case "label": this._creator.createLabel(o.position, o.text, o.option, t, o.description); break; case "imgLabel": this._creator.createImageLabel(o.position, o.imageLabel, t, o.description); break; case "polygon": this._creator.createPolygon(o.geometry, o.lineColor, o.altitudeType, t, o.description); break; case "polyline": this._creator.createPolyline(o.geometry, o.lineColor, o.altitudeType, t, o.description); break; case "box": this._creator.createBox(o.position, o.box, o.name, t, o.description); break; case "circle": this._creator.createCircle(o.position, o.circle, o.name, t, o.description); break; case "cone": this._creator.createCone(o.position, o.cylinder, o.name, o.description) } } }, q.prototype.InitRootImageLayerAndTerrainlayer = function () { }, Object.defineProperties(q.prototype, { selectedItem: { get: function () { return V.selectedItem }, set: function (e) { V.selectedItem = e } } }); function qh() { var e = arguments[0]; let t, i, o; o = arguments[1] === Cesium ? (t = arguments[2] || {}, "function" == typeof arguments[3] ? (i = {}, arguments[3]) : (i = arguments[3], arguments[4])) : "function" == typeof arguments[4] ? (t = arguments[2] || {}, i = arguments[3], arguments[4]) : (t = arguments[1] || {}, "function" == typeof arguments[2] ? (i = {}, arguments[2]) : (i = arguments[2], arguments[3])), this._core = new f, Cesium.Ion.defaultAccessToken = t.defaultAccessToken || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYWRlZDhiNi1hZTljLTQ4MWItYjdjNS0xYTkyMjk2YzdlOTQiLCJpZCI6NjcxNTksImlhdCI6MTYzMTU4NDY2NX0.l2kHF0uC2pTgJYwzQGpEBj6HCCdbYfRThEbXajcXOI8", this.rightRotate = t.rightRotate; var a = { 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 t ? a.imageryProvider = new Cesium.SingleTileImageryProvider({ url: t }) : (t.url && (a.imageryProvider = new Cesium.SingleTileImageryProvider({ url: t.url })), this._core.extend(a, t, !0)), a.baseLayerPicker) { let t = this.getAllImageryView(); if (a.basemaps) a.basemaps.forEach(e => { a.imageryProviderViewModels.push(t[e]) }); else for (var r in t) a.imageryProviderViewModels.push(t[r]) } else a.imageryProvider || (n = this._core.defaultValue(localStorage.getItem("sdkIsOnline"), 1), parseInt(n) ? a.imageryProvider = new Cesium.ArcGisMapServerImageryProvider({ name: "ArcGisMapServer", url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" }) : a.imageryProvider = new Cesium.SingleTileImageryProvider({ url: window.SmartEarthRootUrl + "Workers/image/earth.jpg" })); var n = { destination: Cesium.Cartesian3.fromDegrees(t.x || 110, t.y || 32, t.z || 8e6), orientation: { heading: Cesium.Math.toRadians(this._core.defaultValue(t.heading, 0)), pitch: Cesium.Math.toRadians(this._core.defaultValue(t.pitch, -90)), roll: Cesium.Math.toRadians(this._core.defaultValue(t.roll, 0)) }, duration: t.duration || .5 }; if (t.removeGlobe && (a.skyBox = !1, a.skyAtmosphere = !1, a.contextOptions = { failIfMajorPerformanceCaveat: !1, webgl: { alpha: !0, preserveDrawingBuffer: !0 } }), this._Viewer = new Cesium.Viewer(e, a), 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 && (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 = t.toolbar, t.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)"), t.backgroundImage && (this._Viewer.container.style.backgroundImage = "url(" + t.backgroundImage + ")")) : this._Viewer.scene.globe.depthTestAgainstTerrain = !0, this.Navigate.flyToPointsInterest(n, 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), a.maxViewHeight && (this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance = a.maxViewHeight), a.minViewHeight || a.maxViewPitch) { this.minViewHeight = a.minViewHeight, this.maxViewPitch = a.maxViewPitch && Cesium.Math.toRadians(a.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 < this.minViewHeight, r + this.minViewHeight), i.pitch < 0 ? i.pitch : 0); e ? i.setView({ destination: this.oldPosition || Cesium.Cartesian3.fromRadians(i.positionCartographic.longitude, i.positionCartographic.latitude, t), orientation: { heading: i.heading, pitch: o, roll: 0 } }) : this.oldPosition = i.position.clone() } } }) } if (t.mouseDownView && this.mouseDownView(!0), Object.defineProperties(Cesium.Model.prototype, { _cachedGltf: { configurable: !0, set: function (e) { var a, t, s; this._vtxf_cachedGltf = e, this._vtxf_cachedGltf && this._vtxf_cachedGltf._gltf && (a = this._vtxf_cachedGltf._gltf).extensionsUsed && a.extensionsRequired && (e = a.extensionsUsed.indexOf("KHR_technique_webgl"), t = a.extensionsRequired.indexOf("KHR_technique_webgl"), -1 !== e && (a.extensionsRequired.splice(t, 1, "KHR_techniques_webgl"), a.extensionsUsed.splice(e, 1, "KHR_techniques_webgl"), a.extensions = a.extensions || {}, a.extensions.KHR_techniques_webgl = {}, a.extensions.KHR_techniques_webgl.programs = a.programs, a.extensions.KHR_techniques_webgl.shaders = a.shaders, a.extensions.KHR_techniques_webgl.techniques = a.techniques, s = a.extensions.KHR_techniques_webgl.techniques, a.materials.forEach(function (e, t) { a.materials[t].extensions.KHR_technique_webgl.values = a.materials[t].values, a.materials[t].extensions.KHR_techniques_webgl = a.materials[t].extensions.KHR_technique_webgl; var i, o = a.materials[t].extensions.KHR_techniques_webgl; for (i in o.values) { var r, n = s[o.technique].uniforms; for (r in n) if (n[r] === i) { o.values[r] = o.values[i], delete o.values[i]; break } } }), s.forEach(function (e) { for (var t in e.attributes) { var i = e.attributes[t]; e.attributes[t] = e.parameters[i] } for (var o in e.uniforms) { i = e.uniforms[o]; e.uniforms[o] = e.parameters[i] } }))) }, get: function () { return this._vtxf_cachedGltf } } }), Cesium.Resource && (Cesium.loadText = Cesium.Resource.fetchText, Cesium.loadJson = Cesium.Resource.fetchJson, Cesium.loadBlob = Cesium.Resource.fetchBlob, Cesium.loadArrayBuffer = Cesium.Resource.fetchArrayBuffer, Cesium.loadImage = Cesium.Resource.fetchImage), Cesium.isArray || (Cesium.isArray = Array.isArray), a.navigation) { if (!Cesium.viewerCesiumNavigationMixin) { let e = new oe(!1); e.addJs(window.SmartEarthRootUrl + "Workers/viewerCesiumNavigationMixin.js") } e = { defaultResetView: Cesium.Rectangle.fromDegrees(80, 22, 130, 50), enableCompass: !0, enableZoomControls: !0, enableDistanceLegend: !0, enableCompassOuterRing: !0 }; t.navigationOption && this._core.extend(e, t.navigationOption, !0), this._Viewer.extend(Cesium.viewerCesiumNavigationMixin, e) } a.disableRightClickMenu && (document.oncontextmenu = function () { return !1 }); n = this._Viewer; if (n.cesiumWidget._supportsImageRenderingPixelated && window && window.devicePixelRatio) { for (var s = window.devicePixelRatio; 2 <= s;)s /= 2; n.resolutionScale = s } n.scene.postProcessStages.fxaa.enabled = !0, this.sunLight = !1; var u = this; function h(t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(c(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise } function l(e, t) { for (var i = e.tilingScheme, o = i.positionToTileXY(t, 0), e = u._Viewer.scene.globe._surface.tileProvider.quadtree._levelZeroTiles, r = e[0].x == o.x && e[0].y == o.y ? e[0] : e[1], n = 1; n < 22; n++) { var a = function (e, t) { for (var i = 0; i < e.children.length; i++)if (e.children[i].state >= 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(u._Viewer.scene.primitives._primitives, function (e) { return e instanceof Cesium.Cesium3DTileset }), t = 0; t < e.length; ++t) { var i = e[t], o = i instanceof Cesium.Cartographic, r = o ? i : Cesium.Cartographic.fromCartesian(i); r.height = u.G, o || (o = Cesium.Cartesian3.fromRadiansArrayHeights([r.longitude, r.latitude, r.height])[0], i.z = o.z) } return e } function c(e, t) { for (var i = 0; i < t.length; ++i) { var o = t[i], r = l(e, o); o.height = r.data.terrainData.interpolateHeight(r.rectangle, o.longitude, o.latitude) } return t } function d(e) { this.value = new Float32Array([e]) } u.G = 65535, d.fromZBias = function (e) { if (Cesium.defined(e)) return new d(e); throw new DeveloperError("zbias is required.") }, d.toValue = function (e, t) { if (Cesium.defined(e)) return Cesium.defined(t) ? color.toBytes(t) : new Float32Array(e); throw new DeveloperError("zbias is required.") }, d.equals = function (e, t) { return e === t || Cesium.defined(e) && Cesium.defined(t) && e.value[0] === t.value[0] }, d.defaultBias = function () { return d.fromZBias(15e-6) }, Cesium.ZBiasGeometryInstanceAttribute = d, Cesium.SampleRenderedDataFlags = { TERRAIN: 2, MESH: 4, FLOOR: 8 }, Cesium.DynamicEyeOffset = function (e) { return void 0 === e && (e = 0), new Cesium.Cartesian3(.001234321, 0, e) }, Cesium.sampleRenderedData = function (r, e) { var t, i = 2, o = 4, n = 8, a = (null == e && (e = i | o), Cesium.when.defer()), s = [], l = (i < e ? r.forEach(function (e) { s.push(Cesium.Cartographic.fromRadians(e.longitude, e.latitude, e.height)) }) : s = r, []), c = (e & i && l.push(h(u._Viewer.terrainProvider, r)), 0 < (e & n)); return e & (o | n) && l.push((i = s, Cesium.Check.defined("positions", i), t = Cesium.when.defer(), Cesium.when(m(i), function (e) { t.resolve(e) }), t.promise)), Cesium.when.all(l).then(function (e) { if (1 < l.length) for (var t = 0; t < r.length; t++) { var i = e[0][t], o = e[1][t]; o.height != u.G && (i.height < o.height || c) && (i.height = o.height) } a.resolve(e[0]) }), a.promise }, Cesium.sampleRenderedMesh = function (e, t) { Cesium.Check.defined("positions", e); var i = Cesium.when.defer(); return Cesium.when(m(e), function (e) { i.resolve(e) }), i.promise }, Cesium.sampleRenderedTerrain = function (t, i) { Cesium.Check.typeOf.object("terrainProvider", t), Cesium.Check.defined("positions", i); var o = Cesium.when.defer(); return function e() { t.ready ? Cesium.when(c(t, i), function (e) { o.resolve(e) }) : setTimeout(e, 10) }(), o.promise }, Cesium.QuadtreePrimitive.prototype.getRenderedBestLevelInfo = function () { var e, t = this.getRenderedLevelInfo(), i = 0; for (e in t) i < Number(e) && (i = Number(e)); return { bestLevel: i, count: t[i] } }, Cesium.QuadtreePrimitive.prototype.getRenderedLevelInfo = function () { var t = []; return this._tilesToRender.forEach(function (e) { null == t[e.level] && (t[e.level] = 0), t[e.level]++ }), t } } function Xh(e, t) { let i = new oe(!1); i.addJs(SmartEarthRootUrl + "SmartEarth.min.js"), this._core = new f, this.left = e, this.leftContainer = e._Viewer.container, this.leftContainer.style.width = "50%", this.parentElement = this.leftContainer.parentElement, this.createRightScreen(t), this.addEvenListener() } qh.prototype.mouseDownView = function (e) { if (e && !this.cursorHandel) { this.cursorHandel = new Cesium.ScreenSpaceEventHandler(this._Viewer.scene.canvas); let t, i, o = (this.cursorPoint = document.createElement("div"), this.cursorPoint.className = "mouseDownViewPoint", this.cursorPoint.style.cssText = "visibility: hidden;opacity: 0;pointer-events: none;position: absolute;z-index: 999;transition: visibility 0.2s ease 0s, opacity 0.2s ease-in;", this.cursorPoint.innerHTML = '<img src="' + window.SmartEarthRootUrl + 'Workers/image/cursor.png" style="width: 36px;height: 36px;">', 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 _r(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 }, qh.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, c; 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); c = "坐标信息", 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 ? (c = a.id.fid, s = a.id.attributes) : a.id.id && a.id.properties ? (c = a.id.name || a.id.id, s = a.id.properties.getValue ? a.id.properties.getValue() : a.id.properties) : a.id.feature && (c = a.id.feature.id, s = a.id.feature.properties); else if (a._modelId) a._modelId.id && a._modelId.properties && (c = a._modelId.id, s = a._modelId.properties); else if (!a.color && a.content) { c = "模型" + 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 = '<table class="cesium-infoBox-defaultTable"><tbody>', s) l += `<tr><th>${e}</th><td>${s[e]}</td></tr>`; l += "</tbody></table>", this._Viewer.selectedEntity = new Cesium.Entity({ name: c, 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) }, qh.prototype.pickPosition = function (e, t = !0) { this.endPick(), this.pick(e, t, !1, !0) }, qh.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) }, qh.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(qh.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 Hh(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 f), this._Core } }, Command: { get: function () { return null == this._Command && (this._Command = new $r(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 sc(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 } } }), qh.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))) }, qh.prototype.CreateWfs = function (e, t, i, o, r, n, a, s, l) { return new W(e, t, i, o, r, n, a, s, l) }, qh.prototype.AttachEvent = function (e, t) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachEvent(e, t) }, qh.prototype.RemoNormalCesiumLeftDoubleClick = function () { return null == this._DetachEvent && (this._DetachEvent = new Ah(this._Viewer, Cesium)), this._DetachEvent.RemoNormalCesiumLeftDoubleClick() }, qh.prototype.AttachOnLButtonDblClkEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnLButtonDblClkEvent(e) }, qh.prototype.AttachOnLButtonDownEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnLButtonDownEvent(e) }, qh.prototype.AttachOnLButtonUpEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnLButtonUpEvent(e) }, qh.prototype.AttachOnMButtonDblClkEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnMButtonDblClkEvent(e) }, qh.prototype.AttachOnMButtonDownEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnMButtonDownEvent(e) }, qh.prototype.AttachOnMButtonUpEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnMButtonUpEvent(e) }, qh.prototype.AttachOnMouseWheelEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnMouseWheelEvent(e) }, qh.prototype.AttachOnFrameEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnFrameEvent(e) }, qh.prototype.AttachOnRButtonDownEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnRButtonDownEvent(e) }, qh.prototype.AttachOnRButtonUpEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachOnRButtonUpEvent(e) }, qh.prototype.AttachCameraChangeEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.AttachCameraChangeEvent(e) }, qh.prototype.CameraMoveEndEvent = function (e) { return null == this._AttachEvent && (this._AttachEvent = new Ih(this._Viewer, Cesium)), this._AttachEvent.CameraMoveEndEvent(e) }, qh.prototype.DetachEvent = function (e, t) { return null == this._DetachEvent && (this._DetachEvent = new Ah(this._Viewer, Cesium)), this._DetachEvent.DetachEvent(e, t) }, qh.prototype.DetachEventAll = function (e) { return null == this._DetachEvent && (this._DetachEvent = new Ah(this._Viewer, Cesium)), this._DetachEvent.DetachEventAll(e) }, qh.prototype.DetachCameraChangeEvent = function (e) { return null == this._DetachEvent && (this._DetachEvent = new Ah(this._Viewer, Cesium)), this._DetachEvent.DetachCameraChangeEvent(e) }, Xh.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 qh("SDKSecondaryScreen",e),this.right.Navigate.Stop(),this.leftEvenListener()},Xh.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}})},Xh.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 Zh,$h;function em(e,t){this._viewer=e,this._cesium=t,this._Color=new m(this._viewer,this._cesium),this._core=new f,this._getPosition=new y(this._viewer,this._cesium),this._tree=V,this._points=[],this._polylines=[],this.Streamerpath=new eh(this._viewer),this.Streamerwall=new oh(this._viewer)}function tm(e,t){this._viewer=e,this._cesium=t}function im(e,t){this._viewer=e,this._cesium=t,this._current=new tm(this._viewer,this._cesium)}Xh.prototype.addEvenListener=function(){this.leftContainer.onmouseover=()=>{Zh||(Zh=this.leftEvenListener.bind(this),this.left._Viewer.scene.preRender.addEventListener(Zh)),$h&&this.right._Viewer.scene.preRender.removeEventListener($h),$h=null},this.rightContainer.onmouseover=()=>{$h||($h=this.rightEvenListener.bind(this),this.right._Viewer.scene.preRender.addEventListener($h)),Zh&&this.left._Viewer.scene.preRender.removeEventListener(Zh),Zh=null}},Xh.prototype.removeEvenListener=function(){this.leftContainer.onmouseover=null,this.rightContainer.onmouseover=null,$h&&this.right._Viewer.scene.preRender.removeEventListener($h),Zh&&this.left._Viewer.scene.preRender.removeEventListener(Zh),$h=null,Zh=null},Xh.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%"},em.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<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerpath.create({positions:o,...t})});e={id:t.id,name:"新建流光线图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},em.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);i.then(e=>{var i=e.entities.values;let o=[];for(let t=0;t<i.length;t++){let e=i[t];e.polyline?o.push(e.polyline.positions.getValue()):e.polygon&&o.push(e.polygon.hierarchy.getValue().positions)}this.Streamerwall.create({positions:o,...t})});e={id:t.id,name:"新建流动墙图层",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(e),this._tree.insertGroupId(e,0),this},em.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},r=((o=this._core.extend(o,i,!0)).twoColor&&(m={color1:o.twoColor.color1||"#00ff00",color2:o.twoColor.color2||"#ff0000"}),o.LightSpot&&(m={LightSpot:!0,color:o.LightSpotColor||o.LineColor}),new te(o.LineColor,this._core.defaultValue(m,o.LinkImage),o.time)),n=(r.alpha=o.alpha,i.inflow);let a,s;for(var l=0;l<t.length;l++){n?(a=t[l],s=e):(s=t[l],a=e);for(var c=this.parabolaEquation({pt1:a,pt2:s,height:o.height,num:o.num}),u=[],h=0;h<c.length;h++)u.push(c[h][0],c[h][1],c[h][2]);this._polylines.push(this._viewer.entities.add({name:"PolylineTrailLink"+l,polyline:{positions:this._cesium.Cartesian3.fromDegreesArrayHeights(u),width:o.width,material:r,distanceDisplayCondition:new Cesium.DistanceDisplayCondition(0,o.far||1/0)}}))}this.pathMaterial=r,o.static&&this.pathMaterial.setScale(0);var m={id:this._core.getuid(),name:"新建流动路径",pId:0,type:"TrailLine",item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,0),this},em.prototype.createFlyingLine=function(e,t={}){var i={time:3e3,LineColor:this._core.defaultValue(t.color,"#ffffff"),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.TrailLine),minHeight:0,width:1,alpha:0},t={LightSpot:!0,color:(i=this._core.extend(i,t,!0)).LightSpotColor||i.LineColor},o=new te(i.LineColor,this._core.defaultValue(t,i.LinkImage),i.time);o.alpha=i.alpha;let r;e.forEach(e=>{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},em.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;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"PolylineTrail",polyline:{positions:o,width:i.width,material:t,clampToGround:i.clampToGround}}));t={id:this._core.getuid(),name:"新建流动线",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},em.prototype.createWall=function(e,t){var i={time:9e3,LineColor:this._core.defaultValue((t="number"==typeof(t=t||{})?{time:t}:t).color,this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(t.url,window.SmartEarthRootUrl+I.colors3)},t=new te((i=this._core.extend(i,t,!0)).LineColor,i.LinkImage,i.time||9e3),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;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y,e[r].z));else o=e;else for(r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x,e[r].y));else if(2===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1]));else if(3===e[0].length)for(var r=0;r<e.length;r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0],e[r][1],e[r][2]));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:o,material:t,maximumHeights:i.maximumHeights,minimumHeights:i.minimumHeights}}));t={id:this._core.getuid(),name:"新建流动墙",pId:0,type:"TrailLine",item:this};return this.setTreeobj(t),this._tree.insertGroupId(t,0),this},em.prototype.parabolaEquation=function(e,t){var i=this._core.defaultValue(e.height,5e3),o=Math.abs(e.pt1.lon-e.pt2.lon)>Math.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&&50<e.num?e.num:50,n=[],a=o/r,s=e.pt1.height||0,l=e.pt2.height||0;if(Math.abs(e.pt1.lon-e.pt2.lon)>Math.abs(e.pt1.lat-e.pt2.lat)){var c=(e.pt2.lat-e.pt1.lat)/r;0<e.pt1.lon-e.pt2.lon&&(a=-a);for(var u=0;u<=r;u++){var h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+a*u,d=e.pt1.lat+c*u;n.push([m,d,h])}}else{var p=(e.pt2.lon-e.pt1.lon)/r;0<e.pt1.lat-e.pt2.lat&&(a=-a);for(u=0;u<=r;u++){h=i-4*Math.pow(-.5*o+Math.abs(a)*u,2)*i/Math.pow(o,2)+s+(l-s)*u/r,m=e.pt1.lon+p*u,d=e.pt1.lat+a*u;n.push([m,d,h])}}return n},em.prototype.setThisPosition=function(e,t){var i;this.pathMaterial&&(i=this._cesium.Cartesian3.fromDegrees(e[0].lon,e[0].lat),e=this._cesium.Cartesian3.fromDegrees(e[1].lon,e[1].lat),t=this._cesium.Cartesian3.fromDegrees(t.lon,t.lat),e=this._core.getSpaceDistancem([i,e],this._cesium),i=this._core.getSpaceDistancem([i,t],this._cesium),this.pathMaterial.setScale(i/e))},em.prototype.clear=function(){if(0<this._points.length)for(var e=0;e<this._points.length;e++)this._viewer.entities.remove(this._points[e]);if(0<this._polylines.length)for(e=0;e<this._polylines.length;e++)this._viewer.entities.remove(this._polylines[e]);this._points=[],this._polylines=[],this.Streamerpath.removeAll(),this.Streamerwall.removeAll()},em.prototype.setTreeobj=function(e){this.treeobj=e},em.prototype.deleteObject=function(){this.clear()},em.prototype.setVisibility=function(e){if(0<this._points.length)for(var t=0;t<this._points.length;t++)this._points[t].show=e;if(0<this._polylines.length)for(t=0;t<this._polylines.length;t++)this._polylines[t].show=e;this.Streamerpath.show(e),this.Streamerwall.show(e)},tm.prototype.currentTime=function(e){return""!=e&&null!=e&&(e=new Date(e),e=this.this._cesium.JulianDate.fromDate(e),this._viewer.clock.currentTime=e.clone()),this},tm.prototype.currentTimeFaster=function(){return this._viewer.animation.viewModel.faster(),this},tm.prototype.currentTimeSlower=function(){return this._viewer.animation.viewModel.slower(),this},tm.prototype.currentplayForwardViewModel=function(){return this._viewer.animation.viewModel.playForwardViewModel.command(),this},tm.prototype.currentplayReverseViewModel=function(){return this._viewer.animation.viewModel.playReverseViewModel.command(),this},tm.prototype.currentpauseViewModel=function(){return this._viewer.animation.viewModel.pauseViewModel.command(),this},im.prototype.currentTime=function(e){return this._current.currentTime(e)},im.prototype.currentTimeFaster=function(){return this._current.currentTimeFaster()},im.prototype.currentTimeSlower=function(){return this._current.currentTimeSlower()},im.prototype.currentplayForwardViewModel=function(){return this._current.currentplayForwardViewModel()},im.prototype.currentplayReverseViewModel=function(){return this._current.currentplayReverseViewModel()},im.prototype.currentpauseViewModel=function(){return this._current.currentpauseViewModel()};let om={draw_tip_left:"左键开始绘制!",draw_tip_right:"右键结束绘制!",draw_tip_click:"点击继续绘制!",draw_tip_cancel:"再次点击结束绘制,右键取消!",draw_tip_first_point:"点击添加第一个点",draw_tip_state:"点击添加点,右键结束",draw_tip_info_radius:"半径",unit_m:"米",unit_km:"千米"};function rm(e){this._core=new f,this._lang=this._core.extend(om,e,!0)}rm.prototype.getStr=function(e){return this._lang[e]},rm.prototype.set=function(e){this._lang=this._core.extend(om,e,!0)},rm.prototype.get=function(){return this._lang};let nm="undefined"!=typeof window?window:"undefined"!=typeof self?self:{},am=document.currentScript&&document.currentScript.src;if(!am)try{throw Error("获取当前文件路径")}catch(e){e.fileName?am=e.fileName:e.stack?am=(e.stack.match(/at\s+(.*?):\d+:\d+/)||["",""])[1]:e.sourceURL&&(am=e.sourceURL)}let sm=(am=-1<am.indexOf("(")?am.split("(")[1]:am).indexOf("SmartEarth.js"),lm=(sm<0&&(sm=am.indexOf("SmartEarth.min.js")),nm.SmartEarthRootUrl);if(!lm){lm=sm<0?(sm=am.indexOf("Source/Main"),am.substring(0,sm)+"Build/"):am.substring(0,sm);let t=document.getElementsByTagName("link"),i=!1;for(let e=0;e<t.length;e++)-1!==t[e].href.indexOf("smartearth.css")&&(i=!0);if(!i){let e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=lm+"Workers/css/smartearth.css",document.head.appendChild(e)}let e=new oe(!1);try{nm.$||e.addJs(lm+"Workers/jquery-2.0.3.js"),nm.layer||e.addJs(lm+"Workers/layui/lay/modules/layer.js"),nm.layuiLayer=nm.layer,nm.Cesium_turf||(e.addJs(lm+"Workers/turf.min.js"),nm.Cesium_turf=nm.turf),e.addJs(lm+"Workers/polyfill.min.js")}catch(e){}nm.SmartEarthPopupData={}}function cm(e,t){this._viewer=e,this._cesium=t,this._tree=V.getSource()}nm.language=new rm,nm.SmartEarthRootUrl=lm,nm.logSmartEarthLog=e=>{var t=nm.SmartEarth&&nm.SmartEarth.VERSION,i=nm.SmartEarth&&nm.SmartEarth.COMPILETIME,o=nm.Cesium&&nm.Cesium.VERSION;let r=e===1/0||-1<am.indexOf("Source/Main")?"永久激活":new Date(e);e=`
    `, 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 qh("SDKSecondaryScreen", e), this.right.Navigate.Stop(), this.leftEvenListener()
    }, Xh.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 } }) }, Xh.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 Zh, $h; function em(e, t) { this._viewer = e, this._cesium = t, this._Color = new m(this._viewer, this._cesium), this._core = new f, this._getPosition = new y(this._viewer, this._cesium), this._tree = V, this._points = [], this._polylines = [], this.Streamerpath = new eh(this._viewer), this.Streamerwall = new oh(this._viewer) } function tm(e, t) { this._viewer = e, this._cesium = t } function im(e, t) { this._viewer = e, this._cesium = t, this._current = new tm(this._viewer, this._cesium) } Xh.prototype.addEvenListener = function () { this.leftContainer.onmouseover = () => { Zh || (Zh = this.leftEvenListener.bind(this), this.left._Viewer.scene.preRender.addEventListener(Zh)), $h && this.right._Viewer.scene.preRender.removeEventListener($h), $h = null }, this.rightContainer.onmouseover = () => { $h || ($h = this.rightEvenListener.bind(this), this.right._Viewer.scene.preRender.addEventListener($h)), Zh && this.left._Viewer.scene.preRender.removeEventListener(Zh), Zh = null } }, Xh.prototype.removeEvenListener = function () { this.leftContainer.onmouseover = null, this.rightContainer.onmouseover = null, $h && this.right._Viewer.scene.preRender.removeEventListener($h), Zh && this.left._Viewer.scene.preRender.removeEventListener(Zh), $h = null, Zh = null }, Xh.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%" }, em.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 < i.length; t++) { let e = i[t]; e.polyline ? o.push(e.polyline.positions.getValue()) : e.polygon && o.push(e.polygon.hierarchy.getValue().positions) } this.Streamerpath.create({ positions: o, ...t }) }); e = { id: t.id, name: "新建流光线图层", pId: 0, type: "TrailLineLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, em.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); i.then(e => { var i = e.entities.values; let o = []; for (let t = 0; t < i.length; t++) { let e = i[t]; e.polyline ? o.push(e.polyline.positions.getValue()) : e.polygon && o.push(e.polygon.hierarchy.getValue().positions) } this.Streamerwall.create({ positions: o, ...t }) }); e = { id: t.id, name: "新建流动墙图层", pId: 0, type: "TrailLineLayer", item: this }; return this.setTreeobj(e), this._tree.insertGroupId(e, 0), this }, em.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 }, r = ((o = this._core.extend(o, i, !0)).twoColor && (m = { color1: o.twoColor.color1 || "#00ff00", color2: o.twoColor.color2 || "#ff0000" }), o.LightSpot && (m = { LightSpot: !0, color: o.LightSpotColor || o.LineColor }), new te(o.LineColor, this._core.defaultValue(m, o.LinkImage), o.time)), n = (r.alpha = o.alpha, i.inflow); let a, s; for (var l = 0; l < t.length; l++) { n ? (a = t[l], s = e) : (s = t[l], a = e); for (var c = this.parabolaEquation({ pt1: a, pt2: s, height: o.height, num: o.num }), u = [], h = 0; h < c.length; h++)u.push(c[h][0], c[h][1], c[h][2]); this._polylines.push(this._viewer.entities.add({ name: "PolylineTrailLink" + l, polyline: { positions: this._cesium.Cartesian3.fromDegreesArrayHeights(u), width: o.width, material: r, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, o.far || 1 / 0) } })) } this.pathMaterial = r, o.static && this.pathMaterial.setScale(0); var m = { id: this._core.getuid(), name: "新建流动路径", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(m), this._tree.insertGroupId(m, 0), this }, em.prototype.createFlyingLine = function (e, t = {}) { var i = { time: 3e3, LineColor: this._core.defaultValue(t.color, "#ffffff"), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + I.TrailLine), minHeight: 0, width: 1, alpha: 0 }, t = { LightSpot: !0, color: (i = this._core.extend(i, t, !0)).LightSpotColor || i.LineColor }, o = new te(i.LineColor, this._core.defaultValue(t, i.LinkImage), i.time); o.alpha = i.alpha; let r; e.forEach(e => { 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 }, em.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; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1], e[r][2])); this._polylines.push(this._viewer.entities.add({ name: "PolylineTrail", polyline: { positions: o, width: i.width, material: t, clampToGround: i.clampToGround } })); t = { id: this._core.getuid(), name: "新建流动线", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, em.prototype.createWall = function (e, t) { var i = { time: 9e3, LineColor: this._core.defaultValue((t = "number" == typeof (t = t || {}) ? { time: t } : t).color, this._cesium.Color.ORANGE), LinkImage: this._core.defaultValue(t.url, window.SmartEarthRootUrl + I.colors3) }, t = new te((i = this._core.extend(i, t, !0)).LineColor, i.LinkImage, i.time || 9e3), 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; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y, e[r].z)); else o = e; else for (r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r].x, e[r].y)); else if (2 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1])); else if (3 === e[0].length) for (var r = 0; r < e.length; r++)o.push(this._cesium.Cartesian3.fromDegrees(e[r][0], e[r][1], e[r][2])); this._polylines.push(this._viewer.entities.add({ name: "WallTrail", wall: { positions: o, material: t, maximumHeights: i.maximumHeights, minimumHeights: i.minimumHeights } })); t = { id: this._core.getuid(), name: "新建流动墙", pId: 0, type: "TrailLine", item: this }; return this.setTreeobj(t), this._tree.insertGroupId(t, 0), this }, em.prototype.parabolaEquation = function (e, t) { var i = this._core.defaultValue(e.height, 5e3), o = Math.abs(e.pt1.lon - e.pt2.lon) > Math.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 && 50 < e.num ? e.num : 50, n = [], a = o / r, s = e.pt1.height || 0, l = e.pt2.height || 0; if (Math.abs(e.pt1.lon - e.pt2.lon) > Math.abs(e.pt1.lat - e.pt2.lat)) { var c = (e.pt2.lat - e.pt1.lat) / r; 0 < e.pt1.lon - e.pt2.lon && (a = -a); for (var u = 0; u <= r; u++) { var h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * u, 2) * i / Math.pow(o, 2) + s + (l - s) * u / r, m = e.pt1.lon + a * u, d = e.pt1.lat + c * u; n.push([m, d, h]) } } else { var p = (e.pt2.lon - e.pt1.lon) / r; 0 < e.pt1.lat - e.pt2.lat && (a = -a); for (u = 0; u <= r; u++) { h = i - 4 * Math.pow(-.5 * o + Math.abs(a) * u, 2) * i / Math.pow(o, 2) + s + (l - s) * u / r, m = e.pt1.lon + p * u, d = e.pt1.lat + a * u; n.push([m, d, h]) } } return n }, em.prototype.setThisPosition = function (e, t) { var i; this.pathMaterial && (i = this._cesium.Cartesian3.fromDegrees(e[0].lon, e[0].lat), e = this._cesium.Cartesian3.fromDegrees(e[1].lon, e[1].lat), t = this._cesium.Cartesian3.fromDegrees(t.lon, t.lat), e = this._core.getSpaceDistancem([i, e], this._cesium), i = this._core.getSpaceDistancem([i, t], this._cesium), this.pathMaterial.setScale(i / e)) }, em.prototype.clear = function () { if (0 < this._points.length) for (var e = 0; e < this._points.length; e++)this._viewer.entities.remove(this._points[e]); if (0 < this._polylines.length) for (e = 0; e < this._polylines.length; e++)this._viewer.entities.remove(this._polylines[e]); this._points = [], this._polylines = [], this.Streamerpath.removeAll(), this.Streamerwall.removeAll() }, em.prototype.setTreeobj = function (e) { this.treeobj = e }, em.prototype.deleteObject = function () { this.clear() }, em.prototype.setVisibility = function (e) { if (0 < this._points.length) for (var t = 0; t < this._points.length; t++)this._points[t].show = e; if (0 < this._polylines.length) for (t = 0; t < this._polylines.length; t++)this._polylines[t].show = e; this.Streamerpath.show(e), this.Streamerwall.show(e) }, tm.prototype.currentTime = function (e) { return "" != e && null != e && (e = new Date(e), e = this.this._cesium.JulianDate.fromDate(e), this._viewer.clock.currentTime = e.clone()), this }, tm.prototype.currentTimeFaster = function () { return this._viewer.animation.viewModel.faster(), this }, tm.prototype.currentTimeSlower = function () { return this._viewer.animation.viewModel.slower(), this }, tm.prototype.currentplayForwardViewModel = function () { return this._viewer.animation.viewModel.playForwardViewModel.command(), this }, tm.prototype.currentplayReverseViewModel = function () { return this._viewer.animation.viewModel.playReverseViewModel.command(), this }, tm.prototype.currentpauseViewModel = function () { return this._viewer.animation.viewModel.pauseViewModel.command(), this }, im.prototype.currentTime = function (e) { return this._current.currentTime(e) }, im.prototype.currentTimeFaster = function () { return this._current.currentTimeFaster() }, im.prototype.currentTimeSlower = function () { return this._current.currentTimeSlower() }, im.prototype.currentplayForwardViewModel = function () { return this._current.currentplayForwardViewModel() }, im.prototype.currentplayReverseViewModel = function () { return this._current.currentplayReverseViewModel() }, im.prototype.currentpauseViewModel = function () { return this._current.currentpauseViewModel() }; let om = { draw_tip_left: "左键开始绘制!", draw_tip_right: "右键结束绘制!", draw_tip_click: "点击继续绘制!", draw_tip_cancel: "再次点击结束绘制,右键取消!", draw_tip_first_point: "点击添加第一个点", draw_tip_state: "点击添加点,右键结束", draw_tip_info_radius: "半径", unit_m: "米", unit_km: "千米" }; function rm(e) { this._core = new f, this._lang = this._core.extend(om, e, !0) } rm.prototype.getStr = function (e) { return this._lang[e] }, rm.prototype.set = function (e) { this._lang = this._core.extend(om, e, !0) }, rm.prototype.get = function () { return this._lang }; let nm = "undefined" != typeof window ? window : "undefined" != typeof self ? self : {}, am = document.currentScript && document.currentScript.src; if (!am) try { throw Error("获取当前文件路径") } catch (e) { e.fileName ? am = e.fileName : e.stack ? am = (e.stack.match(/at\s+(.*?):\d+:\d+/) || ["", ""])[1] : e.sourceURL && (am = e.sourceURL) } let sm = (am = -1 < am.indexOf("(") ? am.split("(")[1] : am).indexOf("SmartEarth.js"), lm = (sm < 0 && (sm = am.indexOf("SmartEarth.min.js")), nm.SmartEarthRootUrl); if (!lm) { lm = sm < 0 ? (sm = am.indexOf("Source/Main"), am.substring(0, sm) + "Build/") : am.substring(0, sm); let t = document.getElementsByTagName("link"), i = !1; for (let e = 0; e < t.length; e++)-1 !== t[e].href.indexOf("smartearth.css") && (i = !0); if (!i) { let e = document.createElement("link"); e.rel = "stylesheet", e.type = "text/css", e.href = lm + "Workers/css/smartearth.css", document.head.appendChild(e) } let e = new oe(!1); try { nm.$ || e.addJs(lm + "Workers/jquery-2.0.3.js"), nm.layer || e.addJs(lm + "Workers/layui/lay/modules/layer.js"), nm.layuiLayer = nm.layer, nm.Cesium_turf || (e.addJs(lm + "Workers/turf.min.js"), nm.Cesium_turf = nm.turf), e.addJs(lm + "Workers/polyfill.min.js") } catch (e) { } nm.SmartEarthPopupData = {} } function cm(e, t) { this._viewer = e, this._cesium = t, this._tree = V.getSource() } nm.language = new rm, nm.SmartEarthRootUrl = lm, nm.logSmartEarthLog = e => {
        var t = nm.SmartEarth && nm.SmartEarth.VERSION, i = nm.SmartEarth && nm.SmartEarth.COMPILETIME, o = nm.Cesium && nm.Cesium.VERSION; let r = e === 1 / 0 || -1 < am.indexOf("Source/Main") ? "永久激活" : new Date(e); e = `
%c
SmartEarth
%c
版 本 号:${t}    Cesium版本:${o}
编译时间:${i}
授权信息:${r="永久激活"!==r?`有效期至${r.getFullYear()}年${r.getMonth()+1}月${r.getDate()}日`:r}。
授权信息:${r = "永久激活" !== r ? `有效期至${r.getFullYear()}年${r.getMonth() + 1}月${r.getDate()}日` : r}。
版权声明: SmartEarthSDK版权完全属于【泰瑞数创科技(北京)股份有限公司】
在线示例:http://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<am.indexOf("Source/Main")},cm.prototype.deleteItem=function(e){};var um=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var i=t,o=[],r=!0,t=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(o.push(a.value),!i||o.length!==i);r=!0);}catch(e){t=!0,n=e}finally{try{!r&&s.return&&s.return()}finally{if(t)throw n}}return o}throw new TypeError("Invalid attempt to destructure non-iterable instance")},hm="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 mm(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function dm(e,t,i){this._viewer=e,this._cesium=t,this._viewer=null,this._Cesium=i.Cesium,this._url=i.url,this._urlParams=i.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=i.rectangle,this._maximumLevel=i.maximumLevel||19,this._minimumLevel=i.minimumLevel||1,this._tilingScheme=i.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=i.lowerLevelLimit||1,this._upperLevelLimit=i.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var o=this._radianToDegree(this._rectangle.west),r=this._radianToDegree(this._rectangle.south),n=this._radianToDegree(this._rectangle.east),a=this._radianToDegree(this._rectangle.north),s=this._minimumLevel;s<=this._maximumLevel;s++){var l=this._lonLatToTileInWGS84([o,r],s),c=this._lonLatToTileInWGS84([n,a],s),u=Math.min(l[0],c[0]),h=Math.max(l[0],c[0]),m=Math.min(l[1],c[1]),l=Math.max(l[1],c[1]);this._tileRangeByLevel[s]={minCol:m,maxCol:l,minRow:u,maxRow:h}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}function pm(){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 gm(e,i){$.each(e._primitives,function(e,t){if(t instanceof Cesium.BillboardCollection)return e=bm.indexOf(t=t),t._parentCollection._primitiveOld=i,-1!==e?(viewer.scene.primitives.remove(bm[e]._parentCollection),bm[e]=t):bm.push(t),!1})}function fm(e,t){viewer.scene.primitives.remove(t),e._onDestroyTilePrimitive=function(){viewer.scene.primitives.remove(t),this._onDestroyTilePrimitive=void 0}}function _m(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 Cm(e,t){_m($.map(e._primitives,function(e){return e.readyPromise}),e,t)}function ym(e,t){_m($.map(e._primitives[0]._primitives,function(e){return e.readyPromise}),e,t)}function vm(e,t){viewer.scene.primitives.remove(t)}function wm(e,t){_m([e.readyPromise],e,t)}dm.prototype._serialize=function(e){var t,i=[],o=window.encodeURIComponent;for(t in e){var r=e[t];"object"===(void 0===r?"undefined":hm(r))?i.push(o(t)+"="+o(JSON.stringify(r))):i.push(o(t)+"="+o(e[t]))}return i.join("&")},dm.prototype._fetch=function(r){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(t,i){var o=new XMLHttpRequest;if(o.open(n.method||"GET",r),n.headers)for(var e in n.headers)o.setRequestHeader(e,n.headers[e]);o.onload=function(){if(4===o.readyState&&200===o.status)try{var e=JSON.parse(o.responseText);t(e)}catch(e){i(new Error("INVALID RESPONSE"))}},o.onerror=function(e){i(e)},o.onloadend=function(e){200!==e.target.status&&i(new Error("["+e.target.status+"]request failed: "+r))},o.send(n.body||null)})},dm.prototype._lonLatToTileInWGS84=function(e,t){var e=um(e,2),i=e[0],e=e[1];return[Math.floor(Math.pow(2,t)*(90-e)/180),Math.floor(Math.pow(2,t)*(180+i)/180)]},dm.prototype._radianToDegree=function(e){return e/Math.PI*180},dm.prototype._isTileInRange=function(e){try{var t=this._tileRangeByLevel[e.level],i=t.minCol,o=t.maxCol,r=t.minRow,n=t.maxRow;return e.x>=i&&e.x<=o&&e.y>=r&&e.y<=n}catch(e){return!1}},dm.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0},dm.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;2<e.length?e.forEach(function(e){var t;2<=e.length&&(t=o[i]).push.apply(t,mm(e))}):(t=o[i]).push.apply(t,mm(e))});var e=new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])),t=a._Cesium.BoundingSphere.fromPoints(e.positions).center,t=a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t))||0,e=new a._Cesium.PolygonGeometry({polygonHierarchy:e,height:t,vertexFormat:a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),t=new a._Cesium.GeometryInstance({geometry:e,attributes:{color:n}});r.push(t)})):console.warn('GeoJSONVectorTileProvider: geometry type "'+e.geometry.type+'" detected, but is not going to be rendered')}),new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:r})},dm.prototype._cameraMoveEndHandler=function(){var i,o,e,t,r,n,a,s,l;this._stop||(i=this,o=Date.now(),t=(e=this._viewer.scene.globe._surface._tilesToRender).map(function(e){return e.level}),r=Math.min.apply(Math,mm(t)),(n=Math.max.apply(Math,mm(t)))<this._lowerLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),this._upperLevelLimit&&r>this._upperLevelLimit&&(i._tileKeys=[],i._removeObsoletePrimitives(i._primitiveByTile,[]),e=[]),(e=2<n-r?e.filter(function(e){return e.level>=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}))}))},dm.prototype._refineTiles=function(e,s){var l=[],c=[];return e.forEach(function(e){var t="Z"+e.level+"X"+e.x+"Y"+e.y;if(e.level<s-1)c.includes(t)||(l.push(e),c.push(t));else if(e.level===s-1)for(var i=0;i<2;i++)for(var o=0;o<2;o++){var r="Z"+(e.level+1)+"X"+(2*e.x+i)+"Y"+(2*e.y+o);c.includes(r)||(l.push({x:2*e.x+i,y:2*e.y+o,level:e.level+1}),c.push(r))}else{var n,a=e.level-s;0==a?c.includes(t)||(l.push(e),c.push(t)):(t=2*a,a=Math.floor(e.x/t),t=Math.floor(e.y/t),c.includes(n="Z"+s+"X"+a+"Y"+t)||(l.push({x:a,y:t,level:s}),c.push(n)))}}),l},dm.prototype._removeObsoletePrimitives=function(e,t){var i,o=[];for(i in 0<t.length&&(o=t),e)o.includes(i)||this._primitiveCollection.remove(e[i])&&delete e[i]},dm.prototype.addTo=function(e){this._viewer=e,this._viewer.scene.primitives.add(this._primitiveCollection),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()},dm.prototype.remove=function(){if(this._viewer){for(var e in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[e]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}},dm.prototype.setStatus=function(e){this._stop=e},dm.prototype.isRemoved=function(){return this._isRemoved},dm.prototype.filterBy=function(e,t,i){this._propertyToBeFiltered=e,this._valuesToBeFiltered=t},dm.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null},Object.defineProperties(pm.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<this._numTilesInLevel[t]&&e<t&&(e=t);return e}}}),pm.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var bm=[],Tm=0,Sm=!(pm.prototype.onPreFrame=function(e,t){if(Tm++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;0<this._primitivesWaitingToBeAddedToTheScene.length;){var i=this._primitivesWaitingToBeAddedToTheScene.pop();e.primitives.add(i)}else 0<this._primitivesWaitingToBeAddedToTheScene.length&&Tm%this.streamSpeedFactor()==0&&((i=this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds&&100<i._instanceIds.length&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),e.primitives.add(i));$.each(bm,function(e,t){t.ready&&viewer.scene.primitives.remove(t._parentCollection._primitiveOld)})}}),Em=(pm.prototype.initialize=function(e){Sm||(viewer.scene.preRender.addEventListener(this.onPreFrame,this),Sm=!0)},pm.prototype.beginUpdate=function(e){this.quadtree.beginFrame(e)},pm.prototype.endUpdate=function(e){var t=this;e.afterRender.push(function(){t.quadtree.endFrame(e)})},pm.prototype.updateForPick=function(e){},pm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumError/(1<<e)*this._quadtree.maximumScreenSpaceError},Math.PI,pm.prototype.placeHolder=function(e,t){t=t||Cesium.Color.fromBytes(0,255,0,255);t=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.RectangleOutlineGeometry({rectangle:e.rectangle,height:viewer.camera.positionCartographic.height-.99*TerraExplorer.internal.Navigate.HeightAboveGround}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(t)}}),appearance:new Cesium.PerInstanceColorAppearance({flat:!0})});e.data.primitive.add(t)},pm.prototype.loadTile=function(e,t){var i=this;null==this._numTilesInLevel[t._level]&&(this._numTilesInLevel[t._level]=0),this._numTilesInLevel[t._level]++,t.state===Cesium.QuadtreeTileLoadState.START&&(t.data={primitive:new Cesium.PrimitiveCollection,wfsLayerData:[],id:Cesium.createGuid(),freeResources:function(){if(i._tileCache[t.data.id]&&i._numTilesInLevel[t._level]--,i._numTilesInLevel[t._level]<0&&(i._numTilesInLevel[t._level]=0),Cesium.defined(this.wfsLayerData)){for(var e in this.wfsLayerData)Cesium.defined(this.wfsLayerData[e])&&this.wfsLayerData[e].freeResources();this.wfsLayerData=void 0}Cesium.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete i._tileCache[t.data.id]}},this._tileCache[t.data.id]=t,Math.abs(6371e3*(t.rectangle.south-t.rectangle.north)),t.data.boundingSphere3D=Cesium.BoundingSphere.fromRectangle3D(t.rectangle),t.data.boundingSphere2D=Cesium.BoundingSphere.fromRectangle2D(t.rectangle,e.mapProjection),t.rectangle.west,t.rectangle.south,t.rectangle.east,t.rectangle.north,this.loadTileEvent.raiseEvent(t),t.state=Cesium.QuadtreeTileLoadState.DONE,t.renderable=!0)},pm.prototype.getTile=function(e){return this._tileCache[e]},pm.prototype.getAllTiles=function(){var e,t=[];for(e in this._tileCache)t.push(this._tileCache[e]);return t},pm.prototype.computeTileVisibility=function(e,t,i){var o=this.computeDistanceToTile(e,t);return e._distance=o,t.fog.enabled&&9<e._level&&1<=Cesium.Math.fog(o,t.fog.density)?Cesium.Visibility.NONE:(o=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,t.cullingVolume.computeVisibility(o))},pm.prototype.showTileThisFrame=function(e,t){e.data.primitive.update(t)},pm.prototype.computeDistanceToTile=function(e,t){var i=new Cesium.Cartesian3,e=t.mode===Cesium.SceneMode.SCENE3D?e.data.boundingSphere3D:e.data.boundingSphere2D,e=Cesium.Cartesian3.subtract(e.center,t.camera.positionWC,i),t=Cesium.Cartesian3.magnitude(e);return Math.max(1,t-TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition)},pm.prototype.isDestroyed=function(){return!1},pm.prototype.destroy=function(){return Cesium.destroyObject(this)},pm.prototype.getInstance=function(t){var i;return 0==Cesium.defined(t.TileManager)&&(t.TileManager=new e,i=new Cesium.QuadtreePrimitive({tileProvider:t.TileManager,maximumScreenSpaceError:2}),t.scene.primitives.add(i)),t.TileManager},pm.prototype.addToScene=function(e){this._primitivesWaitingToBeAddedToTheScene.push(e)},pm.prototype.removeFromScene=function(e){var t=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=t?(this._primitivesWaitingToBeAddedToTheScene[t].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(t,1)):viewer.scene.primitives.remove(e)},pm.prototype.replaceInScene=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);if(-1!=i)this._primitivesWaitingToBeAddedToTheScene[i]=t;else switch(e.ID!=t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),null!=e._replacmentPrimitive&&viewer.scene.primitives.remove(e._replacmentPrimitive),e._replacmentPrimitive=t,viewer.scene.primitives.add(t),t.ID.split(":")[0]){case"billboards":gm(t,e);break;case"labels":fm(t,e);break;case"polygons":Cm(t,e);break;case"models":ym(t,e);break;case"polylines":wm(t,e);break;case"points":vm(0,e);break;default:console.log("Error updating layer"),viewer.scene.primitives.remove(e)}},{billboards:gm,labels:fm,polygons:Cm,models:ym,polylines:wm,points:vm});pm.prototype.replaceInSceneNew=function(e,t){var i=this._primitivesWaitingToBeAddedToTheScene.indexOf(e);-1!=i?this._primitivesWaitingToBeAddedToTheScene[i]=t:(e.ID!==t.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(t),i=t.ID.split(":")[0],(i=Em[i])?i(t,e):(console.log("Error updating layer"),viewer.scene.primitives.remove(e)))};ni=Object.freeze({LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21,CRN_DXT5:26,STANDARD_CRN:27});o.Analysis=O,o.Angle=xr,o.ArcgisNVectorTileProvider=dm,o.AttachEvent=Ih,o.BaiduImageryProvider=Ml,o.Bearing=Pr,o.Billboard=Bl,o.Box=B,o.BoxGeoJsonFeatureLayer=Vl,o.BufferAnalysis=Ai,o.CIMServerTool=ne,o.COMPILETIME="2022.12.26",o.CZML=uh,o.CameraPlaneVideo=Hl,o.CanvasField=rc,o.Cartesian2=function(e=0,t=0){this.x=e,this.y=t},o.Cartesian3=function(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i},o.Cartesian3_to_WGS84=function(e){return e=Cesium.Cartographic.fromCartesian(e),{lat:Cesium.Math.toDegrees(e.latitude),lon:Cesium.Math.toDegrees(e.longitude),height:e.height}},o.Cdcl=Tr,o.CesiumHeatmap=tn,o.CesiumHeatmapGL=on,o.CesiumRenderPass=mr,o.Circle=H,o.ClusterLayer=nc,o.Color=m,o.ColorAdjustment=sc,o.ColorAdjustmentFS=ac,o.CombineEcharts=re,o.Command=$r,o.Cone=j,o.ConicSensor=lc,o.ContentState=Ce,o.CoordTransform=he,o.Core=f,o.Corridor=cc,o.CreateWfsFeatureLayer=mu,o.Creator=Q,o.Current=tm,o.DDSTexture=et,o.DXTTextureDecode=Ee,o.DateTime=im,o.Degrees=function(e=0,t=0,i=0){this.lon=e,this.lat=t,this.height=i},o.Deprecated=Ir,o.DetachEvent=Ah,o.DivPoint=Ti,o.DoubleScreen=Xh,o.EdgeStage=dr,o.EffectCircle=wh,o.EffectCircleSource=vh,o.EffectConeBottomSource=Sh,o.EffectConeSource=Th,o.EffectCylinder=Eh,o.EffectCylinderSource=bh,o.ElevationContour=Yt,o.ElevationTool=hn,o.Ellipsoid=Fr,o.EntityCreator=ul,o.EventType=en,o.FieldIntensity=yh,o.FlowField=qu,o.GeoJSONVectorTileProvider=v,o.GeoJSONVectorTileProvider1=Li,o.GeoJSONVectorTileProviderPolymerization=Tu,o.GeoJsonFeatureLayer=w,o.Gettreeid=function(e,t){for(var i="",o=V.getSource(),r=0;r<o.length;r++)e==o[r].name&&o[r].pId==t&&(i=o[r].id);return i},o.GmlParser=bn,o.Hawkeye=ah,o.Heatmap=hh,o.Highvolume=Br,o.ImageLabel=gu,o.ImageryLayer=yu,o.InstanceMode=lt,o.JBAlgorithm=U,o.KmlLayer=sh,o.Label=G,o.LabelGeoJsonFeatureLayer=Su,o.LabelGeoJsonFeatureLayercopy=S,o.Language=rm,o.LonLatProjection=Mi,o.MaterialPass=tt,o.MilitaryStandard=K,o.Mjcl=Dr,o.ModelClipping=ch,o.ModelEdit=Jt,o.ModifyMesh=lh,o.Navigate=Hh,o.OperationType=Vt,o.Particle=xo,o.Point=L,o.PointFly=_r,o.PointModel=P,o.Polygon=M,o.PolygonGeoJsonFeatureLayer=Gi,o.PolygonVectorGeoJsonFeatureLayer=Ju,o.PolygonVectorTileLayerArcgis=mo,o.Polyline=R,o.PolylineGeoJsonFeatureLayer=Hi,o.PolylineLinkSource=Ut,o.PolylineTrailLinkMaterial=te,o.PolylineTrailLinkMaterialSource=ee,o.PolylineTrailLinkSource=Z,o.PolylineVolume=du,o.PopupMessage=Si,o.ProgramDefines=at,o.ProjectTree=q,o.RangeMode=bt,o.Recorder=ae,o.Rectangle=F,o.RenderEntity=ut,o.Road=nh,o.S3MCacheFileRenderEntity=pt,o.S3MCompressType={encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22},o.S3MContentFactory=Ct,o.S3MContentParser=yt,o.S3MCreateIndexJob=nt,o.S3MCreateShaderProgramJob=ct,o.S3MCreateVertexJob=rt,o.S3MLayerCache=Bt,o.S3MLayerScheduler=Dt,o.S3MObliqueRenderEntity=_t,o.S3MPixelFormat=ni,o.S3MTile=Tt,o.S3MTilesFS=ot,o.S3MTilesLayer=Ht,o.S3MTilesNoLightFS=ft,o.S3MTilesNoLightVS=gt,o.S3MTilesVS=it,o.S3ModelParser=Me,o.SE3DTileset=A,o.SE3DTilesetFS=vr,o.SE3DTilesetVS=wr,o.SFSTerrainProvider=Ou,o.SFSTerrainProvider7_2_3=Au,o.SGWorld=qh,o.SatelliteTrail=mh,o.Scan=Ko,o.Scan_PostProcessStage=Vr,o.Screenshot=fr,o.ShadowPostProcess=nr,o.ShadowPostProcessFS=or,o.ShadowsAnalysis=gr,o.SightLine=yo,o.SimpleGraphic=x,o.SimpleSqlParser=Bn,o.Skip=oe,o.SkyBox=Qu,o.SkylineAnalysis=lr,o.Stop=Fh,o.StreamerPath=eh,o.StreamerPathFS=$u,o.StreamerWall=oh,o.StreamerWallFS=ih,o.StreetView=Io,o.StreetViewYZ=Bo,o.Style3D=Ft,o.SunshineAnalysis=Cr,o.TdtLabel=_h,o.Terrain=zu,o.TerrainExcavation=pr,o.TerrainModifier=gh,o.Tetrahedron=Ph,o.TileManager=pm,o.TileManager1=Tn,o.TrafficLight=xh,o.TrailLine=em,o.TrailLinePrimitive=rh,o.UndergroundGrid=Do,o.UndergroundMode=Rr,o.VERSION="2.3.0",o.VectorCesiumTerrainProvider=Vu,o.VectorGeoJsonFeatureLayer=E,o.VectorImgFeatureLayer=ph,o.VectorTileProvider=T,o.VertexCompressOption=st,o.Video=fh,o.ViewCone=ar,o.Viewshed=Zo,o.ViewshedPoss=sr,o.VolumeGeoJsonFeatureLayer=Wu,o.VolumetricMeasure=Sr,o.WFSTool=Ll,o.WGS84_to_Cartesian3=function(e){return Cesium.Cartesian3.fromDegrees(e.lon,e.lat,e.height)},o.WMTSGetCapabilities=ge,o.WMTSTerrain=Uu,o.WallGeoFeatureLayer=go,o.WaterGeoJsonFeatureLayer=Ch,o.WfsLayer=W,o.WorkerPool=de,o.billboardGeoJsonFeatureLayer=Ii,o.clone=function e(t,i){if(null===t||"object"!=typeof t)return t;i=X(i,!1);var o,r,n=new t.constructor;for(o in t)t.hasOwnProperty(o)&&(r=t[o],i&&(r=e(r,i)),n[o]=r);return n},o.configData=I,o.createGroup=Ei,o.curtaincontrast=wo,o.czmlPathAnimation=Dh,o.decode=un,o.defaultValue=X,o.deleteItem=Gh,o.demolition=br,o.depthTestAgainstTerrain=Qo,o.dynamicObject=k,o.execute=Zr,o.expandGroup=cm,o.export=Qh,o.findItem=kh,o.flyTo=Fi,o.flyToObj=Rh,o.getExitsObjectType=Yh,o.getItemName=Nh,o.getNextItem=Wh,o.getObject=Jh,o.getPosition=y,o.getVisibility=jh,o.gradientColor=me,o.indoormode=Eo,o.isGroup=Kh,o.jumpTo=Oh,o.license=function(i){return new Promise((t,e)=>{yn({type:"get",url:i+"/licenseEncryption/getLicenseSecret",success(e){yn({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:"暂无许可权限"})}})})},o.lineOfSight=Mr,o.lodash=C,o.main=nm,o.measure=Er,o.meshopt_decoder_module=Ae,o.northfinger=Bh,o.pako_inflate=ye,o.pbf_dev=Ni,o.position=pu,o.renameGroup=zh,o.setPosition=Vh,o.setVisibility=Uh,o.tdtwmtsimageprovider=vn,o.treeSource=V,o.uuid=wn,o.vectortile=uo,o.wall=fu,o.weather=Po,o.zoomIn=Lh,o.zoomOut=Mh,Object.defineProperty(o,"__esModule",{value:!0})});
    `; return setTimeout(console.log.bind(console, e, "font:bold 50px 微软雅黑;color:#018aff;", "color:#018aff;font-size:13px;font-family:微软雅黑"), 0), -1 < am.indexOf("Source/Main")
    }, cm.prototype.deleteItem = function (e) { }; var um = function (e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) { var i = t, o = [], r = !0, t = !1, n = void 0; try { for (var a, s = e[Symbol.iterator](); !(r = (a = s.next()).done) && (o.push(a.value), !i || o.length !== i); r = !0); } catch (e) { t = !0, n = e } finally { try { !r && s.return && s.return() } finally { if (t) throw n } } return o } throw new TypeError("Invalid attempt to destructure non-iterable instance") }, hm = "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 mm(e) { if (Array.isArray(e)) { for (var t = 0, i = Array(e.length); t < e.length; t++)i[t] = e[t]; return i } return Array.from(e) } function dm(e, t, i) { this._viewer = e, this._cesium = t, this._viewer = null, this._Cesium = i.Cesium, this._url = i.url, this._urlParams = i.urlParams, this._urlTemplate = this._url + "?" + this._serialize(this._urlParams), this._rectangle = i.rectangle, this._maximumLevel = i.maximumLevel || 19, this._minimumLevel = i.minimumLevel || 1, this._tilingScheme = i.tilingScheme || new this._Cesium.GeographicTilingScheme, this._tileRangeByLevel = {}, this._moveEndTimestamp = null, this._isRemoved = !1, this._isCameraMoving = !1, this._propertyToBeFiltered = null, this._valuesToBeFiltered = null, this._primitiveByTile = {}, this._tileKeys = [], this._lowerLevelLimit = i.lowerLevelLimit || 1, this._upperLevelLimit = i.upperLevelLimit || null, this._cameraMoveEndHandler = this._cameraMoveEndHandler.bind(this), this._cameraMoveStartHandler = this._cameraMoveStartHandler.bind(this), this.heightById = {}; for (var o = this._radianToDegree(this._rectangle.west), r = this._radianToDegree(this._rectangle.south), n = this._radianToDegree(this._rectangle.east), a = this._radianToDegree(this._rectangle.north), s = this._minimumLevel; s <= this._maximumLevel; s++) { var l = this._lonLatToTileInWGS84([o, r], s), c = this._lonLatToTileInWGS84([n, a], s), u = Math.min(l[0], c[0]), h = Math.max(l[0], c[0]), m = Math.min(l[1], c[1]), l = Math.max(l[1], c[1]); this._tileRangeByLevel[s] = { minCol: m, maxCol: l, minRow: u, maxRow: h } } this._tileRangeByLevel[0] = { minCol: 0, maxCol: 0, minRow: 0, maxRow: 0 }, this._primitiveCollection = new this._Cesium.PrimitiveCollection, this._stop = !1 } function pm() { 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 gm(e, i) { $.each(e._primitives, function (e, t) { if (t instanceof Cesium.BillboardCollection) return e = bm.indexOf(t = t), t._parentCollection._primitiveOld = i, -1 !== e ? (viewer.scene.primitives.remove(bm[e]._parentCollection), bm[e] = t) : bm.push(t), !1 }) } function fm(e, t) { viewer.scene.primitives.remove(t), e._onDestroyTilePrimitive = function () { viewer.scene.primitives.remove(t), this._onDestroyTilePrimitive = void 0 } } function _m(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 Cm(e, t) { _m($.map(e._primitives, function (e) { return e.readyPromise }), e, t) } function ym(e, t) { _m($.map(e._primitives[0]._primitives, function (e) { return e.readyPromise }), e, t) } function vm(e, t) { viewer.scene.primitives.remove(t) } function wm(e, t) { _m([e.readyPromise], e, t) } dm.prototype._serialize = function (e) { var t, i = [], o = window.encodeURIComponent; for (t in e) { var r = e[t]; "object" === (void 0 === r ? "undefined" : hm(r)) ? i.push(o(t) + "=" + o(JSON.stringify(r))) : i.push(o(t) + "=" + o(e[t])) } return i.join("&") }, dm.prototype._fetch = function (r) { var n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; return new Promise(function (t, i) { var o = new XMLHttpRequest; if (o.open(n.method || "GET", r), n.headers) for (var e in n.headers) o.setRequestHeader(e, n.headers[e]); o.onload = function () { if (4 === o.readyState && 200 === o.status) try { var e = JSON.parse(o.responseText); t(e) } catch (e) { i(new Error("INVALID RESPONSE")) } }, o.onerror = function (e) { i(e) }, o.onloadend = function (e) { 200 !== e.target.status && i(new Error("[" + e.target.status + "]request failed: " + r)) }, o.send(n.body || null) }) }, dm.prototype._lonLatToTileInWGS84 = function (e, t) { var e = um(e, 2), i = e[0], e = e[1]; return [Math.floor(Math.pow(2, t) * (90 - e) / 180), Math.floor(Math.pow(2, t) * (180 + i) / 180)] }, dm.prototype._radianToDegree = function (e) { return e / Math.PI * 180 }, dm.prototype._isTileInRange = function (e) { try { var t = this._tileRangeByLevel[e.level], i = t.minCol, o = t.maxCol, r = t.minRow, n = t.maxRow; return e.x >= i && e.x <= o && e.y >= r && e.y <= n } catch (e) { return !1 } }, dm.prototype._cameraMoveStartHandler = function () { this._isCameraMoving = !0 }, dm.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; 2 < e.length ? e.forEach(function (e) { var t; 2 <= e.length && (t = o[i]).push.apply(t, mm(e)) }) : (t = o[i]).push.apply(t, mm(e)) }); var e = new a._Cesium.PolygonHierarchy(a._Cesium.Cartesian3.fromDegreesArray(o[i])), t = a._Cesium.BoundingSphere.fromPoints(e.positions).center, t = a._viewer.scene.globe.getHeight(a._Cesium.Cartographic.fromCartesian(t)) || 0, e = new a._Cesium.PolygonGeometry({ polygonHierarchy: e, height: t, vertexFormat: a._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT, extrudedHeight: 1e3 }), t = new a._Cesium.GeometryInstance({ geometry: e, attributes: { color: n } }); r.push(t) })) : console.warn('GeoJSONVectorTileProvider: geometry type "' + e.geometry.type + '" detected, but is not going to be rendered') }), new this._Cesium.Primitive({ allowPicking: !1, appearance: new this._Cesium.PerInstanceColorAppearance({ translucent: !1 }), geometryInstances: r }) }, dm.prototype._cameraMoveEndHandler = function () { var i, o, e, t, r, n, a, s, l; this._stop || (i = this, o = Date.now(), t = (e = this._viewer.scene.globe._surface._tilesToRender).map(function (e) { return e.level }), r = Math.min.apply(Math, mm(t)), (n = Math.max.apply(Math, mm(t))) < this._lowerLevelLimit && (i._tileKeys = [], i._removeObsoletePrimitives(i._primitiveByTile, []), e = []), this._upperLevelLimit && r > this._upperLevelLimit && (i._tileKeys = [], i._removeObsoletePrimitives(i._primitiveByTile, []), e = []), (e = 2 < n - r ? e.filter(function (e) { return e.level >= 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 })) })) }, dm.prototype._refineTiles = function (e, s) { var l = [], c = []; return e.forEach(function (e) { var t = "Z" + e.level + "X" + e.x + "Y" + e.y; if (e.level < s - 1) c.includes(t) || (l.push(e), c.push(t)); else if (e.level === s - 1) for (var i = 0; i < 2; i++)for (var o = 0; o < 2; o++) { var r = "Z" + (e.level + 1) + "X" + (2 * e.x + i) + "Y" + (2 * e.y + o); c.includes(r) || (l.push({ x: 2 * e.x + i, y: 2 * e.y + o, level: e.level + 1 }), c.push(r)) } else { var n, a = e.level - s; 0 == a ? c.includes(t) || (l.push(e), c.push(t)) : (t = 2 * a, a = Math.floor(e.x / t), t = Math.floor(e.y / t), c.includes(n = "Z" + s + "X" + a + "Y" + t) || (l.push({ x: a, y: t, level: s }), c.push(n))) } }), l }, dm.prototype._removeObsoletePrimitives = function (e, t) { var i, o = []; for (i in 0 < t.length && (o = t), e) o.includes(i) || this._primitiveCollection.remove(e[i]) && delete e[i] }, dm.prototype.addTo = function (e) { this._viewer = e, this._viewer.scene.primitives.add(this._primitiveCollection), this._isRemoved = !1, this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler), this._cameraMoveEndHandler() }, dm.prototype.remove = function () { if (this._viewer) { for (var e in this._primitiveByTile) this._viewer.scene.primitives.remove(this._primitiveByTile[e]); this._primitiveByTile = {}, this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler), this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler), this._viewer = null, this._isRemoved = !0 } }, dm.prototype.setStatus = function (e) { this._stop = e }, dm.prototype.isRemoved = function () { return this._isRemoved }, dm.prototype.filterBy = function (e, t, i) { this._propertyToBeFiltered = e, this._valuesToBeFiltered = t }, dm.prototype.removeFilter = function () { this._propertyToBeFiltered = null, this._valuesToBeFiltered = null }, Object.defineProperties(pm.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 < this._numTilesInLevel[t] && e < t && (e = t); return e } } }), pm.prototype.streamSpeedFactor = function () { switch (this._streamSpeed) { case this.STREAM_SPEED_FAST: return 1; case this.STREAM_SPEED_NORMAL: return 3; case this.STREAM_SPEED_SLOW: return 20; default: return 3 } }; var bm = [], Tm = 0, Sm = !(pm.prototype.onPreFrame = function (e, t) { if (Tm++, !this._pauseStreaming) { if (this._streamSpeed == this.STREAM_SPEED_IMIDIATE) for (; 0 < this._primitivesWaitingToBeAddedToTheScene.length;) { var i = this._primitivesWaitingToBeAddedToTheScene.pop(); e.primitives.add(i) } else 0 < this._primitivesWaitingToBeAddedToTheScene.length && Tm % this.streamSpeedFactor() == 0 && ((i = this._primitivesWaitingToBeAddedToTheScene.pop())._instanceIds && 100 < i._instanceIds.length && this.streamSpeed === this.STREAM_SPEED_FAST && (this.streamSpeed = this.STREAM_SPEED_NORMAL), e.primitives.add(i)); $.each(bm, function (e, t) { t.ready && viewer.scene.primitives.remove(t._parentCollection._primitiveOld) }) } }), Em = (pm.prototype.initialize = function (e) { Sm || (viewer.scene.preRender.addEventListener(this.onPreFrame, this), Sm = !0) }, pm.prototype.beginUpdate = function (e) { this.quadtree.beginFrame(e) }, pm.prototype.endUpdate = function (e) { var t = this; e.afterRender.push(function () { t.quadtree.endFrame(e) }) }, pm.prototype.updateForPick = function (e) { }, pm.prototype.getLevelMaximumGeometricError = function (e) { return this._levelZeroMaximumError / (1 << e) * this._quadtree.maximumScreenSpaceError }, Math.PI, pm.prototype.placeHolder = function (e, t) { t = t || Cesium.Color.fromBytes(0, 255, 0, 255); t = new Cesium.Primitive({ geometryInstances: new Cesium.GeometryInstance({ geometry: new Cesium.RectangleOutlineGeometry({ rectangle: e.rectangle, height: viewer.camera.positionCartographic.height - .99 * TerraExplorer.internal.Navigate.HeightAboveGround }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(t) } }), appearance: new Cesium.PerInstanceColorAppearance({ flat: !0 }) }); e.data.primitive.add(t) }, pm.prototype.loadTile = function (e, t) { var i = this; null == this._numTilesInLevel[t._level] && (this._numTilesInLevel[t._level] = 0), this._numTilesInLevel[t._level]++, t.state === Cesium.QuadtreeTileLoadState.START && (t.data = { primitive: new Cesium.PrimitiveCollection, wfsLayerData: [], id: Cesium.createGuid(), freeResources: function () { if (i._tileCache[t.data.id] && i._numTilesInLevel[t._level]--, i._numTilesInLevel[t._level] < 0 && (i._numTilesInLevel[t._level] = 0), Cesium.defined(this.wfsLayerData)) { for (var e in this.wfsLayerData) Cesium.defined(this.wfsLayerData[e]) && this.wfsLayerData[e].freeResources(); this.wfsLayerData = void 0 } Cesium.defined(this.primitive) && (this.primitive.destroy(), this.primitive = void 0), delete i._tileCache[t.data.id] } }, this._tileCache[t.data.id] = t, Math.abs(6371e3 * (t.rectangle.south - t.rectangle.north)), t.data.boundingSphere3D = Cesium.BoundingSphere.fromRectangle3D(t.rectangle), t.data.boundingSphere2D = Cesium.BoundingSphere.fromRectangle2D(t.rectangle, e.mapProjection), t.rectangle.west, t.rectangle.south, t.rectangle.east, t.rectangle.north, this.loadTileEvent.raiseEvent(t), t.state = Cesium.QuadtreeTileLoadState.DONE, t.renderable = !0) }, pm.prototype.getTile = function (e) { return this._tileCache[e] }, pm.prototype.getAllTiles = function () { var e, t = []; for (e in this._tileCache) t.push(this._tileCache[e]); return t }, pm.prototype.computeTileVisibility = function (e, t, i) { var o = this.computeDistanceToTile(e, t); return e._distance = o, t.fog.enabled && 9 < e._level && 1 <= Cesium.Math.fog(o, t.fog.density) ? Cesium.Visibility.NONE : (o = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, t.cullingVolume.computeVisibility(o)) }, pm.prototype.showTileThisFrame = function (e, t) { e.data.primitive.update(t) }, pm.prototype.computeDistanceToTile = function (e, t) { var i = new Cesium.Cartesian3, e = t.mode === Cesium.SceneMode.SCENE3D ? e.data.boundingSphere3D : e.data.boundingSphere2D, e = Cesium.Cartesian3.subtract(e.center, t.camera.positionWC, i), t = Cesium.Cartesian3.magnitude(e); return Math.max(1, t - TerraExplorer.internal.Navigate.GroundHeightAtCameraPosition) }, pm.prototype.isDestroyed = function () { return !1 }, pm.prototype.destroy = function () { return Cesium.destroyObject(this) }, pm.prototype.getInstance = function (t) { var i; return 0 == Cesium.defined(t.TileManager) && (t.TileManager = new e, i = new Cesium.QuadtreePrimitive({ tileProvider: t.TileManager, maximumScreenSpaceError: 2 }), t.scene.primitives.add(i)), t.TileManager }, pm.prototype.addToScene = function (e) { this._primitivesWaitingToBeAddedToTheScene.push(e) }, pm.prototype.removeFromScene = function (e) { var t = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != t ? (this._primitivesWaitingToBeAddedToTheScene[t].destroy(), this._primitivesWaitingToBeAddedToTheScene.splice(t, 1)) : viewer.scene.primitives.remove(e) }, pm.prototype.replaceInScene = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); if (-1 != i) this._primitivesWaitingToBeAddedToTheScene[i] = t; else switch (e.ID != t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), null != e._replacmentPrimitive && viewer.scene.primitives.remove(e._replacmentPrimitive), e._replacmentPrimitive = t, viewer.scene.primitives.add(t), t.ID.split(":")[0]) { case "billboards": gm(t, e); break; case "labels": fm(t, e); break; case "polygons": Cm(t, e); break; case "models": ym(t, e); break; case "polylines": wm(t, e); break; case "points": vm(0, e); break; default: console.log("Error updating layer"), viewer.scene.primitives.remove(e) } }, { billboards: gm, labels: fm, polygons: Cm, models: ym, polylines: wm, points: vm }); pm.prototype.replaceInSceneNew = function (e, t) { var i = this._primitivesWaitingToBeAddedToTheScene.indexOf(e); -1 != i ? this._primitivesWaitingToBeAddedToTheScene[i] = t : (e.ID !== t.ID && console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"), this.addToScene(t), i = t.ID.split(":")[0], (i = Em[i]) ? i(t, e) : (console.log("Error updating layer"), viewer.scene.primitives.remove(e))) }; ni = Object.freeze({ LUMINANCE_8: 1, LUMINANCE_16: 2, ALPHA: 3, ALPHA_4_LUMINANCE_4: 4, LUMINANCE_ALPHA: 5, RGB_565: 6, BGR565: 7, RGB: 10, BGR: 11, ARGB: 12, ABGR: 13, BGRA: 14, WEBP: 25, RGBA: 28, DXT1: 17, DXT2: 18, DXT3: 19, DXT4: 20, DXT5: 21, CRN_DXT5: 26, STANDARD_CRN: 27 }); o.Analysis = O, o.Angle = xr, o.ArcgisNVectorTileProvider = dm, o.AttachEvent = Ih, o.BaiduImageryProvider = Ml, o.Bearing = Pr, o.Billboard = Bl, o.Box = B, o.BoxGeoJsonFeatureLayer = Vl, o.BufferAnalysis = Ai, o.CIMServerTool = ne, o.COMPILETIME = "2022.12.26", o.CZML = uh, o.CameraPlaneVideo = Hl, o.CanvasField = rc, o.Cartesian2 = function (e = 0, t = 0) { this.x = e, this.y = t }, o.Cartesian3 = function (e = 0, t = 0, i = 0) { this.x = e, this.y = t, this.z = i }, o.Cartesian3_to_WGS84 = function (e) { return e = Cesium.Cartographic.fromCartesian(e), { lat: Cesium.Math.toDegrees(e.latitude), lon: Cesium.Math.toDegrees(e.longitude), height: e.height } }, o.Cdcl = Tr, o.CesiumHeatmap = tn, o.CesiumHeatmapGL = on, o.CesiumRenderPass = mr, o.Circle = H, o.ClusterLayer = nc, o.Color = m, o.ColorAdjustment = sc, o.ColorAdjustmentFS = ac, o.CombineEcharts = re, o.Command = $r, o.Cone = j, o.ConicSensor = lc, o.ContentState = Ce, o.CoordTransform = he, o.Core = f, o.Corridor = cc, o.CreateWfsFeatureLayer = mu, o.Creator = Q, o.Current = tm, o.DDSTexture = et, o.DXTTextureDecode = Ee, o.DateTime = im, o.Degrees = function (e = 0, t = 0, i = 0) { this.lon = e, this.lat = t, this.height = i }, o.Deprecated = Ir, o.DetachEvent = Ah, o.DivPoint = Ti, o.DoubleScreen = Xh, o.EdgeStage = dr, o.EffectCircle = wh, o.EffectCircleSource = vh, o.EffectConeBottomSource = Sh, o.EffectConeSource = Th, o.EffectCylinder = Eh, o.EffectCylinderSource = bh, o.ElevationContour = Yt, o.ElevationTool = hn, o.Ellipsoid = Fr, o.EntityCreator = ul, o.EventType = en, o.FieldIntensity = yh, o.FlowField = qu, o.GeoJSONVectorTileProvider = v, o.GeoJSONVectorTileProvider1 = Li, o.GeoJSONVectorTileProviderPolymerization = Tu, o.GeoJsonFeatureLayer = w, o.Gettreeid = function (e, t) { for (var i = "", o = V.getSource(), r = 0; r < o.length; r++)e == o[r].name && o[r].pId == t && (i = o[r].id); return i }, o.GmlParser = bn, o.Hawkeye = ah, o.Heatmap = hh, o.Highvolume = Br, o.ImageLabel = gu, o.ImageryLayer = yu, o.InstanceMode = lt, o.JBAlgorithm = U, o.KmlLayer = sh, o.Label = G, o.LabelGeoJsonFeatureLayer = Su, o.LabelGeoJsonFeatureLayercopy = S, o.Language = rm, o.LonLatProjection = Mi, o.MaterialPass = tt, o.MilitaryStandard = K, o.Mjcl = Dr, o.ModelClipping = ch, o.ModelEdit = Jt, o.ModifyMesh = lh, o.Navigate = Hh, o.OperationType = Vt, o.Particle = xo, o.Point = L, o.PointFly = _r, o.PointModel = P, o.Polygon = M, o.PolygonGeoJsonFeatureLayer = Gi, o.PolygonVectorGeoJsonFeatureLayer = Ju, o.PolygonVectorTileLayerArcgis = mo, o.Polyline = R, o.PolylineGeoJsonFeatureLayer = Hi, o.PolylineLinkSource = Ut, o.PolylineTrailLinkMaterial = te, o.PolylineTrailLinkMaterialSource = ee, o.PolylineTrailLinkSource = Z, o.PolylineVolume = du, o.PopupMessage = Si, o.ProgramDefines = at, o.ProjectTree = q, o.RangeMode = bt, o.Recorder = ae, o.Rectangle = F, o.RenderEntity = ut, o.Road = nh, o.S3MCacheFileRenderEntity = pt, o.S3MCompressType = { encNONE: 0, enrS3TCDXTN: 14, enrPVRTPF_PVRTC2: 19, enrPVRTPF_PVRTC: 20, enrPVRTPF_PVRTC_4bpp: 21, enrPVRTPF_ETC1: 22 }, o.S3MContentFactory = Ct, o.S3MContentParser = yt, o.S3MCreateIndexJob = nt, o.S3MCreateShaderProgramJob = ct, o.S3MCreateVertexJob = rt, o.S3MLayerCache = Bt, o.S3MLayerScheduler = Dt, o.S3MObliqueRenderEntity = _t, o.S3MPixelFormat = ni, o.S3MTile = Tt, o.S3MTilesFS = ot, o.S3MTilesLayer = Ht, o.S3MTilesNoLightFS = ft, o.S3MTilesNoLightVS = gt, o.S3MTilesVS = it, o.S3ModelParser = Me, o.SE3DTileset = A, o.SE3DTilesetFS = vr, o.SE3DTilesetVS = wr, o.SFSTerrainProvider = Ou, o.SFSTerrainProvider7_2_3 = Au, o.SGWorld = qh, o.SatelliteTrail = mh, o.Scan = Ko, o.Scan_PostProcessStage = Vr, o.Screenshot = fr, o.ShadowPostProcess = nr, o.ShadowPostProcessFS = or, o.ShadowsAnalysis = gr, o.SightLine = yo, o.SimpleGraphic = x, o.SimpleSqlParser = Bn, o.Skip = oe, o.SkyBox = Qu, o.SkylineAnalysis = lr, o.Stop = Fh, o.StreamerPath = eh, o.StreamerPathFS = $u, o.StreamerWall = oh, o.StreamerWallFS = ih, o.StreetView = Io, o.StreetViewYZ = Bo, o.Style3D = Ft, o.SunshineAnalysis = Cr, o.TdtLabel = _h, o.Terrain = zu, o.TerrainExcavation = pr, o.TerrainModifier = gh, o.Tetrahedron = Ph, o.TileManager = pm, o.TileManager1 = Tn, o.TrafficLight = xh, o.TrailLine = em, o.TrailLinePrimitive = rh, o.UndergroundGrid = Do, o.UndergroundMode = Rr, o.VERSION = "2.3.0", o.VectorCesiumTerrainProvider = Vu, o.VectorGeoJsonFeatureLayer = E, o.VectorImgFeatureLayer = ph, o.VectorTileProvider = T, o.VertexCompressOption = st, o.Video = fh, o.ViewCone = ar, o.Viewshed = Zo, o.ViewshedPoss = sr, o.VolumeGeoJsonFeatureLayer = Wu, o.VolumetricMeasure = Sr, o.WFSTool = Ll, o.WGS84_to_Cartesian3 = function (e) { return Cesium.Cartesian3.fromDegrees(e.lon, e.lat, e.height) }, o.WMTSGetCapabilities = ge, o.WMTSTerrain = Uu, o.WallGeoFeatureLayer = go, o.WaterGeoJsonFeatureLayer = Ch, o.WfsLayer = W, o.WorkerPool = de, o.billboardGeoJsonFeatureLayer = Ii, o.clone = function e(t, i) { if (null === t || "object" != typeof t) return t; i = X(i, !1); var o, r, n = new t.constructor; for (o in t) t.hasOwnProperty(o) && (r = t[o], i && (r = e(r, i)), n[o] = r); return n }, o.configData = I, o.createGroup = Ei, o.curtaincontrast = wo, o.czmlPathAnimation = Dh, o.decode = un, o.defaultValue = X, o.deleteItem = Gh, o.demolition = br, o.depthTestAgainstTerrain = Qo, o.dynamicObject = k, o.execute = Zr, o.expandGroup = cm, o.export = Qh, o.findItem = kh, o.flyTo = Fi, o.flyToObj = Rh, o.getExitsObjectType = Yh, o.getItemName = Nh, o.getNextItem = Wh, o.getObject = Jh, o.getPosition = y, o.getVisibility = jh, o.gradientColor = me, o.indoormode = Eo, o.isGroup = Kh, o.jumpTo = Oh, o.license = function (i) { return new Promise((t, e) => { yn({ type: "get", url: i + "/licenseEncryption/getLicenseSecret", success(e) { yn({ 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: "暂无许可权限" }) } }) }) }, o.lineOfSight = Mr, o.lodash = C, o.main = nm, o.measure = Er, o.meshopt_decoder_module = Ae, o.northfinger = Bh, o.pako_inflate = ye, o.pbf_dev = Ni, o.position = pu, o.renameGroup = zh, o.setPosition = Vh, o.setVisibility = Uh, o.tdtwmtsimageprovider = vn, o.treeSource = V, o.uuid = wn, o.vectortile = uo, o.wall = fu, o.weather = Po, o.zoomIn = Lh, o.zoomOut = Mh, Object.defineProperty(o, "__esModule", { value: !0 })
});